Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSSL 3 will deprecate some of the functions we use in tests #869

Closed
rex4539 opened this issue Jan 19, 2021 · 4 comments
Closed

OpenSSL 3 will deprecate some of the functions we use in tests #869

rex4539 opened this issue Jan 19, 2021 · 4 comments

Comments

@rex4539
Copy link
Contributor

rex4539 commented Jan 19, 2021

/Users/rex/secp256k1 on branch master rex@MacBook-Pro-2018% ./autogen.sh 
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: copying file 'build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-aux/m4'.
glibtoolize: copying file 'build-aux/m4/libtool.m4'
glibtoolize: copying file 'build-aux/m4/ltoptions.m4'
glibtoolize: copying file 'build-aux/m4/ltsugar.m4'
glibtoolize: copying file 'build-aux/m4/ltversion.m4'
glibtoolize: copying file 'build-aux/m4/lt~obsolete.m4'
configure.ac:15: installing 'build-aux/compile'
configure.ac:5: installing 'build-aux/config.guess'
configure.ac:5: installing 'build-aux/config.sub'
configure.ac:9: installing 'build-aux/install-sh'
configure.ac:9: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'
parallel-tests: installing 'build-aux/test-driver'
/Users/rex/secp256k1 on branch master rex@MacBook-Pro-2018% ./configure 
checking build system type... x86_64-apple-darwin20.3.0
checking host system type... x86_64-apple-darwin20.3.0
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... rm: conftest.dSYM: is a directory
yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /opt/local/bin/gsed
checking for grep that handles long lines and -e... /opt/local/bin/ggrep
checking for egrep... /opt/local/bin/ggrep -E
checking for fgrep... /opt/local/bin/ggrep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /opt/local/bin/nm -B
checking the name lister (/opt/local/bin/nm -B) interface... rm: conftest.dSYM: is a directory
BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786432
checking how to convert x86_64-apple-darwin20.3.0 file names to x86_64-apple-darwin20.3.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin20.3.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... rm: conftest.dSYM: is a directory
no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /opt/local/bin/nm -B output from gcc object... rm: conftest.dSYM: is a directory
ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking for pkg-config... /opt/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ar... /opt/local/bin/ar
checking for ranlib... /opt/local/bin/ranlib
checking for strip... /opt/local/bin/strip
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... gcc3
checking for brew... no
checking for port... /opt/local/bin/port
checking if gcc supports -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-unused-function -Wno-long-long -Wno-overlength-strings... yes
checking if gcc supports -fvisibility=hidden... yes
checking valgrind/memcheck.h usability... yes
checking valgrind/memcheck.h presence... yes
checking for valgrind/memcheck.h... yes
checking for x86_64 assembly availability... yes
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for __gmpz_init in -lgmp... yes
checking for libcrypto... yes
checking for main in -lcrypto... yes
checking for EC functions in libcrypto... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libsecp256k1.pc
config.status: creating src/libsecp256k1-config.h
config.status: executing depfiles commands
config.status: executing libtool commands

Build Options:
  with ecmult precomp     = yes
  with external callbacks = no
  with benchmarks         = yes
  with tests              = yes
  with openssl tests      = yes
  with coverage           = no
  module ecdh             = no
  module recovery         = no
  module extrakeys        = no
  module schnorrsig       = no

  asm                     = x86_64
  bignum                  = gmp
  ecmult window size      = 15
  ecmult gen prec. bits   = 4

  valgrind                = yes
  CC                      = gcc
  CFLAGS                  = -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
  CPPFLAGS                =   -isystem /opt/local/include
  LDFLAGS                 =  -L/opt/local/lib

  CC_FOR_BUILD            = gcc
  CFLAGS_FOR_BUILD        = -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
  CPPFLAGS_FOR_BUILD      =   -isystem /opt/local/include
  LDFLAGS_FOR_BUILD       =  -L/opt/local/lib
/Users/rex/secp256k1 on branch master rex@MacBook-Pro-2018% make -j12
gcc -isystem /opt/local/include -I. -I./src -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 -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:72:22: warning: 'ECDSA_verify' is deprecated [-Wdeprecated-declarations]
            result = ECDSA_verify(0, &data->msg[0], sizeof(data->msg), &data->sig[0], data->siglen, pkey) == (i == 0);
                     ^
