]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
crypto/sm2/sm2_sign.c: Add BN_CTX_end
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Fri, 23 Sep 2022 02:35:39 +0000 (10:35 +0800)
committerTomas Mraz <tomas@openssl.org>
Tue, 13 Jun 2023 11:37:33 +0000 (13:37 +0200)
To match the BN_CTX_start, it should be better to add
BN_CTX_end in the end of the function.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19266)

crypto/sm2/sm2_sign.c

index 67c61b1dcdc8ebb67857f1e15659a013537df490..67d020ffaacd7ea4e6ebc1281f48829d909ebbcf 100644 (file)
@@ -390,6 +390,7 @@ static int sm2_sig_verify(const EC_KEY *key, const ECDSA_SIG *sig,
         ret = 1;
 
  done:
+    BN_CTX_end(ctx);
     EC_POINT_free(pt);
     BN_CTX_free(ctx);
     return ret;