Browse Source

Fix safestack issues in asn1.h

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12781)
master
Matt Caswell 1 year ago
parent
commit
b4780134df
44 changed files with 36 additions and 71 deletions
  1. +2
    -1
      .gitignore
  2. +0
    -2
      apps/asn1pars.c
  3. +0
    -1
      apps/cmp_mock_srv.c
  4. +0
    -2
      apps/x509.c
  5. +5
    -2
      build.info
  6. +0
    -2
      crypto/asn1/a_strnid.c
  7. +0
    -1
      crypto/asn1/asn1_gen.c
  8. +0
    -2
      crypto/asn1/asn1_lib.c
  9. +0
    -1
      crypto/asn1/asn_mime.c
  10. +0
    -1
      crypto/asn1/d2i_pr.c
  11. +0
    -1
      crypto/cmp/cmp_client.c
  12. +0
    -1
      crypto/cmp/cmp_ctx.c
  13. +0
    -1
      crypto/cmp/cmp_hdr.c
  14. +0
    -1
      crypto/cmp/cmp_msg.c
  15. +0
    -2
      crypto/cmp/cmp_status.c
  16. +0
    -1
      crypto/cmp/cmp_util.c
  17. +0
    -1
      crypto/cms/cms_sd.c
  18. +0
    -2
      crypto/ocsp/ocsp_ext.c
  19. +0
    -2
      crypto/pkcs7/pk7_attr.c
  20. +0
    -1
      crypto/pkcs7/pk7_doit.c
  21. +0
    -1
      crypto/pkcs7/pk7_lib.c
  22. +0
    -1
      crypto/pkcs7/pk7_smime.c
  23. +0
    -1
      crypto/ts/ts_rsp_print.c
  24. +0
    -2
      crypto/ts/ts_rsp_sign.c
  25. +0
    -1
      crypto/ts/ts_rsp_verify.c
  26. +0
    -2
      crypto/x509/pcy_data.c
  27. +0
    -2
      crypto/x509/pcy_map.c
  28. +0
    -2
      crypto/x509/pcy_node.c
  29. +0
    -2
      crypto/x509/pcy_tree.c
  30. +0
    -2
      crypto/x509/t_x509.c
  31. +0
    -2
      crypto/x509/v3_admis.c
  32. +0
    -1
      crypto/x509/v3_cpols.c
  33. +0
    -1
      crypto/x509/v3_extku.c
  34. +0
    -2
      crypto/x509/v3_purp.c
  35. +0
    -1
      crypto/x509/v3_tlsf.c
  36. +0
    -2
      crypto/x509/x509_att.c
  37. +0
    -2
      crypto/x509/x509_trs.c
  38. +0
    -1
      crypto/x509/x509_vpm.c
  39. +0
    -2
      crypto/x509/x_attrib.c
  40. +0
    -2
      crypto/x509/x_x509a.c
  41. +29
    -7
      include/openssl/asn1.h.in
  42. +0
    -1
      test/cmp_ctx_test.c
  43. +0
    -1
      test/cmp_hdr_test.c
  44. +0
    -2
      test/cmp_status_test.c

+ 2
- 1
.gitignore View File

