From 317b7cabb309d0f6d5eb1ad8665c92405200fcc7 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Sat, 28 Jan 2017 23:22:20 -0800 Subject: [PATCH] Ensuring usage matched OIDs. (#681) --- lemur/common/fields.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lemur/common/fields.py b/lemur/common/fields.py index 12e9aa08..b2fecf4e 100644 --- a/lemur/common/fields.py +++ b/lemur/common/fields.py @@ -200,22 +200,22 @@ class ExtendedKeyUsageExtension(Field): usages = value._usages usage_list = {} for usage in usages: - if usage.dotted_string == x509.oid.ExtendedKeyUsageOID.CLIENT_AUTH: + if usage == x509.oid.ExtendedKeyUsageOID.CLIENT_AUTH: usage_list['useClientAuthentication'] = True - elif usage.dotted_string == x509.oid.ExtendedKeyUsageOID.SERVER_AUTH: + elif usage == x509.oid.ExtendedKeyUsageOID.SERVER_AUTH: usage_list['useServerAuthentication'] = True - elif usage.dotted_string == x509.oid.ExtendedKeyUsageOID.CODE_SIGNING: + elif usage == x509.oid.ExtendedKeyUsageOID.CODE_SIGNING: usage_list['useCodeSigning'] = True - elif usage.dotted_string == x509.oid.ExtendedKeyUsageOID.EMAIL_PROTECTION: + elif usage == x509.oid.ExtendedKeyUsageOID.EMAIL_PROTECTION: usage_list['useEmailProtection'] = True - elif usage.dotted_string == x509.oid.ExtendedKeyUsageOID.TIME_STAMPING: + elif usage == x509.oid.ExtendedKeyUsageOID.TIME_STAMPING: usage_list['useTimestamping'] = True - elif usage.dotted_string == x509.oid.ExtendedKeyUsageOID.OCSP_SIGNING: + elif usage == x509.oid.ExtendedKeyUsageOID.OCSP_SIGNING: usage_list['useOCSPSigning'] = True elif usage.dotted_string == '1.3.6.1.5.5.7.3.14':