x509.py (salt-3002.1) | : | x509.py (salt-3002.2) | ||
---|---|---|---|---|
skipping to change at line 419 | skipping to change at line 419 | |||
required_cert_info["X509v3 Extensions"]["authorityKeyIdentifier"] = re.sub( | required_cert_info["X509v3 Extensions"]["authorityKeyIdentifier"] = re.sub( | |||
r"serial:([0-9A-F]{2}:)*[0-9A-F]{2}", | r"serial:([0-9A-F]{2}:)*[0-9A-F]{2}", | |||
"serial:--", | "serial:--", | |||
required_cert_info["X509v3 Extensions"]["authorityKeyIdentifier" ], | required_cert_info["X509v3 Extensions"]["authorityKeyIdentifier" ], | |||
) | ) | |||
except KeyError: | except KeyError: | |||
pass | pass | |||
diff = [] | diff = [] | |||
for k, v in required_cert_info.items(): | for k, v in required_cert_info.items(): | |||
# cert info comes as byte string | ||||
if isinstance(v, str): | ||||
v = salt.utils.stringutils.to_bytes(v) | ||||
try: | try: | |||
if v != cert_info[k]: | if v != cert_info[k]: | |||
if k == "Subject Hash": | if k == "Subject Hash": | |||
# If we failed the subject hash check but the subject matche s, then this is | # If we failed the subject hash check but the subject matche s, then this is | |||
# likely a certificate generated under Python 2 where sortin g differs and thus | # likely a certificate generated under Python 2 where sortin g differs and thus | |||
# the hash also differs | # the hash also differs | |||
if required_cert_info["Subject"] != cert_info["Subject"]: | if required_cert_info["Subject"] != cert_info["Subject"]: | |||
diff.append(k) | diff.append(k) | |||
elif k == "Issuer Hash": | elif k == "Issuer Hash": | |||
# If we failed the issuer hash check but the issuer matches, then this is | # If we failed the issuer hash check but the issuer matches, then this is | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added |