@ -22,9 +22,10 @@
# Auto generated headers
/crypto/buildinf.h
/include/crypto/*_conf.h
/include/openssl/asn1.h
/include/openssl/configuration.h
/include/openssl/opensslv.h
/include/openssl/fipskey.h
/include/openssl/opensslv.h
/include/openssl/safestack.h
/include/openssl/ssl.h
/include/openssl/x509.h


+ 0
- 2
apps/asn1pars.c View File

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


+ 0
- 1
apps/cmp_mock_srv.c View File

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


+ 0
- 2
apps/x509.c View File

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


+ 5
- 2
build.info View File

@ -13,8 +13,10 @@ DEPEND[libssl]=libcrypto
# Empty DEPEND "indices" means the dependencies are expected to be built
# unconditionally before anything else.
DEPEND[]=include/openssl/configuration.h include/openssl/opensslv.h \
DEPEND[]=include/openssl/asn1.h \
include/openssl/configuration.h \
include/openssl/fipskey.h \
include/openssl/opensslv.h \
include/openssl/safestack.h \
include/openssl/ssl.h \
include/openssl/x509.h \
@ -22,9 +24,10 @@ DEPEND[]=include/openssl/configuration.h include/openssl/opensslv.h \
include/crypto/bn_conf.h include/crypto/dso_conf.h \
doc/man7/openssl_user_macros.pod
GENERATE[include/openssl/asn1.h]=include/openssl/asn1.h.in
GENERATE[include/openssl/configuration.h]=include/openssl/configuration.h.in
GENERATE[include/openssl/opensslv.h]=include/openssl/opensslv.h.in
GENERATE[include/openssl/fipskey.h]=include/openssl/fipskey.h.in
GENERATE[include/openssl/opensslv.h]=include/openssl/opensslv.h.in
GENERATE[include/openssl/safestack.h]=include/openssl/safestack.h.in
GENERATE[include/openssl/ssl.h]=include/openssl/ssl.h.in
GENERATE[include/openssl/x509.h]=include/openssl/x509.h.in


+ 0
- 2
crypto/asn1/a_strnid.c View File

@ -12,8 +12,6 @@
#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,


+ 0
- 1
crypto/asn1/asn1_gen.c View File

@ -23,7 +23,6 @@
#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


+ 0
- 2
crypto/asn1/asn1_lib.c View File

@ -13,8 +13,6 @@
#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);


+ 0
- 1
crypto/asn1/asn_mime.c View File

@ -20,7 +20,6 @@
#include "asn1_local.h"
DEFINE_STACK_OF(BIO)
DEFINE_STACK_OF(X509_ALGOR)
/*
* Generalised MIME like utilities for streaming ASN1. Although many have a


+ 0
- 1
crypto/asn1/d2i_pr.c View File

@ -21,7 +21,6 @@
#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)
{


+ 0
- 1
crypto/cmp/cmp_client.c View File

@ -21,7 +21,6 @@
#include "openssl/cmp_util.h"
DEFINE_STACK_OF(ASN1_UTF8STRING)
DEFINE_STACK_OF(OSSL_CMP_CERTRESPONSE)
DEFINE_STACK_OF(OSSL_CMP_PKISI)
DEFINE_STACK_OF(OSSL_CRMF_CERTID)


+ 0
- 1
crypto/cmp/cmp_ctx.c View File

@ -21,7 +21,6 @@
#include <openssl/crmf.h>
#include <openssl/err.h>
DEFINE_STACK_OF(ASN1_UTF8STRING)
DEFINE_STACK_OF(OSSL_CMP_ITAV)
/*


+ 0
- 1
crypto/cmp/cmp_hdr.c View File

@ -20,7 +20,6 @@
#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)


+ 0
- 1
crypto/cmp/cmp_msg.c View File

@ -27,7 +27,6 @@ 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)
{


+ 0
- 2
crypto/cmp/cmp_status.c View File

@ -26,8 +26,6 @@
#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)


+ 0
- 1
crypto/cmp/cmp_util.c View File

@ -17,7 +17,6 @@
#include <openssl/x509v3.h>
DEFINE_STACK_OF(X509_OBJECT)
DEFINE_STACK_OF(ASN1_UTF8STRING)
/*
* use trace API for CMP-specific logging, prefixed by "CMP " and severity


+ 0
- 1
crypto/cms/cms_sd.c View File

@ -24,7 +24,6 @@
DEFINE_STACK_OF(CMS_RevocationInfoChoice)
DEFINE_STACK_OF(CMS_SignerInfo)
DEFINE_STACK_OF(X509_ALGOR)
/* CMS SignedData Utilities */


+ 0
- 2
crypto/ocsp/ocsp_ext.c View File

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


+ 0
- 2
crypto/pkcs7/pk7_attr.c View File

