From 1dd0d7d0eeb6bf30ba691d304122d51f591ea29c Mon Sep 17 00:00:00 2001 From: max furman Date: Thu, 11 Aug 2022 09:34:04 -0700 Subject: [PATCH] Update bad serial error to be more specific --- api/revoke.go | 2 +- api/revoke_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/revoke.go b/api/revoke.go index 4f8ce6b6..4221696a 100644 --- a/api/revoke.go +++ b/api/revoke.go @@ -36,7 +36,7 @@ func (r *RevokeRequest) Validate() (err error) { } sn, ok := new(big.Int).SetString(r.Serial, 0) if !ok { - return errs.BadRequest("'%s' is not a valid serial number - use a base 10 representation or add a prefix indicating the base", r.Serial) + return errs.BadRequest("'%s' is not a valid serial number - use a base 10 representation or a base 16 representation with '0x' prefix", r.Serial) } r.Serial = sn.String() if r.ReasonCode < ocsp.Unspecified || r.ReasonCode > ocsp.AACompromise { diff --git a/api/revoke_test.go b/api/revoke_test.go index 74293d50..0955244e 100644 --- a/api/revoke_test.go +++ b/api/revoke_test.go @@ -33,7 +33,7 @@ func TestRevokeRequestValidate(t *testing.T) { }, "error/bad sn": { rr: &RevokeRequest{Serial: "sn"}, - err: &errs.Error{Err: errors.New("'sn' is not a valid serial number - use a base 10 representation or add a prefix indicating the base"), Status: http.StatusBadRequest}, + err: &errs.Error{Err: errors.New("'sn' is not a valid serial number - use a base 10 representation or a base 16 representation with '0x' prefix"), Status: http.StatusBadRequest}, }, "error/bad reasonCode": { rr: &RevokeRequest{