diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-25 19:43:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-25 19:43:35 -0400 |
commit | 62606c224d72a98c35d21a849f95cccf95b0a252 (patch) | |
tree | 6f6f3466451edf9baa2ea8b5f9fc558aa555c69a /net/rxrpc | |
parent | 24ed334f33666f2ae929ccc08f72e7e72e353c64 (diff) | |
parent | a1c6fd4308d37f072e939a2782f24214115fc7e8 (diff) |
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu:
"API:
- Remove VLA usage
- Add cryptostat user-space interface
- Add notifier for new crypto algorithms
Algorithms:
- Add OFB mode
- Remove speck
Drivers:
- Remove x86/sha*-mb as they are buggy
- Remove pcbc(aes) from x86/aesni
- Improve performance of arm/ghash-ce by up to 85%
- Implement CTS-CBC in arm64/aes-blk, faster by up to 50%
- Remove PMULL based arm64/crc32 driver
- Use PMULL in arm64/crct10dif
- Add aes-ctr support in s5p-sss
- Add caam/qi2 driver
Others:
- Pick better transform if one becomes available in crc-t10dif"
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (124 commits)
crypto: chelsio - Update ntx queue received from cxgb4
crypto: ccree - avoid implicit enum conversion
crypto: caam - add SPDX license identifier to all files
crypto: caam/qi - simplify CGR allocation, freeing
crypto: mxs-dcp - make symbols 'sha1_null_hash' and 'sha256_null_hash' static
crypto: arm64/aes-blk - ensure XTS mask is always loaded
crypto: testmgr - fix sizeof() on COMP_BUF_SIZE
crypto: chtls - remove set but not used variable 'csk'
crypto: axis - fix platform_no_drv_owner.cocci warnings
crypto: x86/aes-ni - fix build error following fpu template removal
crypto: arm64/aes - fix handling sub-block CTS-CBC inputs
crypto: caam/qi2 - avoid double export
crypto: mxs-dcp - Fix AES issues
crypto: mxs-dcp - Fix SHA null hashes and output length
crypto: mxs-dcp - Implement sha import/export
crypto: aegis/generic - fix for big endian systems
crypto: morus/generic - fix for big endian systems
crypto: lrw - fix rebase error after out of bounds fix
crypto: cavium/nitrox - use pci_alloc_irq_vectors() while enabling MSI-X.
crypto: cavium/nitrox - NITROX command queue changes.
...
Diffstat (limited to 'net/rxrpc')
-rw-r--r-- | net/rxrpc/ar-internal.h | 2 | ||||
-rw-r--r-- | net/rxrpc/rxkad.c | 44 |
2 files changed, 23 insertions, 23 deletions
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index 0a7c49e8e053..382196e57a26 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h | |||
@@ -435,7 +435,7 @@ struct rxrpc_connection { | |||
435 | struct sk_buff_head rx_queue; /* received conn-level packets */ | 435 | struct sk_buff_head rx_queue; /* received conn-level packets */ |
436 | const struct rxrpc_security *security; /* applied security module */ | 436 | const struct rxrpc_security *security; /* applied security module */ |
437 | struct key *server_key; /* security for this service */ | 437 | struct key *server_key; /* security for this service */ |
438 | struct crypto_skcipher *cipher; /* encryption handle */ | 438 | struct crypto_sync_skcipher *cipher; /* encryption handle */ |
439 | struct rxrpc_crypt csum_iv; /* packet checksum base */ | 439 | struct rxrpc_crypt csum_iv; /* packet checksum base */ |
440 | unsigned long flags; | 440 | unsigned long flags; |
441 | unsigned long events; | 441 | unsigned long events; |
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index cea16838d588..cbef9ea43dec 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c | |||
@@ -46,7 +46,7 @@ struct rxkad_level2_hdr { | |||
46 | * alloc routine, but since we have it to hand, we use it to decrypt RESPONSE | 46 | * alloc routine, but since we have it to hand, we use it to decrypt RESPONSE |
47 | * packets | 47 | * packets |
48 | */ | 48 | */ |
49 | static struct crypto_skcipher *rxkad_ci; | 49 | static struct crypto_sync_skcipher *rxkad_ci; |
50 | static DEFINE_MUTEX(rxkad_ci_mutex); | 50 | static DEFINE_MUTEX(rxkad_ci_mutex); |
51 | 51 | ||
52 | /* | 52 | /* |
@@ -54,7 +54,7 @@ static DEFINE_MUTEX(rxkad_ci_mutex); | |||
54 | */ | 54 | */ |
55 | static int rxkad_init_connection_security(struct rxrpc_connection *conn) | 55 | static int rxkad_init_connection_security(struct rxrpc_connection *conn) |
56 | { | 56 | { |
57 | struct crypto_skcipher *ci; | 57 | struct crypto_sync_skcipher *ci; |
58 | struct rxrpc_key_token *token; | 58 | struct rxrpc_key_token *token; |
59 | int ret; | 59 | int ret; |
60 | 60 | ||
@@ -63,14 +63,14 @@ static int rxkad_init_connection_security(struct rxrpc_connection *conn) | |||
63 | token = conn->params.key->payload.data[0]; | 63 | token = conn->params.key->payload.data[0]; |
64 | conn->security_ix = token->security_index; | 64 | conn->security_ix = token->security_index; |
65 | 65 | ||
66 | ci = crypto_alloc_skcipher("pcbc(fcrypt)", 0, CRYPTO_ALG_ASYNC); | 66 | ci = crypto_alloc_sync_skcipher("pcbc(fcrypt)", 0, 0); |
67 | if (IS_ERR(ci)) { | 67 | if (IS_ERR(ci)) { |
68 | _debug("no cipher"); | 68 | _debug("no cipher"); |
69 | ret = PTR_ERR(ci); | 69 | ret = PTR_ERR(ci); |
70 | goto error; | 70 | goto error; |
71 | } | 71 | } |
72 | 72 | ||
73 | if (crypto_skcipher_setkey(ci, token->kad->session_key, | 73 | if (crypto_sync_skcipher_setkey(ci, token->kad->session_key, |
74 | sizeof(token->kad->session_key)) < 0) | 74 | sizeof(token->kad->session_key)) < 0) |
75 | BUG(); | 75 | BUG(); |
76 | 76 | ||
@@ -104,7 +104,7 @@ error: | |||
104 | static int rxkad_prime_packet_security(struct rxrpc_connection *conn) | 104 | static int rxkad_prime_packet_security(struct rxrpc_connection *conn) |
105 | { | 105 | { |
106 | struct rxrpc_key_token *token; | 106 | struct rxrpc_key_token *token; |
107 | SKCIPHER_REQUEST_ON_STACK(req, conn->cipher); | 107 | SYNC_SKCIPHER_REQUEST_ON_STACK(req, conn->cipher); |
108 | struct scatterlist sg; | 108 | struct scatterlist sg; |
109 | struct rxrpc_crypt iv; | 109 | struct rxrpc_crypt iv; |
110 | __be32 *tmpbuf; | 110 | __be32 *tmpbuf; |
@@ -128,7 +128,7 @@ static int rxkad_prime_packet_security(struct rxrpc_connection *conn) | |||
128 | tmpbuf[3] = htonl(conn->security_ix); | 128 | tmpbuf[3] = htonl(conn->security_ix); |
129 | 129 | ||
130 | sg_init_one(&sg, tmpbuf, tmpsize); | 130 | sg_init_one(&sg, tmpbuf, tmpsize); |
131 | skcipher_request_set_tfm(req, conn->cipher); | 131 | skcipher_request_set_sync_tfm(req, conn->cipher); |
132 | skcipher_request_set_callback(req, 0, NULL, NULL); | 132 | skcipher_request_set_callback(req, 0, NULL, NULL); |
133 | skcipher_request_set_crypt(req, &sg, &sg, tmpsize, iv.x); | 133 | skcipher_request_set_crypt(req, &sg, &sg, tmpsize, iv.x); |
134 | crypto_skcipher_encrypt(req); | 134 | crypto_skcipher_encrypt(req); |
@@ -167,7 +167,7 @@ static int rxkad_secure_packet_auth(const struct rxrpc_call *call, | |||
167 | memset(&iv, 0, sizeof(iv)); | 167 | memset(&iv, 0, sizeof(iv)); |
168 | 168 | ||
169 | sg_init_one(&sg, sechdr, 8); | 169 | sg_init_one(&sg, sechdr, 8); |
170 | skcipher_request_set_tfm(req, call->conn->cipher); | 170 | skcipher_request_set_sync_tfm(req, call->conn->cipher); |
171 | skcipher_request_set_callback(req, 0, NULL, NULL); | 171 | skcipher_request_set_callback(req, 0, NULL, NULL); |
172 | skcipher_request_set_crypt(req, &sg, &sg, 8, iv.x); | 172 | skcipher_request_set_crypt(req, &sg, &sg, 8, iv.x); |
173 | crypto_skcipher_encrypt(req); | 173 | crypto_skcipher_encrypt(req); |
@@ -212,7 +212,7 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call, | |||
212 | memcpy(&iv, token->kad->session_key, sizeof(iv)); | 212 | memcpy(&iv, token->kad->session_key, sizeof(iv)); |
213 | 213 | ||
214 | sg_init_one(&sg[0], sechdr, sizeof(rxkhdr)); | 214 | sg_init_one(&sg[0], sechdr, sizeof(rxkhdr)); |
215 | skcipher_request_set_tfm(req, call->conn->cipher); | 215 | skcipher_request_set_sync_tfm(req, call->conn->cipher); |
216 | skcipher_request_set_callback(req, 0, NULL, NULL); | 216 | skcipher_request_set_callback(req, 0, NULL, NULL); |
217 | skcipher_request_set_crypt(req, &sg[0], &sg[0], sizeof(rxkhdr), iv.x); | 217 | skcipher_request_set_crypt(req, &sg[0], &sg[0], sizeof(rxkhdr), iv.x); |
218 | crypto_skcipher_encrypt(req); | 218 | crypto_skcipher_encrypt(req); |
@@ -250,7 +250,7 @@ static int rxkad_secure_packet(struct rxrpc_call *call, | |||
250 | void *sechdr) | 250 | void *sechdr) |
251 | { | 251 | { |
252 | struct rxrpc_skb_priv *sp; | 252 | struct rxrpc_skb_priv *sp; |
253 | SKCIPHER_REQUEST_ON_STACK(req, call->conn->cipher); | 253 | SYNC_SKCIPHER_REQUEST_ON_STACK(req, call->conn->cipher); |
254 | struct rxrpc_crypt iv; | 254 | struct rxrpc_crypt iv; |
255 | struct scatterlist sg; | 255 | struct scatterlist sg; |
256 | u32 x, y; | 256 | u32 x, y; |
@@ -279,7 +279,7 @@ static int rxkad_secure_packet(struct rxrpc_call *call, | |||
279 | call->crypto_buf[1] = htonl(x); | 279 | call->crypto_buf[1] = htonl(x); |
280 | 280 | ||
281 | sg_init_one(&sg, call->crypto_buf, 8); | 281 | sg_init_one(&sg, call->crypto_buf, 8); |
282 | skcipher_request_set_tfm(req, call->conn->cipher); | 282 | skcipher_request_set_sync_tfm(req, call->conn->cipher); |
283 | skcipher_request_set_callback(req, 0, NULL, NULL); | 283 | skcipher_request_set_callback(req, 0, NULL, NULL); |
284 | skcipher_request_set_crypt(req, &sg, &sg, 8, iv.x); | 284 | skcipher_request_set_crypt(req, &sg, &sg, 8, iv.x); |
285 | crypto_skcipher_encrypt(req); | 285 | crypto_skcipher_encrypt(req); |
@@ -352,7 +352,7 @@ static int rxkad_verify_packet_1(struct rxrpc_call *call, struct sk_buff *skb, | |||
352 | /* start the decryption afresh */ | 352 | /* start the decryption afresh */ |
353 | memset(&iv, 0, sizeof(iv)); | 353 | memset(&iv, 0, sizeof(iv)); |
354 | 354 | ||
355 | skcipher_request_set_tfm(req, call->conn->cipher); | 355 | skcipher_request_set_sync_tfm(req, call->conn->cipher); |
356 | skcipher_request_set_callback(req, 0, NULL, NULL); | 356 | skcipher_request_set_callback(req, 0, NULL, NULL); |
357 | skcipher_request_set_crypt(req, sg, sg, 8, iv.x); | 357 | skcipher_request_set_crypt(req, sg, sg, 8, iv.x); |
358 | crypto_skcipher_decrypt(req); | 358 | crypto_skcipher_decrypt(req); |
@@ -450,7 +450,7 @@ static int rxkad_verify_packet_2(struct rxrpc_call *call, struct sk_buff *skb, | |||
450 | token = call->conn->params.key->payload.data[0]; | 450 | token = call->conn->params.key->payload.data[0]; |
451 | memcpy(&iv, token->kad->session_key, sizeof(iv)); | 451 | memcpy(&iv, token->kad->session_key, sizeof(iv)); |
452 | 452 | ||
453 | skcipher_request_set_tfm(req, call->conn->cipher); | 453 | skcipher_request_set_sync_tfm(req, call->conn->cipher); |
454 | skcipher_request_set_callback(req, 0, NULL, NULL); | 454 | skcipher_request_set_callback(req, 0, NULL, NULL); |
455 | skcipher_request_set_crypt(req, sg, sg, len, iv.x); | 455 | skcipher_request_set_crypt(req, sg, sg, len, iv.x); |
456 | crypto_skcipher_decrypt(req); | 456 | crypto_skcipher_decrypt(req); |
@@ -506,7 +506,7 @@ static int rxkad_verify_packet(struct rxrpc_call *call, struct sk_buff *skb, | |||
506 | unsigned int offset, unsigned int len, | 506 | unsigned int offset, unsigned int len, |
507 | rxrpc_seq_t seq, u16 expected_cksum) | 507 | rxrpc_seq_t seq, u16 expected_cksum) |
508 | { | 508 | { |
509 | SKCIPHER_REQUEST_ON_STACK(req, call->conn->cipher); | 509 | SYNC_SKCIPHER_REQUEST_ON_STACK(req, call->conn->cipher); |
510 | struct rxrpc_crypt iv; | 510 | struct rxrpc_crypt iv; |
511 | struct scatterlist sg; | 511 | struct scatterlist sg; |
512 | bool aborted; | 512 | bool aborted; |
@@ -529,7 +529,7 @@ static int rxkad_verify_packet(struct rxrpc_call *call, struct sk_buff *skb, | |||
529 | call->crypto_buf[1] = htonl(x); | 529 | call->crypto_buf[1] = htonl(x); |
530 | 530 | ||
531 | sg_init_one(&sg, call->crypto_buf, 8); | 531 | sg_init_one(&sg, call->crypto_buf, 8); |
532 | skcipher_request_set_tfm(req, call->conn->cipher); | 532 | skcipher_request_set_sync_tfm(req, call->conn->cipher); |
533 | skcipher_request_set_callback(req, 0, NULL, NULL); | 533 | skcipher_request_set_callback(req, 0, NULL, NULL); |
534 | skcipher_request_set_crypt(req, &sg, &sg, 8, iv.x); | 534 | skcipher_request_set_crypt(req, &sg, &sg, 8, iv.x); |
535 | crypto_skcipher_encrypt(req); | 535 | crypto_skcipher_encrypt(req); |
@@ -755,7 +755,7 @@ static void rxkad_encrypt_response(struct rxrpc_connection *conn, | |||
755 | struct rxkad_response *resp, | 755 | struct rxkad_response *resp, |
756 | const struct rxkad_key *s2) | 756 | const struct rxkad_key *s2) |
757 | { | 757 | { |
758 | SKCIPHER_REQUEST_ON_STACK(req, conn->cipher); | 758 | SYNC_SKCIPHER_REQUEST_ON_STACK(req, conn->cipher); |
759 | struct rxrpc_crypt iv; | 759 | struct rxrpc_crypt iv; |
760 | struct scatterlist sg[1]; | 760 | struct scatterlist sg[1]; |
761 | 761 | ||
@@ -764,7 +764,7 @@ static void rxkad_encrypt_response(struct rxrpc_connection *conn, | |||
764 | 764 | ||
765 | sg_init_table(sg, 1); | 765 | sg_init_table(sg, 1); |
766 | sg_set_buf(sg, &resp->encrypted, sizeof(resp->encrypted)); | 766 | sg_set_buf(sg, &resp->encrypted, sizeof(resp->encrypted)); |
767 | skcipher_request_set_tfm(req, conn->cipher); | 767 | skcipher_request_set_sync_tfm(req, conn->cipher); |
768 | skcipher_request_set_callback(req, 0, NULL, NULL); | 768 | skcipher_request_set_callback(req, 0, NULL, NULL); |
769 | skcipher_request_set_crypt(req, sg, sg, sizeof(resp->encrypted), iv.x); | 769 | skcipher_request_set_crypt(req, sg, sg, sizeof(resp->encrypted), iv.x); |
770 | crypto_skcipher_encrypt(req); | 770 | crypto_skcipher_encrypt(req); |
@@ -1021,7 +1021,7 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn, | |||
1021 | struct rxkad_response *resp, | 1021 | struct rxkad_response *resp, |
1022 | const struct rxrpc_crypt *session_key) | 1022 | const struct rxrpc_crypt *session_key) |
1023 | { | 1023 | { |
1024 | SKCIPHER_REQUEST_ON_STACK(req, rxkad_ci); | 1024 | SYNC_SKCIPHER_REQUEST_ON_STACK(req, rxkad_ci); |
1025 | struct scatterlist sg[1]; | 1025 | struct scatterlist sg[1]; |
1026 | struct rxrpc_crypt iv; | 1026 | struct rxrpc_crypt iv; |
1027 | 1027 | ||
@@ -1031,7 +1031,7 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn, | |||
1031 | ASSERT(rxkad_ci != NULL); | 1031 | ASSERT(rxkad_ci != NULL); |
1032 | 1032 | ||
1033 | mutex_lock(&rxkad_ci_mutex); | 1033 | mutex_lock(&rxkad_ci_mutex); |
1034 | if (crypto_skcipher_setkey(rxkad_ci, session_key->x, | 1034 | if (crypto_sync_skcipher_setkey(rxkad_ci, session_key->x, |
1035 | sizeof(*session_key)) < 0) | 1035 | sizeof(*session_key)) < 0) |
1036 | BUG(); | 1036 | BUG(); |
1037 | 1037 | ||
@@ -1039,7 +1039,7 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn, | |||
1039 | 1039 | ||
1040 | sg_init_table(sg, 1); | 1040 | sg_init_table(sg, 1); |
1041 | sg_set_buf(sg, &resp->encrypted, sizeof(resp->encrypted)); | 1041 | sg_set_buf(sg, &resp->encrypted, sizeof(resp->encrypted)); |
1042 | skcipher_request_set_tfm(req, rxkad_ci); | 1042 | skcipher_request_set_sync_tfm(req, rxkad_ci); |
1043 | skcipher_request_set_callback(req, 0, NULL, NULL); | 1043 | skcipher_request_set_callback(req, 0, NULL, NULL); |
1044 | skcipher_request_set_crypt(req, sg, sg, sizeof(resp->encrypted), iv.x); | 1044 | skcipher_request_set_crypt(req, sg, sg, sizeof(resp->encrypted), iv.x); |
1045 | crypto_skcipher_decrypt(req); | 1045 | crypto_skcipher_decrypt(req); |
@@ -1218,7 +1218,7 @@ static void rxkad_clear(struct rxrpc_connection *conn) | |||
1218 | _enter(""); | 1218 | _enter(""); |
1219 | 1219 | ||
1220 | if (conn->cipher) | 1220 | if (conn->cipher) |
1221 | crypto_free_skcipher(conn->cipher); | 1221 | crypto_free_sync_skcipher(conn->cipher); |
1222 | } | 1222 | } |
1223 | 1223 | ||
1224 | /* | 1224 | /* |
@@ -1228,7 +1228,7 @@ static int rxkad_init(void) | |||
1228 | { | 1228 | { |
1229 | /* pin the cipher we need so that the crypto layer doesn't invoke | 1229 | /* pin the cipher we need so that the crypto layer doesn't invoke |
1230 | * keventd to go get it */ | 1230 | * keventd to go get it */ |
1231 | rxkad_ci = crypto_alloc_skcipher("pcbc(fcrypt)", 0, CRYPTO_ALG_ASYNC); | 1231 | rxkad_ci = crypto_alloc_sync_skcipher("pcbc(fcrypt)", 0, 0); |
1232 | return PTR_ERR_OR_ZERO(rxkad_ci); | 1232 | return PTR_ERR_OR_ZERO(rxkad_ci); |
1233 | } | 1233 | } |
1234 | 1234 | ||
@@ -1238,7 +1238,7 @@ static int rxkad_init(void) | |||
1238 | static void rxkad_exit(void) | 1238 | static void rxkad_exit(void) |
1239 | { | 1239 | { |
1240 | if (rxkad_ci) | 1240 | if (rxkad_ci) |
1241 | crypto_free_skcipher(rxkad_ci); | 1241 | crypto_free_sync_skcipher(rxkad_ci); |
1242 | } | 1242 | } |
1243 | 1243 | ||
1244 | /* | 1244 | /* |