Browse Source

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)
master
Rich Salz 3 years ago
committed by Tomas Mraz
parent
commit
852c2ed260
227 changed files with 797 additions and 140 deletions
  1. +5
    -0
      CHANGES.md
  2. +2
    -2
      Configurations/00-base-templates.conf
  3. +3
    -0
      apps/asn1pars.c
  4. +5
    -0
      apps/ca.c
  5. +2
    -0
      apps/ciphers.c
  6. +4
    -0
      apps/cmp_mock_srv.c
  7. +6
    -0
      apps/cms.c
  8. +5
    -0
      apps/crl2p7.c
  9. +2
    -0
      apps/dgst.c
  10. +3
    -0
      apps/engine.c
  11. +2
    -0
      apps/fipsinstall.c
  12. +2
    -0
      apps/kdf.c
  13. +11
    -0
      apps/lib/apps.c
  14. +2
    -0
      apps/lib/names.c
  15. +5
    -0
      apps/lib/s_cb.c
  16. +2
    -0
      apps/list.c
  17. +2
    -0
      apps/mac.c
  18. +2
    -0
      apps/nseq.c
  19. +5
    -0
      apps/ocsp.c
  20. +6
    -0
      apps/pkcs12.c
  21. +3
    -0
      apps/pkcs7.c
  22. +2
    -0
      apps/pkeyutl.c
  23. +2
    -0
      apps/provider.c
  24. +2
    -0
      apps/rehash.c
  25. +2
    -0
      apps/req.c
  26. +6
    -0
      apps/s_client.c
  27. +6
    -0
      apps/s_server.c
  28. +3
    -0
      apps/smime.c
  29. +4
    -0
      apps/verify.c
  30. +4
    -0
      apps/x509.c
  31. +2
    -0
      crypto/asn1/a_strnid.c
  32. +3
    -0
      crypto/asn1/asn1_gen.c
  33. +2
    -0
      crypto/asn1/asn1_lib.c
  34. +3
    -0
      crypto/asn1/asn_mime.c
  35. +2
    -0
      crypto/asn1/asn_moid.c
  36. +1
    -0
      crypto/asn1/asn_mstbl.c
  37. +1
    -0
      crypto/asn1/d2i_pr.c
  38. +1
    -0
      crypto/asn1/tasn_dec.c
  39. +2
    -0
      crypto/asn1/tasn_fre.c
  40. +2
    -0
      crypto/asn1/tasn_new.c
  41. +2
    -0
      crypto/cmp/cmp_asn.c
  42. +6
    -0
      crypto/cmp/cmp_client.c
  43. +10
    -1
      crypto/cmp/cmp_ctx.c
  44. +3
    -0
      crypto/cmp/cmp_hdr.c
  45. +2
    -0
      crypto/cmp/cmp_http.c
  46. +10
    -0
      crypto/cmp/cmp_msg.c
  47. +2
    -0
      crypto/cmp/cmp_protect.c
  48. +5
    -0
      crypto/cmp/cmp_server.c
  49. +2
    -0
      crypto/cmp/cmp_status.c
  50. +4
    -0
      crypto/cmp/cmp_util.c
  51. +2
    -0
      crypto/cmp/cmp_vfy.c
  52. +4
    -0
      crypto/cms/cms_env.c
  53. +3
    -0
      crypto/cms/cms_ess.c
  54. +2
    -0
      crypto/cms/cms_kari.c
  55. +4
    -0
      crypto/cms/cms_lib.c
  56. +2
    -0
      crypto/cms/cms_pwri.c
  57. +6
    -0
      crypto/cms/cms_sd.c
  58. +6
    -0
      crypto/cms/cms_smime.c
  59. +2
    -0
      crypto/conf/conf_api.c
  60. +2
    -0
      crypto/conf/conf_def.c
  61. +4
    -0
      crypto/conf/conf_mod.c
  62. +2
    -0
      crypto/conf/conf_ssl.c
  63. +3
    -0
      crypto/crmf/crmf_lib.c
  64. +2
    -0
      crypto/ct/ct_log.c
  65. +2
    -0
      crypto/ct/ct_oct.c
  66. +2
    -0
      crypto/ct/ct_prn.c
  67. +2
    -0
      crypto/ct/ct_sct.c
  68. +2
    -0
      crypto/ct/ct_x509v3.c
  69. +2
    -0
      crypto/dso/dso_dlfcn.c
  70. +2
    -0
      crypto/dso/dso_lib.c
  71. +2
    -0
      crypto/dso/dso_win32.c
  72. +2
    -0
      crypto/engine/eng_cnf.c
  73. +2
    -0
      crypto/engine/eng_dyn.c
  74. +5
    -0
      crypto/ess/ess_lib.c
  75. +2
    -0
      crypto/evp/evp_cnf.c
  76. +1
    -0
      crypto/evp/p_lib.c
  77. +2
    -0
      crypto/ex_data.c
  78. +2
    -0
      crypto/http/http_client.c
  79. +4
    -0
      crypto/ocsp/ocsp_cl.c
  80. +3
    -0
      crypto/ocsp/ocsp_ext.c
  81. +4
    -0
      crypto/ocsp/ocsp_prn.c
  82. +4
    -0
      crypto/ocsp/ocsp_srv.c
  83. +4
    -0
      crypto/ocsp/ocsp_vfy.c
  84. +2
    -0
      crypto/ocsp/v3_ocsp.c
  85. +2
    -0
      crypto/pem/pem_info.c
  86. +4
    -0
      crypto/pkcs12/p12_crt.c
  87. +4
    -0
      crypto/pkcs12/p12_kiss.c
  88. +3
    -0
      crypto/pkcs12/p12_npas.c
  89. +2
    -0
      crypto/pkcs7/pk7_attr.c
  90. +5
    -0
      crypto/pkcs7/pk7_doit.c
  91. +6
    -0
      crypto/pkcs7/pk7_lib.c
  92. +5
    -1
      crypto/pkcs7/pk7_smime.c
  93. +3
    -1
      crypto/provider_conf.c
  94. +4
    -0
      crypto/srp/srp_vfy.c
  95. +2
    -0
      crypto/store/loader_file.c
  96. +4
    -0
      crypto/ts/ts_conf.c
  97. +2
    -0
      crypto/ts/ts_req_utils.c
  98. +3
    -0
      crypto/ts/ts_rsp_print.c
  99. +6
    -0
      crypto/ts/ts_rsp_sign.c
  100. +2
    -0
      crypto/ts/ts_rsp_utils.c

