X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=crypto%2Fecdh.c;h=96f80c8f8e30484c2c1b656d91d12a0e82eeee9f;hb=1193a7de6ef447db3e9b40cbdcc742ddc434b35a;hp=d56b8603dec95a9fca11c4fb2c5dafdf4f5d2fcf;hpb=16182ac1f02c8a5fc9753f9b8b5f3ef8c01707d8;p=linux-2.6-microblaze.git diff --git a/crypto/ecdh.c b/crypto/ecdh.c index d56b8603dec9..96f80c8f8e30 100644 --- a/crypto/ecdh.c +++ b/crypto/ecdh.c @@ -39,7 +39,8 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf, struct ecdh params; 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; ndigits = ecdh_supported_curve(params.curve_id);