X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Fsm2_internal_test.c;h=8e76daa913fad559fd360f425dcb53527fb0f9b0;hp=ea8ac7df8861af423c9a8a5f9d254df278403aff;hb=80de174281f7bf5ae9799df26153efe476f41b92;hpb=09fb65d5e413b7b87bf26f01ec441b44a03d4ee2 diff --git a/test/sm2_internal_test.c b/test/sm2_internal_test.c index ea8ac7df88..8e76daa913 100644 --- a/test/sm2_internal_test.c +++ b/test/sm2_internal_test.c @@ -1,7 +1,7 @@ /* * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. * - * Licensed under the OpenSSL license (the "License"). You may not use + * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html @@ -107,8 +107,8 @@ static EC_GROUP *create_EC_group(const char *p_hex, const char *a_hex, if (!TEST_true(BN_hex2bn(&g_x, x_hex)) || !TEST_true(BN_hex2bn(&g_y, y_hex)) - || !TEST_true(EC_POINT_set_affine_coordinates_GFp(group, generator, - g_x, g_y, NULL))) + || !TEST_true(EC_POINT_set_affine_coordinates(group, generator, g_x, + g_y, NULL))) goto done; if (!TEST_true(BN_hex2bn(&order, order_hex)) @@ -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);