Skip to content

Commit

Permalink
Use logrus instead of slog
Browse files Browse the repository at this point in the history
  • Loading branch information
codingllama committed Jan 20, 2025
1 parent cae03c3 commit 69f7b69
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions lib/auth/webauthn/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package webauthn

import (
"context"
"crypto/x509"
"encoding/pem"
"errors"
Expand Down Expand Up @@ -92,23 +91,19 @@ func verifyAttestation(cfg *types.Webauthn, obj protocol.AttestationObject) erro
if _, err := cert.Verify(opts); err == nil {
allowed = true // OK, but keep checking
} else {
log.DebugContext(context.Background(),
"Attestation check for allowed CAs failed",
"subject", cert.Subject,
"error", err,
)
log.WithError(err).
WithField("subject", cert.Subject).
Debug("Attestation check for allowed CAs failed")
}

opts = verifyOptsBase // take copy
opts.Roots = deniedPool
if _, err := cert.Verify(opts); err == nil {
return trace.BadParameter("attestation certificate %q from issuer %q not allowed", cert.Subject, cert.Issuer)
} else if !errors.As(err, new(x509.UnknownAuthorityError)) {
log.DebugContext(context.Background(),
"Attestation check for denied CAs failed",
"subject", cert.Subject,
"error", err,
)
log.WithError(err).
WithField("subject", cert.Subject).
Debug("Attestation check for denied CAs failed")
}
}
if !allowed {
Expand Down

0 comments on commit 69f7b69

Please sign in to comment.