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 a functional bug in arm/chacha-neon as well as a potential buffer overflow in ecdh" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: ecdh - avoid buffer overflow in ecdh_set_secret() crypto: arm/chacha-neon - add missing counter increment
This commit is contained in:
commit
ea1c87c156
@ -60,6 +60,7 @@ static void chacha_doneon(u32 *state, u8 *dst, const u8 *src,
|
|||||||
chacha_block_xor_neon(state, d, s, nrounds);
|
chacha_block_xor_neon(state, d, s, nrounds);
|
||||||
if (d != dst)
|
if (d != dst)
|
||||||
memcpy(dst, buf, bytes);
|
memcpy(dst, buf, bytes);
|
||||||
|
state[12]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,8 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf,
|
|||||||
struct ecdh params;
|
struct ecdh params;
|
||||||
unsigned int ndigits;
|
unsigned int ndigits;
|
||||||
|
|
||||||
if (crypto_ecdh_decode_key(buf, len, ¶ms) < 0)
|
if (crypto_ecdh_decode_key(buf, len, ¶ms) < 0 ||
|
||||||
|
params.key_size > sizeof(ctx->private_key))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ndigits = ecdh_supported_curve(params.curve_id);
|
ndigits = ecdh_supported_curve(params.curve_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user