Commit 7800dee0 authored by pengjun's avatar pengjun

update cert_auth

parent 30d1028d
......@@ -405,16 +405,16 @@ func (validator *ecdsaValidator) getValidityOptsForCert(cert *x509.Certificate)
}
func (validator *ecdsaValidator) GetCertFromSignature(signature []byte) ([]byte, error) {
cert, _, err := utils.DecodeCertFromSignature(signature)
certSign, err := utils.DecodeCertFromSignature(signature)
if err != nil {
authLogger.Error(fmt.Sprintf("unmashal certificate from signature failed. %s", err.Error()))
return nil, err
}
if len(cert) == 0 {
if len(certSign.Cert) == 0 {
authLogger.Error("cert can not be null")
return nil, types.ErrInvalidParam
}
return cert, nil
return certSign.Cert, nil
}
......@@ -339,16 +339,16 @@ func (validator *gmValidator) getValidityOptsForCert(cert *sm2.Certificate) sm2.
func (validator *gmValidator) GetCertFromSignature(signature []byte) ([]byte, error) {
// 从proto中解码signature
cert, _, err := utils.DecodeCertFromSignature(signature)
cert, err := utils.DecodeCertFromSignature(signature)
if err != nil {
authLogger.Error(fmt.Sprintf("unmashal certificate from signature failed. %s", err.Error()))
return nil, err
}
if len(cert) == 0 {
if len(cert.Cert) == 0 {
authLogger.Error("cert can not be null")
return nil, types.ErrInvalidParam
}
return cert, nil
return cert.Cert, nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment