From 675fa85413a130607ec780ce9edaa6dd7ee1500f Mon Sep 17 00:00:00 2001 From: neighbads <16126598+neighbads@users.noreply.github.com> Date: Wed, 11 Jul 2018 15:40:03 +0800 Subject: [PATCH] Update sm2_crypt.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit asn1_encode : x, y => 0 | x,0 | y (because of DER encoding rules when x and y have high bit set) CLA: Trivial Reviewed-by: Paul Dale Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/6694) --- crypto/sm2/sm2_crypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/sm2/sm2_crypt.c b/crypto/sm2/sm2_crypt.c index aedf9054c1..d6f9c81d8c 100644 --- a/crypto/sm2/sm2_crypt.c +++ b/crypto/sm2/sm2_crypt.c @@ -95,7 +95,7 @@ int sm2_ciphertext_size(const EC_KEY *key, const EVP_MD *digest, size_t msg_len, if (field_size == 0 || md_size < 0) return 0; - *ct_size = 10 + 2 * field_size + (size_t)md_size + msg_len; + *ct_size = 12 + 2 * field_size + (size_t)md_size + msg_len; return 1; } -- 2.25.1