You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Vault PKI alphabetically sorts all OUs when multiple ones are present in a requested CSR.
To Reproduce
Steps to reproduce the behavior:
Enable the pki engine: vault secrets enable pki
Generate the CSR for an intermediate CA: vault write -field=csr pki/intermediate/generate/internal country="US" organization="Hashicorp" ou="C,A,B" common_name="My CA" key_type="rsa" key_bits=4096 add_basic_constraints=true > My_CA.csr
Show the subject of the generated CSR: openssl req -in My_CA.csr -noout -subject
See that the three OUs will be ordered like OU = A + OU = B + OU = C
Expected behavior
Because the RDNs impose a hierarchy, the OUs should follow the order that was defined in the request, i.e. they should be ordered (in this example) like OU = C + OU = A + OU = B.
You can further inspect the CSR and verify that the OUs were actually ordered by running openssl asn1parse -i -in My_CA.csr.
Environment:
Vault Server Version: 1.1.1
Vault CLI Version: 1.1.1
Server Operating System/Architecture: GNU/Linux x86_64 (Ubuntu Server 18.04.2 LTS)
The OUs should probably be a sequence of RDNs, not a single set, but this should really be fixed in the x509 package. The committed change preserves the order, and I verified that the set is converted into a sequence by x509 when it is parsed.
Describe the bug
Vault PKI alphabetically sorts all OUs when multiple ones are present in a requested CSR.
To Reproduce
Steps to reproduce the behavior:
vault secrets enable pki
vault write -field=csr pki/intermediate/generate/internal country="US" organization="Hashicorp" ou="C,A,B" common_name="My CA" key_type="rsa" key_bits=4096 add_basic_constraints=true > My_CA.csr
openssl req -in My_CA.csr -noout -subject
OU = A + OU = B + OU = C
Expected behavior
Because the RDNs impose a hierarchy, the OUs should follow the order that was defined in the request, i.e. they should be ordered (in this example) like
OU = C + OU = A + OU = B
.You can further inspect the CSR and verify that the OUs were actually ordered by running
openssl asn1parse -i -in My_CA.csr
.Environment:
Vault server configuration file(s):
Additional context
https://en.wikipedia.org/wiki/Directory_information_tree
https://tools.ietf.org/html/rfc5280#section-4.1.2.6
The text was updated successfully, but these errors were encountered: