Requesting ability for policyMappings extension to parse mappings from one issuer domain to multiple subject domains
#31087 opened on May 5, 2026
Description
When building a certificate profile in openssl.cnf for a cross certificate, the policyMappings extension cannot process multiple mappings from one issuer policy to multiple subject policies.
In this case, the second occurrence of the issuer:subject mapping wins.
Example snippet from my profile:
policyMappings = @cross_cert_mappings
[ cross_cert_mappings ]
2.16.840.1.999.1 = 2.16.840.1.666.1
2.16.840.1.999.2 = 2.16.840.1.666.2
2.16.840.1.999.2 = 2.16.840.1.777.1
2.16.840.1.999.3 = 2.16.840.1.666.3
When signing the cert with openssl ca, i get this:
X509v3 Policy Mappings:
2.16.840.1.999.1:2.16.840.1.666.1,
2.16.840.1.999.2:2.16.840.1.777.1,
2.16.840.1.999.3:2.16.840.1.666.3
So this (first) occurrence of the issuer:subject policy mapping ending in .2 policy is lost in the final certificate:
2.16.840.1.999.2:2.16.840.1.666.2
There is a workaround by manually creating the ASN.1 structure of the policyMappings extension and then adding it to the profile (sample python script attached to do this, i've also done similar with openssl asn1parse -genconf):
2.5.29.33 = DER:30503012060760864801876701060760864801851a013012060760864801876702060760864801851a0230120607608648018767020607608648018609013012060760864801876703060760864801851a03
Which correctly produces the following:
X509v3 Policy Mappings:
2.16.840.1.999.1:2.16.840.1.666.1,
2.16.840.1.999.2:2.16.840.1.666.2,
2.16.840.1.999.2:2.16.840.1.777.1,
2.16.840.1.999.3:2.16.840.1.666.3
But this is tedious and having the extension be able to parse multiple occurrences of one issuer policy to multiple subject policies would be very helpful.
Thanks!