summaryrefslogtreecommitdiffstats
path: root/crypto/cms/cms_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2008-04-06 17:41:25 +0200
committerDr. Stephen Henson <steve@openssl.org>2008-04-06 17:41:25 +0200
commitd5a37b029357b8ed8595f5cefc6654ac15302ae8 (patch)
treea2a3fa0a3ed0bc0e07ccb306b55fe6e72db8b601 /crypto/cms/cms_lib.c
parentDelete nonexistant function from pkcs7.h header file. WIN32 build fix from (diff)
downloadopenssl-d5a37b029357b8ed8595f5cefc6654ac15302ae8.tar.xz
openssl-d5a37b029357b8ed8595f5cefc6654ac15302ae8.zip
Give consistent return value and add error code for duplicate certificates.
Diffstat (limited to 'crypto/cms/cms_lib.c')
-rw-r--r--crypto/cms/cms_lib.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c
index 8c3854dfc9..a715fc3ad5 100644
--- a/crypto/cms/cms_lib.c
+++ b/crypto/cms/cms_lib.c
@@ -472,8 +472,11 @@ int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert)
if (cch->type == CMS_CERTCHOICE_CERT)
{
if (!X509_cmp(cch->d.certificate, cert))
- return -1;
-
+ {
+ CMSerr(CMS_F_CMS_ADD0_CERT,
+ CMS_R_CERTIFICTATE_ALREADY_PRESENT);
+ return 0;
+ }
}
}
cch = CMS_add0_CertificateChoices(cms);