Commit 16382ed9 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 4c0b1c67 47cd3060
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/hw_random.h> #include <linux/hw_random.h>
#include <linux/of.h>
#define RNG_CTRL 0x00 #define RNG_CTRL 0x00
#define RNG_EN (1 << 0) #define RNG_EN (1 << 0)
......
...@@ -78,6 +78,7 @@ krb5_encrypt( ...@@ -78,6 +78,7 @@ krb5_encrypt(
memcpy(out, in, length); memcpy(out, in, length);
sg_init_one(sg, out, length); sg_init_one(sg, out, length);
skcipher_request_set_tfm(req, tfm);
skcipher_request_set_callback(req, 0, NULL, NULL); skcipher_request_set_callback(req, 0, NULL, NULL);
skcipher_request_set_crypt(req, sg, sg, length, local_iv); skcipher_request_set_crypt(req, sg, sg, length, local_iv);
...@@ -115,6 +116,7 @@ krb5_decrypt( ...@@ -115,6 +116,7 @@ krb5_decrypt(
memcpy(out, in, length); memcpy(out, in, length);
sg_init_one(sg, out, length); sg_init_one(sg, out, length);
skcipher_request_set_tfm(req, tfm);
skcipher_request_set_callback(req, 0, NULL, NULL); skcipher_request_set_callback(req, 0, NULL, NULL);
skcipher_request_set_crypt(req, sg, sg, length, local_iv); skcipher_request_set_crypt(req, sg, sg, length, local_iv);
...@@ -946,7 +948,8 @@ krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher, ...@@ -946,7 +948,8 @@ krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher,
return PTR_ERR(hmac); return PTR_ERR(hmac);
} }
desc = kmalloc(sizeof(*desc), GFP_KERNEL); desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac),
GFP_KERNEL);
if (!desc) { if (!desc) {
dprintk("%s: failed to allocate shash descriptor for '%s'\n", dprintk("%s: failed to allocate shash descriptor for '%s'\n",
__func__, kctx->gk5e->cksum_name); __func__, kctx->gk5e->cksum_name);
...@@ -1012,7 +1015,8 @@ krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher, ...@@ -1012,7 +1015,8 @@ krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher,
return PTR_ERR(hmac); return PTR_ERR(hmac);
} }
desc = kmalloc(sizeof(*desc), GFP_KERNEL); desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac),
GFP_KERNEL);
if (!desc) { if (!desc) {
dprintk("%s: failed to allocate shash descriptor for '%s'\n", dprintk("%s: failed to allocate shash descriptor for '%s'\n",
__func__, kctx->gk5e->cksum_name); __func__, kctx->gk5e->cksum_name);
......
...@@ -451,7 +451,8 @@ context_derive_keys_rc4(struct krb5_ctx *ctx) ...@@ -451,7 +451,8 @@ context_derive_keys_rc4(struct krb5_ctx *ctx)
goto out_err_free_hmac; goto out_err_free_hmac;
desc = kmalloc(sizeof(*desc), GFP_KERNEL); desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac),
GFP_KERNEL);
if (!desc) { if (!desc) {
dprintk("%s: failed to allocate hash descriptor for '%s'\n", dprintk("%s: failed to allocate hash descriptor for '%s'\n",
__func__, ctx->gk5e->cksum_name); __func__, ctx->gk5e->cksum_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment