Skip to content

Commit

Permalink
pkcs7: fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun authored Mar 9, 2023
1 parent 9a839b5 commit 1d1382f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkcs7/sign_enveloped.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type signedEnvelopedData struct {
SignerInfos []signerInfo `asn1:"set"`
}

func (data signedEnvelopedData) findRecipient(cert *smx509.Certificate) *recipientInfo {
func (data signedEnvelopedData) GetRecipient(cert *smx509.Certificate) *recipientInfo {
for _, recp := range data.RecipientInfos {
if isCertMatchForIssuerAndSerial(cert, recp.IssuerAndSerialNumber) {
return &recp
Expand Down Expand Up @@ -93,7 +93,7 @@ func (p7 *PKCS7) DecryptAndVerify(cert *smx509.Certificate, pkey crypto.PrivateK
if !ok {
return nil, errors.New("pkcs7: it's NOT SignedAndEvelopedData")
}
recipient := sed.findRecipient(cert)
recipient := sed.GetRecipient(cert)
if recipient == nil {
return nil, errors.New("pkcs7: no enveloped recipient for provided certificate")
}
Expand Down

0 comments on commit 1d1382f

Please sign in to comment.