Skip to content

Commit 16382ed

Browse files
committed
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
2 parents 4c0b1c6 + 47cd306 commit 16382ed

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

drivers/char/hw_random/bcm63xx-rng.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/clk.h>
1313
#include <linux/platform_device.h>
1414
#include <linux/hw_random.h>
15+
#include <linux/of.h>
1516

1617
#define RNG_CTRL 0x00
1718
#define RNG_EN (1 << 0)

net/sunrpc/auth_gss/gss_krb5_crypto.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ krb5_encrypt(
7878
memcpy(out, in, length);
7979
sg_init_one(sg, out, length);
8080

81+
skcipher_request_set_tfm(req, tfm);
8182
skcipher_request_set_callback(req, 0, NULL, NULL);
8283
skcipher_request_set_crypt(req, sg, sg, length, local_iv);
8384

@@ -115,6 +116,7 @@ krb5_decrypt(
115116
memcpy(out, in, length);
116117
sg_init_one(sg, out, length);
117118

119+
skcipher_request_set_tfm(req, tfm);
118120
skcipher_request_set_callback(req, 0, NULL, NULL);
119121
skcipher_request_set_crypt(req, sg, sg, length, local_iv);
120122

@@ -946,7 +948,8 @@ krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher,
946948
return PTR_ERR(hmac);
947949
}
948950

949-
desc = kmalloc(sizeof(*desc), GFP_KERNEL);
951+
desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac),
952+
GFP_KERNEL);
950953
if (!desc) {
951954
dprintk("%s: failed to allocate shash descriptor for '%s'\n",
952955
__func__, kctx->gk5e->cksum_name);
@@ -1012,7 +1015,8 @@ krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher,
10121015
return PTR_ERR(hmac);
10131016
}
10141017

1015-
desc = kmalloc(sizeof(*desc), GFP_KERNEL);
1018+
desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac),
1019+
GFP_KERNEL);
10161020
if (!desc) {
10171021
dprintk("%s: failed to allocate shash descriptor for '%s'\n",
10181022
__func__, kctx->gk5e->cksum_name);

net/sunrpc/auth_gss/gss_krb5_mech.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,8 @@ context_derive_keys_rc4(struct krb5_ctx *ctx)
451451
goto out_err_free_hmac;
452452

453453

454-
desc = kmalloc(sizeof(*desc), GFP_KERNEL);
454+
desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac),
455+
GFP_KERNEL);
455456
if (!desc) {
456457
dprintk("%s: failed to allocate hash descriptor for '%s'\n",
457458
__func__, ctx->gk5e->cksum_name);

0 commit comments

Comments
 (0)