Skip to content

Commit

Permalink
Test kryoptic with NSS DB
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Jelen <[email protected]>
  • Loading branch information
Jakuje committed Dec 9, 2024
1 parent 755cbc8 commit 33d0c20
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/kryoptic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ jobs:
- name: Build Kryoptic
run: |
cd kryoptic
cargo build --features standard
cargo test --features standard | tee testout.log 2>&1
cargo build --features standard,nssdb
cargo test --features standard,nssdb | tee testout.log 2>&1
grep -q "0 failed" testout.log
- name: Setup
Expand Down
16 changes: 16 additions & 0 deletions tests/kryoptic-init-nss.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash -ex
# Copyright (C) 2024 Jakub Jelen <[email protected]>
# SPDX-License-Identifier: Apache-2.0
#

export KRYOPTIC_CONF="${TMPPDIR}/kryoptic.conf"
cat >"${KRYOPTIC_CONF}" <<_EOF
[[slots]]
slot = 42
dbtype = "nssdb"
dbpath = "${TOKDIR}"
description = "The NSS DB"
_EOF

# the rest is the same
source "${TESTSSRCDIR}/kryoptic-init.sh"
3 changes: 1 addition & 2 deletions tests/kryoptic-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ find_kryoptic \

title LINE "Creating Kyroptic database"

# Kryoptic configuration
export KRYOPTIC_CONF="$TOKDIR/kryoptic.sql"
# Kryoptic configuration set by the caller

export TOKENLABEL="Kryoptic Token"
export TOKENLABELURI="Kryoptic%20Token"
Expand Down
46 changes: 23 additions & 23 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if nss_softokn.found()
endif

setup_script=find_program('setup.sh')
foreach suite : ['softokn', 'softhsm', 'kryoptic']
foreach suite : ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']
test(
'setup',
setup_script,
Expand Down Expand Up @@ -118,29 +118,29 @@ foreach t, sources : test_programs
endforeach

tests = {
'basic': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'pubkey': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'certs': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'ecc': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'edwards': {'suites': ['softhsm', 'kryoptic']},
'ecdh': {'suites': ['softokn', 'kryoptic']},
'democa': {'suites': ['softokn', 'softhsm', 'kryoptic'], 'is_parallel': false},
'digest': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'fork': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'oaepsha2': {'suites': ['softokn', 'kryoptic']},
'hkdf': {'suites': ['softokn', 'kryoptic']},
'imported' : {'suites': ['softokn', 'kryoptic']},
'rsapss': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'basic': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'pubkey': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'certs': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'ecc': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'edwards': {'suites': ['softhsm', 'kryoptic', 'kryoptic-nss']},
'ecdh': {'suites': ['softokn', 'kryoptic', 'kryoptic-nss']},
'democa': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss'], 'is_parallel': false},
'digest': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'fork': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'oaepsha2': {'suites': ['softokn', 'kryoptic', 'kryoptic-nss']},
'hkdf': {'suites': ['softokn', 'kryoptic', 'kryoptic-nss']},
'imported' : {'suites': ['softokn', 'kryoptic', 'kryoptic-nss']},
'rsapss': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'rsapssam': {'suites': ['softhsm']},
'genkey': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'session': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'rand': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'readkeys': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'tls': {'suites': ['softokn', 'softhsm', 'kryoptic'], 'is_parallel': false},
'tlsfuzzer': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'uri': {'suites': ['softokn', 'softhsm', 'kryoptic']},
'ecxc': {'suites': ['softhsm', 'kryoptic']},
'cms': {'suites': ['softokn', 'kryoptic']},
'genkey': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'session': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'rand': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'readkeys': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'tls': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss'], 'is_parallel': false},
'tlsfuzzer': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'uri': {'suites': ['softokn', 'softhsm', 'kryoptic', 'kryoptic-nss']},
'ecxc': {'suites': ['softhsm', 'kryoptic', 'kryoptic-nss']},
'cms': {'suites': ['softokn', 'kryoptic', 'kryoptic-nss']},
'pinlock': {'suites': ['kryoptic']},
}

Expand Down
3 changes: 3 additions & 0 deletions tests/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ if [ "${TOKENTYPE}" == "softhsm" ]; then
elif [ "${TOKENTYPE}" == "softokn" ]; then
source "${TESTSSRCDIR}/softokn-init.sh"
elif [ "${TOKENTYPE}" == "kryoptic" ]; then
export KRYOPTIC_CONF="$TOKDIR/kryoptic.sql"
source "${TESTSSRCDIR}/kryoptic-init.sh"
elif [ "${TOKENTYPE}" == "kryoptic-nss" ]; then
source "${TESTSSRCDIR}/kryoptic-init-nss.sh"
else
echo "Unknown token type: $1"
exit 1
Expand Down

0 comments on commit 33d0c20

Please sign in to comment.