Return an error for trailing CT signature garbage rather than logging an error
This commit is contained in:
parent
02b6c5ee51
commit
0aa86dd1cb
|
@ -10,7 +10,6 @@ import (
|
||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"math/big"
|
"math/big"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -79,7 +78,7 @@ func (s SignatureVerifier) verifySignature(data []byte, sig DigitallySigned) err
|
||||||
return fmt.Errorf("failed to unmarshal ECDSA signature: %v", err)
|
return fmt.Errorf("failed to unmarshal ECDSA signature: %v", err)
|
||||||
}
|
}
|
||||||
if len(rest) != 0 {
|
if len(rest) != 0 {
|
||||||
log.Printf("Garbage following signature %v", rest)
|
return fmt.Errorf("Garbage following signature %v", rest)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ecdsa.Verify(ecdsaKey, hash, ecdsaSig.R, ecdsaSig.S) {
|
if !ecdsa.Verify(ecdsaKey, hash, ecdsaSig.R, ecdsaSig.S) {
|
||||||
|
|
Loading…
Reference in New Issue