diff options
| -rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_crypto.c | 8 | ||||
| -rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_mech.c | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c index d94a8e1e9f05..da26455cf86c 100644 --- a/net/sunrpc/auth_gss/gss_krb5_crypto.c +++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c | |||
| @@ -78,6 +78,7 @@ krb5_encrypt( | |||
| 78 | memcpy(out, in, length); | 78 | memcpy(out, in, length); |
| 79 | sg_init_one(sg, out, length); | 79 | sg_init_one(sg, out, length); |
| 80 | 80 | ||
| 81 | skcipher_request_set_tfm(req, tfm); | ||
| 81 | skcipher_request_set_callback(req, 0, NULL, NULL); | 82 | skcipher_request_set_callback(req, 0, NULL, NULL); |
| 82 | skcipher_request_set_crypt(req, sg, sg, length, local_iv); | 83 | skcipher_request_set_crypt(req, sg, sg, length, local_iv); |
| 83 | 84 | ||
| @@ -115,6 +116,7 @@ krb5_decrypt( | |||
| 115 | memcpy(out, in, length); | 116 | memcpy(out, in, length); |
| 116 | sg_init_one(sg, out, length); | 117 | sg_init_one(sg, out, length); |
| 117 | 118 | ||
| 119 | skcipher_request_set_tfm(req, tfm); | ||
| 118 | skcipher_request_set_callback(req, 0, NULL, NULL); | 120 | skcipher_request_set_callback(req, 0, NULL, NULL); |
| 119 | skcipher_request_set_crypt(req, sg, sg, length, local_iv); | 121 | skcipher_request_set_crypt(req, sg, sg, length, local_iv); |
| 120 | 122 | ||
| @@ -946,7 +948,8 @@ krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher, | |||
| 946 | return PTR_ERR(hmac); | 948 | return PTR_ERR(hmac); |
| 947 | } | 949 | } |
| 948 | 950 | ||
| 949 | desc = kmalloc(sizeof(*desc), GFP_KERNEL); | 951 | desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac), |
| 952 | GFP_KERNEL); | ||
| 950 | if (!desc) { | 953 | if (!desc) { |
| 951 | dprintk("%s: failed to allocate shash descriptor for '%s'\n", | 954 | dprintk("%s: failed to allocate shash descriptor for '%s'\n", |
| 952 | __func__, kctx->gk5e->cksum_name); | 955 | __func__, kctx->gk5e->cksum_name); |
| @@ -1012,7 +1015,8 @@ krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher, | |||
| 1012 | return PTR_ERR(hmac); | 1015 | return PTR_ERR(hmac); |
| 1013 | } | 1016 | } |
| 1014 | 1017 | ||
| 1015 | desc = kmalloc(sizeof(*desc), GFP_KERNEL); | 1018 | desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac), |
| 1019 | GFP_KERNEL); | ||
| 1016 | if (!desc) { | 1020 | if (!desc) { |
| 1017 | dprintk("%s: failed to allocate shash descriptor for '%s'\n", | 1021 | dprintk("%s: failed to allocate shash descriptor for '%s'\n", |
| 1018 | __func__, kctx->gk5e->cksum_name); | 1022 | __func__, kctx->gk5e->cksum_name); |
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c index 71341ccb9890..65427492b1c9 100644 --- a/net/sunrpc/auth_gss/gss_krb5_mech.c +++ b/net/sunrpc/auth_gss/gss_krb5_mech.c | |||
| @@ -451,7 +451,8 @@ context_derive_keys_rc4(struct krb5_ctx *ctx) | |||
| 451 | goto out_err_free_hmac; | 451 | goto out_err_free_hmac; |
| 452 | 452 | ||
| 453 | 453 | ||
| 454 | desc = kmalloc(sizeof(*desc), GFP_KERNEL); | 454 | desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac), |
| 455 | GFP_KERNEL); | ||
| 455 | if (!desc) { | 456 | if (!desc) { |
| 456 | dprintk("%s: failed to allocate hash descriptor for '%s'\n", | 457 | dprintk("%s: failed to allocate hash descriptor for '%s'\n", |
| 457 | __func__, ctx->gk5e->cksum_name); | 458 | __func__, ctx->gk5e->cksum_name); |
