From df8c62aab357954000e8539ac17daea45f93ee7c Mon Sep 17 00:00:00 2001 From: Ade Lee Date: Thu, 2 Aug 2018 16:35:19 -0400 Subject: [PATCH] Refactor PKCS#11 to allow configurable mechanisms Allow for setting the PKCS#11 encryption and hmac algorithms in the config file. This patch also implements CKM_AES_CBC encryption and decryption. Change-Id: I847b4b17df51bc4846c37a1e19e6adec76f46b38 Co-Authored-By: Ade Lee --- barbican/cmd/barbican_manage.py | 31 +++- barbican/plugin/crypto/p11_crypto.py | 66 ++++--- barbican/plugin/crypto/pkcs11.py | 172 ++++++++++++++---- barbican/tests/cmd/test_barbican_manage.py | 16 +- .../tests/plugin/crypto/test_p11_crypto.py | 9 +- barbican/tests/plugin/crypto/test_pkcs11.py | 63 ++++--- barbican/tests/utils.py | 4 + .../api/v1/functional/test_orders.py | 2 +- functionaltests/api/v1/functional/test_rsa.py | 10 +- functionaltests/run_tests.sh | 2 + ...le-mechanism-options-2e5c57099b4c91b1.yaml | 12 ++ tox.ini | 2 + 12 files changed, 283 insertions(+), 106 deletions(-) create mode 100644 releasenotes/notes/add-configurable-mechanism-options-2e5c57099b4c91b1.yaml diff --git a/barbican/cmd/barbican_manage.py b/barbican/cmd/barbican_manage.py index e084d2ab3..520c570e9 100644 --- a/barbican/cmd/barbican_manage.py +++ b/barbican/cmd/barbican_manage.py @@ -185,12 +185,16 @@ class HSMCommands(object): @args('--label', '-L', metavar='