Skip to content

Commit

Permalink
Backport 11259 (Stable PKI attribute/value pairs) to 1.6.x (#11287)
Browse files Browse the repository at this point in the history
* Make all duplicate removals stable in PKI (#11259)

* Changelog for 11259 (#11266)
  • Loading branch information
sgmiller authored Apr 6, 2021
1 parent d889673 commit 7f4c9a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions builtin/logical/pki/cert_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions changelog/11259.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```changelog:enhancement
secret/pki: Preserve ordering of all DN attribute values when issuing certificates
```

0 comments on commit 7f4c9a6

Please sign in to comment.