simplyfy error message code

Co-authored-by: Aaron Gable <aaron@aarongable.com>
This commit is contained in:
orangepizza 2025-05-06 20:24:57 +09:00 committed by GitHub
parent 5ae392d6a5
commit eacd9199e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -696,10 +696,8 @@ func (wfe *WebFrontEndImpl) parseJWS(body string) (*jose.JSONWebSignature, *acme
if err != nil {
var unexpectedSignAlgo *jose.ErrUnexpectedSignatureAlgorithm
if errors.As(err, &unexpectedSignAlgo) {
errmsg := fmt.Sprintf(
"JWS header contained unsupported algorithm, supported algorithms are: %s", goodJWSSignatureAlgorithms,
)
return nil, acme.BadSignatureAlgorithmProblem(errmsg)
return nil, acme.BadSignatureAlgorithmProblem(fmt.Sprintf(
"JWS header contained unsupported algorithm, supported algorithms are: %s", goodJWSSignatureAlgorithms))
}
return nil, acme.MalformedProblem(fmt.Sprint("Parse error reading JWS: ", err.Error()))
}