Visitar URL original
docs(publisher): note r and s are bounded so FillBytes cannot panic · modelcontextprotocol/registry@ad788f5 · GitHub
Skip to content

Commit ad788f5

Browse files
JosephDoUrdenrdimitrov
authored andcommitted
docs(publisher): note r and s are bounded so FillBytes cannot panic
1 parent 0e3bd78 commit ad788f5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎cmd/publisher/auth/common.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ func (c *InProcessSigner) GetSignedTimestamp(_ context.Context) (*string, []byte
139139
// directly can produce fewer than 96 bytes when r or s is small, which the
140140
// registry rejects with "invalid signature size for ECDSA P-384". FillBytes
141141
// left-pads each component to 48 bytes so verification always sees 96 bytes.
142+
// r and s come from ecdsa.Sign in this file and are bounded by the P-384 group
143+
// order, so they always fit in 48 bytes and FillBytes cannot panic.
142144
func encodeECDSAP384Signature(r, s *big.Int) []byte {
143145
signature := make([]byte, 96)
144146
r.FillBytes(signature[:48])

0 commit comments

Comments
 (0)