Skip to content

Commit

Permalink
Merge pull request #116 from olcf/ngin_sig_verification
Browse files Browse the repository at this point in the history
Signing issues should just throw a warning, not an exception
  • Loading branch information
Noah Ginsburg authored Sep 20, 2019
2 parents cb6c529 + 3ef60b9 commit b641d5d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
6 changes: 1 addition & 5 deletions libpkpass/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from libpkpass.errors import EncryptionError, DecryptionError, SignatureCreationError, \
SignatureVerificationError, X509CertificateError
from libpkpass.errors import EncryptionError, DecryptionError, SignatureCreationError, X509CertificateError

##############################################################################
def handle_python_strings(string):
Expand Down Expand Up @@ -130,9 +129,6 @@ def pk_verify_signature(string, signature, identity):
proc = Popen(command, stdout=PIPE, stdin=PIPE, stderr=STDOUT)
stdout, _ = proc.communicate(input=base64.urlsafe_b64decode(handle_python_strings(signature)))

if proc.returncode != 0:
raise SignatureVerificationError(stdout)

return stdout.decode("ASCII") == stringhash


Expand Down
3 changes: 0 additions & 3 deletions libpkpass/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ class RSAKeyError(PKPassError):
class SignatureCreationError(PKPassError):
pass

class SignatureVerificationError(PKPassError):
pass

class TrustChainVerificationError(PKPassError):
pass

Expand Down

0 comments on commit b641d5d

Please sign in to comment.