@ -17,8 +17,6 @@
#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)
{


+ 0
- 1
crypto/pkcs7/pk7_doit.c View File

@ -16,7 +16,6 @@
#include <openssl/err.h>
#include "pk7_local.h"
DEFINE_STACK_OF(X509_ALGOR)
DEFINE_STACK_OF(PKCS7_RECIP_INFO)
DEFINE_STACK_OF(PKCS7_SIGNER_INFO)


+ 0
- 1
crypto/pkcs7/pk7_lib.c View File

@ -16,7 +16,6 @@
#include "crypto/x509.h" /* for sk_X509_add1_cert() */
#include "pk7_local.h"
DEFINE_STACK_OF(X509_ALGOR)
DEFINE_STACK_OF(PKCS7_RECIP_INFO)
DEFINE_STACK_OF(PKCS7_SIGNER_INFO)


+ 0
- 1
crypto/pkcs7/pk7_smime.c View File

@ -17,7 +17,6 @@
#define BUFFERSIZE 4096
DEFINE_STACK_OF(X509_ALGOR)
DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si);


+ 0
- 1
crypto/ts/ts_rsp_print.c View File

@ -15,7 +15,6 @@
#include <openssl/ts.h>
#include "ts_local.h"
DEFINE_STACK_OF(ASN1_UTF8STRING)
DEFINE_STACK_OF(CONF_VALUE)
struct status_map_st {


+ 0
- 2
crypto/ts/ts_rsp_sign.c View File

@ -17,8 +17,6 @@
#include "ts_local.h"
#include "crypto/ess.h"
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 *);


+ 0
- 1
crypto/ts/ts_rsp_verify.c View File

@ -18,7 +18,6 @@
DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
DEFINE_STACK_OF(ESS_CERT_ID)
DEFINE_STACK_OF(ESS_CERT_ID_V2)
DEFINE_STACK_OF(ASN1_UTF8STRING)
static int ts_verify_cert(X509_STORE *store, STACK_OF(X509) *untrusted,
X509 *signer, STACK_OF(X509) **chain);


+ 0
- 2
crypto/x509/pcy_data.c View File

@ -13,8 +13,6 @@
#include "pcy_local.h"
DEFINE_STACK_OF(ASN1_OBJECT)
/* Policy Node routines */
void policy_data_free(X509_POLICY_DATA *data)


+ 0
- 2
crypto/x509/pcy_map.c View File

@ -14,8 +14,6 @@
#include "pcy_local.h"
DEFINE_STACK_OF(ASN1_OBJECT)
/*
* Set policy mapping entries in cache. Note: this modifies the passed
* POLICY_MAPPINGS structure


+ 0
- 2
crypto/x509/pcy_node.c View File

@ -14,8 +14,6 @@
#include "pcy_local.h"
DEFINE_STACK_OF(ASN1_OBJECT)
static int node_cmp(const X509_POLICY_NODE *const *a,
const X509_POLICY_NODE *const *b)
{


+ 0
- 2
crypto/x509/pcy_tree.c View File

@ -14,8 +14,6 @@
#include "pcy_local.h"
DEFINE_STACK_OF(ASN1_OBJECT)
static void expected_print(BIO *channel,
X509_POLICY_LEVEL *lev, X509_POLICY_NODE *node,
int indent)


+ 0
- 2
crypto/x509/t_x509.c View File

@ -17,8 +17,6 @@
#include "crypto/asn1.h"
#include "crypto/x509.h"
DEFINE_STACK_OF(ASN1_OBJECT)
#ifndef OPENSSL_NO_STDIO
int X509_print_fp(FILE *fp, X509 *x)
{


+ 0
- 2
crypto/x509/v3_admis.c View File

@ -20,8 +20,6 @@
#include "v3_admis.h"
#include "ext_dat.h"
DEFINE_STACK_OF(ASN1_OBJECT)
ASN1_SEQUENCE(NAMING_AUTHORITY) = {
ASN1_OPT(NAMING_AUTHORITY, namingAuthorityId, ASN1_OBJECT),
ASN1_OPT(NAMING_AUTHORITY, namingAuthorityUrl, ASN1_IA5STRING),


+ 0
- 1
crypto/x509/v3_cpols.c View File

@ -19,7 +19,6 @@
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(ASN1_INTEGER)
/* Certificate policies extension support: this one is a bit complex... */


