Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use non-default cryptographic algorithm #245

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions functional/basic-attestation-on-localhost/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ rlJournalStart
if [ -n "$KEYLIME_TEST_DISABLE_REVOCATION" ]; then
rlRun "limeUpdateConf agent enable_revocation_notifications false"
fi
# if enviroment variable is set, the default algorithm in configuration file has changed
if [ -n "$KEYLIME_TEST_USE_NON_DEFAULT_ALGORITHM" ]; then
rlRun "limeUpdateConf agent tpm_encryption_alg ecc"
rlRun "limeUpdateConf agent tpm_signing_alg ecschnorr"
fi
# if TPM emulator is present
if limeTPMEmulated; then
# start tpm emulator
Expand Down Expand Up @@ -123,6 +128,10 @@ _EOF"
limeClearData
limeRestoreConfig
limeExtendNextExcludelist $TESTDIR
# remove file with env variablo for future rerun of tests
if [ -n "$KEYLIME_TEST_USE_NON_DEFAULT_ALGORITHM" ]; then
rlRun "rm -rf /etc/profile.d/export_KEYLIME_TEST_USE_NON_DEFAULT_ALGORITHM.sh"
fi
#rlRun "rm -f $TESTDIR/*" # possible but not really necessary
rlPhaseEnd

Expand Down
2 changes: 2 additions & 0 deletions plans/basic-attestation-without-revocation.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ discover:
- /setup/enable_keylime_debug_messages
- /setup/configure_kernel_ima_module/ima_policy_signing
- "/functional/basic-attestation-.*"
- /setup/configure_non_default_encrypting_algorithm
- /functional/basic-attestation-on-localhost

execute:
how: tmt
Expand Down
11 changes: 11 additions & 0 deletions setup/configure_non_default_encrypting_algorithm/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
summary: Configure non default encrypting algorithms
description: Export environment variable for configuring default algorithms in keylime.conf to the required value.
contact: Patrik Koncity <[email protected]>
component:
- keylime
test: ./test.sh
tag:
- setup
framework: beakerlib
duration: 3m
enabled: true
14 changes: 14 additions & 0 deletions setup/configure_non_default_encrypting_algorithm/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
. /usr/share/beakerlib/beakerlib.sh || exit 1

rlJournalStart

rlPhaseStartSetup
rlRun 'rlImport "./test-helpers"' || rlDie "cannot import keylime-tests/test-helpers library"
rlRun "cat > /etc/profile.d/export_KEYLIME_TEST_USE_NON_DEFAULT_ALGORITHM.sh <<_EOF
export KEYLIME_TEST_USE_NON_DEFAULT_ALGORITHM=TRUE
_EOF"
rlPhaseEnd

rlJournalEnd