In OpenSSL builds, declare STACK for datatypes ...

... and only *define* them in the source files that need them.
Use DEFINE_OR_DECLARE which is set appropriately for internal builds
and not non-deprecated builds.

Deprecate stack-of-block

Better documentation

Move some ASN1 struct typedefs to types.h

Update ParseC to handle this.  Most of all, ParseC needed to be more
consistent.  The handlers are "recursive", in so far that they are called
again and again until they terminate, which depends entirely on what the
"massager" returns.  There's a comment at the beginning of ParseC that
explains how that works. {Richard Levtte}

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10669)
This commit is contained in:
Rich Salz 2019-12-19 17:30:24 -05:00 committed by Tomas Mraz
parent 4692e98bdb
commit 852c2ed260
227 changed files with 797 additions and 140 deletions

View File

@ -417,6 +417,11 @@ OpenSSL 3.0
replaced with no-ops.
*Rich Salz*
* Added documentation for the STACK API. OpenSSL only defines the STACK
functions where they are used.
*Rich Salz*
* Introduced a new method type and API, OSSL_SERIALIZER, to
represent generic serializers. An implementation is expected to

View File

@ -10,7 +10,7 @@ my %targets=(
includes => [],
lib_cflags => "",
lib_cppflags => "",
lib_defines => [ 'OPENSSL_BUILDING_OPENSSL' ],
lib_defines => [],
thread_scheme => "(unknown)", # Assume we don't know
thread_defines => [],
@ -47,7 +47,7 @@ my %targets=(
defines =>
sub {
my @defs = ();
my @defs = ( 'OPENSSL_BUILDING_OPENSSL' );
push @defs, "ZLIB" unless $disabled{zlib};
push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
return [ @defs ];

View File

@ -18,6 +18,9 @@
#include <openssl/pem.h>
#include <openssl/asn1t.h>
DEFINE_STACK_OF(ASN1_OBJECT)
DEFINE_STACK_OF_STRING()
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
OPT_INFORM, OPT_IN, OPT_OUT, OPT_INDENT, OPT_NOOUT,

View File

@ -34,6 +34,11 @@
#include "apps.h"
#include "progs.h"
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_EXTENSION)
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF_STRING()
#ifndef W_OK
# define F_OK 0
# define W_OK 2

View File

@ -15,6 +15,8 @@
#include <openssl/err.h>
#include <openssl/ssl.h>
DEFINE_STACK_OF_CONST(SSL_CIPHER)
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
OPT_STDNAME,

View File

@ -15,6 +15,10 @@
#include <openssl/err.h>
#include <openssl/cmperr.h>
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(OSSL_CMP_ITAV)
DEFINE_STACK_OF(ASN1_UTF8STRING)
/* the context for the CMP mock server */
typedef struct
{

View File

@ -23,6 +23,12 @@
# include <openssl/x509v3.h>
# include <openssl/cms.h>
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(CMS_SignerInfo)
DEFINE_STACK_OF(GENERAL_NAME)
DEFINE_STACK_OF(GENERAL_NAMES)
DEFINE_STACK_OF_STRING()
static int save_certs(char *signerfile, STACK_OF(X509) *signers);
static int cms_cb(int ok, X509_STORE_CTX *ctx);
static void receipt_request_print(CMS_ContentInfo *cms);

View File

@ -19,6 +19,11 @@
#include <openssl/pem.h>
#include <openssl/objects.h>
DEFINE_STACK_OF(X509_CRL)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_INFO)
DEFINE_STACK_OF_STRING()
static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile);
typedef enum OPTION_choice {

View File

@ -21,6 +21,8 @@
#include <openssl/hmac.h>
#include <ctype.h>
DEFINE_STACK_OF_STRING()
#undef BUFSIZE
#define BUFSIZE 1024*8

View File

@ -19,6 +19,9 @@
#include <openssl/ssl.h>
#include <openssl/store.h>
DEFINE_STACK_OF_STRING()
DEFINE_STACK_OF_CSTRING()
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
OPT_C, OPT_T, OPT_TT, OPT_PRE, OPT_POST,

View File

@ -18,6 +18,8 @@
#include "apps.h"
#include "progs.h"
DEFINE_STACK_OF_STRING()
#define BUFSIZE 4096
#define DEFAULT_MAC_NAME "HMAC"
#define DEFAULT_FIPS_SECTION "fips_check_section"

View File

@ -17,6 +17,8 @@
#include <openssl/kdf.h>
#include <openssl/params.h>
DEFINE_STACK_OF_STRING()
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
OPT_KDFOPT, OPT_BIN, OPT_KEYLEN, OPT_OUT,

View File

@ -57,6 +57,17 @@ static int WIN32_rename(const char *from, const char *to);
#define PASS_SOURCE_SIZE_MAX 4
DEFINE_STACK_OF(CONF)
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_CRL)
DEFINE_STACK_OF(X509_INFO)
DEFINE_STACK_OF(X509_EXTENSION)
DEFINE_STACK_OF(X509_POLICY_NODE)
DEFINE_STACK_OF(GENERAL_NAME)
DEFINE_STACK_OF(DIST_POINT)
DEFINE_STACK_OF_STRING()
typedef struct {
const char *name;
unsigned long flag;

View File

@ -12,6 +12,8 @@
#include <openssl/safestack.h>
#include "names.h"
DEFINE_STACK_OF_CSTRING()
#ifdef _WIN32
# define strcasecmp _stricmp
#endif

View File

@ -26,6 +26,11 @@
#define COOKIE_SECRET_LENGTH 16
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_CRL)
DEFINE_STACK_OF(X509_NAME)
DEFINE_STACK_OF_STRING()
VERIFY_CB_ARGS verify_args = { -1, 0, X509_V_OK, 0 };
#ifndef OPENSSL_NO_SOCK

View File

@ -19,6 +19,8 @@
#include "opt.h"
#include "names.h"
DEFINE_STACK_OF_CSTRING()
static int verbose = 0;
static void legacy_cipher_fn(const EVP_CIPHER *c,

View File

@ -16,6 +16,8 @@
#include <openssl/evp.h>
#include <openssl/params.h>
DEFINE_STACK_OF_STRING()
#undef BUFSIZE
#define BUFSIZE 1024*8

View File

@ -14,6 +14,8 @@
#include <openssl/pem.h>
#include <openssl/err.h>
DEFINE_STACK_OF(X509)
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
OPT_TOSEQ, OPT_IN, OPT_OUT,

View File

@ -33,6 +33,11 @@
#include <openssl/x509v3.h>
#include <openssl/rand.h>
DEFINE_STACK_OF(OCSP_CERTID)
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF_STRING()
#ifndef HAVE_FORK
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS)
# define HAVE_FORK 0

View File

@ -19,6 +19,12 @@
#include <openssl/pem.h>
#include <openssl/pkcs12.h>
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(PKCS7)
DEFINE_STACK_OF(PKCS12_SAFEBAG)
DEFINE_STACK_OF(X509_ATTRIBUTE)
DEFINE_STACK_OF_STRING()
#define NOKEYS 0x1
#define NOCERTS 0x2
#define INFO 0x4

View File

@ -20,6 +20,9 @@
#include <openssl/pkcs7.h>
#include <openssl/pem.h>
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_CRL)
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_NOOUT,

