hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/sunrpc/auth_gss/gss_krb5_crypto.c
....@@ -53,7 +53,7 @@
5353
5454 u32
5555 krb5_encrypt(
56
- struct crypto_skcipher *tfm,
56
+ struct crypto_sync_skcipher *tfm,
5757 void * iv,
5858 void * in,
5959 void * out,
....@@ -62,24 +62,24 @@
6262 u32 ret = -EINVAL;
6363 struct scatterlist sg[1];
6464 u8 local_iv[GSS_KRB5_MAX_BLOCKSIZE] = {0};
65
- SKCIPHER_REQUEST_ON_STACK(req, tfm);
65
+ SYNC_SKCIPHER_REQUEST_ON_STACK(req, tfm);
6666
67
- if (length % crypto_skcipher_blocksize(tfm) != 0)
67
+ if (length % crypto_sync_skcipher_blocksize(tfm) != 0)
6868 goto out;
6969
70
- if (crypto_skcipher_ivsize(tfm) > GSS_KRB5_MAX_BLOCKSIZE) {
70
+ if (crypto_sync_skcipher_ivsize(tfm) > GSS_KRB5_MAX_BLOCKSIZE) {
7171 dprintk("RPC: gss_k5encrypt: tfm iv size too large %d\n",
72
- crypto_skcipher_ivsize(tfm));
72
+ crypto_sync_skcipher_ivsize(tfm));
7373 goto out;
7474 }
7575
7676 if (iv)
77
- memcpy(local_iv, iv, crypto_skcipher_ivsize(tfm));
77
+ memcpy(local_iv, iv, crypto_sync_skcipher_ivsize(tfm));
7878
7979 memcpy(out, in, length);
8080 sg_init_one(sg, out, length);
8181
82
- skcipher_request_set_tfm(req, tfm);
82
+ skcipher_request_set_sync_tfm(req, tfm);
8383 skcipher_request_set_callback(req, 0, NULL, NULL);
8484 skcipher_request_set_crypt(req, sg, sg, length, local_iv);
8585
....@@ -92,7 +92,7 @@
9292
9393 u32
9494 krb5_decrypt(
95
- struct crypto_skcipher *tfm,
95
+ struct crypto_sync_skcipher *tfm,
9696 void * iv,
9797 void * in,
9898 void * out,
....@@ -101,23 +101,23 @@
101101 u32 ret = -EINVAL;
102102 struct scatterlist sg[1];
103103 u8 local_iv[GSS_KRB5_MAX_BLOCKSIZE] = {0};
104
- SKCIPHER_REQUEST_ON_STACK(req, tfm);
104
+ SYNC_SKCIPHER_REQUEST_ON_STACK(req, tfm);
105105
106
- if (length % crypto_skcipher_blocksize(tfm) != 0)
106
+ if (length % crypto_sync_skcipher_blocksize(tfm) != 0)
107107 goto out;
108108
109
- if (crypto_skcipher_ivsize(tfm) > GSS_KRB5_MAX_BLOCKSIZE) {
109
+ if (crypto_sync_skcipher_ivsize(tfm) > GSS_KRB5_MAX_BLOCKSIZE) {
110110 dprintk("RPC: gss_k5decrypt: tfm iv size too large %d\n",
111
- crypto_skcipher_ivsize(tfm));
111
+ crypto_sync_skcipher_ivsize(tfm));
112112 goto out;
113113 }
114114 if (iv)
115
- memcpy(local_iv,iv, crypto_skcipher_ivsize(tfm));
115
+ memcpy(local_iv, iv, crypto_sync_skcipher_ivsize(tfm));
116116
117117 memcpy(out, in, length);
118118 sg_init_one(sg, out, length);
119119
120
- skcipher_request_set_tfm(req, tfm);
120
+ skcipher_request_set_sync_tfm(req, tfm);
121121 skcipher_request_set_callback(req, 0, NULL, NULL);
122122 skcipher_request_set_crypt(req, sg, sg, length, local_iv);
123123
....@@ -138,135 +138,6 @@
138138 return crypto_ahash_update(req);
139139 }
140140
141
-static int
142
-arcfour_hmac_md5_usage_to_salt(unsigned int usage, u8 salt[4])
143
-{
144
- unsigned int ms_usage;
145
-
146
- switch (usage) {
147
- case KG_USAGE_SIGN:
148
- ms_usage = 15;
149
- break;
150
- case KG_USAGE_SEAL:
151
- ms_usage = 13;
152
- break;
153
- default:
154
- return -EINVAL;
155
- }
156
- salt[0] = (ms_usage >> 0) & 0xff;
157
- salt[1] = (ms_usage >> 8) & 0xff;
158
- salt[2] = (ms_usage >> 16) & 0xff;
159
- salt[3] = (ms_usage >> 24) & 0xff;
160
-
161
- return 0;
162
-}
163
-
164
-static u32
165
-make_checksum_hmac_md5(struct krb5_ctx *kctx, char *header, int hdrlen,
166
- struct xdr_buf *body, int body_offset, u8 *cksumkey,
167
- unsigned int usage, struct xdr_netobj *cksumout)
168
-{
169
- struct scatterlist sg[1];
170
- int err = -1;
171
- u8 *checksumdata;
172
- u8 *rc4salt;
173
- struct crypto_ahash *md5;
174
- struct crypto_ahash *hmac_md5;
175
- struct ahash_request *req;
176
-
177
- if (cksumkey == NULL)
178
- return GSS_S_FAILURE;
179
-
180
- if (cksumout->len < kctx->gk5e->cksumlength) {
181
- dprintk("%s: checksum buffer length, %u, too small for %s\n",
182
- __func__, cksumout->len, kctx->gk5e->name);
183
- return GSS_S_FAILURE;
184
- }
185
-
186
- rc4salt = kmalloc_array(4, sizeof(*rc4salt), GFP_NOFS);
187
- if (!rc4salt)
188
- return GSS_S_FAILURE;
189
-
190
- if (arcfour_hmac_md5_usage_to_salt(usage, rc4salt)) {
191
- dprintk("%s: invalid usage value %u\n", __func__, usage);
192
- goto out_free_rc4salt;
193
- }
194
-
195
- checksumdata = kmalloc(GSS_KRB5_MAX_CKSUM_LEN, GFP_NOFS);
196
- if (!checksumdata)
197
- goto out_free_rc4salt;
198
-
199
- md5 = crypto_alloc_ahash("md5", 0, CRYPTO_ALG_ASYNC);
200
- if (IS_ERR(md5))
201
- goto out_free_cksum;
202
-
203
- hmac_md5 = crypto_alloc_ahash(kctx->gk5e->cksum_name, 0,
204
- CRYPTO_ALG_ASYNC);
205
- if (IS_ERR(hmac_md5))
206
- goto out_free_md5;
207
-
208
- req = ahash_request_alloc(md5, GFP_NOFS);
209
- if (!req)
210
- goto out_free_hmac_md5;
211
-
212
- ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_SLEEP, NULL, NULL);
213
-
214
- err = crypto_ahash_init(req);
215
- if (err)
216
- goto out;
217
- sg_init_one(sg, rc4salt, 4);
218
- ahash_request_set_crypt(req, sg, NULL, 4);
219
- err = crypto_ahash_update(req);
220
- if (err)
221
- goto out;
222
-
223
- sg_init_one(sg, header, hdrlen);
224
- ahash_request_set_crypt(req, sg, NULL, hdrlen);
225
- err = crypto_ahash_update(req);
226
- if (err)
227
- goto out;
228
- err = xdr_process_buf(body, body_offset, body->len - body_offset,
229
- checksummer, req);
230
- if (err)
231
- goto out;
232
- ahash_request_set_crypt(req, NULL, checksumdata, 0);
233
- err = crypto_ahash_final(req);
234
- if (err)
235
- goto out;
236
-
237
- ahash_request_free(req);
238
- req = ahash_request_alloc(hmac_md5, GFP_NOFS);
239
- if (!req)
240
- goto out_free_hmac_md5;
241
-
242
- ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_SLEEP, NULL, NULL);
243
-
244
- err = crypto_ahash_setkey(hmac_md5, cksumkey, kctx->gk5e->keylength);
245
- if (err)
246
- goto out;
247
-
248
- sg_init_one(sg, checksumdata, crypto_ahash_digestsize(md5));
249
- ahash_request_set_crypt(req, sg, checksumdata,
250
- crypto_ahash_digestsize(md5));
251
- err = crypto_ahash_digest(req);
252
- if (err)
253
- goto out;
254
-
255
- memcpy(cksumout->data, checksumdata, kctx->gk5e->cksumlength);
256
- cksumout->len = kctx->gk5e->cksumlength;
257
-out:
258
- ahash_request_free(req);
259
-out_free_hmac_md5:
260
- crypto_free_ahash(hmac_md5);
261
-out_free_md5:
262
- crypto_free_ahash(md5);
263
-out_free_cksum:
264
- kfree(checksumdata);
265
-out_free_rc4salt:
266
- kfree(rc4salt);
267
- return err ? GSS_S_FAILURE : 0;
268
-}
269
-
270141 /*
271142 * checksum the plaintext data and hdrlen bytes of the token header
272143 * The checksum is performed over the first 8 bytes of the
....@@ -283,11 +154,6 @@
283154 int err = -1;
284155 u8 *checksumdata;
285156 unsigned int checksumlen;
286
-
287
- if (kctx->gk5e->ctype == CKSUMTYPE_HMAC_MD5_ARCFOUR)
288
- return make_checksum_hmac_md5(kctx, header, hdrlen,
289
- body, body_offset,
290
- cksumkey, usage, cksumout);
291157
292158 if (cksumout->len < kctx->gk5e->cksumlength) {
293159 dprintk("%s: checksum buffer length, %u, too small for %s\n",
....@@ -466,7 +332,8 @@
466332 {
467333 struct encryptor_desc *desc = data;
468334 struct xdr_buf *outbuf = desc->outbuf;
469
- struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(desc->req);
335
+ struct crypto_sync_skcipher *tfm =
336
+ crypto_sync_skcipher_reqtfm(desc->req);
470337 struct page *in_page;
471338 int thislen = desc->fraglen + sg->length;
472339 int fraglen, ret;
....@@ -492,7 +359,7 @@
492359 desc->fraglen += sg->length;
493360 desc->pos += sg->length;
494361
495
- fraglen = thislen & (crypto_skcipher_blocksize(tfm) - 1);
362
+ fraglen = thislen & (crypto_sync_skcipher_blocksize(tfm) - 1);
496363 thislen -= fraglen;
497364
498365 if (thislen == 0)
....@@ -526,16 +393,16 @@
526393 }
527394
528395 int
529
-gss_encrypt_xdr_buf(struct crypto_skcipher *tfm, struct xdr_buf *buf,
396
+gss_encrypt_xdr_buf(struct crypto_sync_skcipher *tfm, struct xdr_buf *buf,
530397 int offset, struct page **pages)
531398 {
532399 int ret;
533400 struct encryptor_desc desc;
534
- SKCIPHER_REQUEST_ON_STACK(req, tfm);
401
+ SYNC_SKCIPHER_REQUEST_ON_STACK(req, tfm);
535402
536
- BUG_ON((buf->len - offset) % crypto_skcipher_blocksize(tfm) != 0);
403
+ BUG_ON((buf->len - offset) % crypto_sync_skcipher_blocksize(tfm) != 0);
537404
538
- skcipher_request_set_tfm(req, tfm);
405
+ skcipher_request_set_sync_tfm(req, tfm);
539406 skcipher_request_set_callback(req, 0, NULL, NULL);
540407
541408 memset(desc.iv, 0, sizeof(desc.iv));
....@@ -567,7 +434,8 @@
567434 {
568435 struct decryptor_desc *desc = data;
569436 int thislen = desc->fraglen + sg->length;
570
- struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(desc->req);
437
+ struct crypto_sync_skcipher *tfm =
438
+ crypto_sync_skcipher_reqtfm(desc->req);
571439 int fraglen, ret;
572440
573441 /* Worst case is 4 fragments: head, end of page 1, start
....@@ -578,7 +446,7 @@
578446 desc->fragno++;
579447 desc->fraglen += sg->length;
580448
581
- fraglen = thislen & (crypto_skcipher_blocksize(tfm) - 1);
449
+ fraglen = thislen & (crypto_sync_skcipher_blocksize(tfm) - 1);
582450 thislen -= fraglen;
583451
584452 if (thislen == 0)
....@@ -608,17 +476,17 @@
608476 }
609477
610478 int
611
-gss_decrypt_xdr_buf(struct crypto_skcipher *tfm, struct xdr_buf *buf,
479
+gss_decrypt_xdr_buf(struct crypto_sync_skcipher *tfm, struct xdr_buf *buf,
612480 int offset)
613481 {
614482 int ret;
615483 struct decryptor_desc desc;
616
- SKCIPHER_REQUEST_ON_STACK(req, tfm);
484
+ SYNC_SKCIPHER_REQUEST_ON_STACK(req, tfm);
617485
618486 /* XXXJBF: */
619
- BUG_ON((buf->len - offset) % crypto_skcipher_blocksize(tfm) != 0);
487
+ BUG_ON((buf->len - offset) % crypto_sync_skcipher_blocksize(tfm) != 0);
620488
621
- skcipher_request_set_tfm(req, tfm);
489
+ skcipher_request_set_sync_tfm(req, tfm);
622490 skcipher_request_set_callback(req, 0, NULL, NULL);
623491
624492 memset(desc.iv, 0, sizeof(desc.iv));
....@@ -672,12 +540,12 @@
672540 }
673541
674542 static u32
675
-gss_krb5_cts_crypt(struct crypto_skcipher *cipher, struct xdr_buf *buf,
543
+gss_krb5_cts_crypt(struct crypto_sync_skcipher *cipher, struct xdr_buf *buf,
676544 u32 offset, u8 *iv, struct page **pages, int encrypt)
677545 {
678546 u32 ret;
679547 struct scatterlist sg[1];
680
- SKCIPHER_REQUEST_ON_STACK(req, cipher);
548
+ SYNC_SKCIPHER_REQUEST_ON_STACK(req, cipher);
681549 u8 *data;
682550 struct page **save_pages;
683551 u32 len = buf->len - offset;
....@@ -706,7 +574,7 @@
706574
707575 sg_init_one(sg, data, len);
708576
709
- skcipher_request_set_tfm(req, cipher);
577
+ skcipher_request_set_sync_tfm(req, cipher);
710578 skcipher_request_set_callback(req, 0, NULL, NULL);
711579 skcipher_request_set_crypt(req, sg, sg, len, iv);
712580
....@@ -735,7 +603,7 @@
735603 struct xdr_netobj hmac;
736604 u8 *cksumkey;
737605 u8 *ecptr;
738
- struct crypto_skcipher *cipher, *aux_cipher;
606
+ struct crypto_sync_skcipher *cipher, *aux_cipher;
739607 int blocksize;
740608 struct page **save_pages;
741609 int nblocks, nbytes;
....@@ -754,7 +622,7 @@
754622 cksumkey = kctx->acceptor_integ;
755623 usage = KG_USAGE_ACCEPTOR_SEAL;
756624 }
757
- blocksize = crypto_skcipher_blocksize(cipher);
625
+ blocksize = crypto_sync_skcipher_blocksize(cipher);
758626
759627 /* hide the gss token header and insert the confounder */
760628 offset += GSS_KRB5_TOK_HDR_LEN;
....@@ -807,7 +675,7 @@
807675 memset(desc.iv, 0, sizeof(desc.iv));
808676
809677 if (cbcbytes) {
810
- SKCIPHER_REQUEST_ON_STACK(req, aux_cipher);
678
+ SYNC_SKCIPHER_REQUEST_ON_STACK(req, aux_cipher);
811679
812680 desc.pos = offset + GSS_KRB5_TOK_HDR_LEN;
813681 desc.fragno = 0;
....@@ -816,7 +684,7 @@
816684 desc.outbuf = buf;
817685 desc.req = req;
818686
819
- skcipher_request_set_tfm(req, aux_cipher);
687
+ skcipher_request_set_sync_tfm(req, aux_cipher);
820688 skcipher_request_set_callback(req, 0, NULL, NULL);
821689
822690 sg_init_table(desc.infrags, 4);
....@@ -849,13 +717,13 @@
849717 }
850718
851719 u32
852
-gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset, struct xdr_buf *buf,
853
- u32 *headskip, u32 *tailskip)
720
+gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset, u32 len,
721
+ struct xdr_buf *buf, u32 *headskip, u32 *tailskip)
854722 {
855723 struct xdr_buf subbuf;
856724 u32 ret = 0;
857725 u8 *cksum_key;
858
- struct crypto_skcipher *cipher, *aux_cipher;
726
+ struct crypto_sync_skcipher *cipher, *aux_cipher;
859727 struct xdr_netobj our_hmac_obj;
860728 u8 our_hmac[GSS_KRB5_MAX_CKSUM_LEN];
861729 u8 pkt_hmac[GSS_KRB5_MAX_CKSUM_LEN];
....@@ -874,12 +742,12 @@
874742 cksum_key = kctx->initiator_integ;
875743 usage = KG_USAGE_INITIATOR_SEAL;
876744 }
877
- blocksize = crypto_skcipher_blocksize(cipher);
745
+ blocksize = crypto_sync_skcipher_blocksize(cipher);
878746
879747
880748 /* create a segment skipping the header and leaving out the checksum */
881749 xdr_buf_subsegment(buf, &subbuf, offset + GSS_KRB5_TOK_HDR_LEN,
882
- (buf->len - offset - GSS_KRB5_TOK_HDR_LEN -
750
+ (len - offset - GSS_KRB5_TOK_HDR_LEN -
883751 kctx->gk5e->cksumlength));
884752
885753 nblocks = (subbuf.len + blocksize - 1) / blocksize;
....@@ -891,13 +759,13 @@
891759 memset(desc.iv, 0, sizeof(desc.iv));
892760
893761 if (cbcbytes) {
894
- SKCIPHER_REQUEST_ON_STACK(req, aux_cipher);
762
+ SYNC_SKCIPHER_REQUEST_ON_STACK(req, aux_cipher);
895763
896764 desc.fragno = 0;
897765 desc.fraglen = 0;
898766 desc.req = req;
899767
900
- skcipher_request_set_tfm(req, aux_cipher);
768
+ skcipher_request_set_sync_tfm(req, aux_cipher);
901769 skcipher_request_set_callback(req, 0, NULL, NULL);
902770
903771 sg_init_table(desc.frags, 4);
....@@ -924,7 +792,7 @@
924792 goto out_err;
925793
926794 /* Get the packet's hmac value */
927
- ret = read_bytes_from_xdr_buf(buf, buf->len - kctx->gk5e->cksumlength,
795
+ ret = read_bytes_from_xdr_buf(buf, len - kctx->gk5e->cksumlength,
928796 pkt_hmac, kctx->gk5e->cksumlength);
929797 if (ret)
930798 goto out_err;
....@@ -939,145 +807,4 @@
939807 if (ret && ret != GSS_S_BAD_SIG)
940808 ret = GSS_S_FAILURE;
941809 return ret;
942
-}
943
-
944
-/*
945
- * Compute Kseq given the initial session key and the checksum.
946
- * Set the key of the given cipher.
947
- */
948
-int
949
-krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher,
950
- unsigned char *cksum)
951
-{
952
- struct crypto_shash *hmac;
953
- struct shash_desc *desc;
954
- u8 Kseq[GSS_KRB5_MAX_KEYLEN];
955
- u32 zeroconstant = 0;
956
- int err;
957
-
958
- dprintk("%s: entered\n", __func__);
959
-
960
- hmac = crypto_alloc_shash(kctx->gk5e->cksum_name, 0, 0);
961
- if (IS_ERR(hmac)) {
962
- dprintk("%s: error %ld, allocating hash '%s'\n",
963
- __func__, PTR_ERR(hmac), kctx->gk5e->cksum_name);
964
- return PTR_ERR(hmac);
965
- }
966
-
967
- desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac),
968
- GFP_NOFS);
969
- if (!desc) {
970
- dprintk("%s: failed to allocate shash descriptor for '%s'\n",
971
- __func__, kctx->gk5e->cksum_name);
972
- crypto_free_shash(hmac);
973
- return -ENOMEM;
974
- }
975
-
976
- desc->tfm = hmac;
977
- desc->flags = 0;
978
-
979
- /* Compute intermediate Kseq from session key */
980
- err = crypto_shash_setkey(hmac, kctx->Ksess, kctx->gk5e->keylength);
981
- if (err)
982
- goto out_err;
983
-
984
- err = crypto_shash_digest(desc, (u8 *)&zeroconstant, 4, Kseq);
985
- if (err)
986
- goto out_err;
987
-
988
- /* Compute final Kseq from the checksum and intermediate Kseq */
989
- err = crypto_shash_setkey(hmac, Kseq, kctx->gk5e->keylength);
990
- if (err)
991
- goto out_err;
992
-
993
- err = crypto_shash_digest(desc, cksum, 8, Kseq);
994
- if (err)
995
- goto out_err;
996
-
997
- err = crypto_skcipher_setkey(cipher, Kseq, kctx->gk5e->keylength);
998
- if (err)
999
- goto out_err;
1000
-
1001
- err = 0;
1002
-
1003
-out_err:
1004
- kzfree(desc);
1005
- crypto_free_shash(hmac);
1006
- dprintk("%s: returning %d\n", __func__, err);
1007
- return err;
1008
-}
1009
-
1010
-/*
1011
- * Compute Kcrypt given the initial session key and the plaintext seqnum.
1012
- * Set the key of cipher kctx->enc.
1013
- */
1014
-int
1015
-krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher,
1016
- s32 seqnum)
1017
-{
1018
- struct crypto_shash *hmac;
1019
- struct shash_desc *desc;
1020
- u8 Kcrypt[GSS_KRB5_MAX_KEYLEN];
1021
- u8 zeroconstant[4] = {0};
1022
- u8 seqnumarray[4];
1023
- int err, i;
1024
-
1025
- dprintk("%s: entered, seqnum %u\n", __func__, seqnum);
1026
-
1027
- hmac = crypto_alloc_shash(kctx->gk5e->cksum_name, 0, 0);
1028
- if (IS_ERR(hmac)) {
1029
- dprintk("%s: error %ld, allocating hash '%s'\n",
1030
- __func__, PTR_ERR(hmac), kctx->gk5e->cksum_name);
1031
- return PTR_ERR(hmac);
1032
- }
1033
-
1034
- desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac),
1035
- GFP_NOFS);
1036
- if (!desc) {
1037
- dprintk("%s: failed to allocate shash descriptor for '%s'\n",
1038
- __func__, kctx->gk5e->cksum_name);
1039
- crypto_free_shash(hmac);
1040
- return -ENOMEM;
1041
- }
1042
-
1043
- desc->tfm = hmac;
1044
- desc->flags = 0;
1045
-
1046
- /* Compute intermediate Kcrypt from session key */
1047
- for (i = 0; i < kctx->gk5e->keylength; i++)
1048
- Kcrypt[i] = kctx->Ksess[i] ^ 0xf0;
1049
-
1050
- err = crypto_shash_setkey(hmac, Kcrypt, kctx->gk5e->keylength);
1051
- if (err)
1052
- goto out_err;
1053
-
1054
- err = crypto_shash_digest(desc, zeroconstant, 4, Kcrypt);
1055
- if (err)
1056
- goto out_err;
1057
-
1058
- /* Compute final Kcrypt from the seqnum and intermediate Kcrypt */
1059
- err = crypto_shash_setkey(hmac, Kcrypt, kctx->gk5e->keylength);
1060
- if (err)
1061
- goto out_err;
1062
-
1063
- seqnumarray[0] = (unsigned char) ((seqnum >> 24) & 0xff);
1064
- seqnumarray[1] = (unsigned char) ((seqnum >> 16) & 0xff);
1065
- seqnumarray[2] = (unsigned char) ((seqnum >> 8) & 0xff);
1066
- seqnumarray[3] = (unsigned char) ((seqnum >> 0) & 0xff);
1067
-
1068
- err = crypto_shash_digest(desc, seqnumarray, 4, Kcrypt);
1069
- if (err)
1070
- goto out_err;
1071
-
1072
- err = crypto_skcipher_setkey(cipher, Kcrypt, kctx->gk5e->keylength);
1073
- if (err)
1074
- goto out_err;
1075
-
1076
- err = 0;
1077
-
1078
-out_err:
1079
- kzfree(desc);
1080
- crypto_free_shash(hmac);
1081
- dprintk("%s: returning %d\n", __func__, err);
1082
- return err;
1083810 }