diff options
Diffstat (limited to '')
-rw-r--r-- | crypto/ecdh.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/ecdh.c b/crypto/ecdh.c index 80afee3234..3049f147e0 100644 --- a/crypto/ecdh.c +++ b/crypto/ecdh.c @@ -33,6 +33,8 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf, params.key_size > sizeof(u64) * ctx->ndigits) return -EINVAL; + memset(ctx->private_key, 0, sizeof(ctx->private_key)); + if (!params.key || !params.key_size) return ecc_gen_privkey(ctx->curve_id, ctx->ndigits, ctx->private_key); |