summaryrefslogtreecommitdiffstats
path: root/test/sm2_internal_test.c
diff options
context:
space:
mode:
authorPaul Yang <yang.yang@baishancloud.com>2018-09-03 19:24:55 +0200
committerPaul Yang <yang.yang@baishancloud.com>2018-09-07 12:12:26 +0200
commit00433bad41bfa492f2e204675d42061314028ff2 (patch)
tree3be74f013f2cc7900f301e6f67dc753137393566 /test/sm2_internal_test.c
parentSupport pmeth->digest_custom (diff)
downloadopenssl-00433bad41bfa492f2e204675d42061314028ff2.tar.xz
openssl-00433bad41bfa492f2e204675d42061314028ff2.zip
Make SM2 ID stick to specification
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7113)
Diffstat (limited to 'test/sm2_internal_test.c')
-rw-r--r--test/sm2_internal_test.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/sm2_internal_test.c b/test/sm2_internal_test.c
index 0d145e8553..015fa85e68 100644
--- a/test/sm2_internal_test.c
+++ b/test/sm2_internal_test.c
@@ -294,7 +294,8 @@ static int test_sm2_sign(const EC_GROUP *group,
goto done;
start_fake_rand(k_hex);
- sig = sm2_do_sign(key, EVP_sm3(), userid, (const uint8_t *)message, msg_len);
+ sig = sm2_do_sign(key, EVP_sm3(), (const uint8_t *)userid, strlen(userid),
+ (const uint8_t *)message, msg_len);
if (!TEST_ptr(sig)
|| !TEST_size_t_eq(fake_rand_bytes_offset, fake_rand_size)) {
restore_rand();
@@ -310,8 +311,8 @@ static int test_sm2_sign(const EC_GROUP *group,
|| !TEST_BN_eq(s, sig_s))
goto done;
- ok = sm2_do_verify(key, EVP_sm3(), sig, userid, (const uint8_t *)message,
- msg_len);
+ ok = sm2_do_verify(key, EVP_sm3(), sig, (const uint8_t *)userid,
+ strlen(userid), (const uint8_t *)message, msg_len);
/* We goto done whether this passes or fails */
TEST_true(ok);