summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2021-02-18 20:27:26 +1000
committerShane Lontis <shane.lontis@oracle.com>2021-02-26 10:53:01 +1000
commit32ab57cbb4877ce7e6b4eb3f9b3cfbb0ff7cd10b (patch)
tree91e75951efa936b26e3a636b9a0daf90d60182b0 /test
parent5af02212a5331cc30389246bb94f97fbcdebc23a (diff)
Fix external symbols related to ec & sm2 keys
Partial fix for #12964 This adds ossl_ names for the following symbols: ec_*, ecx_*, ecdh_*, ecdsa_*, sm2_* Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14231)
Diffstat (limited to 'test')
-rw-r--r--test/ec_internal_test.c4
-rw-r--r--test/sm2_internal_test.c21
2 files changed, 14 insertions, 11 deletions
diff --git a/test/ec_internal_test.c b/test/ec_internal_test.c
index e2ea65b885..e0e6a859cb 100644
--- a/test/ec_internal_test.c
+++ b/test/ec_internal_test.c
@@ -233,8 +233,8 @@ static int underflow_test(void)
|| !TEST_int_gt(BN_hex2bn(&y1, p521m1), 0)
|| !TEST_int_gt(BN_hex2bn(&z1, p521m1), 0)
|| !TEST_int_gt(BN_hex2bn(&k, "02"), 0)
- || !TEST_true(ec_GFp_simple_set_Jprojective_coordinates_GFp(grp, P, x1,
- y1, z1, ctx))
+ || !TEST_true(ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(grp, P, x1,
+ y1, z1, ctx))
|| !TEST_true(EC_POINT_mul(grp, Q, NULL, P, k, ctx))
|| !TEST_true(EC_POINT_get_affine_coordinates(grp, Q, x1, y1, ctx))
|| !TEST_true(EC_POINT_dbl(grp, R, P, ctx))
diff --git a/test/sm2_internal_test.c b/test/sm2_internal_test.c
index 77b76e64f8..aaa337b57b 100644
--- a/test/sm2_internal_test.c
+++ b/test/sm2_internal_test.c
@@ -159,7 +159,8 @@ static int test_sm2_crypt(const EC_GROUP *group,
if (!TEST_ptr(pt)
|| !TEST_true(EC_POINT_mul(group, pt, priv, NULL, NULL, NULL))
|| !TEST_true(EC_KEY_set_public_key(key, pt))
- || !TEST_true(sm2_ciphertext_size(key, digest, msg_len, &ctext_len)))
+ || !TEST_true(ossl_sm2_ciphertext_size(key, digest, msg_len,
+ &ctext_len)))
goto done;
ctext = OPENSSL_zalloc(ctext_len);
@@ -167,8 +168,9 @@ static int test_sm2_crypt(const EC_GROUP *group,
goto done;
start_fake_rand(k_hex);
- if (!TEST_true(sm2_encrypt(key, digest, (const uint8_t *)message, msg_len,
- ctext, &ctext_len))) {
+ if (!TEST_true(ossl_sm2_encrypt(key, digest,
+ (const uint8_t *)message, msg_len,
+ ctext, &ctext_len))) {
restore_rand();
goto done;
}
@@ -177,13 +179,14 @@ static int test_sm2_crypt(const EC_GROUP *group,
if (!TEST_mem_eq(ctext, ctext_len, expected, ctext_len))
goto done;
- if (!TEST_true(sm2_plaintext_size(key, digest, ctext_len, &ptext_len))
+ if (!TEST_true(ossl_sm2_plaintext_size(key, digest, ctext_len, &ptext_len))
|| !TEST_int_eq(ptext_len, msg_len))
goto done;
recovered = OPENSSL_zalloc(ptext_len);
if (!TEST_ptr(recovered)
- || !TEST_true(sm2_decrypt(key, digest, ctext, ctext_len, recovered, &recovered_len))
+ || !TEST_true(ossl_sm2_decrypt(key, digest, ctext, ctext_len,
+ recovered, &recovered_len))
|| !TEST_int_eq(recovered_len, msg_len)
|| !TEST_mem_eq(recovered, recovered_len, message, msg_len))
goto done;
@@ -286,8 +289,8 @@ static int test_sm2_sign(const EC_GROUP *group,
goto done;
start_fake_rand(k_hex);
- sig = sm2_do_sign(key, EVP_sm3(), (const uint8_t *)userid, strlen(userid),
- (const uint8_t *)message, msg_len);
+ sig = ossl_sm2_do_sign(key, EVP_sm3(), (const uint8_t *)userid,
+ strlen(userid), (const uint8_t *)message, msg_len);
if (!TEST_ptr(sig)) {
restore_rand();
goto done;
@@ -302,8 +305,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, (const uint8_t *)userid,
- strlen(userid), (const uint8_t *)message, msg_len);
+ ok = ossl_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);