aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-04-14 21:15:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-04-14 21:15:40 -0400
commit16382ed978cb40713684cfa0f25dc255a58d0c59 (patch)
tree3d1acc687a810aaa51cdc08b4d20d8de888eec6a
parent4c0b1c67c6250be73cedeac935b860e09de4420f (diff)
parent47cd30608f3fc3dbb4fdf37300baca911e2dde34 (diff)
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This fixes an NFS regression caused by the skcipher/hash conversion in sunrpc. It also fixes a build problem in certain configurations with bcm63xx" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: hwrng: bcm63xx - fix device tree compilation sunrpc: Fix skcipher/shash conversion
-rw-r--r--drivers/char/hw_random/bcm63xx-rng.c1
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_crypto.c8
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_mech.c3
3 files changed, 9 insertions, 3 deletions
diff --git a/drivers/char/hw_random/bcm63xx-rng.c b/drivers/char/hw_random/bcm63xx-rng.c
index ca9c40309757..5132c9cde50d 100644
--- a/drivers/char/hw_random/bcm63xx-rng.c
+++ b/drivers/char/hw_random/bcm63xx-rng.c
@@ -12,6 +12,7 @@
12#include <linux/clk.h> 12#include <linux/clk.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/hw_random.h> 14#include <linux/hw_random.h>
15#include <linux/of.h>
15 16
16#define RNG_CTRL 0x00 17#define RNG_CTRL 0x00
17#define RNG_EN (1 << 0) 18#define RNG_EN (1 << 0)
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
index 045e11ecd332..244245bcbbd2 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);