Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RxRPC: Declare the security index constants symbolically

Declare the security index constants symbolically rather than just referring
to them numerically.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Howells and committed by
David S. Miller
8b815477 531afd64

+12 -5
+7
include/linux/rxrpc.h
··· 58 58 #define RXRPC_SECURITY_AUTH 1 /* authenticated packets */ 59 59 #define RXRPC_SECURITY_ENCRYPT 2 /* encrypted packets */ 60 60 61 + /* 62 + * RxRPC security indices 63 + */ 64 + #define RXRPC_SECURITY_NONE 0 /* no security protocol */ 65 + #define RXRPC_SECURITY_RXKAD 2 /* kaserver or kerberos 4 */ 66 + #define RXRPC_SECURITY_RXGK 4 /* gssapi-based */ 67 + #define RXRPC_SECURITY_RXK5 5 /* kerberos 5 */ 61 68 62 69 #endif /* _LINUX_RXRPC_H */
+2 -2
net/rxrpc/ar-key.c
··· 122 122 tsec->ticket[6], tsec->ticket[7]); 123 123 124 124 ret = -EPROTONOSUPPORT; 125 - if (tsec->security_index != 2) 125 + if (tsec->security_index != RXRPC_SECURITY_RXKAD) 126 126 goto error; 127 127 128 128 key->type_data.x[0] = tsec->security_index; ··· 308 308 _debug("key %d", key_serial(key)); 309 309 310 310 data.kver = 1; 311 - data.tsec.security_index = 2; 311 + data.tsec.security_index = RXRPC_SECURITY_RXKAD; 312 312 data.tsec.ticket_len = 0; 313 313 data.tsec.expiry = expiry; 314 314 data.tsec.kvno = 0;
+3 -3
net/rxrpc/rxkad.c
··· 42 42 __be32 checksum; /* decrypted data checksum */ 43 43 }; 44 44 45 - MODULE_DESCRIPTION("RxRPC network protocol type-2 security (Kerberos)"); 45 + MODULE_DESCRIPTION("RxRPC network protocol type-2 security (Kerberos 4)"); 46 46 MODULE_AUTHOR("Red Hat, Inc."); 47 47 MODULE_LICENSE("GPL"); 48 48 ··· 506 506 if (!call->conn->cipher) 507 507 return 0; 508 508 509 - if (sp->hdr.securityIndex != 2) { 509 + if (sp->hdr.securityIndex != RXRPC_SECURITY_RXKAD) { 510 510 *_abort_code = RXKADINCONSISTENCY; 511 511 _leave(" = -EPROTO [not rxkad]"); 512 512 return -EPROTO; ··· 1122 1122 static struct rxrpc_security rxkad = { 1123 1123 .owner = THIS_MODULE, 1124 1124 .name = "rxkad", 1125 - .security_index = RXKAD_VERSION, 1125 + .security_index = RXRPC_SECURITY_RXKAD, 1126 1126 .init_connection_security = rxkad_init_connection_security, 1127 1127 .prime_packet_security = rxkad_prime_packet_security, 1128 1128 .secure_packet = rxkad_secure_packet,