/usr/local/include/openssl/ec.h:1402:1: note: 'ECDSA_verify' has been explicitly marked deprecated here
DEPRECATEDIN_3_0(int ECDSA_verify(int type, const unsigned char *dgst,
^
/usr/local/include/openssl/macros.h:182:49: note: expanded from macro 'DEPRECATEDIN_3_0'
#   define DEPRECATEDIN_3_0(f)                  OSSL_DEPRECATEDIN_3_0 f;
                                                ^
/usr/local/include/openssl/macros.h:180:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:60:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
1 warning generated.
  CCLD     exhaustive_tests
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 -L/opt/local/lib gen_context.o -o gen_context
./gen_context
  CC       src/libsecp256k1_la-secp256k1.lo
  CC       src/bench_internal-bench_internal.o
  CC       src/tests-tests.o
  CC       src/bench_ecmult-bench_ecmult.o
src/tests.c:5409:11: warning: 'ECDSA_sign' is deprecated [-Wdeprecated-declarations]
    CHECK(ECDSA_sign(0, message, sizeof(message), signature, &sigsize, ec_key));
          ^
/usr/local/include/openssl/ec.h:1369:1: note: 'ECDSA_sign' has been explicitly marked deprecated here
DEPRECATEDIN_3_0(int ECDSA_sign(int type, const unsigned char *dgst,
^
/usr/local/include/openssl/macros.h:182:49: note: expanded from macro 'DEPRECATEDIN_3_0'
#   define DEPRECATEDIN_3_0(f)                  OSSL_DEPRECATEDIN_3_0 f;
                                                ^
/usr/local/include/openssl/macros.h:180:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:60:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
src/tests.c:5418:11: warning: 'ECDSA_verify' is deprecated [-Wdeprecated-declarations]
    CHECK(ECDSA_verify(0, message, sizeof(message), signature, secp_sigsize, ec_key) == 1);
          ^
/usr/local/include/openssl/ec.h:1402:1: note: 'ECDSA_verify' has been explicitly marked deprecated here
DEPRECATEDIN_3_0(int ECDSA_verify(int type, const unsigned char *dgst,
^
/usr/local/include/openssl/macros.h:182:49: note: expanded from macro 'DEPRECATEDIN_3_0'
#   define DEPRECATEDIN_3_0(f)                  OSSL_DEPRECATEDIN_3_0 f;
                                                ^
/usr/local/include/openssl/macros.h:180:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/local/include/openssl/macros.h:60:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
  CCLD     bench_ecmult
  CCLD     bench_internal
  CCLD     libsecp256k1.la
  CCLD     bench_verify
  CCLD     bench_sign
  CCLD     valgrind_ctime_test
2 warnings generated.
  CCLD     tests
/Users/rex/secp256k1 on branch master rex@MacBook-Pro-2018% clang --version
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
@sipa
Copy link
Contributor

sipa commented Jan 19, 2021

There is nothing to worry about here; OpenSSL is only used to test/benchmark against.

This means we'll either want to update the OpenSSL usage to whatever the ECDSA API is being replaced with, or drop support for it entirely.

@real-or-random
Copy link
Contributor

@rex4539 Which OpenSSL version do you use? AFAIU these functions will be deprecated in OpenSSL 3, which has not been released yet.

@rex4539
Copy link
Contributor Author

rex4539 commented Jan 20, 2021

Aha, ahead of the curve it seems.

% openssl version
OpenSSL 3.0.0-alpha11-dev  (Library: OpenSSL 3.0.0-alpha11-dev )

@real-or-random real-or-random changed the title Warnings during compilation OpenSSL 3 will deprecate some of the functions we use in tests Jan 20, 2021
real-or-random added a commit that referenced this issue Oct 16, 2021
bc08599 Remove OpenSSL testing support (Pieter Wuille)

Pull request description:

  This removes the ability to test against OpenSSL, as well as the OpenSSL verification benchmark.

  The motivation is that OpenSSL 3 is deprecating part of the API used here (see #869), and I'm not sure it's worth maintaining. We do lose the fact that this is the only test that verifies randomly-generated cases against an independent implementation. On the other hand, there are tons of existing fixed tests now that test all kinds of edge cases already.

ACKs for top commit:
  elichai:
    tACK bc08599
  real-or-random:
    ACK bc08599
  jonasnick:
    ACK bc08599

Tree-SHA512: 632e6d3cf7bbc5828f5ca1f0f2a92c80bcb681bbcd4320c352b4a86fd521e410c852ccebcfc30fadc8fbf86649267a9e521f53e0f78072a8cd74d8726da28973
@real-or-random
Copy link
Contributor

This has been solved by #983. Re-adding cross tests is tracked in #691.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants