Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion keyutil/jwk.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ func (ec *jwkEC) params() (crv elliptic.Curve, byteLen int, e error) {
default:
return nil, 0, fmt.Errorf("Unsupported ECC curve '%s'", ec.Curve)
}
return crv, crv.Params().BitSize / 8, nil
// The P-521 curve has 521 bits (65.125 bytes), so we must round up to get the bytes. We need 66 bytes to store 521 bits.
return crv, (crv.Params().BitSize + 7) / 8, nil
Comment thread
getvictor marked this conversation as resolved.
}

func (ec *jwkEC) PublicKey() (*ecdsa.PublicKey, error) {
Expand Down
Loading