diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2019-07-31 11:14:12 +0200 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2019-07-31 11:14:12 +0200 |
commit | 8c00f267b8df1a8c70eff8198de40aa561299e48 (patch) | |
tree | 5e9505ba088c41584184eecbf0f92d30bc2c5605 /crypto | |
parent | Document recent changes in NEWS and CHANGES (diff) | |
download | openssl-8c00f267b8df1a8c70eff8198de40aa561299e48.tar.xz openssl-8c00f267b8df1a8c70eff8198de40aa561299e48.zip |
CAdES : lowercase name for now internal methods.
CAdES : rework CAdES signing API.
Make it private, as it is unused outside library bounds.
Fix varous doc-nits.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/cms/cms_ess.c | 12 | ||||
-rw-r--r-- | crypto/cms/cms_sd.c | 7 | ||||
-rw-r--r-- | crypto/err/openssl.txt | 4 | ||||
-rw-r--r-- | crypto/include/internal/cms_int.h | 13 | ||||
-rw-r--r-- | crypto/include/internal/ess_int.h | 9 |
5 files changed, 34 insertions, 11 deletions
diff --git a/crypto/cms/cms_ess.c b/crypto/cms/cms_ess.c index 95e3628d9c..8f80f6ba5d 100644 --- a/crypto/cms/cms_ess.c +++ b/crypto/cms/cms_ess.c @@ -17,6 +17,7 @@ #include <openssl/ess.h> #include "cms_lcl.h" #include "internal/ess_int.h" +#include "internal/cms_int.h" IMPLEMENT_ASN1_FUNCTIONS(CMS_ReceiptRequest) @@ -339,12 +340,10 @@ ASN1_OCTET_STRING *cms_encode_Receipt(CMS_SignerInfo *si) } /* - * Add signer certificate's V2 digest to a SignerInfo - * structure + * Add signer certificate's V2 digest |sc| to a SignerInfo structure |si| */ -int CMS_add1_signing_cert_v2(CMS_SignerInfo *si, - ESS_SIGNING_CERT_V2 *sc) +int cms_add1_signing_cert_v2(CMS_SignerInfo *si, ESS_SIGNING_CERT_V2 *sc) { ASN1_STRING *seq = NULL; unsigned char *p, *pp; @@ -373,11 +372,10 @@ int CMS_add1_signing_cert_v2(CMS_SignerInfo *si, } /* - * Add signer certificate's digest to a SignerInfo - * structure + * Add signer certificate's digest |sc| to a SignerInfo structure |si| */ -int CMS_add1_signing_cert(CMS_SignerInfo *si, ESS_SIGNING_CERT *sc) +int cms_add1_signing_cert(CMS_SignerInfo *si, ESS_SIGNING_CERT *sc) { ASN1_STRING *seq = NULL; unsigned char *p, *pp; diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c index 40a3356359..4de750bd72 100644 --- a/crypto/cms/cms_sd.c +++ b/crypto/cms/cms_sd.c @@ -14,9 +14,12 @@ #include <openssl/x509v3.h> #include <openssl/err.h> #include <openssl/cms.h> +#include <openssl/ess.h> #include "cms_lcl.h" #include "internal/asn1_int.h" #include "internal/evp_int.h" +#include "internal/cms_int.h" +#include "internal/ess_int.h" /* CMS SignedData Utilities */ @@ -355,13 +358,13 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, if ((sc = ESS_SIGNING_CERT_new_init(signer, NULL, 1)) == NULL) goto err; - add_sc = CMS_add1_signing_cert(si, sc); + add_sc = cms_add1_signing_cert(si, sc); ESS_SIGNING_CERT_free(sc); } else { if ((sc2 = ESS_SIGNING_CERT_V2_new_init(md, signer, NULL, 1)) == NULL) goto err; - add_sc = CMS_add1_signing_cert_v2(si, sc2); + add_sc = cms_add1_signing_cert_v2(si, sc2); ESS_SIGNING_CERT_V2_free(sc2); } if (!add_sc) diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt index ede1c57a7b..d172f4c288 100644 --- a/crypto/err/openssl.txt +++ b/crypto/err/openssl.txt @@ -246,8 +246,8 @@ CMS_F_CMS_ADD1_RECEIPTREQUEST:158:CMS_add1_ReceiptRequest CMS_F_CMS_ADD1_RECIPIENT_CERT:101:CMS_add1_recipient_cert CMS_F_CMS_ADD1_SIGNER:102:CMS_add1_signer CMS_F_CMS_ADD1_SIGNINGTIME:103:cms_add1_signingTime -CMS_F_CMS_ADD1_SIGNING_CERT:181:CMS_add1_signing_cert -CMS_F_CMS_ADD1_SIGNING_CERT_V2:182:CMS_add1_signing_cert_v2 +CMS_F_CMS_ADD1_SIGNING_CERT:181:cms_add1_signing_cert +CMS_F_CMS_ADD1_SIGNING_CERT_V2:182:cms_add1_signing_cert_v2 CMS_F_CMS_COMPRESS:104:CMS_compress CMS_F_CMS_COMPRESSEDDATA_CREATE:105:cms_CompressedData_create CMS_F_CMS_COMPRESSEDDATA_INIT_BIO:106:cms_CompressedData_init_bio diff --git a/crypto/include/internal/cms_int.h b/crypto/include/internal/cms_int.h new file mode 100644 index 0000000000..c630991d68 --- /dev/null +++ b/crypto/include/internal/cms_int.h @@ -0,0 +1,13 @@ +/* + * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* internal CMS-ESS related stuff */ + +int cms_add1_signing_cert(CMS_SignerInfo *si, ESS_SIGNING_CERT *sc); +int cms_add1_signing_cert_v2(CMS_SignerInfo *si, ESS_SIGNING_CERT_V2 *sc); diff --git a/crypto/include/internal/ess_int.h b/crypto/include/internal/ess_int.h index 26476ae984..ac6c5c61d7 100644 --- a/crypto/include/internal/ess_int.h +++ b/crypto/include/internal/ess_int.h @@ -12,9 +12,18 @@ ESS_SIGNING_CERT *ESS_SIGNING_CERT_get(PKCS7_SIGNER_INFO *si); int ESS_SIGNING_CERT_add(PKCS7_SIGNER_INFO *si, ESS_SIGNING_CERT *sc); +ESS_SIGNING_CERT *ESS_SIGNING_CERT_new_init(X509 *signcert, + STACK_OF(X509) *certs, + int issuer_needed); + ESS_SIGNING_CERT_V2 *ESS_SIGNING_CERT_V2_get(PKCS7_SIGNER_INFO *si); int ESS_SIGNING_CERT_V2_add(PKCS7_SIGNER_INFO *si, ESS_SIGNING_CERT_V2 *sc); +ESS_SIGNING_CERT_V2 *ESS_SIGNING_CERT_V2_new_init(const EVP_MD *hash_alg, + X509 *signcert, + STACK_OF(X509) *certs, + int issuer_needed); + /*- * IssuerSerial ::= SEQUENCE { * issuer GeneralNames, |