mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
cert-request: restrict IPAddress SAN to host/service principals
Part of: https://pagure.io/freeipa/issue/7451 Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
parent
dccb2e0eb8
commit
8ec4868a64
@ -864,6 +864,13 @@ class cert_request(Create, BaseCertMethod, VirtualCommand):
|
|||||||
"for non-user principals") % "RFC822Name"
|
"for non-user principals") % "RFC822Name"
|
||||||
)
|
)
|
||||||
elif isinstance(gn, cryptography.x509.general_name.IPAddress):
|
elif isinstance(gn, cryptography.x509.general_name.IPAddress):
|
||||||
|
if principal.is_user:
|
||||||
|
raise errors.ValidationError(
|
||||||
|
name='csr',
|
||||||
|
error=_(
|
||||||
|
"subject alt name type %s is forbidden "
|
||||||
|
"for user principals") % "IPAddress"
|
||||||
|
)
|
||||||
san_ipaddrs.add(gn.value)
|
san_ipaddrs.add(gn.value)
|
||||||
else:
|
else:
|
||||||
raise errors.ACIError(
|
raise errors.ACIError(
|
||||||
|
Loading…
Reference in New Issue
Block a user