mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
Set CA chain when intermediate does not have an authority key ID.
This is essentially an approved review of the code provided in #2465. Fixes #2465
This commit is contained in:
parent
a9237c6eb3
commit
799000be20
1 changed files with 4 additions and 2 deletions
|
|
@ -66,8 +66,10 @@ func (b *caInfoBundle) GetCAChain() []*certutil.CertBlock {
|
|||
chain := []*certutil.CertBlock{}
|
||||
|
||||
// Include issuing CA in Chain, not including Root Authority
|
||||
if len(b.Certificate.AuthorityKeyId) > 0 &&
|
||||
!bytes.Equal(b.Certificate.AuthorityKeyId, b.Certificate.SubjectKeyId) {
|
||||
if (len(b.Certificate.AuthorityKeyId) > 0 &&
|
||||
!bytes.Equal(b.Certificate.AuthorityKeyId, b.Certificate.SubjectKeyId)) ||
|
||||
(len(b.Certificate.AuthorityKeyId) == 0 &&
|
||||
!bytes.Equal(b.Certificate.RawIssuer, b.Certificate.RawSubject)) {
|
||||
|
||||
chain = append(chain, &certutil.CertBlock{
|
||||
Certificate: b.Certificate,
|
||||
|
|
|
|||
Loading…
Reference in a new issue