Skip to content

Commit

Permalink
Fix legacy crypto support for OpenSSL 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Leseratte10 committed May 3, 2022
1 parent 6fc98b8 commit 5cd9cca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions oscrypto/_openssl/_libcrypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@
# like PKCS12
libcrypto_legacy_support = True
if libcrypto_version_info >= (3, ):
if libcrypto.OSSL_PROVIDER_available(null(), "legacy".encode("ascii")):
libcrypto.OSSL_PROVIDER_load(null(), "legacy".encode("ascii"))
else:

libcrypto.OSSL_PROVIDER_load(null(), "legacy".encode("ascii"))
libcrypto.OSSL_PROVIDER_load(null(), "default".encode("ascii"))

if libcrypto.OSSL_PROVIDER_available(null(), "legacy".encode("ascii")) == 0:
libcrypto_legacy_support = False


Expand Down

0 comments on commit 5cd9cca

Please sign in to comment.