+ 0
- 1
crypto/x509/v3_extku.c View File

@ -14,7 +14,6 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(ASN1_OBJECT)
DEFINE_STACK_OF(CONF_VALUE)
static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method,


+ 0
- 2
crypto/x509/v3_purp.c View File

@ -16,8 +16,6 @@
#include "internal/tsan_assist.h"
#include "x509_local.h"
DEFINE_STACK_OF(ASN1_OBJECT)
static int check_ssl_ca(const X509 *x);
static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x,
int ca);


+ 0
- 1
crypto/x509/v3_tlsf.c View File

@ -16,7 +16,6 @@
#include "ext_dat.h"
#include "x509_local.h"
DEFINE_STACK_OF(ASN1_INTEGER)
DEFINE_STACK_OF(CONF_VALUE)
static STACK_OF(CONF_VALUE) *i2v_TLS_FEATURE(const X509V3_EXT_METHOD *method,


+ 0
- 2
crypto/x509/x509_att.c View File

@ -17,8 +17,6 @@
#include <openssl/x509v3.h>
#include "x509_local.h"
DEFINE_STACK_OF(ASN1_TYPE)
int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x)
{
return sk_X509_ATTRIBUTE_num(x);


+ 0
- 2
crypto/x509/x509_trs.c View File

@ -12,8 +12,6 @@
#include <openssl/x509v3.h>
#include "crypto/x509.h"
DEFINE_STACK_OF(ASN1_OBJECT)
static int tr_cmp(const X509_TRUST *const *a, const X509_TRUST *const *b);
static void trtable_free(X509_TRUST *p);


+ 0
- 1
crypto/x509/x509_vpm.c View File

@ -18,7 +18,6 @@
#include "x509_local.h"
DEFINE_STACK_OF(ASN1_OBJECT)
DEFINE_STACK_OF(X509_VERIFY_PARAM)
/* X509_VERIFY_PARAM functions */


+ 0
- 2
crypto/x509/x_attrib.c View File

@ -14,8 +14,6 @@
#include <openssl/x509.h>
#include "x509_local.h"
DEFINE_STACK_OF(ASN1_TYPE)
/*-
* X509_ATTRIBUTE: this has the following form:
*


+ 0
- 2
crypto/x509/x_x509a.c View File

@ -14,8 +14,6 @@
#include <openssl/x509.h>
#include "crypto/x509.h"
DEFINE_STACK_OF(ASN1_OBJECT)
/*
* X509_CERT_AUX routines. These are used to encode additional user
* modifiable data about a certificate. This data is appended to the X509


include/openssl/asn1.h → include/openssl/asn1.h.in View File


+ 0
- 1
test/cmp_ctx_test.c View File

@ -13,7 +13,6 @@
#include <openssl/x509_vfy.h>
DEFINE_STACK_OF(ASN1_UTF8STRING)
DEFINE_STACK_OF(OSSL_CMP_ITAV)
typedef struct test_fixture {


+ 0
- 1
test/cmp_hdr_test.c View File

@ -12,7 +12,6 @@
#include "cmp_testlib.h"
DEFINE_STACK_OF(OSSL_CMP_ITAV)
DEFINE_STACK_OF(ASN1_UTF8STRING)
static unsigned char rand_data[OSSL_CMP_TRANSACTIONID_LENGTH];


+ 0
- 2
test/cmp_status_test.c View File

@ -11,8 +11,6 @@
#include "cmp_testlib.h"
DEFINE_STACK_OF(ASN1_UTF8STRING)
typedef struct test_fixture {
const char *test_case_name;
int pkistatus;


Loading…
Cancel
Save