diff options
author | David S. Miller <davem@davemloft.net> | 2008-04-03 17:33:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-03 17:33:42 -0400 |
commit | 3bb5da3837cc1aa17736b05139c9a22c3794851a (patch) | |
tree | c92d5684a866542b1cb20641607ac1643ce03a47 /net/rxrpc | |
parent | 7feb49c82a74bc7c091b8ab2a3f96baa33d08ece (diff) | |
parent | 9597362d354f8655ece324b01d0c640a0e99c077 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/rxrpc')
-rw-r--r-- | net/rxrpc/ar-internal.h | 2 | ||||
-rw-r--r-- | net/rxrpc/rxkad.c | 27 |
2 files changed, 16 insertions, 13 deletions
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index e58cc65728b5..c89b797b221d 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h | |||
@@ -23,7 +23,7 @@ | |||
23 | struct rxrpc_crypt { | 23 | struct rxrpc_crypt { |
24 | union { | 24 | union { |
25 | u8 x[FCRYPT_BSIZE]; | 25 | u8 x[FCRYPT_BSIZE]; |
26 | u32 n[2]; | 26 | __be32 n[2]; |
27 | }; | 27 | }; |
28 | } __attribute__((aligned(8))); | 28 | } __attribute__((aligned(8))); |
29 | 29 | ||
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index f48434adb7c2..d1c296f2d617 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c | |||
@@ -261,6 +261,7 @@ static int rxkad_secure_packet(const struct rxrpc_call *call, | |||
261 | __be32 x[2]; | 261 | __be32 x[2]; |
262 | } tmpbuf __attribute__((aligned(8))); /* must all be in same page */ | 262 | } tmpbuf __attribute__((aligned(8))); /* must all be in same page */ |
263 | __be32 x; | 263 | __be32 x; |
264 | u32 y; | ||
264 | int ret; | 265 | int ret; |
265 | 266 | ||
266 | sp = rxrpc_skb(skb); | 267 | sp = rxrpc_skb(skb); |
@@ -292,11 +293,11 @@ static int rxkad_secure_packet(const struct rxrpc_call *call, | |||
292 | sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf)); | 293 | sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf)); |
293 | crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf)); | 294 | crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf)); |
294 | 295 | ||
295 | x = ntohl(tmpbuf.x[1]); | 296 | y = ntohl(tmpbuf.x[1]); |
296 | x = (x >> 16) & 0xffff; | 297 | y = (y >> 16) & 0xffff; |
297 | if (x == 0) | 298 | if (y == 0) |
298 | x = 1; /* zero checksums are not permitted */ | 299 | y = 1; /* zero checksums are not permitted */ |
299 | sp->hdr.cksum = htons(x); | 300 | sp->hdr.cksum = htons(y); |
300 | 301 | ||
301 | switch (call->conn->security_level) { | 302 | switch (call->conn->security_level) { |
302 | case RXRPC_SECURITY_PLAIN: | 303 | case RXRPC_SECURITY_PLAIN: |
@@ -314,7 +315,7 @@ static int rxkad_secure_packet(const struct rxrpc_call *call, | |||
314 | break; | 315 | break; |
315 | } | 316 | } |
316 | 317 | ||
317 | _leave(" = %d [set %hx]", ret, x); | 318 | _leave(" = %d [set %hx]", ret, y); |
318 | return ret; | 319 | return ret; |
319 | } | 320 | } |
320 | 321 | ||
@@ -492,6 +493,7 @@ static int rxkad_verify_packet(const struct rxrpc_call *call, | |||
492 | __be32 x[2]; | 493 | __be32 x[2]; |
493 | } tmpbuf __attribute__((aligned(8))); /* must all be in same page */ | 494 | } tmpbuf __attribute__((aligned(8))); /* must all be in same page */ |
494 | __be32 x; | 495 | __be32 x; |
496 | u16 y; | ||
495 | __be16 cksum; | 497 | __be16 cksum; |
496 | int ret; | 498 | int ret; |
497 | 499 | ||
@@ -526,12 +528,12 @@ static int rxkad_verify_packet(const struct rxrpc_call *call, | |||
526 | sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf)); | 528 | sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf)); |
527 | crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf)); | 529 | crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf)); |
528 | 530 | ||
529 | x = ntohl(tmpbuf.x[1]); | 531 | y = ntohl(tmpbuf.x[1]); |
530 | x = (x >> 16) & 0xffff; | 532 | y = (y >> 16) & 0xffff; |
531 | if (x == 0) | 533 | if (y == 0) |
532 | x = 1; /* zero checksums are not permitted */ | 534 | y = 1; /* zero checksums are not permitted */ |
533 | 535 | ||
534 | cksum = htons(x); | 536 | cksum = htons(y); |
535 | if (sp->hdr.cksum != cksum) { | 537 | if (sp->hdr.cksum != cksum) { |
536 | *_abort_code = RXKADSEALEDINCON; | 538 | *_abort_code = RXKADSEALEDINCON; |
537 | _leave(" = -EPROTO [csum failed]"); | 539 | _leave(" = -EPROTO [csum failed]"); |
@@ -1001,7 +1003,8 @@ static int rxkad_verify_response(struct rxrpc_connection *conn, | |||
1001 | struct rxrpc_crypt session_key; | 1003 | struct rxrpc_crypt session_key; |
1002 | time_t expiry; | 1004 | time_t expiry; |
1003 | void *ticket; | 1005 | void *ticket; |
1004 | u32 abort_code, version, kvno, ticket_len, csum, level; | 1006 | u32 abort_code, version, kvno, ticket_len, level; |
1007 | __be32 csum; | ||
1005 | int ret; | 1008 | int ret; |
1006 | 1009 | ||
1007 | _enter("{%d,%x}", conn->debug_id, key_serial(conn->server_key)); | 1010 | _enter("{%d,%x}", conn->debug_id, key_serial(conn->server_key)); |