+ 5
- 0
CHANGES.md 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


+ 2
- 2
Configurations/00-base-templates.conf 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 ];


+ 3
- 0
apps/asn1pars.c 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,


+ 5
- 0
apps/ca.c 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


+ 2
- 0
apps/ciphers.c 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,


+ 4
- 0
apps/cmp_mock_srv.c 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
{


+ 6
- 0
apps/cms.c 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);


+ 5
- 0
apps/crl2p7.c 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 {


+ 2
- 0
apps/dgst.c View File

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


+ 3
- 0
apps/engine.c 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,


+ 2
- 0
apps/fipsinstall.c 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"


+ 2
- 0
apps/kdf.c 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,


+ 11
- 0
apps/lib/apps.c 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;


+ 2
- 0
apps/lib/names.c View File

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


+ 5
- 0
apps/lib/s_cb.c 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


+ 2
- 0
apps/list.c 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,


+ 2
- 0
apps/mac.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


+ 2
- 0
apps/nseq.c 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,


+ 5
- 0
apps/ocsp.c 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


+ 6
- 0
apps/pkcs12.c 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


+ 3
- 0
apps/pkcs7.c 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,


+ 2
- 0
apps/pkeyutl.c 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


+ 2
- 0
apps/provider.c 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


+ 2
- 0
apps/rehash.c 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


+ 2
- 0
apps/req.c 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"


+ 6
- 0
apps/s_client.c 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


+ 6
- 0
apps/s_server.c 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);


+ 3
- 0
apps/smime.c 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);


+ 4
- 0
apps/verify.c 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,


+ 4
- 0
apps/x509.c 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


+ 2
- 0
crypto/asn1/a_strnid.c 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,


+ 3
- 0
crypto/asn1/asn1_gen.c 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


+ 2
- 0
crypto/asn1/asn1_lib.c 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);


+ 3
- 0
crypto/asn1/asn_mime.c 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.


+ 2
- 0
crypto/asn1/asn_moid.c 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);


+ 1
- 0
crypto/asn1/asn_mstbl.c 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);


+ 1
- 0
crypto/asn1/d2i_pr.c 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)
{


+ 1
- 0
crypto/asn1/tasn_dec.c 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)


+ 2
- 0
crypto/asn1/tasn_fre.c 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)


