Ensure safety_buffer in PKI is greater than zero (#4643)

Fixes #4641
This commit is contained in:
Jeff Mitchell 2018-05-28 12:08:22 -04:00 committed by GitHub
parent 95978c208f
commit edf4f7a5e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,6 +53,10 @@ func (b *backend) pathTidyWrite(ctx context.Context, req *logical.Request, d *fr
tidyCertStore := d.Get("tidy_cert_store").(bool)
tidyRevocationList := d.Get("tidy_revocation_list").(bool)
if safetyBuffer < 1 {
return logical.ErrorResponse("safety_buffer must be greater than zero"), nil
}
bufferDuration := time.Duration(safetyBuffer) * time.Second
var resp *logical.Response