View File

@ -15,6 +15,8 @@
#include <openssl/evp.h>
#include <sys/stat.h>
DEFINE_STACK_OF_STRING()
#define KEY_NONE 0
#define KEY_PRIVKEY 1
#define KEY_PUBKEY 2

View File

@ -20,6 +20,8 @@
#include <openssl/core.h>
#include <openssl/core_numbers.h>
DEFINE_STACK_OF_CSTRING()
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
OPT_V = 100, OPT_VV, OPT_VVV

View File

@ -42,6 +42,8 @@
# include <openssl/pem.h>
# include <openssl/x509.h>
DEFINE_STACK_OF(X509_INFO)
DEFINE_STACK_OF_STRING()
# ifndef PATH_MAX
# define PATH_MAX 4096

View File

@ -32,6 +32,8 @@
# include <openssl/dsa.h>
#endif
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF_STRING()
#define BITS "default_bits"
#define KEYFILE "default_keyfile"

View File

@ -56,6 +56,12 @@ typedef unsigned int u_int;
# endif
#endif
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_CRL)
DEFINE_STACK_OF(X509_NAME)
DEFINE_STACK_OF(SCT)
DEFINE_STACK_OF_STRING()
#undef BUFSIZZ
#define BUFSIZZ 1024*8
#define S_CLIENT_IRC_READ_TIMEOUT 8

