mirror of
https://github.com/google/go-attestation.git
synced 2024-12-18 20:47:57 +00:00
don't drop leading zeroes when performing generic ecdsa signing (#357)
call ret.FillBytes() instead of ret.Bytes() to preserve leading zeroes that may have been dropped when converting the digest to an integer
This commit is contained in:
parent
93c5899459
commit
a3545dfc94
@ -623,7 +623,9 @@ func signECDSA(rw io.ReadWriter, key tpmutil.Handle, digest []byte, curve ellipt
|
||||
if excess > 0 {
|
||||
ret.Rsh(ret, uint(excess))
|
||||
}
|
||||
digest = ret.Bytes()
|
||||
// call ret.FillBytes() here instead of ret.Bytes() to preserve leading zeroes
|
||||
// that may have been dropped when converting the digest to an integer
|
||||
digest = ret.FillBytes(digest)
|
||||
|
||||
sig, err := tpm2.Sign(rw, key, "", digest, nil, nil)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user