Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
710808b
Add PKCS#11 Library path variable
tanishqjasoria Jun 19, 2019
8b17617
Add support for cryptographic tokens
tanishqjasoria Jun 19, 2019
1362b1e
Add functions to establish communication with HSM
tanishqjasoria Jun 19, 2019
3b4d181
Add methods to extract various objects from the HSM
tanishqjasoria Jun 19, 2019
15bd268
Add methods to genrerate and verify signatures using HSMs
tanishqjasoria Jun 19, 2019
393d39c
Create a high level API to perform cryptographic operations using HSMs
tanishqjasoria Jun 19, 2019
4e4bec6
Add methods to load private key and create signatures
tanishqjasoria Jun 19, 2019
1ba8f40
Add various method for cryptographic operations using public keys
tanishqjasoria Jun 19, 2019
22feed2
No need for reinitialization of HSM object again
tanishqjasoria Jun 19, 2019
f634e91
Add test for the hsm.py module
tanishqjasoria Jun 20, 2019
e3823c7
Remove exception handeling for get_public_key_objects
tanishqjasoria Jun 24, 2019
2edbc87
Fix get_x509_value to use default_backend
tanishqjasoria Jun 24, 2019
6cfd1b5
Exclude hsm.py and hsm_keys.py for coverage info
tanishqjasoria Jun 24, 2019
421b923
Add library to interact with the softHSM for testing purpose
tanishqjasoria Jun 28, 2019
455aa87
Class setup to carry out tests
tanishqjasoria Jun 28, 2019
3ef4016
Shift SoftHSM initialization to setUpClass
tanishqjasoria Jun 28, 2019
ff2ad94
Add test for various function in hsm.py
tanishqjasoria Jun 28, 2019
39d35cd
Add PyKCS11 as requirements
tanishqjasoria Jun 28, 2019
87e38cb
Change self.sess to self.session to increse readability
tanishqjasoria Jul 1, 2019
74d114c
Correct grammatical and spelling mistakes
tanishqjasoria Jul 1, 2019
549a712
Define constants for RSA PSS signature generation and verification
tanishqjasoria Jul 1, 2019
24b320e
Use logger.info() instead of print statement.
tanishqjasoria Jul 1, 2019
ecd92fe
Edit exception handling when PKCS11LIB path is invalid
tanishqjasoria Jul 1, 2019
fe4052d
Error propagation when the token is not present
tanishqjasoria Jul 1, 2019
234a827
Edit exception handlind when HSM.close() is used
tanishqjasoria Jul 1, 2019
80a63a7
Remove redundant global variable defination
tanishqjasoria Jul 1, 2019
55b6b7f
Exception handeling when a wrong dictionary is passes as slot_info
tanishqjasoria Jul 1, 2019
44fd232
Install swig and SoftHSMv2.3.0 before running the tests
tanishqjasoria Jul 1, 2019
83feb26
Change PKCS11LIB path used for tests
tanishqjasoria Jul 1, 2019
6b3c795
Use binascii to convert signature into HEX
tanishqjasoria Jul 2, 2019
07c1c43
Add method to use user specific library to interact with hardware tokens
tanishqjasoria Jul 2, 2019
8f1404f
Remove prompt for user_pin
tanishqjasoria Jul 2, 2019
4cf3677
FIX input to get_HSM_session()
tanishqjasoria Jul 2, 2019
948f2a2
Do not logout, to use private_key handle for generating signatures
tanishqjasoria Jul 2, 2019
e505a1c
Add tests for hsm_keys.py module
tanishqjasoria Jul 2, 2019
e85af21
Modify test_get_HSM_session()
tanishqjasoria Jul 2, 2019
a5cc882
Use close when session handle is invalid
tanishqjasoria Jul 2, 2019
c500679
Generate and Verify Signatures using RSA and EC Keys
tanishqjasoria Jul 3, 2019
cf026da
Fix assertTrue -> assertFalse
tanishqjasoria Jul 3, 2019
b81384a
Remove default import of PYKCS11LIB from settings.py
tanishqjasoria Jul 3, 2019
9a14d84
Change signature verification test
tanishqjasoria Jul 8, 2019
2f0cd6a
Revert "Change signature verification test"
tanishqjasoria Jul 8, 2019
34623e9
Modify tests to clean up the new tokens created for performing the tests
tanishqjasoria Aug 19, 2019
eb4f67e
FIX error in creating token.save directory when it already existed.
tanishqjasoria Sep 6, 2019
e4bf9b5
Change the workflow of the HSM.close method
tanishqjasoria Sep 6, 2019
bde1389
Change the user_pin variable and add the argument to the function def…
tanishqjasoria Sep 6, 2019
6396d3a
Remove the share library file as tests were configured to use librari…
tanishqjasoria Sep 6, 2019
fb4a007
No need for sudo while downloading and extracting the softhsm install…
tanishqjasoria Sep 10, 2019
f944c75
Remove unnecessary sudo commands
tanishqjasoria Sep 11, 2019
3e0dbb1
Change logging to a higher level while logging an error
tanishqjasoria Sep 11, 2019
7125d66
Add CKK_ECDSA as a key type
tanishqjasoria Sep 12, 2019
2a8feef
Modify test aggregation script to manage version specific tests
tanishqjasoria Sep 21, 2019
34e911a
No need to change dir to tests for the tests to run
tanishqjasoria Jan 28, 2020
3ec8042
Revert "No need to change dir to tests for the tests to run"
tanishqjasoria Jan 28, 2020
bd60698
FIX if the tokens save dir is already created
tanishqjasoria Jan 30, 2020
1367848
FIX mismatching of keys while creation and verification of signature
tanishqjasoria Jan 30, 2020
86529f4
FIX skipping HSM tests for Python 2
tanishqjasoria Feb 11, 2020
7ad3b8d
Do not import HSM related libraries for python 2
tanishqjasoria Feb 11, 2020
131633e
Minor changes regarding logging
tanishqjasoria Feb 21, 2020
d0f11e2
Remove pkcs11 library path from settings
tanishqjasoria Feb 21, 2020
4ca1d2e
Remove PyKCS11 from minimum requirement
tanishqjasoria Feb 25, 2020
5ddb551
Error handling of wrong sequence of calls used
tanishqjasoria Feb 25, 2020
870e896
Allow the import of hsm modules even if the PyKCS11 not available
tanishqjasoria Feb 25, 2020
b6898f9
Compare using symbolic value from PyKCS11.CKR
tanishqjasoria Feb 25, 2020
dbe3610
FIX typos and string formatting
tanishqjasoria Feb 27, 2020
0020046
Use __name__ for loggers as per logging convention
tanishqjasoria Feb 27, 2020
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
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ omit =
*/tests/*
*/site-packages/*


[report]
exclude_lines =
pragma: no cover
Expand Down
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,18 @@ matrix:
before_install:
- sudo apt-get remove -y --allow-remove-essential gnupg gnupg2

before_install:
- sudo apt-get update
- sudo apt-get install -y swig

install:
- pip install -U tox coveralls
- wget https://dist.opendnssec.org/source/softhsm-2.3.0.tar.gz
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

softhsm is packaged in Ubuntu, is there any reason we can't use the version from the host OS here? https://packages.ubuntu.com/search?suite=xenial&searchon=names&keywords=softhsm

Copy link
Author

@tanishqjasoria tanishqjasoria Feb 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can use the version from the host OS. I will update this, thanks for pointing this out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

- tar -xzf softhsm-2.3.0.tar.gz
- cd softhsm-2.3.0
- ./configure
- make
- sudo make install

script:
- tox
Expand Down
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# test runtime dependencies (see 'tests_require' field in setup.py)
mock; python_version < "3.3"
PyKCS11>=1.5.5; python_version > '3'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#209 shuffled the requirements files quite a bit, so there will be a few conflicts on a (necessary) rebase. I can help you with that if you want.

Copy link
Author

@tanishqjasoria tanishqjasoria Mar 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already did a rebase and resolved the conflicts.


# additional test tools
coverage
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ colorama
six
python-dateutil
subprocess32; python_version < '3'
PyKCS11>=1.5.5; python_version > '3'
Loading