Skip to content

Commit

Permalink
fix p11 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leifj committed Sep 14, 2018
1 parent 45c74f7 commit e7de509
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/xmlsec/test/p11_test.py
Expand Up @@ -25,7 +25,7 @@
from xmlsec.test.case import load_test_data

P11_MODULE = find_alts(['/usr/lib/libsofthsm.so', '/usr/lib/softhsm/libsofthsm.so', '/usr/lib/softhsm/libsofthsm2.so'])
P11_ENGINE = find_alts(['/usr/lib/engines/engine_pkcs11.so','/usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so'])
P11_ENGINE = find_alts(['/usr/lib/ssl/engines/libpkcs11.so','/usr/lib/engines/engine_pkcs11.so'])

This comment has been minimized.

Copy link
@sklemer1

sklemer1 Oct 2, 2018

Contributor

I didn't make this path up when introducing it :) -- Ubuntu has the engines in /usr/lib/x86_64-linux-gnu/engines-1.1/. Please consider re-adding it. On entry less or more shouldn't harm here.

This comment has been minimized.

Copy link
@c00kiemon5ter

c00kiemon5ter Oct 2, 2018

Member

All paths are subject to change from distribution to distribution. I'd say lets have some sensible "default" values but also check the environment for such a declaration, so that different distributions (or future changes) can set the appropriate value without changing the code:

p11_engine_paths = [
  os.environ.get('P11_ENGINE') or (
    '/usr/lib/ssl/engines/libpkcs11.so',
    '/usr/lib/engines/engine_pkcs11.so',
    '/usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so',
  )]
P11_ENGINE = find_alts(p11_engine_paths)

See #52

This comment has been minimized.

Copy link
@sklemer1

sklemer1 Oct 2, 2018

Contributor

+1

This comment has been minimized.

Copy link
@leifj

leifj Oct 3, 2018

Author Contributor

just give me a PR and I'll say "mea culpa" in the commit message

P11_SPY = find_alts(['/usr/lib/pkcs11/pkcs11-spy.so'])
PKCS11_TOOL = find_alts(['/usr/bin/pkcs11-tool'])
OPENSC_TOOL = find_alts(['/usr/bin/opensc-tool'])
Expand All @@ -41,7 +41,7 @@
raise unittest.SkipTest("OpenSSL not installed")

if SOFTHSM is None:
raise unittest.SkipTest("SoftHSM not installed")
raise unittest.SkipTest("SoftHSM2 not installed")

if OPENSC_TOOL is None:
raise unittest.SkipTest("OpenSC not installed")
Expand Down Expand Up @@ -134,8 +134,8 @@ def setup():
[pkcs11_section]
engine_id = pkcs11
# dynamic_path = %s
# MODULE_PATH = %s
dynamic_path = %s
MODULE_PATH = %s

This comment has been minimized.

Copy link
@sklemer1

sklemer1 Oct 17, 2018

Contributor

These 2 lines actually break pkcs11 on latest Ubuntu. This should also be the reason the first 2 tests in #53 fail.

PIN = secret1
init = 0
Expand Down

0 comments on commit e7de509

Please sign in to comment.