Fix warnings building secp256k1 tests with openssl 3.0 #23048

issue andypost openend this issue on September 20, 2021
  1. andypost commented at 3:31 pm on September 20, 2021: none

    Is your feature request related to a problem? Please describe.

    Building package 22.0 for Alpinelinux using OpenSSL 3.0 getting warnings that tests using deprecated in 3.0 functions (only tests affected)

     0make[4]: Entering directory '/home/skilld/aports/community/bitcoin/src/bitcoin-22.0/src/secp256k1'
     1  CC       src/exhaustive_tests-tests_exhaustive.o
     2  CC       src/tests-tests.o
     3src/tests.c: In function 'get_openssl_key':
     4src/tests.c:6161:5: warning: 'EC_KEY_new_by_curve_name' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
     5 6161 |     EC_KEY *ec_key = EC_KEY_new_by_curve_name(NID_secp256k1);
     6      |     ^~~~~~
     7In file included from src/tests.c:25:
     8/usr/include/openssl/ec.h:996:31: note: declared here
     9  996 | OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name(int nid);
    10      |                               ^~~~~~~~~~~~~~~~~~~~~~~~
    11src/tests.c:6163:5: warning: 'd2i_ECPrivateKey' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
    12 6163 |     CHECK(d2i_ECPrivateKey(&ec_key, &pbegin, privkeylen));
    13      |     ^~~~~
    14In file included from src/tests.c:25:
    15/usr/include/openssl/ec.h:1185:31: note: declared here
    16 1185 | OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey(EC_KEY **key,
    17      |                               ^~~~~~~~~~~~~~~~
    18src/tests.c:6164:5: warning: 'EC_KEY_check_key' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
    19 6164 |     CHECK(EC_KEY_check_key(ec_key));
    20      |     ^~~~~
    21In file included from src/tests.c:25:
    22/usr/include/openssl/ec.h:1105:27: note: declared here
    23 1105 | OSSL_DEPRECATEDIN_3_0 int EC_KEY_check_key(const EC_KEY *key);
    24      |                           ^~~~~~~~~~~~~~~~
    25src/tests.c: In function 'test_ecdsa_openssl':
    26src/tests.c:6189:5: warning: 'ECDSA_sign' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
    27 6189 |     CHECK(ECDSA_sign(0, message, sizeof(message), signature, &sigsize, ec_key));
    28      |     ^~~~~
    29In file included from src/tests.c:25:
    30/usr/include/openssl/ec.h:1412:27: note: declared here
    31 1412 | OSSL_DEPRECATEDIN_3_0 int ECDSA_sign(int type, const unsigned char *dgst,
    32      |                           ^~~~~~~~~~
    33src/tests.c:6198:5: warning: 'ECDSA_verify' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
    34 6198 |     CHECK(ECDSA_verify(0, message, sizeof(message), signature, secp_sigsize, ec_key) == 1);
    35      |     ^~~~~
    36In file included from src/tests.c:25:
    37/usr/include/openssl/ec.h:1445:27: note: declared here
    38 1445 | OSSL_DEPRECATEDIN_3_0 int ECDSA_verify(int type, const unsigned char *dgst,
    39      |                           ^~~~~~~~~~~~
    40src/tests.c:6200:5: warning: 'EC_KEY_free' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
    41 6200 |     EC_KEY_free(ec_key);
    42      |     ^~~~~~~~~~~
    43In file included from src/tests.c:25:
    44/usr/include/openssl/ec.h:1001:28: note: declared here
    45 1001 | OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key);
    46      |                            ^~~~~~~~~~~
    47  CCLD     exhaustive_tests
    48  CCLD     tests
    49make  check-TESTS
    50make[5]: Entering directory '/home/skilld/aports/community/bitcoin/src/bitcoin-22.0/src/secp256k1'
    51make[6]: Entering directory '/home/skilld/aports/community/bitcoin/src/bitcoin-22.0/src/secp256k1'
    52PASS: exhaustive_tests
    53FAIL: tests
    54============================================================================
    55Testsuite summary for libsecp256k1 0.1
    56============================================================================
    57# TOTAL: 2
    58# PASS:  1
    59# SKIP:  0
    60# XFAIL: 0
    61# FAIL:  1
    62# XPASS: 0
    63# ERROR: 0
    

    Describe the solution you’d like

    According to man it needs replacement

    Describe alternatives you’ve considered

    Used to configure with --disable-openssl-tests

    Additional context

    Alpinelinux started OpenSSL 3.0 adoption

  2. andypost added the label Feature on Sep 20, 2021
  3. fanquake removed the label Feature on Sep 21, 2021
  4. fanquake added the label Upstream on Sep 21, 2021
  5. fanquake commented at 3:25 am on September 21, 2021: member
    If you’d like these “fixed” you should open an issue in the upstream secp256k1 repo: https://github.com/bitcoin-core/secp256k1.
  6. andypost commented at 2:23 pm on September 21, 2021: none
    Thank you, will do
  7. hebasto commented at 7:11 am on October 3, 2021: member
    Could be closed here?
  8. fanquake commented at 9:43 am on October 3, 2021: member
    Yes. Looks like the OpenSSL related code may even be removed shortly upstream.
  9. fanquake closed this on Oct 3, 2021

  10. fanquake referenced this in commit d7524546ab on Oct 20, 2021
  11. laanwj referenced this in commit d807aceeab on Oct 20, 2021
  12. fanquake referenced this in commit e959b46aa9 on Oct 20, 2021
  13. MarcoFalke referenced this in commit 56156a1f08 on Oct 21, 2021
  14. luke-jr referenced this in commit 14eac26e30 on Dec 14, 2021
  15. knst referenced this in commit 6f1d324aa0 on Jul 27, 2022
  16. UdjinM6 referenced this in commit a6e9e50845 on Jul 27, 2022
  17. DrahtBot locked this on Oct 30, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me