1
0
mirror of synced 2026-10-24 12:59:18 +03:00
Files
Ted Malone 3b58a2a81e Return unauthorized for a reused external account binding key
When a client registers an ACME account with an external account binding
key that has already been bound, step-ca answers 500 serverInternal
instead of 401 unauthorized.

ExternalAccountKey.BindTo clears the key's HMAC bytes when it binds
("can only be used once"), and validateExternalAccountBinding checked
for missing key bytes before checking whether the key was bound. So
every reuse of a bound key reached the server-error branch, and the
already-bound branch below it was unreachable for any key that had
been bound through BindTo. The existing test for that branch passes
only because its fixture keeps key bytes on a bound key, which BindTo
never produces.

The status matters because ACME clients treat 5xx as retryable. Go's
golang.org/x/crypto/acme client retried until its context deadline, a
full minute in my test; certbot and cert-manager back off and retry
the same way. A misconfigured client that reuses a key now gets a
definite 401 and stops.

The fix checks AlreadyBound before the key bytes. An unbound key with
no key bytes is still a server error, unchanged. The new test case
builds the key the way BindTo leaves it and fails against the old
order.

go build, go vet and gofmt are clean with CGO_ENABLED=0 (the cgo build
needs libpcsclite, which this machine lacks); ./acme/... passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-22 20:39:38 +00:00
..
2026-09-03 14:28:33 -07:00
2026-09-03 14:28:33 -07:00
2026-09-03 14:28:33 -07:00
2026-09-03 14:28:33 -07:00
2026-09-03 14:28:33 -07:00
2024-04-29 16:15:08 -07:00
2026-09-03 14:28:33 -07:00
2026-09-03 14:28:33 -07:00
2024-08-20 16:54:29 +02:00
2022-05-02 18:09:26 -07:00
2026-02-17 17:26:07 -08:00
2021-03-25 12:05:46 -07:00
2026-09-03 14:28:33 -07:00
2026-09-03 14:28:33 -07:00
2021-03-25 12:05:45 -07:00