diff options
author | David Howells <dhowells@redhat.com> | 2015-10-21 09:04:48 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2015-10-21 10:18:36 -0400 |
commit | 146aa8b1453bd8f1ff2304ffb71b4ee0eb9acdcc (patch) | |
tree | a89ef2cd2e8029b0c09a58739cca0e7e2e68f4db /net/rxrpc/rxkad.c | |
parent | 4adc605edc5f744dcf432241b5996ff6a13d868c (diff) |
KEYS: Merge the type-specific data with the payload data
Merge the type-specific data with the payload data into one four-word chunk
as it seems pointless to keep them separate.
Use user_key_payload() for accessing the payloads of overloaded
user-defined keys.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-cifs@vger.kernel.org
cc: ecryptfs@vger.kernel.org
cc: linux-ext4@vger.kernel.org
cc: linux-f2fs-devel@lists.sourceforge.net
cc: linux-nfs@vger.kernel.org
cc: ceph-devel@vger.kernel.org
cc: linux-ima-devel@lists.sourceforge.net
Diffstat (limited to 'net/rxrpc/rxkad.c')
-rw-r--r-- | net/rxrpc/rxkad.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index f226709ebd8f..d7a9ab5a9d9c 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c | |||
@@ -67,7 +67,7 @@ static int rxkad_init_connection_security(struct rxrpc_connection *conn) | |||
67 | 67 | ||
68 | _enter("{%d},{%x}", conn->debug_id, key_serial(conn->key)); | 68 | _enter("{%d},{%x}", conn->debug_id, key_serial(conn->key)); |
69 | 69 | ||
70 | token = conn->key->payload.data; | 70 | token = conn->key->payload.data[0]; |
71 | conn->security_ix = token->security_index; | 71 | conn->security_ix = token->security_index; |
72 | 72 | ||
73 | ci = crypto_alloc_blkcipher("pcbc(fcrypt)", 0, CRYPTO_ALG_ASYNC); | 73 | ci = crypto_alloc_blkcipher("pcbc(fcrypt)", 0, CRYPTO_ALG_ASYNC); |
@@ -125,7 +125,7 @@ static void rxkad_prime_packet_security(struct rxrpc_connection *conn) | |||
125 | if (!conn->key) | 125 | if (!conn->key) |
126 | return; | 126 | return; |
127 | 127 | ||
128 | token = conn->key->payload.data; | 128 | token = conn->key->payload.data[0]; |
129 | memcpy(&iv, token->kad->session_key, sizeof(iv)); | 129 | memcpy(&iv, token->kad->session_key, sizeof(iv)); |
130 | 130 | ||
131 | desc.tfm = conn->cipher; | 131 | desc.tfm = conn->cipher; |
@@ -221,7 +221,7 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call, | |||
221 | rxkhdr.checksum = 0; | 221 | rxkhdr.checksum = 0; |
222 | 222 | ||
223 | /* encrypt from the session key */ | 223 | /* encrypt from the session key */ |
224 | token = call->conn->key->payload.data; | 224 | token = call->conn->key->payload.data[0]; |
225 | memcpy(&iv, token->kad->session_key, sizeof(iv)); | 225 | memcpy(&iv, token->kad->session_key, sizeof(iv)); |
226 | desc.tfm = call->conn->cipher; | 226 | desc.tfm = call->conn->cipher; |
227 | desc.info = iv.x; | 227 | desc.info = iv.x; |
@@ -433,7 +433,7 @@ static int rxkad_verify_packet_encrypt(const struct rxrpc_call *call, | |||
433 | skb_to_sgvec(skb, sg, 0, skb->len); | 433 | skb_to_sgvec(skb, sg, 0, skb->len); |
434 | 434 | ||
435 | /* decrypt from the session key */ | 435 | /* decrypt from the session key */ |
436 | token = call->conn->key->payload.data; | 436 | token = call->conn->key->payload.data[0]; |
437 | memcpy(&iv, token->kad->session_key, sizeof(iv)); | 437 | memcpy(&iv, token->kad->session_key, sizeof(iv)); |
438 | desc.tfm = call->conn->cipher; | 438 | desc.tfm = call->conn->cipher; |
439 | desc.info = iv.x; | 439 | desc.info = iv.x; |
@@ -780,7 +780,7 @@ static int rxkad_respond_to_challenge(struct rxrpc_connection *conn, | |||
780 | if (conn->security_level < min_level) | 780 | if (conn->security_level < min_level) |
781 | goto protocol_error; | 781 | goto protocol_error; |
782 | 782 | ||
783 | token = conn->key->payload.data; | 783 | token = conn->key->payload.data[0]; |
784 | 784 | ||
785 | /* build the response packet */ | 785 | /* build the response packet */ |
786 | memset(&resp, 0, sizeof(resp)); | 786 | memset(&resp, 0, sizeof(resp)); |
@@ -848,12 +848,12 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn, | |||
848 | } | 848 | } |
849 | } | 849 | } |
850 | 850 | ||
851 | ASSERT(conn->server_key->payload.data != NULL); | 851 | ASSERT(conn->server_key->payload.data[0] != NULL); |
852 | ASSERTCMP((unsigned long) ticket & 7UL, ==, 0); | 852 | ASSERTCMP((unsigned long) ticket & 7UL, ==, 0); |
853 | 853 | ||
854 | memcpy(&iv, &conn->server_key->type_data, sizeof(iv)); | 854 | memcpy(&iv, &conn->server_key->payload.data[2], sizeof(iv)); |
855 | 855 | ||
856 | desc.tfm = conn->server_key->payload.data; | 856 | desc.tfm = conn->server_key->payload.data[0]; |
857 | desc.info = iv.x; | 857 | desc.info = iv.x; |
858 | desc.flags = 0; | 858 | desc.flags = 0; |
859 | 859 | ||