Skip to content

Commit

Permalink
Load existing CRLs on startup and after invalidate (#17138)
Browse files Browse the repository at this point in the history
* Load existing CRLs on startup and after invalidate

* changelog
  • Loading branch information
sgmiller committed Sep 14, 2022
1 parent 20eddff commit f4fa806
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions builtin/credential/cert/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend,
if err := b.Setup(ctx, conf); err != nil {
return nil, err
}
if err := b.populateCRLs(ctx, conf.StorageView); err != nil {
return nil, err
}
return b, nil
}

Expand Down
6 changes: 6 additions & 0 deletions builtin/credential/cert/path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ func (b *backend) pathLogin(ctx context.Context, req *logical.Request, data *fra
return nil, err
}

if b.crls == nil {
if err := b.populateCRLs(ctx, req.Storage); err != nil {
return nil, err
}
}

var matched *ParsedCert
if verifyResp, resp, err := b.verifyCredentials(ctx, req, data); err != nil {
return nil, err
Expand Down
3 changes: 3 additions & 0 deletions changelog/17138.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
auth/cert: Vault does not initially load the CRLs in cert auth unless the read/write CRL endpoint is hit.
```

0 comments on commit f4fa806

Please sign in to comment.