Skip to content

Commit

Permalink
hooks: cryptography: account for ossl-modules location on Alpine linux
Browse files Browse the repository at this point in the history
On Alpine linux, the true location of libssl.so.3 seems to be the
`/lib` directory, while the `ossl-modules` directory is located
in `/usr/lib` directory. Account for that possibility.
  • Loading branch information
rokm committed Apr 22, 2024
1 parent a0cbbc2 commit 485ce07
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ def _check_cryptography_openssl3():
if not ossl_modules_dir.is_dir() and openssl_lib_dir.name == 'bin':
ossl_modules_dir = openssl_lib_dir.parent / 'lib' / 'ossl-modules'

# On Alpine linux, the true location of shared library is /lib directory, but the modules' directory is located
# in /usr/lib instead. Account for that possibility.
if not ossl_modules_dir.is_dir() and openssl_lib_dir == pathlib.Path('/lib'):
ossl_modules_dir = pathlib.Path('/usr/lib/ossl-modules')

if ossl_modules_dir.is_dir():
logger.debug("hook-cryptography: collecting OpenSSL modules directory: %r", str(ossl_modules_dir))
binaries.append((str(ossl_modules_dir), 'ossl-modules'))

0 comments on commit 485ce07

Please sign in to comment.