Fix warnings building secp256k1 tests with openssl 3.0 #23048

issue andypost opened 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.

    <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

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

    <details><summary>log of `make check`</summary>

    make[4]: Entering directory '/home/skilld/aports/community/bitcoin/src/bitcoin-22.0/src/secp256k1'
      CC       src/exhaustive_tests-tests_exhaustive.o
      CC       src/tests-tests.o
    src/tests.c: In function 'get_openssl_key':
    src/tests.c:6161:5: warning: 'EC_KEY_new_by_curve_name' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
     6161 |     EC_KEY *ec_key = EC_KEY_new_by_curve_name(NID_secp256k1);
          |     ^~~~~~
    In file included from src/tests.c:25:
    /usr/include/openssl/ec.h:996:31: note: declared here
      996 | OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name(int nid);
          |                               ^~~~~~~~~~~~~~~~~~~~~~~~
    src/tests.c:6163:5: warning: 'd2i_ECPrivateKey' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
     6163 |     CHECK(d2i_ECPrivateKey(&ec_key, &pbegin, privkeylen));
          |     ^~~~~
    In file included from src/tests.c:25:
    /usr/include/openssl/ec.h:1185:31: note: declared here
     1185 | OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey(EC_KEY **key,
          |                               ^~~~~~~~~~~~~~~~
    src/tests.c:6164:5: warning: 'EC_KEY_check_key' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
     6164 |     CHECK(EC_KEY_check_key(ec_key));
          |     ^~~~~
    In file included from src/tests.c:25:
    /usr/include/openssl/ec.h:1105:27: note: declared here
     1105 | OSSL_DEPRECATEDIN_3_0 int EC_KEY_check_key(const EC_KEY *key);
          |                           ^~~~~~~~~~~~~~~~
    src/tests.c: In function 'test_ecdsa_openssl':
    src/tests.c:6189:5: warning: 'ECDSA_sign' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
     6189 |     CHECK(ECDSA_sign(0, message, sizeof(message), signature, &sigsize, ec_key));
          |     ^~~~~
    In file included from src/tests.c:25:
    /usr/include/openssl/ec.h:1412:27: note: declared here
     1412 | OSSL_DEPRECATEDIN_3_0 int ECDSA_sign(int type, const unsigned char *dgst,
          |                           ^~~~~~~~~~
    src/tests.c:6198:5: warning: 'ECDSA_verify' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
     6198 |     CHECK(ECDSA_verify(0, message, sizeof(message), signature, secp_sigsize, ec_key) == 1);
          |     ^~~~~
    In file included from src/tests.c:25:
    /usr/include/openssl/ec.h:1445:27: note: declared here
     1445 | OSSL_DEPRECATEDIN_3_0 int ECDSA_verify(int type, const unsigned char *dgst,
          |                           ^~~~~~~~~~~~
    src/tests.c:6200:5: warning: 'EC_KEY_free' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
     6200 |     EC_KEY_free(ec_key);
          |     ^~~~~~~~~~~
    In file included from src/tests.c:25:
    /usr/include/openssl/ec.h:1001:28: note: declared here
     1001 | OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key);
          |                            ^~~~~~~~~~~
      CCLD     exhaustive_tests
      CCLD     tests
    make  check-TESTS
    make[5]: Entering directory '/home/skilld/aports/community/bitcoin/src/bitcoin-22.0/src/secp256k1'
    make[6]: Entering directory '/home/skilld/aports/community/bitcoin/src/bitcoin-22.0/src/secp256k1'
    PASS: exhaustive_tests
    FAIL: tests
    ============================================================================
    Testsuite summary for libsecp256k1 0.1
    ============================================================================
    # TOTAL: 2
    # PASS:  1
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  1
    # XPASS: 0
    # ERROR: 0
    

    </details>

    Describe the solution you'd like

    <!-- A clear and concise description of what you want to happen. -->

    According to man it needs replacement

    Describe alternatives you've considered

    <!-- A clear and concise description of any alternative solutions or features you've considered. -->

    Used to configure with --disable-openssl-tests

    Additional context

    <!-- Add any other context or screenshots about the feature request here. -->

    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: 2026-04-26 09:14 UTC

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