aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoffrey Thomas <geofft@ldpreload.com>2015-04-14 00:20:33 -0400
committerGeoffrey Thomas <geofft@ldpreload.com>2015-04-14 00:33:10 -0400
commitd914609d6cf5f40b3ec1901bbd6af13a6e6b037a (patch)
tree5a2258cfe1d341cbcaaa642d2f5a62357584cb72
parent5054e6591db055b520eacc39db7e5dcd6e6e3a1a (diff)
downloadcryptography-d914609d6cf5f40b3ec1901bbd6af13a6e6b037a.tar.gz
cryptography-d914609d6cf5f40b3ec1901bbd6af13a6e6b037a.tar.bz2
cryptography-d914609d6cf5f40b3ec1901bbd6af13a6e6b037a.zip
Fix comparison between pyasn1 objects introduced in #1843
__eq__ compares values, so e.g. univ.Integer(0) == eoo.endOfOctets. I believe this isn't a logic error for what we're doing now, but keep the code right in case it gets reused. This is the pattern used by pyasn1 internally.
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/utils.py b/src/cryptography/hazmat/primitives/asymmetric/utils.py
index f04eb66e..29390e40 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/utils.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/utils.py
@@ -32,7 +32,7 @@ def decode_rfc6979_signature(signature):
# pyasn1 can erroneously return this from top-level DER decoding.
# It's intended as a sentinel in recursive BER decoding, so it's
# returned even though an asn1Spec is provided.
- if data == eoo.endOfOctets:
+ if eoo.endOfOctets.isSameTypeWith(data) and data == eoo.endOfOctets:
raise ValueError("Invalid signature data. Unable to decode ASN.1")
r = int(data.getComponentByName('r'))