View File

@ -60,6 +60,12 @@ typedef unsigned int u_int;
#endif
#include "internal/sockets.h"
DEFINE_STACK_OF(X509_EXTENSION)
DEFINE_STACK_OF(X509_CRL)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(SSL_CIPHER)
DEFINE_STACK_OF_STRING()
static int not_resumable_sess_cb(SSL *s, int is_forward_secure);
static int sv_body(int s, int stype, int prot, unsigned char *context);
static int www_body(int s, int stype, int prot, unsigned char *context);

View File

@ -19,6 +19,9 @@
#include <openssl/x509_vfy.h>
#include <openssl/x509v3.h>
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF_STRING()
static int save_certs(char *signerfile, STACK_OF(X509) *signers);
static int smime_cb(int ok, X509_STORE_CTX *ctx);

View File

@ -18,6 +18,10 @@
#include <openssl/x509v3.h>
#include <openssl/pem.h>
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_CRL)
DEFINE_STACK_OF_STRING()
static int cb(int ok, X509_STORE_CTX *ctx);
static int check(X509_STORE *ctx, const char *file,
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,

View File

@ -28,6 +28,10 @@
# include <openssl/dsa.h>
#endif
DEFINE_STACK_OF(ASN1_OBJECT)
DEFINE_STACK_OF(X509_EXTENSION)
DEFINE_STACK_OF_STRING()
#undef POSTFIX
#define POSTFIX ".srl"
#define DEF_DAYS 30

View File

@ -12,6 +12,8 @@
#include <openssl/asn1.h>
#include <openssl/objects.h>
DEFINE_STACK_OF(ASN1_STRING_TABLE)
static STACK_OF(ASN1_STRING_TABLE) *stable = NULL;
static void st_free(ASN1_STRING_TABLE *tbl);
static int sk_table_cmp(const ASN1_STRING_TABLE *const *a,

View File

@ -23,6 +23,9 @@
#define ASN1_GEN_STR(str,val) {str, sizeof(str) - 1, val}
DEFINE_STACK_OF(ASN1_TYPE)
DEFINE_STACK_OF(CONF_VALUE)
#define ASN1_FLAG_EXP_MAX 20
/* Maximum number of nested sequences */
#define ASN1_GEN_SEQ_MAX_DEPTH 50

View File

@ -13,6 +13,8 @@
#include <openssl/asn1.h>
#include "asn1_local.h"
DEFINE_STACK_OF(ASN1_UTF8STRING)
static int asn1_get_length(const unsigned char **pp, int *inf, long *rl,
long max);
static void asn1_put_length(unsigned char **pp, int length);

View File

@ -18,6 +18,9 @@
#include "internal/bio.h"
#include "asn1_local.h"
DEFINE_STACK_OF(BIO)
DEFINE_STACK_OF(X509_ALGOR)
/*
* Generalised MIME like utilities for streaming ASN1. Although many have a
* PKCS7/CMS like flavour others are more general purpose.

View File

@ -16,6 +16,8 @@
#include "crypto/asn1.h"
#include "crypto/objects.h"
DEFINE_STACK_OF(CONF_VALUE)
/* Simple ASN1 OID module: add all objects in a given section */
static int do_create(const char *value, const char *name);

View File

@ -13,6 +13,7 @@
#include <openssl/conf.h>
#include <openssl/x509v3.h>
DEFINE_STACK_OF(CONF_VALUE)
/* Multi string module: add table entries from a given section */
static int do_tcreate(const char *value, const char *name);

View File

@ -18,6 +18,7 @@
#include "crypto/asn1.h"
#include "crypto/evp.h"
DEFINE_STACK_OF(ASN1_TYPE)
EVP_PKEY *d2i_PrivateKey_ex(int type, EVP_PKEY **a, const unsigned char **pp,
long length, OPENSSL_CTX *libctx, const char *propq)
{

View File

@ -17,6 +17,7 @@
#include "internal/numbers.h"
#include "asn1_local.h"
DEFINE_STACK_OF(ASN1_VALUE)
/*
* Constructed types with a recursive definition (such as can be found in PKCS7)

View File

@ -13,6 +13,8 @@
#include <openssl/objects.h>
#include "asn1_local.h"
DEFINE_STACK_OF(ASN1_VALUE)
/* Free up an ASN1 structure */
void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it)

View File

@ -15,6 +15,8 @@
#include <string.h>
#include "asn1_local.h"
DEFINE_STACK_OF(ASN1_VALUE)
static int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
int embed);
static int asn1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it,

View File

@ -17,6 +17,8 @@
#include <openssl/cmp.h>
#include <openssl/crmf.h>
DEFINE_STACK_OF(OSSL_CMP_ITAV)
/* ASN.1 declarations from RFC4210 */
ASN1_SEQUENCE(OSSL_CMP_REVANNCONTENT) = {
/* OSSL_CMP_PKISTATUS is effectively ASN1_INTEGER so it is used directly */

View File

@ -21,6 +21,12 @@
#include "openssl/cmp_util.h"
DEFINE_STACK_OF(ASN1_UTF8STRING)
DEFINE_STACK_OF(X509_CRL)
DEFINE_STACK_OF(OSSL_CMP_CERTRESPONSE)
DEFINE_STACK_OF(OSSL_CMP_PKISI)
DEFINE_STACK_OF(OSSL_CRMF_CERTID)
#define IS_CREP(t) ((t) == OSSL_CMP_PKIBODY_IP || (t) == OSSL_CMP_PKIBODY_CP \
|| (t) == OSSL_CMP_PKIBODY_KUP)

View File

@ -20,7 +20,16 @@
#include <openssl/crmf.h>
#include <openssl/err.h>
/* Get current certificate store containing trusted root CA certs */
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_EXTENSION)
DEFINE_STACK_OF(POLICYINFO)
DEFINE_STACK_OF(ASN1_UTF8STRING)
DEFINE_STACK_OF(GENERAL_NAME)
DEFINE_STACK_OF(OSSL_CMP_ITAV)
/*
* Get current certificate store containing trusted root CA certs
*/
X509_STORE *OSSL_CMP_CTX_get0_trustedStore(const OSSL_CMP_CTX *ctx)
{
if (ctx == NULL) {

View File

@ -20,6 +20,9 @@
#include <openssl/cmp.h>
#include <openssl/err.h>
DEFINE_STACK_OF(ASN1_UTF8STRING)
DEFINE_STACK_OF(OSSL_CMP_ITAV)
int ossl_cmp_hdr_set_pvno(OSSL_CMP_PKIHEADER *hdr, int pvno)
{
if (!ossl_assert(hdr != NULL))

View File

@ -28,6 +28,8 @@
#include <openssl/cmp.h>
#include <openssl/err.h>
DEFINE_STACK_OF(CONF_VALUE)
/*
* Send the PKIMessage req and on success return the response, else NULL.
* Any previous error queue entries will likely be removed by ERR_clear_error().

View File

@ -20,6 +20,16 @@
#include <openssl/err.h>
#include <openssl/x509.h>
DEFINE_STACK_OF(OSSL_CMP_CERTSTATUS)
DEFINE_STACK_OF(OSSL_CMP_ITAV)
DEFINE_STACK_OF(GENERAL_NAME)
DEFINE_STACK_OF(X509_EXTENSION)
DEFINE_STACK_OF(OSSL_CMP_PKISI)
DEFINE_STACK_OF(OSSL_CRMF_MSG)
DEFINE_STACK_OF(OSSL_CMP_CERTRESPONSE)
DEFINE_STACK_OF(OSSL_CRMF_CERTID)
DEFINE_STACK_OF(ASN1_UTF8STRING)
OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg)
{
if (msg == NULL) {

View File

@ -18,6 +18,8 @@
#include <openssl/err.h>
#include <openssl/x509.h>
DEFINE_STACK_OF(X509)
/*
* This function is also used for verification from cmp_vfy.
*

View File

@ -19,6 +19,11 @@
#include <openssl/cmp.h>
#include <openssl/err.h>
DEFINE_STACK_OF(OSSL_CRMF_MSG)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(OSSL_CMP_ITAV)
DEFINE_STACK_OF(OSSL_CMP_CERTSTATUS)
/* the context for the generic CMP server */
struct ossl_cmp_srv_ctx_st
{

View File

@ -26,6 +26,8 @@
#include <openssl/x509.h>
#include <openssl/asn1err.h> /* for ASN1_R_TOO_SMALL and ASN1_R_TOO_LARGE */
DEFINE_STACK_OF(ASN1_UTF8STRING)
/* CMP functions related to PKIStatus */
int ossl_cmp_pkisi_get_status(const OSSL_CMP_PKISI *si)

View File

@ -16,6 +16,10 @@
#include <openssl/err.h> /* should be implied by cmperr.h */
#include <openssl/x509v3.h>
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_OBJECT)
DEFINE_STACK_OF(ASN1_UTF8STRING)
/*
* use trace API for CMP-specific logging, prefixed by "CMP " and severity
*/

View File

@ -22,6 +22,8 @@
#include <openssl/x509.h>
#include "crypto/x509.h"
DEFINE_STACK_OF(X509)
/*
* Verify a message protected by signature according to section 5.1.3.3
* (sha1+RSA/DSA or any other algorithm supported by OpenSSL).

View File

@ -18,6 +18,10 @@
#include "crypto/asn1.h"
#include "crypto/evp.h"
DEFINE_STACK_OF(CMS_RecipientInfo)
DEFINE_STACK_OF(CMS_RevocationInfoChoice)
DEFINE_STACK_OF(X509_ATTRIBUTE)
/* CMS EnvelopedData Utilities */
static void cms_env_set_version(CMS_EnvelopedData *env);

View File

@ -19,6 +19,9 @@
#include "crypto/ess.h"
#include "crypto/cms.h"
DEFINE_STACK_OF(GENERAL_NAMES)
DEFINE_STACK_OF(CMS_SignerInfo)
IMPLEMENT_ASN1_FUNCTIONS(CMS_ReceiptRequest)
/* ESS services */

View File

@ -17,6 +17,8 @@
#include "cms_local.h"
#include "crypto/asn1.h"
DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
/* Key Agreement Recipient Info (KARI) routines */
int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,

View File

@ -16,6 +16,10 @@
#include <openssl/cms.h>
#include "cms_local.h"
DEFINE_STACK_OF(CMS_RevocationInfoChoice)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_CRL)
IMPLEMENT_ASN1_FUNCTIONS(CMS_ContentInfo)
IMPLEMENT_ASN1_PRINT_FUNCTION(CMS_ContentInfo)

View File

@ -18,6 +18,8 @@
#include "cms_local.h"
#include "crypto/asn1.h"
DEFINE_STACK_OF(CMS_RecipientInfo)
int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
unsigned char *pass, ossl_ssize_t passlen)
{

View File

@ -21,6 +21,12 @@
#include "crypto/cms.h"
#include "crypto/ess.h"
DEFINE_STACK_OF(CMS_RevocationInfoChoice)
DEFINE_STACK_OF(CMS_SignerInfo)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_ALGOR)
DEFINE_STACK_OF(X509_ATTRIBUTE)
/* CMS SignedData Utilities */
static CMS_SignedData *cms_get0_signed(CMS_ContentInfo *cms)

View File

@ -16,6 +16,12 @@
#include "cms_local.h"
#include "crypto/asn1.h"
DEFINE_STACK_OF(CMS_SignerInfo)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_CRL)
DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
DEFINE_STACK_OF(CMS_RecipientInfo)
static BIO *cms_get_text_bio(BIO *out, unsigned int flags)
{
BIO *rbio;

View File

@ -16,6 +16,8 @@
#include <openssl/conf.h>
#include <openssl/conf_api.h>
DEFINE_STACK_OF(CONF_VALUE)
static void value_free_hash(const CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf);
static void value_free_stack_doall(CONF_VALUE *a);

View File

@ -27,6 +27,8 @@
# endif
#endif
DEFINE_STACK_OF(BIO)
#ifndef S_ISDIR
# define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR)
#endif

View File

@ -18,6 +18,10 @@
#include <openssl/trace.h>
#include <openssl/engine.h>
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(CONF_MODULE)
DEFINE_STACK_OF(CONF_IMODULE)
#define DSO_mod_init_name "OPENSSL_init"
#define DSO_mod_finish_name "OPENSSL_finish"

View File

@ -14,6 +14,8 @@
#include "internal/sslconf.h"
#include "conf_local.h"
DEFINE_STACK_OF(CONF_VALUE)
/*
* SSL library configuration module placeholder. We load it here but defer
* all decisions about its contents to libssl.

View File

@ -36,6 +36,9 @@
#include <openssl/err.h>
#include <openssl/evp.h>
DEFINE_STACK_OF(X509_EXTENSION)
DEFINE_STACK_OF(OSSL_CRMF_MSG)
/*-
* atyp = Attribute Type
* valt = Value Type

View File

@ -18,6 +18,8 @@
#include "internal/cryptlib.h"
DEFINE_STACK_OF(CTLOG)
/*
* Information about a CT log server.
*/

View File

@ -21,6 +21,8 @@
#include "ct_local.h"
DEFINE_STACK_OF(SCT)
int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len)
{
size_t siglen;

View File

@ -16,6 +16,8 @@
#include "ct_local.h"
DEFINE_STACK_OF(SCT)
static void SCT_signature_algorithms_print(const SCT *sct, BIO *out)
{
int nid = SCT_get_signature_nid(sct);

View File

@ -19,6 +19,8 @@
#include "ct_local.h"
DEFINE_STACK_OF(SCT)
SCT *SCT_new(void)
{
SCT *sct = OPENSSL_zalloc(sizeof(*sct));

View File

@ -13,6 +13,8 @@
#include "ct_local.h"
DEFINE_STACK_OF(SCT)
static char *i2s_poison(const X509V3_EXT_METHOD *method, void *val)
{
return OPENSSL_strdup("NULL");

View File

@ -19,6 +19,8 @@
#include "dso_local.h"
#include "e_os.h"
DEFINE_STACK_OF(void)
#ifdef DSO_DLFCN
# ifdef HAVE_DLFCN_H

View File

@ -10,6 +10,8 @@
#include "dso_local.h"
#include "internal/refcount.h"
DEFINE_STACK_OF(void)
static DSO_METHOD *default_DSO_meth = NULL;
static DSO *DSO_new_method(DSO_METHOD *meth)

View File

@ -69,6 +69,8 @@ static void *win32_globallookup(const char *name);
static const char *openssl_strnchr(const char *string, int c, size_t len);
DEFINE_STACK_OF(void)
static DSO_METHOD dso_meth_win32 = {
"OpenSSL 'win32' shared library method",
win32_load,

View File

@ -11,6 +11,8 @@
#include <openssl/conf.h>
#include <openssl/trace.h>
DEFINE_STACK_OF(CONF_VALUE)
/* ENGINE config module */
static const char *skip_dot(const char *name)

View File

@ -17,6 +17,8 @@
* prototypes.
*/
DEFINE_STACK_OF_STRING()
/* Our ENGINE handlers */
static int dynamic_init(ENGINE *e);
static int dynamic_finish(ENGINE *e);

View File

@ -13,6 +13,11 @@
#include <openssl/ess.h>
#include "crypto/ess.h"
DEFINE_STACK_OF(ESS_CERT_ID)
DEFINE_STACK_OF(ESS_CERT_ID_V2)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(GENERAL_NAME)
static ESS_CERT_ID *ESS_CERT_ID_new_init(X509 *cert, int issuer_needed);
static ESS_CERT_ID_V2 *ESS_CERT_ID_V2_new_init(const EVP_MD *hash_alg,
X509 *cert, int issuer_needed);

View File

@ -15,6 +15,8 @@
#include <openssl/x509v3.h>
#include <openssl/trace.h>
DEFINE_STACK_OF(CONF_VALUE)
/* Algorithm configuration module. */
/* TODO(3.0): the config module functions should be passed a library context */

View File

@ -36,6 +36,7 @@
#include "internal/evp.h"
#include "internal/provider.h"
#include "evp_local.h"
DEFINE_STACK_OF(X509_ATTRIBUTE)
#include "crypto/ec.h"

View File

@ -10,6 +10,8 @@
#include "crypto/cryptlib.h"
#include "internal/thread_once.h"
DEFINE_STACK_OF(void)
int do_ex_data_init(OPENSSL_CTX *ctx)
{
OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(ctx);

View File

@ -25,6 +25,8 @@
#include "http_local.h"
DEFINE_STACK_OF(CONF_VALUE)
#define HTTP_PREFIX "HTTP/"
#define HTTP_VERSION_PATT "1." /* allow 1.x */
#define HTTP_VERSION_STR_LEN 3

View File

@ -18,6 +18,10 @@
#include <openssl/ocsp.h>
#include "ocsp_local.h"
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(OCSP_ONEREQ)
DEFINE_STACK_OF(OCSP_SINGLERESP)
/*
* Utility functions related to sending OCSP requests and extracting relevant
* information from the response.

View File

@ -16,6 +16,9 @@
#include <openssl/rand.h>
#include <openssl/x509v3.h>
DEFINE_STACK_OF(ASN1_OBJECT)
DEFINE_STACK_OF(ACCESS_DESCRIPTION)
/* Standard wrapper functions for extensions */
/* OCSP request extensions */

View File

@ -14,6 +14,10 @@
#include "internal/cryptlib.h"
#include <openssl/pem.h>
DEFINE_STACK_OF(OCSP_ONEREQ)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(OCSP_SINGLERESP)
static int ocsp_certid_print(BIO *bp, OCSP_CERTID *a, int indent)
{
BIO_printf(bp, "%*sCertificate ID:\n", indent, "");

View File

@ -16,6 +16,10 @@
#include <openssl/ocsp.h>
#include "ocsp_local.h"
DEFINE_STACK_OF(OCSP_ONEREQ)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(OCSP_SINGLERESP)
/*
* Utility functions related to sending OCSP responses and extracting
* relevant information from the request.

View File

@ -12,6 +12,10 @@
#include <openssl/err.h>
#include <string.h>
DEFINE_STACK_OF(OCSP_ONEREQ)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(OCSP_SINGLERESP)
static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs,
STACK_OF(X509) *certs, unsigned long flags);
static X509 *ocsp_find_signer_sk(STACK_OF(X509) *certs, OCSP_RESPID *id);

View File

@ -16,6 +16,8 @@
# include <openssl/x509v3.h>
# include "../x509/ext_dat.h"
DEFINE_STACK_OF(ACCESS_DESCRIPTION)
/*
* OCSP extensions and a couple of CRL entry extensions
*/

View File

@ -23,6 +23,8 @@
#include <openssl/rsa.h>
#include <openssl/dsa.h>
DEFINE_STACK_OF(X509_INFO)
#ifndef OPENSSL_NO_STDIO
STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
pem_password_cb *cb, void *u)

View File

@ -12,6 +12,10 @@
#include <openssl/pkcs12.h>
#include "p12_local.h"
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(PKCS7)
DEFINE_STACK_OF(PKCS12_SAFEBAG)
static int pkcs12_add_bag(STACK_OF(PKCS12_SAFEBAG) **pbags,
PKCS12_SAFEBAG *bag);

View File

@ -11,6 +11,10 @@
#include "internal/cryptlib.h"
#include <openssl/pkcs12.h>
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(PKCS7)
DEFINE_STACK_OF(PKCS12_SAFEBAG)
/* Simplified PKCS#12 routines */
static int parse_pk12(PKCS12 *p12, const char *pass, int passlen,

View File

@ -15,6 +15,9 @@
#include <openssl/pkcs12.h>
#include "p12_local.h"
DEFINE_STACK_OF(PKCS7)
DEFINE_STACK_OF(PKCS12_SAFEBAG)
/* PKCS#12 password change routine */
static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass);

View File

@ -17,6 +17,8 @@
#include <openssl/x509.h>
#include <openssl/err.h>
DEFINE_STACK_OF(X509_ALGOR)
int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
STACK_OF(X509_ALGOR) *cap)
{

View File

@ -15,6 +15,11 @@
#include <openssl/x509v3.h>
#include <openssl/err.h>
DEFINE_STACK_OF(X509_ALGOR)
DEFINE_STACK_OF(X509_ATTRIBUTE)
DEFINE_STACK_OF(PKCS7_RECIP_INFO)
DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
void *value);
static ASN1_TYPE *get_attribute(STACK_OF(X509_ATTRIBUTE) *sk, int nid);

View File

@ -14,6 +14,12 @@
#include "crypto/asn1.h"
#include "crypto/evp.h"
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_CRL)
DEFINE_STACK_OF(X509_ALGOR)
DEFINE_STACK_OF(PKCS7_RECIP_INFO)
DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg)
{
int nid;

View File

@ -14,9 +14,13 @@
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#define BUFFERSIZE 4096
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_ATTRIBUTE)
DEFINE_STACK_OF(X509_ALGOR)
DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,

View File

@ -14,9 +14,11 @@
#include <openssl/safestack.h>
#include "internal/provider.h"
DEFINE_STACK_OF(OSSL_PROVIDER)
DEFINE_STACK_OF(CONF_VALUE)
/* PROVIDER config module */
DEFINE_STACK_OF(OSSL_PROVIDER)
static STACK_OF(OSSL_PROVIDER) *activated_providers = NULL;
static const char *skip_dot(const char *name)

View File

@ -25,6 +25,10 @@
# define SRP_RANDOM_SALT_LEN 20
# define MAX_LEN 2500
DEFINE_STACK_OF(SRP_user_pwd)
DEFINE_STACK_OF(SRP_gN_cache)
DEFINE_STACK_OF(SRP_gN)
/*
* Note that SRP uses its own variant of base 64 encoding. A different base64
* alphabet is used and no padding '=' characters are added. Instead we pad to

View File

@ -32,6 +32,8 @@
#include "crypto/evp.h"
#include "store_local.h"
DEFINE_STACK_OF(X509)
#ifdef _WIN32
# define stat _stat
#endif

View File

@ -15,6 +15,10 @@
#include <openssl/engine.h>
#include <openssl/ts.h>
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_INFO)
DEFINE_STACK_OF(CONF_VALUE)
/* Macro definitions for the configuration file. */
#define BASE_SECTION "tsa"
#define ENV_DEFAULT_TSA "default_tsa"

View File

@ -14,6 +14,8 @@
#include <openssl/ts.h>
#include "ts_local.h"
DEFINE_STACK_OF(X509_EXTENSION)
int TS_REQ_set_version(TS_REQ *a, long version)
{
return ASN1_INTEGER_set(a->version, version);

View File

@ -15,6 +15,9 @@
#include <openssl/ts.h>
#include "ts_local.h"
DEFINE_STACK_OF(ASN1_UTF8STRING)
DEFINE_STACK_OF(CONF_VALUE)
struct status_map_st {
int bit;
const char *text;

View File

@ -17,6 +17,12 @@
#include "ts_local.h"
#include "crypto/ess.h"
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_EXTENSION)
DEFINE_STACK_OF(ASN1_UTF8STRING)
DEFINE_STACK_OF(ASN1_OBJECT)
DEFINE_STACK_OF_CONST(EVP_MD)
static ASN1_INTEGER *def_serial_cb(struct TS_resp_ctx *, void *);
static int def_time_cb(struct TS_resp_ctx *, void *, long *sec, long *usec);
static int def_extension_cb(struct TS_resp_ctx *, X509_EXTENSION *, void *);

View File

@ -14,6 +14,8 @@
#include <openssl/pkcs7.h>
#include "ts_local.h"
DEFINE_STACK_OF(X509_EXTENSION)
int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *status_info)
{
TS_STATUS_INFO *new_status_info;

Some files were not shown because too many files have changed in this diff Show More