+ 2
- 0
crypto/asn1/tasn_new.c 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,


+ 2
- 0
crypto/cmp/cmp_asn.c 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 */


+ 6
- 0
crypto/cmp/cmp_client.c 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)


+ 10
- 1
crypto/cmp/cmp_ctx.c 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) {


+ 3
- 0
crypto/cmp/cmp_hdr.c 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))


+ 2
- 0
crypto/cmp/cmp_http.c 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().


+ 10
- 0
crypto/cmp/cmp_msg.c 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) {


+ 2
- 0
crypto/cmp/cmp_protect.c 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.
*


+ 5
- 0
crypto/cmp/cmp_server.c 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
{


+ 2
- 0
crypto/cmp/cmp_status.c 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)


+ 4
- 0
crypto/cmp/cmp_util.c 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
*/


+ 2
- 0
crypto/cmp/cmp_vfy.c 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).


+ 4
- 0
crypto/cms/cms_env.c 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);


+ 3
- 0
crypto/cms/cms_ess.c 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 */


+ 2
- 0
crypto/cms/cms_kari.c 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,


+ 4
- 0
crypto/cms/cms_lib.c 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)


+ 2
- 0
crypto/cms/cms_pwri.c 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)
{


+ 6
- 0
crypto/cms/cms_sd.c 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)


+ 6
- 0
crypto/cms/cms_smime.c 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;


+ 2
- 0
crypto/conf/conf_api.c 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);


+ 2
- 0
crypto/conf/conf_def.c 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


+ 4
- 0
crypto/conf/conf_mod.c 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"


+ 2
- 0
crypto/conf/conf_ssl.c 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.


+ 3
- 0
crypto/crmf/crmf_lib.c 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


+ 2
- 0
crypto/ct/ct_log.c View File

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


+ 2
- 0
crypto/ct/ct_oct.c 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;


+ 2
- 0
crypto/ct/ct_prn.c 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);


+ 2
- 0
crypto/ct/ct_sct.c View File

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


+ 2
- 0
crypto/ct/ct_x509v3.c 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");


+ 2
- 0
crypto/dso/dso_dlfcn.c 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


+ 2
- 0
crypto/dso/dso_lib.c 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)


+ 2
- 0
crypto/dso/dso_win32.c 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,


+ 2
- 0
crypto/engine/eng_cnf.c 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)


+ 2
- 0
crypto/engine/eng_dyn.c 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);


+ 5
- 0
crypto/ess/ess_lib.c 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);


+ 2
- 0
crypto/evp/evp_cnf.c 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 */


+ 1
- 0
crypto/evp/p_lib.c 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"


+ 2
- 0
crypto/ex_data.c 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);


+ 2
- 0
crypto/http/http_client.c 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


+ 4
- 0
crypto/ocsp/ocsp_cl.c 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.


+ 3
- 0
crypto/ocsp/ocsp_ext.c 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 */


+ 4
- 0
crypto/ocsp/ocsp_prn.c 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, "");


+ 4
- 0
crypto/ocsp/ocsp_srv.c 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.


+ 4
- 0
crypto/ocsp/ocsp_vfy.c 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);


+ 2
- 0
crypto/ocsp/v3_ocsp.c 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
*/


+ 2
- 0
crypto/pem/pem_info.c 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)


+ 4
- 0
crypto/pkcs12/p12_crt.c 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);


+ 4
- 0
crypto/pkcs12/p12_kiss.c 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,


+ 3
- 0
crypto/pkcs12/p12_npas.c 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);


+ 2
- 0
crypto/pkcs7/pk7_attr.c 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)
{


+ 5
- 0
crypto/pkcs7/pk7_doit.c 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);


+ 6
- 0
crypto/pkcs7/pk7_lib.c 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;


+ 5
- 1
crypto/pkcs7/pk7_smime.c 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,


+ 3
- 1
crypto/provider_conf.c 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)


+ 4
- 0
crypto/srp/srp_vfy.c 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


+ 2
- 0
crypto/store/loader_file.c View File

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


+ 4
- 0
crypto/ts/ts_conf.c 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"


+ 2
- 0
crypto/ts/ts_req_utils.c 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);


+ 3
- 0
crypto/ts/ts_rsp_print.c 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;


+ 6
- 0
crypto/ts/ts_rsp_sign.c 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 *);


+ 2
- 0
crypto/ts/ts_rsp_utils.c 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 changed in this diff

Loading…
Cancel
Save