diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-05-02 19:27:01 +0200 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-05-02 19:27:01 +0200 |
commit | 19048b5c8d417024e968b10d7de751be30313fc0 (patch) | |
tree | dc6b7fae5ac0497b979413d3b0bd0cf50af65a8f | |
parent | Indicate support for digest init ctrl. (diff) | |
download | openssl-19048b5c8d417024e968b10d7de751be30313fc0.tar.xz openssl-19048b5c8d417024e968b10d7de751be30313fc0.zip |
New function CMS_add1_crl().
-rw-r--r-- | crypto/cms/cms.h | 1 | ||||
-rw-r--r-- | crypto/cms/cms_lib.c | 9 | ||||
-rw-r--r-- | doc/crypto/CMS_add0_cert.pod | 9 |
3 files changed, 15 insertions, 4 deletions
diff --git a/crypto/cms/cms.h b/crypto/cms/cms.h index feddd24fca..09c45d0412 100644 --- a/crypto/cms/cms.h +++ b/crypto/cms/cms.h @@ -235,6 +235,7 @@ STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms); int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl); +int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl); STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); int CMS_SignedData_init(CMS_ContentInfo *cms); diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c index c629baf0e3..6c0d5c097c 100644 --- a/crypto/cms/cms_lib.c +++ b/crypto/cms/cms_lib.c @@ -548,6 +548,15 @@ int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl) return 1; } +int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl) + { + int r; + r = CMS_add0_crl(cms, crl); + if (r > 0) + CRYPTO_add(&crl->references, 1, CRYPTO_LOCK_X509_CRL); + return r; + } + STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms) { STACK_OF(X509) *certs = NULL; diff --git a/doc/crypto/CMS_add0_cert.pod b/doc/crypto/CMS_add0_cert.pod index 2670bfa925..9c13f488f6 100644 --- a/doc/crypto/CMS_add0_cert.pod +++ b/doc/crypto/CMS_add0_cert.pod @@ -13,6 +13,7 @@ STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl); + int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl); STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); @@ -23,8 +24,8 @@ must be of type signed data or enveloped data. CMS_get1_certs() returns all certificates in B<cms>. -CMS_add0_crl() adds CRL B<crl> to B<cms>. CMS_get1_crls() returns any CRLs in -B<cms>. +CMS_add0_crl() and CMS_add1_crl() add CRL B<crl> to B<cms>. CMS_get1_crls() +returns any CRLs in B<cms>. =head1 NOTES @@ -44,8 +45,8 @@ than once. =head1 RETURN VALUES -CMS_add0_cert(), CMS_add1_cert() and CMS_add0_crl() return 1 for success and -0 for failure. +CMS_add0_cert(), CMS_add1_cert() and CMS_add0_crl() and CMS_add1_crl() return +1 for success and 0 for failure. CMS_get1_certs() and CMS_get1_crls() return the STACK of certificates or CRLs or NULL if there are none or an error occurs. The only error which will occur |