openss: fix various test and Python 3 issues (#47188)

This commit is contained in:
Jordan Borean
2018-10-18 05:29:18 +10:00
committed by GitHub
parent 1947d903cd
commit 6666b070a9
4 changed files with 12 additions and 9 deletions

View File

@@ -465,7 +465,7 @@ class CertificateSigningRequest(crypto_utils.OpenSSLObject):
return _check_keyUsage_(extensions, b'basicConstraints', self.basicConstraints, self.basicConstraints_critical)
def _check_ocspMustStaple(extensions):
oms_ext = [ext for ext in extensions if ext.get_short_name() == MUST_STAPLE_NAME and str(ext) == MUST_STAPLE_VALUE]
oms_ext = [ext for ext in extensions if to_bytes(ext.get_short_name()) == MUST_STAPLE_NAME and to_bytes(ext) == MUST_STAPLE_VALUE]
if OpenSSL.SSL.OPENSSL_VERSION_NUMBER < 0x10100000:
# Older versions of libssl don't know about OCSP Must Staple
oms_ext.extend([ext for ext in extensions if ext.get_short_name() == b'UNDEF' and ext.get_data() == b'\x30\x03\x02\x01\x05'])