Skip to content

Commit

Permalink
Return legacy CRL storage path when no migration has occurred.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevendpclark committed Apr 28, 2022
1 parent 6086a1d commit a897075
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion builtin/logical/pki/cert_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func fetchCertBySerial(ctx context.Context, b *backend, req *logical.Request, pr
if err = b.crlBuilder.rebuildIfForced(ctx, b, req); err != nil {
return nil, err
}
path, err = resolveIssuerCRLPath(ctx, req.Storage, defaultRef)
path, err = resolveIssuerCRLPath(ctx, b, req.Storage, defaultRef)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion builtin/logical/pki/path_fetch_issuers.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func (b *backend) pathGetIssuerCRL(ctx context.Context, req *logical.Request, da
return nil, err
}

crlPath, err := resolveIssuerCRLPath(ctx, req.Storage, issuerName)
crlPath, err := resolveIssuerCRLPath(ctx, b, req.Storage, issuerName)
if err != nil {
return nil, err
}
Expand Down
6 changes: 5 additions & 1 deletion builtin/logical/pki/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,11 @@ func resolveIssuerReference(ctx context.Context, s logical.Storage, reference st
return IssuerRefNotFound, errutil.UserError{Err: fmt.Sprintf("unable to find PKI issuer for reference: %v", reference)}
}

func resolveIssuerCRLPath(ctx context.Context, s logical.Storage, reference string) (string, error) {
func resolveIssuerCRLPath(ctx context.Context, b *backend, s logical.Storage, reference string) (string, error) {
if b.useLegacyBundleCaStorage() {
return "crl", nil
}

issuer, err := resolveIssuerReference(ctx, s, reference)
if err != nil {
return "crl", err
Expand Down

0 comments on commit a897075

Please sign in to comment.