Page MenuHomeFreeBSD

libfetch: do not call deprecated OpenSSL functions
ClosedPublic

Authored by emaste on May 25 2023, 3:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 16, 5:32 AM
Unknown Object (File)
Feb 18 2024, 8:29 AM
Unknown Object (File)
Dec 23 2023, 11:49 AM
Unknown Object (File)
Nov 25 2023, 10:27 PM
Unknown Object (File)
Nov 24 2023, 11:14 AM
Unknown Object (File)
Sep 23 2023, 7:36 AM
Unknown Object (File)
Sep 6 2023, 12:38 PM
Unknown Object (File)
Aug 11 2023, 7:33 PM
Subscribers

Details

Summary
As of OpenSSL 1.1 SSL_library_init() and SSL_load_error_strings() are
deprecated.  There are replacement initialization functions but they do
not need to be called: "As of version 1.1.0 OpenSSL will automatically
allocate all resources that it needs so no explicit initialisation is
required."

Wrap both calls in an OPENSSL_VERSION_NUMBER block.

Event:          Kitchener-Waterloo Hackathon 202305
Sponsored by:   The FreeBSD Foundation

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste created this revision.

LGTM; and this also builds fine with OpenSSL 3.0.8 in src.

This revision is now accepted and ready to land.May 25 2023, 3:49 PM

For reference, in current OpenSSL 1.1:

# if OPENSSL_API_COMPAT < 0x10100000L
#  define SSL_library_init() OPENSSL_init_ssl(0, NULL)
# endif

and

# if OPENSSL_API_COMPAT < 0x10100000L
#  define SSL_load_error_strings() \
    OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS \
                     | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
# endif
lib/libfetch/common.c
1207–1215

Does it make sense punting this no-op code forward instead of deleting it, given that supported versions of FreeBSD (12.x, 13.x) have OpenSSL 1.1.1?

1217

This is the newer/non-deprecated name.