refactor(优化代码): 提升代码质量
build.yaml / build (push) Successful in 34s

This commit is contained in:
2026-07-08 16:21:02 +08:00
parent 2f367e5a19
commit 6be7f4b006
-4
View File
@@ -32,7 +32,6 @@ type digitalVerifyResult struct {
DataHashOK bool DataHashOK bool
SignedOK bool SignedOK bool
CertOK bool CertOK bool
Cert []byte
SignerCerts [][]byte SignerCerts [][]byte
Certs [][]byte Certs [][]byte
CertInfo SignatureCertInfo CertInfo SignatureCertInfo
@@ -93,7 +92,6 @@ func verifyRawDigitalSignature(signedValue, signedData []byte, options *signatur
continue continue
} }
result.CertOK = true result.CertOK = true
result.Cert = cert
result.SignerCerts = [][]byte{cert} result.SignerCerts = [][]byte{cert}
result.CertInfo = signatureCertInfo(cert) result.CertInfo = signatureCertInfo(cert)
if sm2VerifySignature(pub, nil, signedData, signedValue) { if sm2VerifySignature(pub, nil, signedData, signedValue) {
@@ -121,7 +119,6 @@ func verifyRawPublicKeySignature(method, digestMethod string, signedValue, signe
continue continue
} }
result.CertOK = true result.CertOK = true
result.Cert = cert
result.SignerCerts = [][]byte{cert} result.SignerCerts = [][]byte{cert}
result.CertInfo = signatureCertInfo(cert) result.CertInfo = signatureCertInfo(cert)
if ok { if ok {
@@ -175,7 +172,6 @@ func verifyGBT35275SignedData(signedValue, signedData []byte, options *signature
result.CertOK = false result.CertOK = false
return result, nil return result, nil
} }
result.Cert = cert.Raw
result.SignerCerts = append(result.SignerCerts, cert.Raw) result.SignerCerts = append(result.SignerCerts, cert.Raw)
result.CertInfo = signatureCertInfo(cert.Raw) result.CertInfo = signatureCertInfo(cert.Raw)
if isSM2SignatureMethod(signer.SignatureAlg) { if isSM2SignatureMethod(signer.SignatureAlg) {