Skip to content

Commit f3c73d5

Browse files
authored
Merge pull request #1966 from smallstep/dependabot/go_modules/golang.org/x/crypto-0.26.0
Bump golang.org/x/crypto from 0.25.0 to 0.26.0
2 parents a9f40ba + aeb5e1b commit f3c73d5

File tree

15 files changed

+40
-42
lines changed

15 files changed

+40
-42
lines changed

acme/api/revoke.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func isAccountAuthorized(_ context.Context, dbCert *acme.Certificate, certToBeRe
180180
func wrapRevokeErr(err error) *acme.Error {
181181
t := err.Error()
182182
if strings.Contains(t, "is already revoked") {
183-
return acme.NewError(acme.ErrorAlreadyRevokedType, t)
183+
return acme.NewError(acme.ErrorAlreadyRevokedType, t) //nolint:govet // allow non-constant error messages
184184
}
185185
return acme.WrapErrorISE(err, "error when revoking certificate")
186186
}
@@ -190,9 +190,9 @@ func wrapRevokeErr(err error) *acme.Error {
190190
func wrapUnauthorizedError(cert *x509.Certificate, unauthorizedIdentifiers []acme.Identifier, msg string, err error) *acme.Error {
191191
var acmeErr *acme.Error
192192
if err == nil {
193-
acmeErr = acme.NewError(acme.ErrorUnauthorizedType, msg)
193+
acmeErr = acme.NewError(acme.ErrorUnauthorizedType, msg) //nolint:govet // allow non-constant error messages
194194
} else {
195-
acmeErr = acme.WrapError(acme.ErrorUnauthorizedType, err, msg)
195+
acmeErr = acme.WrapError(acme.ErrorUnauthorizedType, err, msg) //nolint:govet // allow non-constant error messages
196196
}
197197
acmeErr.Status = http.StatusForbidden // RFC8555 7.6 shows example with 403
198198

acme/errors.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,14 @@ type Subproblem struct {
294294
}
295295

296296
// NewError creates a new Error.
297-
func NewError(pt ProblemType, msg string, args ...interface{}) *Error {
297+
func NewError(pt ProblemType, msg string, args ...any) *Error {
298298
return newError(pt, errors.Errorf(msg, args...))
299299
}
300300

301301
// NewDetailedError creates a new Error that includes the error
302302
// message in the details, providing more information to the
303303
// ACME client.
304-
func NewDetailedError(pt ProblemType, msg string, args ...interface{}) *Error {
304+
func NewDetailedError(pt ProblemType, msg string, args ...any) *Error {
305305
return NewError(pt, msg, args...).withDetail()
306306
}
307307

@@ -324,7 +324,7 @@ func (e *Error) AddSubproblems(subproblems ...Subproblem) *Error {
324324
// NewSubproblem creates a new Subproblem. The msg and args
325325
// are used to create a new error, which is set as the Detail, allowing
326326
// for more detailed error messages to be returned to the ACME client.
327-
func NewSubproblem(pt ProblemType, msg string, args ...interface{}) Subproblem {
327+
func NewSubproblem(pt ProblemType, msg string, args ...any) Subproblem {
328328
e := newError(pt, fmt.Errorf(msg, args...))
329329
s := Subproblem{
330330
Type: e.Type,
@@ -335,7 +335,7 @@ func NewSubproblem(pt ProblemType, msg string, args ...interface{}) Subproblem {
335335

336336
// NewSubproblemWithIdentifier creates a new Subproblem with a specific ACME
337337
// Identifier. It calls NewSubproblem and sets the Identifier.
338-
func NewSubproblemWithIdentifier(pt ProblemType, identifier Identifier, msg string, args ...interface{}) Subproblem {
338+
func NewSubproblemWithIdentifier(pt ProblemType, identifier Identifier, msg string, args ...any) Subproblem {
339339
s := NewSubproblem(pt, msg, args...)
340340
s.Identifier = &identifier
341341
return s
@@ -362,12 +362,12 @@ func newError(pt ProblemType, err error) *Error {
362362
}
363363

364364
// NewErrorISE creates a new ErrorServerInternalType Error.
365-
func NewErrorISE(msg string, args ...interface{}) *Error {
365+
func NewErrorISE(msg string, args ...any) *Error {
366366
return NewError(ErrorServerInternalType, msg, args...)
367367
}
368368

369369
// WrapError attempts to wrap the internal error.
370-
func WrapError(typ ProblemType, err error, msg string, args ...interface{}) *Error {
370+
func WrapError(typ ProblemType, err error, msg string, args ...any) *Error {
371371
var e *Error
372372
switch {
373373
case err == nil:
@@ -384,12 +384,12 @@ func WrapError(typ ProblemType, err error, msg string, args ...interface{}) *Err
384384
}
385385
}
386386

387-
func WrapDetailedError(typ ProblemType, err error, msg string, args ...interface{}) *Error {
387+
func WrapDetailedError(typ ProblemType, err error, msg string, args ...any) *Error {
388388
return WrapError(typ, err, msg, args...).withDetail()
389389
}
390390

391391
// WrapErrorISE shortcut to wrap an internal server error type.
392-
func WrapErrorISE(err error, msg string, args ...interface{}) *Error {
392+
func WrapErrorISE(err error, msg string, args ...any) *Error {
393393
return WrapError(ErrorServerInternalType, err, msg, args...)
394394
}
395395

@@ -415,7 +415,7 @@ func (e *Error) Cause() error {
415415
}
416416

417417
// ToLog implements the EnableLogger interface.
418-
func (e *Error) ToLog() (interface{}, error) {
418+
func (e *Error) ToLog() (any, error) {
419419
b, err := json.Marshal(e)
420420
if err != nil {
421421
return nil, WrapErrorISE(err, "error marshaling acme.Error for logging")

api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"context"
66
"crypto"
7-
"crypto/dsa" //nolint:staticcheck // support legacy algorithms
7+
"crypto/dsa" // support legacy algorithms
88
"crypto/ecdsa"
99
"crypto/ed25519"
1010
"crypto/rsa"

authority/admin/api/webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func (war *webhookAdminResponder) UpdateProvisionerWebhook(w http.ResponseWriter
202202
}
203203
if !found {
204204
msg := fmt.Sprintf("provisioner %q has no webhook with the name %q", prov.Name, newWebhook.Name)
205-
err := admin.NewError(admin.ErrorNotFoundType, msg)
205+
err := admin.NewError(admin.ErrorNotFoundType, msg) //nolint:govet // allow non-constant error messages
206206
render.Error(w, r, err)
207207
return
208208
}

authority/provisioner/jwk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func (p *JWK) AuthorizeSSHSign(_ context.Context, token string) ([]SignOption, e
249249
// Use options in the token.
250250
if opts.CertType != "" {
251251
if certType, err = sshutil.CertTypeFromString(opts.CertType); err != nil {
252-
return nil, errs.BadRequestErr(err, err.Error())
252+
return nil, errs.BadRequestErr(err, err.Error()) //nolint:govet // allow non-constant error messages
253253
}
254254
}
255255
if opts.KeyID != "" {

authority/provisioner/provisioner.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ type Config struct {
246246
Claims Claims
247247
// Audiences are the audiences used in the default provisioner, (JWK).
248248
Audiences Audiences
249-
// SSHKeys are the root SSH public keys
249+
// SSHKeys are the root SSH public keys.
250250
SSHKeys *SSHKeys
251251
// GetIdentityFunc is a function that returns an identity that will be
252252
// used by the provisioner to populate certificate attributes.
@@ -257,11 +257,11 @@ type Config struct {
257257
// AuthorizeSSHRenewFunc is a function that returns nil if a given SSH
258258
// certificate can be renewed.
259259
AuthorizeSSHRenewFunc AuthorizeSSHRenewFunc
260-
// WebhookClient is an http client to use in webhook request
260+
// WebhookClient is an HTTP client used when performing webhook requests.
261261
WebhookClient *http.Client
262262
// SCEPKeyManager, if defined, is the interface used by SCEP provisioners.
263263
SCEPKeyManager SCEPKeyManager
264-
// HTTPClient is an HTTP client that trust the system cert pool and the CA
264+
// HTTPClient is an HTTP client that trusts the system cert pool and the CA
265265
// roots.
266266
HTTPClient *http.Client
267267
}

authority/provisioner/ssh_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func signSSHCertificate(key crypto.PublicKey, opts SignSSHOptions, signOpts []Si
9090
var templErr *sshutil.TemplateError
9191
if errors.As(err, &templErr) {
9292
return nil, errs.NewErr(http.StatusBadRequest, templErr,
93-
errs.WithMessage(templErr.Error()),
93+
errs.WithMessage(templErr.Error()), //nolint:govet // allow non-constant error messages
9494
errs.WithKeyVal("signOptions", signOpts),
9595
)
9696
}

authority/provisioner/x5c.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func (p *X5C) AuthorizeSSHSign(_ context.Context, token string) ([]SignOption, e
301301
// Use options in the token.
302302
if opts.CertType != "" {
303303
if certType, err = sshutil.CertTypeFromString(opts.CertType); err != nil {
304-
return nil, errs.BadRequestErr(err, err.Error())
304+
return nil, errs.BadRequestErr(err, err.Error()) //nolint:govet // allow non-constant error messages
305305
}
306306
}
307307
if opts.KeyID != "" {

authority/ssh.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func (a *Authority) signSSH(ctx context.Context, key ssh.PublicKey, opts provisi
214214
for _, v := range keyValidators {
215215
if err := v.Valid(key); err != nil {
216216
return nil, nil, errs.ApplyOptions(
217-
errs.ForbiddenErr(err, err.Error()),
217+
errs.ForbiddenErr(err, err.Error()), //nolint:govet // allow non-constant error messages
218218
errs.WithKeyVal("signOptions", signOpts),
219219
)
220220
}
@@ -231,7 +231,7 @@ func (a *Authority) signSSH(ctx context.Context, key ssh.PublicKey, opts provisi
231231
// Call enriching webhooks
232232
if err := a.callEnrichingWebhooksSSH(ctx, prov, webhookCtl, cr); err != nil {
233233
return nil, prov, errs.ApplyOptions(
234-
errs.ForbiddenErr(err, err.Error()),
234+
errs.ForbiddenErr(err, err.Error()), //nolint:govet // allow non-constant error messages
235235
errs.WithKeyVal("signOptions", signOpts),
236236
)
237237
}
@@ -243,7 +243,7 @@ func (a *Authority) signSSH(ctx context.Context, key ssh.PublicKey, opts provisi
243243
switch {
244244
case errors.As(err, &te):
245245
return nil, prov, errs.ApplyOptions(
246-
errs.BadRequestErr(err, err.Error()),
246+
errs.BadRequestErr(err, err.Error()), //nolint:govet // allow non-constant error messages
247247
errs.WithKeyVal("signOptions", signOpts),
248248
)
249249
case strings.HasPrefix(err.Error(), "error unmarshaling certificate"):
@@ -263,7 +263,7 @@ func (a *Authority) signSSH(ctx context.Context, key ssh.PublicKey, opts provisi
263263
// Use SignSSHOptions to modify the certificate validity. It will be later
264264
// checked or set if not defined.
265265
if err := opts.ModifyValidity(certTpl); err != nil {
266-
return nil, prov, errs.BadRequestErr(err, err.Error())
266+
return nil, prov, errs.BadRequestErr(err, err.Error()) //nolint:govet // allow non-constant error messages
267267
}
268268

269269
// Use provisioner modifiers.

authority/tls.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (a *Authority) signX509(ctx context.Context, csr *x509.CertificateRequest,
197197

198198
if err := a.callEnrichingWebhooksX509(ctx, prov, webhookCtl, attData, csr); err != nil {
199199
return nil, prov, errs.ApplyOptions(
200-
errs.ForbiddenErr(err, err.Error()),
200+
errs.ForbiddenErr(err, err.Error()), //nolint:govet // allow non-constant error messages
201201
errs.WithKeyVal("csr", csr),
202202
errs.WithKeyVal("signOptions", signOpts),
203203
)
@@ -209,7 +209,7 @@ func (a *Authority) signX509(ctx context.Context, csr *x509.CertificateRequest,
209209
switch {
210210
case errors.As(err, &te):
211211
return nil, prov, errs.ApplyOptions(
212-
errs.BadRequestErr(err, err.Error()),
212+
errs.BadRequestErr(err, err.Error()), //nolint:govet // allow non-constant error messages
213213
errs.WithKeyVal("csr", csr),
214214
errs.WithKeyVal("signOptions", signOpts),
215215
)

0 commit comments

Comments
 (0)