-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NameConstraints must include a mask when serializing IPAddress #105
Comments
This PR resolves the issue by ensuring that the Supported Formats and Usage ExamplesHere's how to use IP addresses in NameConstraints: const nameConstrains = new NameConstraints({
permittedSubtrees: new GeneralSubtrees([
// IPv4 examples
new GeneralSubtree({
base: new GeneralName({
iPAddress: "192.168.1.0/24", // Using CIDR notation
}),
}),
// IPv6 examples
new GeneralSubtree({
base: new GeneralName({
iPAddress: "2001:db8::/64", // IPv6 with CIDR
}),
}),
]),
}); Supported IP Address Formats:The module now handles IP addresses in the following formats: IPv4 Support:
IPv6 Support:
|
I can confirm the latest version now correctly serializes the mask when provided. However, i would argue that either a) it should throw when given the IP without a mask or b) it should add mask /32 or /128 (255.255.255.255 or ffff:ffff...) automatically if the mask isn't given (since mask with all bits is allowing just the IP itself) the issue is that i don't remember anything complaining about the lack of mask in the name, everything seemed to be happily just showing the IP in the constraint and the certificate just wouldn't be accepted. took me quite a while to figure out the mask is mandatory and either a or b would hopefully save the time for someone else. |
Currently serializing and deserializing NameConstraints use the AsnIpConverter same as for example SubjectAlternativeName, resulting in plain IP Address being serialized.
However, RFC 5280 state that the IP Address in name constraints MUST have a mask.
The text was updated successfully, but these errors were encountered: