* [PATCH 1/4] RxRPC: Declare the security index constants symbolically
@ 2009-09-14 11:17 David Howells
0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2009-09-14 11:17 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-afs, netdev, David Howells
Declare the security index constants symbolically rather than just referring
to them numerically.
Signed-off-by: David Howells <dhowells@redhat.com>
---
include/linux/rxrpc.h | 7 +++++++
net/rxrpc/ar-key.c | 4 ++--
net/rxrpc/rxkad.c | 6 +++---
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/include/linux/rxrpc.h b/include/linux/rxrpc.h
index f7b826b..a53915c 100644
--- a/include/linux/rxrpc.h
+++ b/include/linux/rxrpc.h
@@ -58,5 +58,12 @@ struct sockaddr_rxrpc {
#define RXRPC_SECURITY_AUTH 1 /* authenticated packets */
#define RXRPC_SECURITY_ENCRYPT 2 /* encrypted packets */
+/*
+ * RxRPC security indices
+ */
+#define RXRPC_SECURITY_NONE 0 /* no security protocol */
+#define RXRPC_SECURITY_RXKAD 2 /* kaserver or kerberos 4 */
+#define RXRPC_SECURITY_RXGK 4 /* gssapi-based */
+#define RXRPC_SECURITY_RXK5 5 /* kerberos 5 */
#endif /* _LINUX_RXRPC_H */
diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c
index ad8c7a7..b3d10e7 100644
--- a/net/rxrpc/ar-key.c
+++ b/net/rxrpc/ar-key.c
@@ -122,7 +122,7 @@ static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen)
tsec->ticket[6], tsec->ticket[7]);
ret = -EPROTONOSUPPORT;
- if (tsec->security_index != 2)
+ if (tsec->security_index != RXRPC_SECURITY_RXKAD)
goto error;
key->type_data.x[0] = tsec->security_index;
@@ -308,7 +308,7 @@ int rxrpc_get_server_data_key(struct rxrpc_connection *conn,
_debug("key %d", key_serial(key));
data.kver = 1;
- data.tsec.security_index = 2;
+ data.tsec.security_index = RXRPC_SECURITY_RXKAD;
data.tsec.ticket_len = 0;
data.tsec.expiry = expiry;
data.tsec.kvno = 0;
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index ef8f910..acec762 100644
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
@@ -42,7 +42,7 @@ struct rxkad_level2_hdr {
__be32 checksum; /* decrypted data checksum */
};
-MODULE_DESCRIPTION("RxRPC network protocol type-2 security (Kerberos)");
+MODULE_DESCRIPTION("RxRPC network protocol type-2 security (Kerberos 4)");
MODULE_AUTHOR("Red Hat, Inc.");
MODULE_LICENSE("GPL");
@@ -506,7 +506,7 @@ static int rxkad_verify_packet(const struct rxrpc_call *call,
if (!call->conn->cipher)
return 0;
- if (sp->hdr.securityIndex != 2) {
+ if (sp->hdr.securityIndex != RXRPC_SECURITY_RXKAD) {
*_abort_code = RXKADINCONSISTENCY;
_leave(" = -EPROTO [not rxkad]");
return -EPROTO;
@@ -1122,7 +1122,7 @@ static void rxkad_clear(struct rxrpc_connection *conn)
static struct rxrpc_security rxkad = {
.owner = THIS_MODULE,
.name = "rxkad",
- .security_index = RXKAD_VERSION,
+ .security_index = RXRPC_SECURITY_RXKAD,
.init_connection_security = rxkad_init_connection_security,
.prime_packet_security = rxkad_prime_packet_security,
.secure_packet = rxkad_secure_packet,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/4] RxRPC: Declare the security index constants symbolically
@ 2009-09-15 9:46 David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-09-15 9:46 UTC (permalink / raw)
To: dhowells; +Cc: netdev
All 4 patches applied, but...
The rxrpc code seems to use a hodge-podge of uint32_t, uint16_t et
al. and the Linux kernel preferred "u8".
Please consolidate it all to use u32, u16, etc.
This looks especially weird since you use the endianness aware
fixed sized Linux types (be32, be16) as well.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-15 9:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-15 9:46 [PATCH 1/4] RxRPC: Declare the security index constants symbolically David Miller
-- strict thread matches above, loose matches on Subject: below --
2009-09-14 11:17 David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).