From cc671824ad133df93bbf903ef2d363b54b5835a9 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 8 Aug 2015 15:41:54 -0500 Subject: address review comments --- src/cryptography/x509.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index 3f306e3a..713e92a2 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -41,10 +41,10 @@ def _key_identifier_from_public_key(public_key): spki, remaining = decoder.decode( serialized, asn1Spec=_SubjectPublicKeyInfo() ) + assert not remaining # the univ.BitString object is a tuple of bits. We need bytes and # pyasn1 really doesn't want to give them to us. To get it we'll # build an integer and convert that to bytes. - assert not remaining bits = 0 for bit in spki.getComponentByName("subjectPublicKey"): bits = bits << 1 | bit -- cgit v1.2.3