As documented PKCS7_NOCERTS should only exclude the signer's certificate
and not any supplied in the "certs" parameter. This makes it possible to
exclude the signer's certificate but include other certificates. Applications
that don't want to include other certificates should set "certs" to NULL
anyway.
(cherry picked from commit
5c6f808b66f1a2e0fb2a508b24b845a88803fe3a)
goto err;
}
- if(!(flags & PKCS7_NOCERTS))
+ for(i = 0; i < sk_X509_num(certs); i++)
{
- for(i = 0; i < sk_X509_num(certs); i++)
- {
- if (!PKCS7_add_certificate(p7, sk_X509_value(certs, i)))
- goto err;
- }
+ if (!PKCS7_add_certificate(p7, sk_X509_value(certs, i)))
+ goto err;
}
if(flags & PKCS7_DETACHED)