overwriting cn and key_type values from CSR, as they take precedence

This commit is contained in:
Hossein Shafagh 2020-09-09 19:52:59 -07:00
parent 6fa15c4cb3
commit 5ab9626cbd
1 changed files with 7 additions and 0 deletions

View File

@ -148,6 +148,13 @@ class CertificateInputSchema(CertificateCreationSchema):
data["extensions"]["subAltNames"]["names"] = [] data["extensions"]["subAltNames"]["names"] = []
data["extensions"]["subAltNames"]["names"] = csr_sans data["extensions"]["subAltNames"]["names"] = csr_sans
common_name = cert_utils.get_cn_from_csr(data["csr"])
if common_name:
data["common_name"] = common_name
key_type = cert_utils.get_key_type_from_csr(data["csr"])
if key_type:
data["key_type"] = key_type
return missing.convert_validity_years(data) return missing.convert_validity_years(data)