clboss/external
Vincenzo Palazzo f9a23f97f1 external: upgrade the secp256k1 to the latest version
With new dependencies version we see some wornings and
test failures.

This commit upgrade the secp256k1 dependencies in order to
fix our build system.

This commit fixes the following warnings

```
s -Wundef -Wno-unused-function -Wno-long-long -Wno-overlength-strings -W -g -c src/gen_context.c -o gen_context.o
  CC       src/bench_verify-bench_verify.o
  CC       src/bench_sign.o
  CC       src/valgrind_ctime_test.o
  CC       src/exhaustive_tests-tests_exhaustive.o
src/bench_verify.c: In function ‘bench_verify_openssl’:
src/bench_verify.c:63:13: warning: ‘EC_KEY_new’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   63 |             EC_KEY *pkey = EC_KEY_new();
      |             ^~~~~~
In file included from /usr/include/openssl/ecdsa.h:10,
                 from src/bench_verify.c:16:
/usr/include/openssl/ec.h:971:31: note: declared here
  971 | OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new(void);
      |                               ^~~~~~~~~~
src/bench_verify.c:68:13: warning: ‘EC_KEY_set_group’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   68 |             result = EC_KEY_set_group(pkey, data->ec_group);
      |             ^~~~~~
/usr/include/openssl/ec.h:1045:27: note: declared here
 1045 | OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
      |                           ^~~~~~~~~~~~~~~~
src/bench_verify.c:70:13: warning: ‘o2i_ECPublicKey’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   70 |             result = (o2i_ECPublicKey(&pkey, &pubkey, data->pubkeylen)) != NULL;
      |             ^~~~~~
/usr/include/openssl/ec.h:1239:31: note: declared here
 1239 | OSSL_DEPRECATEDIN_3_0 EC_KEY *o2i_ECPublicKey(EC_KEY **key,
      |                               ^~~~~~~~~~~~~~~
src/bench_verify.c:72:13: warning: ‘ECDSA_verify’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   72 |             result = ECDSA_verify(0, &data->msg[0], sizeof(data->msg), &data->sig[0], data->siglen, pkey) == (i == 0);
      |             ^~~~~~
/usr/include/openssl/ec.h:1450:27: note: declared here
 1450 | OSSL_DEPRECATEDIN_3_0 int ECDSA_verify(int type, const unsigned char *dgst,
      |                           ^~~~~~~~~~~~
src/bench_verify.c:74:13: warning: ‘EC_KEY_free’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   74 |             EC_KEY_free(pkey);
      |             ^~~~~~~~~~~
/usr/include/openssl/ec.h:1006:28: note: declared here
 1006 | OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key);
      |                            ^~~~~~~~~~~
gcc -O2 -fvisibility=hidden -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-unused-function -Wno-long-long -Wno-overlength-strings -W -g  gen_context.o -o gen_context
./gen_context
  CC       src/libsecp256k1_la-secp256k1.lo
  CC       src/bench_internal-bench_internal.o
  CC       src/bench_ecmult-bench_ecmult.o
  CC       src/tests-tests.o
src/tests.c: In function ‘get_openssl_key’:
src/tests.c:5332:5: warning: ‘EC_KEY_new_by_curve_name’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
 5332 |     EC_KEY *ec_key = EC_KEY_new_by_curve_name(NID_secp256k1);
      |     ^~~~~~
In file included from src/tests.c:24:
/usr/include/openssl/ec.h:1001:31: note: declared here
 1001 | OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name(int nid);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~
src/tests.c:5334:5: warning: ‘d2i_ECPrivateKey’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
 5334 |     CHECK(d2i_ECPrivateKey(&ec_key, &pbegin, privkeylen));
      |     ^~~~~
/usr/include/openssl/ec.h:1190:31: note: declared here
 1190 | OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey(EC_KEY **key,
      |                               ^~~~~~~~~~~~~~~~
src/tests.c:5335:5: warning: ‘EC_KEY_check_key’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
 5335 |     CHECK(EC_KEY_check_key(ec_key));
      |     ^~~~~
/usr/include/openssl/ec.h:1110:27: note: declared here
 1110 | OSSL_DEPRECATEDIN_3_0 int EC_KEY_check_key(const EC_KEY *key);
      |                           ^~~~~~~~~~~~~~~~
src/tests.c: In function ‘test_ecdsa_openssl’:
src/tests.c:5360:5: warning: ‘ECDSA_sign’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
 5360 |     CHECK(ECDSA_sign(0, message, sizeof(message), signature, &sigsize, ec_key));
      |     ^~~~~
/usr/include/openssl/ec.h:1417:27: note: declared here
 1417 | OSSL_DEPRECATEDIN_3_0 int ECDSA_sign(int type, const unsigned char *dgst,
      |                           ^~~~~~~~~~
src/tests.c:5369:5: warning: ‘ECDSA_verify’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
 5369 |     CHECK(ECDSA_verify(0, message, sizeof(message), signature, secp_sigsize, ec_key) == 1);
      |     ^~~~~
/usr/include/openssl/ec.h:1450:27: note: declared here
 1450 | OSSL_DEPRECATEDIN_3_0 int ECDSA_verify(int type, const unsigned char *dgst,
      |                           ^~~~~~~~~~~~
src/tests.c:5371:5: warning: ‘EC_KEY_free’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
 5371 |     EC_KEY_free(ec_key);
      |     ^~~~~~~~~~~
/usr/include/openssl/ec.h:1006:28: note: declared here
 1006 | OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key);

```

