Skip to content

Commit

Permalink
MetadataResolver: Instantiate trusted certs directly
Browse files Browse the repository at this point in the history
No need to hackishly decode from PEM to DER
  • Loading branch information
moreati committed Oct 5, 2015
1 parent ef597bf commit d3fdcaa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions u2flib_server/attestation/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ def _name_key(name):

def _index(self, metadata):
for cert_pem in metadata.trustedCertificates:
cert_der = ''.join(cert_pem.splitlines()[1:-1]).decode('base64')
cert = x509.load_der_x509_certificate(cert_der, default_backend())
cert = x509.load_pem_x509_certificate(cert_pem, default_backend())
subject = self._name_key(cert.subject)
if subject not in self._certs:
self._certs[subject] = []
Expand Down

0 comments on commit d3fdcaa

Please sign in to comment.