mirror of https://github.com/golang/go.git
crypto/x509: optimize the performance of checkSignature
The loop should be terminated immediately when `algo` has been found Fixes #52955
This commit is contained in:
parent
5f2fdbe7ed
commit
721322725f
|
|
@ -823,6 +823,7 @@ func checkSignature(algo SignatureAlgorithm, signed, signature []byte, publicKey
|
|||
if details.algo == algo {
|
||||
hashType = details.hash
|
||||
pubKeyAlgo = details.pubKeyAlgo
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue