Skip to content

Commit

Permalink
Attempt to fix tests against OpenSSL <= 3.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
beldmit committed Oct 19, 2023
1 parent cdfbbd0 commit aa18851
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions regress/unittests/sshkey/test_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ sshkey_file_tests(void)
#ifndef OPENSSL_IS_BORINGSSL /* lacks EC_POINT_point2bn() */
a = load_bignum("ecdsa_1.param.priv");
b = load_bignum("ecdsa_1.param.pub");
ec = EVP_PKEY_get0_EC_KEY(k1->pkey);
ec = EVP_PKEY_get1_EC_KEY(k1->pkey);
ASSERT_PTR_NE(ec, NULL);
/* OpenSSL 3.0.7 and below export EC pub key in compressed form */
#if (OPENSSL_VERSION_NUMBER < 0x30000080L)
c = EC_POINT_point2bn(EC_KEY_get0_group(ec),
Expand All @@ -290,7 +291,7 @@ sshkey_file_tests(void)
c = BN_new();
#endif
ASSERT_PTR_NE(c, NULL);
#if (OPENSSL_VERSION_NUMBER < 0x30000000L)
#if (OPENSSL_VERSION_NUMBER < 0x30000080L)
ASSERT_BIGNUM_EQ(EC_KEY_get0_private_key(ec), a);
#else
ASSERT_PTR_NE(BN_bin2bn(pubkey, pubkey_len, c), NULL);
Expand Down

0 comments on commit aa18851

Please sign in to comment.