clightning-dumpkeys icon indicating copy to clipboard operation
clightning-dumpkeys copied to clipboard

secp256k1 from Bitcoin core v25.0 marks secp256k1_ec_privkey_tweak_add in bip32 as deprecated

Open PMK opened this issue 11 months ago • 2 comments

secp256k1 from Bitcoin core v25.0 marks secp256k1_ec_privkey_tweak_add as deprecated in bip32.h and bip32.c.

$ make check
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o check.o check.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o sha256.o sha256.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o sha512.o sha512.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o ripemd160.o ripemd160.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o hmac.o hmac.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o hkdf.o hkdf.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o bip32.o bip32.c
bip32.c: In function 'bip32_key_from_parent':
bip32.c:454:9: error: 'secp256k1_ec_privkey_tweak_add' is deprecated: Use secp256k1_ec_seckey_tweak_add instead [-Werror=deprecated-declarations]
  454 |         if (!secp256k1_ec_privkey_tweak_add(ctx, key_out->priv_key + 1,
      |         ^~
In file included from bip32.h:6,
                 from bip32.c:7:
/usr/local/include/secp256k1.h:756:48: note: declared here
  756 | SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bip32.c:477:13: error: 'secp256k1_ec_privkey_tweak_add' is deprecated: Use secp256k1_ec_seckey_tweak_add instead [-Werror=deprecated-declarations]
  477 |             !secp256k1_ec_privkey_tweak_add(ctx, pub_key.data,
      |             ^
In file included from bip32.h:6,
                 from bip32.c:7:
/usr/local/include/secp256k1.h:756:48: note: declared here
  756 | SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: bip32.o] Error 1

Removing -Werror as CFLAGS will prevent the error. However, running make check still returns errors and running ./clightning-dumpkey path/to/hsm_secret results in error while loading shared libraries: libsecp256k1.so.2: cannot open shared object file: No such file or directory. I guess this is due to the errors I get?

Note: I didn't test this on other versions.

PMK avatar Jul 21 '23 22:07 PMK