mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 20:26:19 +08:00
smx509: include more hints for verification failure
This commit is contained in:
parent
13f777bb2f
commit
acf6edec18
@ -578,7 +578,7 @@ func encodeSignature(r, s []byte) ([]byte, error) {
|
|||||||
// addASN1IntBytes encodes in ASN.1 a positive integer represented as
|
// addASN1IntBytes encodes in ASN.1 a positive integer represented as
|
||||||
// a big-endian byte slice with zero or more leading zeroes.
|
// a big-endian byte slice with zero or more leading zeroes.
|
||||||
func addASN1IntBytes(b *cryptobyte.Builder, bytes []byte) {
|
func addASN1IntBytes(b *cryptobyte.Builder, bytes []byte) {
|
||||||
for len(bytes) > 1 && bytes[0] == 0 {
|
for len(bytes) > 0 && bytes[0] == 0 {
|
||||||
bytes = bytes[1:]
|
bytes = bytes[1:]
|
||||||
}
|
}
|
||||||
if len(bytes) == 0 {
|
if len(bytes) == 0 {
|
||||||
|
@ -802,6 +802,10 @@ func (c *Certificate) buildChains(currentChain []*Certificate, sigChecks *int, o
|
|||||||
|
|
||||||
err = candidate.isValid(certType, currentChain, opts)
|
err = candidate.isValid(certType, currentChain, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if hintErr == nil {
|
||||||
|
hintErr = err
|
||||||
|
hintCert = candidate
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user