and the following test failure

```
============================================================================
make[4]: Leaving directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/basicsecure'
make[3]: Leaving directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/basicsecure'
make[2]: Leaving directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/basicsecure'
Making check in external/bitcoin-ripemd160
make[2]: Entering directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/bitcoin-ripemd160'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/bitcoin-ripemd160'
Making check in external/bitcoin-sha256
make[2]: Entering directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/bitcoin-sha256'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/bitcoin-sha256'
Making check in external/secp256k1/
make[2]: Entering directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/secp256k1'
make  check-TESTS
make[3]: Entering directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/secp256k1'
make[4]: Entering directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/secp256k1'
PASS: exhaustive_tests
../../../../external/secp256k1/build-aux/test-driver: line 112: 929773 Aborted                 "$@" >> "$log_file" 2>&1
FAIL: tests
============================================================================
Testsuite summary for libsecp256k1 0.1
============================================================================
============================================================================
See ./test-suite.log
============================================================================
make[4]: *** [Makefile:1209: test-suite.log] Error 1
make[4]: Leaving directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/secp256k1'
make[3]: *** [Makefile:1317: check-TESTS] Error 2
make[3]: Leaving directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/secp256k1'
make[2]: *** [Makefile:1535: check-am] Error 2
make[2]: Leaving directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub/external/secp256k1'
make[1]: *** [Makefile:5474: check-recursive] Error 1
make[1]: Leaving directory '/home/vincent/Github/clboss/clboss-0.13A/_build/sub'
make: *** [Makefile:6325: distcheck] Error 1
```

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-08-18 12:34:08 -07:00
..
basicsecure external/basicsecure/basicsecure.c: Fix misspelling of windows.h. 2021-11-17 12:53:46 +08:00
bitcoin-ripemd160 fix distcheck. 2020-09-21 15:39:40 +08:00
bitcoin-sha256 external/bitcoin-sha256/: Use SHA256 implementation from Bitcoin. 2021-03-03 11:05:07 +08:00
jsmn external/jsmn/: JSMN JSON parsing library. 2020-08-24 18:55:14 +08:00
secp256k1 external: upgrade the secp256k1 to the latest version 2023-08-18 12:34:08 -07:00
secp256k1.patch external: upgrade the secp256k1 to the latest version 2023-08-18 12:34:08 -07:00
update-secp256k1.sh external: upgrade the secp256k1 to the latest version 2023-08-18 12:34:08 -07:00