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

Support openssl 3.0.0 #633

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

abbra
Copy link
Contributor

@abbra abbra commented May 27, 2021

This is a first step to make SoftHSM compiled and tests running with OpenSSL 3.0.0 under CentOS 9 Stream (similar to Fedora 34). We cannot use DES anymore there without loading a legacy provider but even if it is loaded, system-wide crypto policies on Fedora/CentOS Stream/RHEL would forbid its use. Same with RSA 1024 or lower key sizes.

The test changes simply make it so that the tests are only run if we are able to initialize encoders or generate keys to work on. Sadly, CPPUNIT cannot produce warnings-only output, they have to be either failures or success, so I have to skip tests that cannot be run.

abbra added 3 commits May 27, 2021 09:19
OpenSSL 3.0 moves DES into a legacy provider which has to be loaded
explicitly. By default, it will not be loaded and DES methods in tests
will fail. Nest test blocks under successful initialization.

Signed-off-by: Alexander Bokovoy <[email protected]>
OpenSSL 3.0 on systems with systemd-wide crypto policy (Fedora, RHEL,
CentOS 9 Stream) might block certain key sizes which causes the tests to
fail. Skip these tests because we are not going to get the results
anyway.

There is no way with CPPUNIT to produce a warning only, so we have to
skip the whole test result.

Signed-off-by: Alexander Bokovoy <[email protected]>
@abbra
Copy link
Contributor Author

abbra commented May 27, 2021

Test failures seem to be unrelated to my changes

@abbra
Copy link
Contributor Author

abbra commented May 27, 2021

Found few more tests that fail due to DES key use..

Signed-off-by: Alexander Bokovoy <[email protected]>
loqs added a commit to loqs/PACKAGES-OSSL3 that referenced this pull request Feb 25, 2022
loqs added a commit to loqs/PACKAGES-OSSL3 that referenced this pull request Mar 22, 2022
loqs added a commit to loqs/PACKAGES-OSSL3 that referenced this pull request Aug 29, 2022
@mcepl
Copy link

mcepl commented Aug 30, 2024

Hmm, I get:

[   55s] make[4]: Entering directory '/home/abuild/rpmbuild/BUILD/softhsm-2.6.1/src/bin/migrate'
[   55s] g++ -DHAVE_CONFIG_H -I. -I../../..  -I./../../lib/pkcs11 -I./../common    -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type  -g -Wall -Wextra -fvisibility=hidden -c -o softhsm2-migrate.o softhsm2-migrate.cpp
[   55s] make[4]: Leaving directory '/home/abuild/rpmbuild/BUILD/softhsm-2.6.1/src/bin/migrate'
[   55s] make[4]: Entering directory '/home/abuild/rpmbuild/BUILD/softhsm-2.6.1/src/bin/migrate'
[   55s] /usr/bin/bash ../../../libtool  --tag=CXX   --mode=link g++  -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type  -g -Wall -Wextra -fvisibility=hidden   -o softhsm2-migrate softhsm2-migrate.o ../common/findslot.o ../common/getpw.o ../common/library.o -lsqlite3 -lrt 
[   55s] libtool: link: g++ -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -Wall -Wextra -fvisibility=hidden -o softhsm2-migrate softhsm2-migrate.o ../common/findslot.o ../common/getpw.o ../common/library.o  -lsqlite3 -lrt
[   55s] make[4]: Leaving directory '/home/abuild/rpmbuild/BUILD/softhsm-2.6.1/src/bin/migrate'
[   55s] make[4]: Nothing to be done for 'all-am'.
[   55s] make[3]: Nothing to be done for 'all-am'.
[   55s] + cp /home/abuild/rpmbuild/SOURCES/softhsm2-pk11install.c .
[   55s] ++ pkg-config --cflags nss
[   55s] + gcc -I/usr/include/nss3 -I/usr/include/nspr4 -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -c softhsm2-pk11install.c
[   55s] softhsm2-pk11install.c: In function ‘installPKCS11’:
[   55s] softhsm2-pk11install.c:201:20: error: implicit declaration of function ‘NSC_ModuleDBFunc’ [-Wimplicit-function-declaration]
[   55s]   201 |     rc = (char **) NSC_ModuleDBFunc(type == Install ?
[   55s]       |                    ^~~~~~~~~~~~~~~~
[   55s] softhsm2-pk11install.c:201:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
[   55s]   201 |     rc = (char **) NSC_ModuleDBFunc(type == Install ?
[   55s]       |          ^
[   55s] softhsm2-pk11install.c: In function ‘installAllPKCS11’:
[   55s] softhsm2-pk11install.c:220:9: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
[   55s]   220 |     int len;
[   55s]       |         ^~~

Complete build log with all versions of packages used and steps taken to reproduce.

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

Successfully merging this pull request may close these issues.

2 participants