diff options
Diffstat (limited to 'crypto/dh.c')
-rw-r--r-- | crypto/dh.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/dh.c b/crypto/dh.c index 7cec04985b9d..e151f12775ca 100644 --- a/crypto/dh.c +++ b/crypto/dh.c @@ -85,6 +85,9 @@ static int dh_set_secret(struct crypto_kpp *tfm, const void *buf, struct dh_ctx *ctx = dh_get_ctx(tfm); struct dh params; + /* Free the old MPI key if any */ + dh_free_ctx(ctx); + if (crypto_dh_decode_key(buf, len, ¶ms) < 0) return -EINVAL; |