Giter Club home page Giter Club logo

tsp-client's People

Contributors

kislyuk avatar mcallistersean avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mcallistersean

tsp-client's Issues

test/test.py fails trying to verify

running test.py fails with this output.

This is in a Linux Mint 20 system with python 3.8.

`
EE

ERROR: test_basic_tsp_client_operations (main.TestTSPClient)

Traceback (most recent call last):
File "./test.py", line 36, in test_basic_tsp_client_operations
signed = self.signer.sign(message)
File "/lvm1/home/sl/work/work23/tsr/tsp-client/tsp_client/signer.py", line 65, in sign
verify_result = self._verifier.verify(tst, nonce=nonce, message_digest=digest)
File "/lvm1/home/sl/work/work23/tsr/tsp-client/tsp_client/verifier.py", line 173, in verify
signing_cert = self._extract_signing_cert(signer_info, certificates=certificates)
File "/lvm1/home/sl/work/work23/tsr/tsp-client/tsp_client/verifier.py", line 123, in _extract_signing_cert
store = self._get_ca_store()
File "/lvm1/home/sl/work/work23/tsr/tsp-client/tsp_client/verifier.py", line 98, in _get_ca_store
store.load_locations(cafile=ca_pem_file, capath=ca_path) # type: ignore
AttributeError: 'X509Store' object has no attribute 'load_locations'

======================================================================
ERROR: test_set_custom_tsa (main.TestTSPClient)

Traceback (most recent call last):
File "./test.py", line 60, in test_set_custom_tsa
signed = self.signer.sign(message, signing_settings=signing_settings)
File "/lvm1/home/sl/work/work23/tsr/tsp-client/tsp_client/signer.py", line 65, in sign
verify_result = self._verifier.verify(tst, nonce=nonce, message_digest=digest)
File "/lvm1/home/sl/work/work23/tsr/tsp-client/tsp_client/verifier.py", line 173, in verify
signing_cert = self._extract_signing_cert(signer_info, certificates=certificates)
File "/lvm1/home/sl/work/work23/tsr/tsp-client/tsp_client/verifier.py", line 123, in _extract_signing_cert
store = self._get_ca_store()
File "/lvm1/home/sl/work/work23/tsr/tsp-client/tsp_client/verifier.py", line 98, in _get_ca_store
store.load_locations(cafile=ca_pem_file, capath=ca_path) # type: ignore
AttributeError: 'X509Store' object has no attribute 'load_locations'


Ran 2 tests in 0.296s

FAILED (errors=2)

'

Feature request: allow to pass digest instead of message

tsp-client takes a message and hashes it. This is inefficient for large files because they have to be help in memory. Python 3.11 added helper functions for efficient hashing of files: https://docs.python.org/3/library/hashlib.html#file-hashing. It would be nice if we were able to use them.

I propose the extend the interface of TSPSigner.sign() so that it takes either a message or a digest. That would allow users to pass a digest without breaking backwards compatibility.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.