Skip to content

Conversation

solney
Copy link

@solney solney commented Nov 30, 2023

Here is a PR to expose AES_CTR mode.

The documentation states that it was not supported due to lack of hardware supporting it. We have been able to enable and use it successfully with a software HSM (SoftHSM), and on the AWS CloudHSM platform.

To run tests against SoftHSM

In a fresh env e.g docker container

docker run --rm -it  -v $(pwd):/work -w /work ubuntu:20.04 bash

Install deps

apt-get update
apt-get install softhsm pip -y
pip install -r dev-requirements.txt -r requirements.txt pytest

Install project deps and run tests:

softhsm2-util  --init-token --free --label test-python-pkcs11 --pin 1234 --so-pin 1234
export PKCS11_MODULE=/usr/lib/softhsm/libsofthsm2.so
export PKCS11_TOKEN_LABEL=test-python-pkcs11
export PKCS11_TOKEN_PIN=1234
export PKCS11_TOKEN_SO_PIN=1234
pytest -v tests/test_aes.py

@MatthiasValvekens
Copy link
Collaborator

Closing this since the AWS-CTR functionality has landed in master through other pathways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants