Commit 2f8d62da authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'v6.6-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
 "This fixes a regression in sm2"

* tag 'v6.6-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: sm2 - Fix crash caused by uninitialized context
parents 3a457d28 21155620
...@@ -278,10 +278,14 @@ int sm2_compute_z_digest(struct shash_desc *desc, ...@@ -278,10 +278,14 @@ int sm2_compute_z_digest(struct shash_desc *desc,
if (!ec) if (!ec)
return -ENOMEM; return -ENOMEM;
err = __sm2_set_pub_key(ec, key, keylen); err = sm2_ec_ctx_init(ec);
if (err) if (err)
goto out_free_ec; goto out_free_ec;
err = __sm2_set_pub_key(ec, key, keylen);
if (err)
goto out_deinit_ec;
bits_len = SM2_DEFAULT_USERID_LEN * 8; bits_len = SM2_DEFAULT_USERID_LEN * 8;
entl[0] = bits_len >> 8; entl[0] = bits_len >> 8;
entl[1] = bits_len & 0xff; entl[1] = bits_len & 0xff;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment