diff --git a/cert/p256/p256.go b/cert/p256/p256.go index be0a2381..dc609a35 100644 --- a/cert/p256/p256.go +++ b/cert/p256/p256.go @@ -44,7 +44,12 @@ func swap(r, s []byte) ([]byte, []byte, error) { } sNormalized := nMod.Nat().Sub(bigS, nMod) - return r, sNormalized.Bytes(nMod), nil + result := sNormalized.Bytes(nMod) + for len(result) > 1 && result[0] == 0 { + result = result[1:] + } + + return r, result, nil } func Normalize(sig []byte) ([]byte, error) {