diff --git a/builtin/logical/pki/cert_util.go b/builtin/logical/pki/cert_util.go index 2a2c9b9b5639..7f099d0509b0 100644 --- a/builtin/logical/pki/cert_util.go +++ b/builtin/logical/pki/cert_util.go @@ -1000,13 +1000,13 @@ func generateCreationBundle(b *backend, data *inputBundle, caSign *certutil.CAIn subject := pkix.Name{ CommonName: cn, SerialNumber: ridSerialNumber, - Country: strutil.RemoveDuplicates(data.role.Country, false), - Organization: strutil.RemoveDuplicates(data.role.Organization, false), + Country: strutil.RemoveDuplicatesStable(data.role.Country, false), + Organization: strutil.RemoveDuplicatesStable(data.role.Organization, false), OrganizationalUnit: strutil.RemoveDuplicatesStable(data.role.OU, false), - Locality: strutil.RemoveDuplicates(data.role.Locality, false), - Province: strutil.RemoveDuplicates(data.role.Province, false), - StreetAddress: strutil.RemoveDuplicates(data.role.StreetAddress, false), - PostalCode: strutil.RemoveDuplicates(data.role.PostalCode, false), + Locality: strutil.RemoveDuplicatesStable(data.role.Locality, false), + Province: strutil.RemoveDuplicatesStable(data.role.Province, false), + StreetAddress: strutil.RemoveDuplicatesStable(data.role.StreetAddress, false), + PostalCode: strutil.RemoveDuplicatesStable(data.role.PostalCode, false), } // Get the TTL and verify it against the max allowed diff --git a/changelog/11259.txt b/changelog/11259.txt new file mode 100644 index 000000000000..7e47743bb672 --- /dev/null +++ b/changelog/11259.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +secret/pki: Preserve ordering of all DN attribute values when issuing certificates +``` \ No newline at end of file