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

[bug] Unit test regression when compiling against OpenSSL 3.0.x #3041

Closed
patricklodder opened this issue Jul 15, 2022 · 5 comments
Closed

[bug] Unit test regression when compiling against OpenSSL 3.0.x #3041

patricklodder opened this issue Jul 15, 2022 · 5 comments
Labels
bug QA Many Quality Assurance
Milestone

Comments

@patricklodder
Copy link
Member

Bug Report

Current behavior:

When testing custom builds on Fedora 36, I found that self-compiling any 1.14 source using OpenSSL 3(.0.5) will cause a regression in wallet crypto unit tests, caused by the code that compares our decryption with OpenSSL decryption. Our implementation is providing correct results, OpenSSL 3 is not.

Every decryption test fails with a line like:

wallet/test/crypto_tests.cpp(150): error: in "wallet_crypto/decrypt": 64cdd9d536ac9e95f2fcc5a7d84a295a0f801fe1efeaf9853d76ebf9fd416b00 != 64cdd9d536ac9e95f2fcc5a7d84a295a00000000000000000000000000000000

The errors do not occur when explicitly selecting openssl 1.1 system libraries, e.g. openssl1.1-devel.x86_64 on Fedora 36. Or the default OpenSSL on i.e. Fedora 35 (as that is also 1.1)

Note: this does not affect production code, only the unit test.

Expected behavior:

Unit tests do not fail based on installed system software, if this software is not used inside the unit.

Steps to reproduce:

Dockerfile:

FROM fedora:36

ARG REF=1.14.6-dev
ARG REPO=https://github.com/dogecoin/dogecoin.git
ARG MAKE_OPTS=-j4

WORKDIR /testbuild

# install requirements (added git)
RUN dnf -y install gcc-c++ libtool which make autoconf automake openssl-devel \
                 libevent-devel boost-devel libdb-cxx-devel git

# clone and checkout ref
RUN git clone $REPO && \
    cd dogecoin && \
    git checkout $REF

WORKDIR /testbuild/dogecoin

# build: only disable bench, to save cycles
RUN ./autogen.sh && \
    ./configure --disable-bench && \
    make $MAKE_OPTS    

# test
RUN make check $MAKE_OPTS VERBOSE=1

Dogecoin Core version

Any 1.14.x source

Machine specs

  • OS: Any linux that uses OpenSSL 3

Extra information

gist:fedora36.log
gist:fedora35.log

@patricklodder patricklodder added this to the 1.14.7 milestone Jul 15, 2022
@patricklodder patricklodder added bug QA Many Quality Assurance labels Jul 15, 2022
@patricklodder
Copy link
Member Author

Possible solution: Bitcoin Core removed this unit test process in bitcoin/bitcoin#11024 - because its purpose is to make sure that our encryption and decryption code is compatible with wallets that used OpenSSL for encryption (pre-1.14 for us).

Additionally, we may want to add a bunch of static fixtures that we know work with both implementations (when not broken) and test these instead.

@patricklodder
Copy link
Member Author

Also confirmed on Ubuntu 22.04 with Openssl 3.0.2

@patricklodder patricklodder changed the title [bug] Unit test regression when compiling against OpenSSL 3.0.5 [bug] Unit test regression when compiling against OpenSSL 3.0.x Jul 26, 2022
@patricklodder
Copy link
Member Author

@envisiondata did you want to work on this one? If not, let me know then I push this through because this issue is growing (self-compiled builds on 2/3 recent linux I tried include openssl 3, so the problem is significant because automated builds on these platforms will fail on make check)

@envisiondata
Copy link

envisiondata commented Jul 26, 2022

No My Linux box is slow.
I'm going to work on #2908
I'll comment on that issue.

@patricklodder
Copy link
Member Author

Fixed with #3079

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

No branches or pull requests

2 participants