diff options
author | neighbads <16126598+neighbads@users.noreply.github.com> | 2018-07-11 15:40:03 +0800 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2018-07-24 12:28:03 +0200 |
commit | 675fa85413a130607ec780ce9edaa6dd7ee1500f (patch) | |
tree | 09f53d99d576f17f16d6e1044adf02f3b94b5587 /crypto/sm2 | |
parent | 85aebfcc6eedceaed34012a8b2c27c43ef402f95 (diff) | |
download | openssl-675fa85413a130607ec780ce9edaa6dd7ee1500f.zip openssl-675fa85413a130607ec780ce9edaa6dd7ee1500f.tar.gz openssl-675fa85413a130607ec780ce9edaa6dd7ee1500f.tar.bz2 |
Update sm2_crypt.c
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 <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6694)
Diffstat (limited to 'crypto/sm2')
-rw-r--r-- | crypto/sm2/sm2_crypt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/sm2/sm2_crypt.c b/crypto/sm2/sm2_crypt.c index aedf905..d6f9c81 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; } |