external/boringssl: Sync to 5e578c9dba73460c3eb17f771c77fc8e36f7812e.
This includes the following changes:
https://boringssl.googlesource.com/boringssl/+log/58e449904e248f34bdfc2be7a609c58bcb0257b7..5e578c9dba73460c3eb17f771c77fc8e36f7812e
Test: BoringSSL CTS Presubmits
Change-Id: Ic1541b034545fa58a284ca35134b3719303455c7
diff --git a/src/include/openssl/aead.h b/src/include/openssl/aead.h
index 521e183..2994438 100644
--- a/src/include/openssl/aead.h
+++ b/src/include/openssl/aead.h
@@ -117,16 +117,6 @@
* https://tools.ietf.org/html/draft-irtf-cfrg-gcmsiv-02 */
OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm_siv(void);
-/* EVP_aead_aes_128_gcm_fips_testonly is AES-128 in Galois Counter Mode with
- * an internally-generated random nonce. This is unsafe and should not be
- * used. */
-OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm_fips_testonly(void);
-
-/* EVP_aead_aes_256_gcm_fips_testonly is AES-256 in Galois Counter Mode with
- * an internally-generated random nonce. This is unsafe and should not be
- * used. */
-OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm_fips_testonly(void);
-
/* EVP_has_aes_hardware returns one if we enable hardware support for fast and
* constant-time AES-GCM. */
OPENSSL_EXPORT int EVP_has_aes_hardware(void);
@@ -161,6 +151,9 @@
/* aead_state is an opaque pointer to whatever state the AEAD needs to
* maintain. */
void *aead_state;
+ /* tag_len may contain the actual length of the authentication tag if it is
+ * known at initialization time. */
+ uint8_t tag_len;
} EVP_AEAD_CTX;
/* EVP_AEAD_MAX_KEY_LENGTH contains the maximum key length used by
@@ -186,6 +179,16 @@
* more uniform cleanup of |EVP_AEAD_CTX|. */
OPENSSL_EXPORT void EVP_AEAD_CTX_zero(EVP_AEAD_CTX *ctx);
+/* EVP_AEAD_CTX_new allocates an |EVP_AEAD_CTX|, calls |EVP_AEAD_CTX_init| and
+ * returns the |EVP_AEAD_CTX|, or NULL on error. */
+OPENSSL_EXPORT EVP_AEAD_CTX *EVP_AEAD_CTX_new(const EVP_AEAD *aead,
+ const uint8_t *key,
+ size_t key_len, size_t tag_len);
+
+/* EVP_AEAD_CTX_free calls |EVP_AEAD_CTX_cleanup| and |OPENSSL_free| on
+ * |ctx|. */
+OPENSSL_EXPORT void EVP_AEAD_CTX_free(EVP_AEAD_CTX *ctx);
+
/* EVP_AEAD_CTX_init initializes |ctx| for the given AEAD algorithm. The |impl|
* argument is ignored and should be NULL. Authentication tags may be truncated
* by passing a size as |tag_len|. A |tag_len| of zero indicates the default
@@ -208,8 +211,8 @@
* authenticates |ad_len| bytes from |ad| and writes the result to |out|. It
* returns one on success and zero otherwise.
*
- * This function may be called (with the same |EVP_AEAD_CTX|) concurrently with
- * itself or |EVP_AEAD_CTX_open|.
+ * This function may be called concurrently with itself or any other seal/open
+ * function on the same |EVP_AEAD_CTX|.
*
* At most |max_out_len| bytes are written to |out| and, in order to ensure
* success, |max_out_len| should be |in_len| plus the result of
@@ -229,13 +232,12 @@
const uint8_t *nonce, size_t nonce_len,
const uint8_t *in, size_t in_len,
const uint8_t *ad, size_t ad_len);
-
/* EVP_AEAD_CTX_open authenticates |in_len| bytes from |in| and |ad_len| bytes
* from |ad| and decrypts at most |in_len| bytes into |out|. It returns one on
* success and zero otherwise.
*
- * This function may be called (with the same |EVP_AEAD_CTX|) concurrently with
- * itself or |EVP_AEAD_CTX_seal|.
+ * This function may be called concurrently with itself or any other seal/open
+ * function on the same |EVP_AEAD_CTX|.
*
* At most |in_len| bytes are written to |out|. In order to ensure success,
* |max_out_len| should be at least |in_len|. On successful return, |*out_len|
@@ -255,6 +257,52 @@
const uint8_t *in, size_t in_len,
const uint8_t *ad, size_t ad_len);
+/* EVP_AEAD_CTX_seal_scatter encrypts and authenticates |in_len| bytes from |in|
+ * and authenticates |ad_len| bytes from |ad|. It writes |in_len| bytes of
+ * ciphertext to |out| and the authentication tag to |out_tag|. It returns one
+ * on success and zero otherwise.
+ *
+ * This function may be called concurrently with itself or any other seal/open
+ * function on the same |EVP_AEAD_CTX|.
+ *
+ * Exactly |in_len| bytes are written to |out|, and up to
+ * |EVP_AEAD_max_overhead| bytes to |out_tag|. On successful return,
+ * |*out_tag_len| is set to the actual number of bytes written to |out_tag|.
+ *
+ * The length of |nonce|, |nonce_len|, must be equal to the result of
+ * |EVP_AEAD_nonce_length| for this AEAD.
+ *
+ * |EVP_AEAD_CTX_seal_scatter| never results in a partial output. If
+ * |max_out_tag_len| is insufficient, zero will be returned. (In this case,
+ * |*out_tag_len| is set to zero.)
+ *
+ * If |in| and |out| alias then |out| must be == |in|. |out_tag| may not alias
+ * any other argument. */
+OPENSSL_EXPORT int EVP_AEAD_CTX_seal_scatter(
+ const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag,
+ size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce,
+ size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *ad,
+ size_t ad_len);
+
+/* EVP_AEAD_CTX_open_gather decrypts and authenticates |in_len| bytes from |in|
+ * and authenticates |ad_len| bytes from |ad| using |in_tag_len| bytes of
+ * authentication tag from |in_tag|. If successful, it writes |in_len| bytes of
+ * plaintext to |out|. It returns one on success and zero otherwise.
+ *
+ * This function may be called concurrently with itself or any other seal/open
+ * function on the same |EVP_AEAD_CTX|.
+ *
+ * The length of |nonce|, |nonce_len|, must be equal to the result of
+ * |EVP_AEAD_nonce_length| for this AEAD.
+ *
+ * |EVP_AEAD_CTX_open_gather| never results in a partial output.
+ *
+ * If |in| and |out| alias then |out| must be == |in|. */
+OPENSSL_EXPORT int EVP_AEAD_CTX_open_gather(
+ const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce,
+ size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag,
+ size_t in_tag_len, const uint8_t *ad, size_t ad_len);
+
/* EVP_AEAD_CTX_aead returns the underlying AEAD for |ctx|, or NULL if one has
* not been set. */
OPENSSL_EXPORT const EVP_AEAD *EVP_AEAD_CTX_aead(const EVP_AEAD_CTX *ctx);
@@ -283,6 +331,14 @@
OPENSSL_EXPORT const EVP_AEAD *EVP_aead_null_sha1_tls(void);
+/* EVP_aead_aes_128_gcm_tls12 is AES-128 in Galois Counter Mode using the TLS
+ * 1.2 nonce construction. */
+OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm_tls12(void);
+
+/* EVP_aead_aes_256_gcm_tls12 is AES-256 in Galois Counter Mode using the TLS
+ * 1.2 nonce construction. */
+OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm_tls12(void);
+
/* SSLv3-specific AEAD algorithms.
*
@@ -334,6 +390,8 @@
internal::StackAllocated<EVP_AEAD_CTX, void, EVP_AEAD_CTX_zero,
EVP_AEAD_CTX_cleanup>;
+BORINGSSL_MAKE_DELETER(EVP_AEAD_CTX, EVP_AEAD_CTX_free)
+
} // namespace bssl
} // extern C++
diff --git a/src/include/openssl/asn1.h b/src/include/openssl/asn1.h
index 8a4430a..64d7989 100644
--- a/src/include/openssl/asn1.h
+++ b/src/include/openssl/asn1.h
@@ -71,6 +71,14 @@
extern "C" {
#endif
+
+/* Legacy ASN.1 library.
+ *
+ * This header is part of OpenSSL's ASN.1 implementation. It is retained for
+ * compatibility but otherwise underdocumented and not actively maintained. Use
+ * the new |CBS| and |CBB| library in <openssl/bytestring.h> instead. */
+
+
#define V_ASN1_UNIVERSAL 0x00
#define V_ASN1_APPLICATION 0x40
#define V_ASN1_CONTEXT_SPECIFIC 0x80
@@ -78,7 +86,6 @@
#define V_ASN1_CONSTRUCTED 0x20
#define V_ASN1_PRIMITIVE_TAG 0x1f
-#define V_ASN1_PRIMATIVE_TAG 0x1f
#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */
#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
@@ -149,51 +156,12 @@
#define MBSTRING_BMP (MBSTRING_FLAG|2)
#define MBSTRING_UNIV (MBSTRING_FLAG|4)
-#define SMIME_OLDMIME 0x400
-#define SMIME_CRLFEOL 0x800
-#define SMIME_STREAM 0x1000
-
#define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */
#define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */
-/* We MUST make sure that, except for constness, asn1_ctx_st and
- asn1_const_ctx are exactly the same. Fortunately, as soon as
- the old ASN1 parsing macros are gone, we can throw this away
- as well... */
-typedef struct asn1_ctx_st
- {
- unsigned char *p;/* work char pointer */
- int eos; /* end of sequence read for indefinite encoding */
- int error; /* error code to use when returning an error */
- int inf; /* constructed if 0x20, indefinite is 0x21 */
- int tag; /* tag from last 'get object' */
- int xclass; /* class from last 'get object' */
- long slen; /* length of last 'get object' */
- unsigned char *max; /* largest value of p allowed */
- unsigned char *q;/* temporary variable */
- unsigned char **pp;/* variable */
- int line; /* used in error processing */
- } ASN1_CTX;
-
-typedef struct asn1_const_ctx_st
- {
- const unsigned char *p;/* work char pointer */
- int eos; /* end of sequence read for indefinite encoding */
- int error; /* error code to use when returning an error */
- int inf; /* constructed if 0x20, indefinite is 0x21 */
- int tag; /* tag from last 'get object' */
- int xclass; /* class from last 'get object' */
- long slen; /* length of last 'get object' */
- const unsigned char *max; /* largest value of p allowed */
- const unsigned char *q;/* temporary variable */
- const unsigned char **pp;/* variable */
- int line; /* used in error processing */
- } ASN1_const_CTX;
-
/* These are used internally in the ASN1_OBJECT to keep track of
* whether the names and data need to be free()ed */
#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
-#define ASN1_OBJECT_FLAG_CRITICAL 0x02 /* critical x509v3 object id */
#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */
#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
struct asn1_object_st
@@ -205,7 +173,7 @@
int flags; /* Should we free this one */
};
-DECLARE_STACK_OF(ASN1_OBJECT)
+DEFINE_STACK_OF(ASN1_OBJECT)
#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
/* This indicates that the ASN1_STRING is not a real value but just a place
@@ -214,12 +182,6 @@
*/
#define ASN1_STRING_FLAG_NDEF 0x010
-/* This flag is used by the CMS code to indicate that a string is not
- * complete and is a place holder for content when it had all been
- * accessed. The flag will be reset when content has been written to it.
- */
-
-#define ASN1_STRING_FLAG_CONT 0x020
/* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING
* type.
*/
@@ -346,11 +308,8 @@
#define CHECKED_PPTR_OF(type, p) \
((void**) (1 ? p : (type**)0))
-#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
-#define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(const type *,unsigned char **)
-#define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
-
-TYPEDEF_D2I2D_OF(void);
+typedef void *d2i_of_void(void **, const unsigned char **, long);
+typedef int i2d_of_void(const void *, unsigned char **);
/* The following macros and typedefs allow an ASN1_ITEM
* to be embedded in a structure and referenced. Since
@@ -480,6 +439,7 @@
ASN1_STRFLGS_DUMP_UNKNOWN | \
ASN1_STRFLGS_DUMP_DER)
+DEFINE_STACK_OF(ASN1_INTEGER)
DECLARE_ASN1_SET_OF(ASN1_INTEGER)
struct asn1_type_st
@@ -512,6 +472,7 @@
} value;
};
+DEFINE_STACK_OF(ASN1_TYPE)
DECLARE_ASN1_SET_OF(ASN1_TYPE)
typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
@@ -527,12 +488,6 @@
DECLARE_ASN1_FUNCTIONS(X509_ALGOR)
-typedef struct NETSCAPE_X509_st
- {
- ASN1_OCTET_STRING *header;
- X509 *cert;
- } NETSCAPE_X509;
-
/* This is used to contain a list of bit names */
typedef struct BIT_STRING_BITNAME_st {
int bitnum;
@@ -714,10 +669,6 @@
OPENSSL_EXPORT int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
OPENSSL_EXPORT int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, unsigned char *flags, int flags_len);
-OPENSSL_EXPORT int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, BIT_STRING_BITNAME *tbl, int indent);
-OPENSSL_EXPORT int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl);
-OPENSSL_EXPORT int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, BIT_STRING_BITNAME *tbl);
-
OPENSSL_EXPORT int i2d_ASN1_BOOLEAN(int a,unsigned char **pp);
OPENSSL_EXPORT int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length);
@@ -804,14 +755,8 @@
OPENSSL_EXPORT unsigned long ASN1_tag2bit(int tag);
-/* PARSING */
-OPENSSL_EXPORT int asn1_Finish(ASN1_CTX *c);
-OPENSSL_EXPORT int asn1_const_Finish(ASN1_const_CTX *c);
-
/* SPECIALS */
OPENSSL_EXPORT int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, int *pclass, long omax);
-OPENSSL_EXPORT int ASN1_check_infinite_end(unsigned char **p,long len);
-OPENSSL_EXPORT int ASN1_const_check_infinite_end(const unsigned char **p,long len);
OPENSSL_EXPORT void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, int xclass);
OPENSSL_EXPORT int ASN1_put_eoc(unsigned char **pp);
OPENSSL_EXPORT int ASN1_object_size(int constructed, int length, int tag);
@@ -896,10 +841,6 @@
/* Used to load and write netscape format cert */
-DECLARE_ASN1_FUNCTIONS(NETSCAPE_X509)
-
-int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
-
OPENSSL_EXPORT void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it);
OPENSSL_EXPORT ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct);
diff --git a/src/include/openssl/asn1t.h b/src/include/openssl/asn1t.h
index 29e2de7..ae507ea 100644
--- a/src/include/openssl/asn1t.h
+++ b/src/include/openssl/asn1t.h
@@ -60,18 +60,18 @@
#include <openssl/base.h>
#include <openssl/asn1.h>
-#ifdef OPENSSL_BUILD_SHLIBCRYPTO
-# undef OPENSSL_EXTERN
-# define OPENSSL_EXTERN OPENSSL_EXPORT
-#endif
-
-/* ASN1 template defines, structures and functions */
-
#ifdef __cplusplus
extern "C" {
#endif
+/* Legacy ASN.1 library template definitions.
+ *
+ * This header is used to define new types in OpenSSL's ASN.1 implementation. It
+ * is deprecated and will be unexported from the library. Use the new |CBS| and
+ * |CBB| library in <openssl/bytestring.h> instead. */
+
+
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))
@@ -407,10 +407,12 @@
typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;
typedef struct ASN1_ADB_st ASN1_ADB;
+typedef struct asn1_must_be_null_st ASN1_MUST_BE_NULL;
+
struct ASN1_ADB_st {
unsigned long flags; /* Various flags */
unsigned long offset; /* Offset of selector field */
- STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */
+ ASN1_MUST_BE_NULL *unused;
const ASN1_ADB_TABLE *tbl; /* Table of possible types */
long tblcount; /* Number of entries in tbl */
const ASN1_TEMPLATE *default_tt; /* Type to use if no match */
@@ -850,7 +852,7 @@
DECLARE_ASN1_ITEM(ASN1_FBOOLEAN)
DECLARE_ASN1_ITEM(ASN1_SEQUENCE)
-DECLARE_STACK_OF(ASN1_VALUE)
+DEFINE_STACK_OF(ASN1_VALUE)
/* Functions used internally by the ASN1 code */
diff --git a/src/include/openssl/base.h b/src/include/openssl/base.h
index 53512ac..460c1e0 100644
--- a/src/include/openssl/base.h
+++ b/src/include/openssl/base.h
@@ -145,7 +145,7 @@
* A consumer may use this symbol in the preprocessor to temporarily build
* against multiple revisions of BoringSSL at the same time. It is not
* recommended to do so for longer than is necessary. */
-#define BORINGSSL_API_VERSION 3
+#define BORINGSSL_API_VERSION 4
#if defined(BORINGSSL_SHARED_LIBRARY)
@@ -197,11 +197,26 @@
#define OPENSSL_MSVC_PRAGMA(arg)
#endif
+#if defined(__GNUC__) || defined(__clang__)
+#define OPENSSL_UNUSED __attribute__((unused))
+#else
+#define OPENSSL_UNUSED
+#endif
+
#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) && \
!defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE)
#define BORINGSSL_UNSAFE_DETERMINISTIC_MODE
#endif
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
+#define OPENSSL_ASAN
+#endif
+#if __has_feature(memory_sanitizer)
+#define OPENSSL_MSAN
+#endif
+#endif
+
/* CRYPTO_THREADID is a dummy value. */
typedef int CRYPTO_THREADID;
@@ -233,7 +248,6 @@
typedef struct DSA_SIG_st DSA_SIG;
typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
-typedef struct Netscape_certificate_sequence NETSCAPE_CERT_SEQUENCE;
typedef struct Netscape_spkac_st NETSCAPE_SPKAC;
typedef struct Netscape_spki_st NETSCAPE_SPKI;
typedef struct RIPEMD160state_st RIPEMD160_CTX;
@@ -249,7 +263,6 @@
typedef struct X509_info_st X509_INFO;
typedef struct X509_name_entry_st X509_NAME_ENTRY;
typedef struct X509_name_st X509_NAME;
-typedef struct X509_objects_st X509_OBJECTS;
typedef struct X509_pubkey_st X509_PUBKEY;
typedef struct X509_req_info_st X509_REQ_INFO;
typedef struct X509_req_st X509_REQ;
@@ -314,7 +327,6 @@
typedef struct v3_ext_ctx X509V3_CTX;
typedef struct x509_attributes_st X509_ATTRIBUTE;
typedef struct x509_cert_aux_st X509_CERT_AUX;
-typedef struct x509_cert_pair_st X509_CERT_PAIR;
typedef struct x509_cinf_st X509_CINF;
typedef struct x509_crl_method_st X509_CRL_METHOD;
typedef struct x509_lookup_st X509_LOOKUP;
@@ -428,7 +440,7 @@
}
// Holds ownership of heap-allocated BoringSSL structures. Sample usage:
-// bssl::UniquePtr<BIO> rsa(RSA_new());
+// bssl::UniquePtr<RSA> rsa(RSA_new());
// bssl::UniquePtr<BIO> bio(BIO_new(BIO_s_mem()));
template <typename T>
using UniquePtr = std::unique_ptr<T, internal::Deleter<T>>;
diff --git a/src/include/openssl/bio.h b/src/include/openssl/bio.h
index a18ad1c..2d0d959 100644
--- a/src/include/openssl/bio.h
+++ b/src/include/openssl/bio.h
@@ -77,6 +77,8 @@
/* Allocation and freeing. */
+DEFINE_STACK_OF(BIO)
+
/* BIO_new creates a new BIO with the given type and a reference count of one.
* It returns the fresh |BIO|, or NULL on error. */
OPENSSL_EXPORT BIO *BIO_new(const BIO_METHOD *type);
diff --git a/src/include/openssl/cipher.h b/src/include/openssl/cipher.h
index f93f4cb..5710e3c 100644
--- a/src/include/openssl/cipher.h
+++ b/src/include/openssl/cipher.h
@@ -586,5 +586,6 @@
#define CIPHER_R_UNSUPPORTED_TAG_SIZE 122
#define CIPHER_R_WRONG_FINAL_BLOCK_LENGTH 123
#define CIPHER_R_NO_DIRECTION_SET 124
+#define CIPHER_R_INVALID_NONCE 125
#endif /* OPENSSL_HEADER_CIPHER_H */
diff --git a/src/include/openssl/conf.h b/src/include/openssl/conf.h
index b8ec12e..ae71575 100644
--- a/src/include/openssl/conf.h
+++ b/src/include/openssl/conf.h
@@ -89,6 +89,8 @@
LHASH_OF(CONF_VALUE) *data;
};
+DEFINE_STACK_OF(CONF_VALUE)
+
/* NCONF_new returns a fresh, empty |CONF|, or NULL on error. The |method|
* argument must be NULL. */
diff --git a/src/include/openssl/cpu.h b/src/include/openssl/cpu.h
index 81cc5ba..5ccf14b 100644
--- a/src/include/openssl/cpu.h
+++ b/src/include/openssl/cpu.h
@@ -156,7 +156,7 @@
}
static inline int CRYPTO_is_ARMv8_AES_capable(void) {
-#if defined(OPENSSL_STATIC_ARMCAP_AES)
+#if defined(OPENSSL_STATIC_ARMCAP_AES) || defined(__ARM_FEATURE_CRYPTO)
return 1;
#else
return 0;
@@ -164,7 +164,7 @@
}
static inline int CRYPTO_is_ARMv8_PMULL_capable(void) {
-#if defined(OPENSSL_STATIC_ARMCAP_PMULL)
+#if defined(OPENSSL_STATIC_ARMCAP_PMULL) || defined(__ARM_FEATURE_CRYPTO)
return 1;
#else
return 0;
diff --git a/src/include/openssl/dh.h b/src/include/openssl/dh.h
index ed2396d..9f92a06 100644
--- a/src/include/openssl/dh.h
+++ b/src/include/openssl/dh.h
@@ -210,7 +210,7 @@
OPENSSL_EXPORT int DH_get_ex_new_index(long argl, void *argp,
CRYPTO_EX_unused *unused,
- CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_dup *dup_unused,
CRYPTO_EX_free *free_func);
OPENSSL_EXPORT int DH_set_ex_data(DH *d, int idx, void *arg);
OPENSSL_EXPORT void *DH_get_ex_data(DH *d, int idx);
diff --git a/src/include/openssl/dsa.h b/src/include/openssl/dsa.h
index 2988877..afe0291 100644
--- a/src/include/openssl/dsa.h
+++ b/src/include/openssl/dsa.h
@@ -296,7 +296,7 @@
OPENSSL_EXPORT int DSA_get_ex_new_index(long argl, void *argp,
CRYPTO_EX_unused *unused,
- CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_dup *dup_unused,
CRYPTO_EX_free *free_func);
OPENSSL_EXPORT int DSA_set_ex_data(DSA *d, int idx, void *arg);
OPENSSL_EXPORT void *DSA_get_ex_data(const DSA *d, int idx);
diff --git a/src/include/openssl/ec_key.h b/src/include/openssl/ec_key.h
index cb7ef10..3aeaa78 100644
--- a/src/include/openssl/ec_key.h
+++ b/src/include/openssl/ec_key.h
@@ -177,6 +177,10 @@
* or zero otherwise. */
OPENSSL_EXPORT int EC_KEY_generate_key(EC_KEY *key);
+/* EC_KEY_generate_key_fips behaves like |EC_KEY_generate_key| but performs
+ * additional checks for FIPS compliance. */
+OPENSSL_EXPORT int EC_KEY_generate_key_fips(EC_KEY *key);
+
/* Serialisation. */
@@ -219,7 +223,7 @@
OPENSSL_EXPORT int EC_KEY_get_ex_new_index(long argl, void *argp,
CRYPTO_EX_unused *unused,
- CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_dup *dup_unused,
CRYPTO_EX_free *free_func);
OPENSSL_EXPORT int EC_KEY_set_ex_data(EC_KEY *r, int idx, void *arg);
OPENSSL_EXPORT void *EC_KEY_get_ex_data(const EC_KEY *r, int idx);
diff --git a/src/include/openssl/evp.h b/src/include/openssl/evp.h
index cb2731e..37c965a 100644
--- a/src/include/openssl/evp.h
+++ b/src/include/openssl/evp.h
@@ -171,7 +171,7 @@
#define EVP_PKEY_RSA NID_rsaEncryption
#define EVP_PKEY_DSA NID_dsa
#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
-#define EVP_PKEY_ED25519 NID_Ed25519
+#define EVP_PKEY_ED25519 NID_ED25519
/* EVP_PKEY_assign sets the underlying key of |pkey| to |key|, which must be of
* the given type. The |type| argument should be one of the |EVP_PKEY_*|
@@ -225,6 +225,10 @@
* success and zero on error. */
OPENSSL_EXPORT int EVP_marshal_private_key(CBB *cbb, const EVP_PKEY *key);
+/* EVP_set_buggy_rsa_parser configures whether |RSA_parse_public_key_buggy| is
+ * used by |EVP_parse_public_key|. By default, it is used. */
+OPENSSL_EXPORT void EVP_set_buggy_rsa_parser(int buggy);
+
/* Signing */
@@ -234,9 +238,9 @@
* operation will be written to |*pctx|; this can be used to set alternative
* signing options.
*
- * This function performs a streaming signing operation and will fail for
- * signature algorithms which do not support this. Use |EVP_PKEY_sign_message|
- * for a single-shot operation.
+ * For single-shot signing algorithms which do not use a pre-hash, such as
+ * Ed25519, |type| should be NULL. The |EVP_MD_CTX| itself is unused but is
+ * present so the API is uniform. See |EVP_DigestSign|.
*
* It returns one on success, or zero on error. */
OPENSSL_EXPORT int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
@@ -244,7 +248,11 @@
EVP_PKEY *pkey);
/* EVP_DigestSignUpdate appends |len| bytes from |data| to the data which will
- * be signed in |EVP_DigestSignFinal|. It returns one. */
+ * be signed in |EVP_DigestSignFinal|. It returns one.
+ *
+ * This function performs a streaming signing operation and will fail for
+ * signature algorithms which do not support this. Use |EVP_DigestSign| for a
+ * single-shot operation. */
OPENSSL_EXPORT int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data,
size_t len);
@@ -255,10 +263,25 @@
* is successful, the signature is written to |out_sig| and |*out_sig_len| is
* set to its length.
*
+ * This function performs a streaming signing operation and will fail for
+ * signature algorithms which do not support this. Use |EVP_DigestSign| for a
+ * single-shot operation.
+ *
* It returns one on success, or zero on error. */
OPENSSL_EXPORT int EVP_DigestSignFinal(EVP_MD_CTX *ctx, uint8_t *out_sig,
size_t *out_sig_len);
+/* EVP_DigestSign signs |data_len| bytes from |data| using |ctx|. If |out_sig|
+ * is NULL then |*out_sig_len| is set to the maximum number of output
+ * bytes. Otherwise, on entry, |*out_sig_len| must contain the length of the
+ * |out_sig| buffer. If the call is successful, the signature is written to
+ * |out_sig| and |*out_sig_len| is set to its length.
+ *
+ * It returns one on success and zero on error. */
+OPENSSL_EXPORT int EVP_DigestSign(EVP_MD_CTX *ctx, uint8_t *out_sig,
+ size_t *out_sig_len, const uint8_t *data,
+ size_t data_len);
+
/* Verifying */
@@ -268,9 +291,9 @@
* operation will be written to |*pctx|; this can be used to set alternative
* signing options.
*
- * This function performs streaming signature verification and will fail for
- * signature algorithms which do not support this. Use |EVP_PKEY_verify_message|
- * for a single-shot verification.
+ * For single-shot signing algorithms which do not use a pre-hash, such as
+ * Ed25519, |type| should be NULL. The |EVP_MD_CTX| itself is unused but is
+ * present so the API is uniform. See |EVP_DigestVerify|.
*
* It returns one on success, or zero on error. */
OPENSSL_EXPORT int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
@@ -278,16 +301,30 @@
EVP_PKEY *pkey);
/* EVP_DigestVerifyUpdate appends |len| bytes from |data| to the data which
- * will be verified by |EVP_DigestVerifyFinal|. It returns one. */
+ * will be verified by |EVP_DigestVerifyFinal|. It returns one.
+ *
+ * This function performs streaming signature verification and will fail for
+ * signature algorithms which do not support this. Use |EVP_PKEY_verify_message|
+ * for a single-shot verification. */
OPENSSL_EXPORT int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data,
size_t len);
/* EVP_DigestVerifyFinal verifies that |sig_len| bytes of |sig| are a valid
* signature for the data that has been included by one or more calls to
- * |EVP_DigestVerifyUpdate|. It returns one on success and zero otherwise. */
+ * |EVP_DigestVerifyUpdate|. It returns one on success and zero otherwise.
+ *
+ * This function performs streaming signature verification and will fail for
+ * signature algorithms which do not support this. Use |EVP_PKEY_verify_message|
+ * for a single-shot verification. */
OPENSSL_EXPORT int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const uint8_t *sig,
size_t sig_len);
+/* EVP_DigestVerify verifies that |sig_len| bytes from |sig| are a valid
+ * signature for |data|. It returns one on success or zero on error. */
+OPENSSL_EXPORT int EVP_DigestVerify(EVP_MD_CTX *ctx, const uint8_t *sig,
+ size_t sig_len, const uint8_t *data,
+ size_t len);
+
/* Signing (old functions) */
@@ -396,6 +433,20 @@
unsigned iterations, size_t key_len,
uint8_t *out_key);
+/* EVP_PBE_scrypt expands |password| into a secret key of length |key_len| using
+ * scrypt, as described in RFC 7914, and writes the result to |out_key|. It
+ * returns one on success and zero on error.
+ *
+ * |N|, |r|, and |p| are as described in RFC 7914 section 6. They determine the
+ * cost of the operation. If the memory required exceeds |max_mem|, the
+ * operation will fail instead. If |max_mem| is zero, a defult limit of 32MiB
+ * will be used. */
+OPENSSL_EXPORT int EVP_PBE_scrypt(const char *password, size_t password_len,
+ const uint8_t *salt, size_t salt_len,
+ uint64_t N, uint64_t r, uint64_t p,
+ size_t max_mem, uint8_t *out_key,
+ size_t key_len);
+
/* Public key contexts.
*
@@ -435,8 +486,8 @@
* |sig| and |*sig_len| updated with the true length.
*
* This function expects a pre-hashed input and will fail for signature
- * algorithms which do not support this. Use |EVP_PKEY_sign_message| or
- * |EVP_DigestSignInit| to sign an unhashed input.
+ * algorithms which do not support this. Use |EVP_DigestSignInit| to sign an
+ * unhashed input.
*
* WARNING: Setting |sig| to NULL only gives the maximum size of the
* signature. The actual signature may be smaller.
@@ -447,21 +498,6 @@
size_t *sig_len, const uint8_t *digest,
size_t digest_len);
-/* EVP_PKEY_sign_message signs |data_len| bytes from |data| using |ctx|. If
- * |sig| is NULL, the maximum size of the signature is written to |out_sig_len|.
- * Otherwise, |*sig_len| must contain the number of bytes of space available at
- * |sig|. If sufficient, the signature will be written to |sig| and |*sig_len|
- * updated with the true length.
- *
- * WARNING: Setting |sig| to NULL only gives the maximum size of the
- * signature. The actual signature may be smaller.
- *
- * It returns one on success or zero on error. (Note: this differs from
- * OpenSSL, which can also return negative values to indicate an error. ) */
-OPENSSL_EXPORT int EVP_PKEY_sign_message(EVP_PKEY_CTX *ctx, uint8_t *sig,
- size_t *sig_len, const uint8_t *data,
- size_t data_len);
-
/* EVP_PKEY_verify_init initialises an |EVP_PKEY_CTX| for a signature
* verification operation. It should be called before |EVP_PKEY_verify|.
*
@@ -472,21 +508,14 @@
* signature for |digest|.
*
* This function expects a pre-hashed input and will fail for signature
- * algorithms which do not support this. Use |EVP_PKEY_verify_message| or
- * |EVP_DigestVerifyInit| to verify a signature given the unhashed input.
+ * algorithms which do not support this. Use |EVP_DigestVerifyInit| to verify a
+ * signature given the unhashed input.
*
* It returns one on success or zero on error. */
OPENSSL_EXPORT int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, const uint8_t *sig,
size_t sig_len, const uint8_t *digest,
size_t digest_len);
-/* EVP_PKEY_verify_message verifies that |sig_len| bytes from |sig| are a valid
- * signature for |data|. It returns one on success or zero on error. */
-OPENSSL_EXPORT int EVP_PKEY_verify_message(EVP_PKEY_CTX *ctx,
- const uint8_t *sig, size_t sig_len,
- const uint8_t *data,
- size_t data_len);
-
/* EVP_PKEY_encrypt_init initialises an |EVP_PKEY_CTX| for an encryption
* operation. It should be called before |EVP_PKEY_encrypt|.
*
@@ -842,5 +871,7 @@
#define EVP_R_UNSUPPORTED_PUBLIC_KEY_TYPE 129
#define EVP_R_NOT_A_PRIVATE_KEY 130
#define EVP_R_INVALID_SIGNATURE 131
+#define EVP_R_MEMORY_LIMIT_EXCEEDED 132
+#define EVP_R_INVALID_PARAMETERS 133
#endif /* OPENSSL_HEADER_EVP_H */
diff --git a/src/include/openssl/ex_data.h b/src/include/openssl/ex_data.h
index e78e070..5d1a45c 100644
--- a/src/include/openssl/ex_data.h
+++ b/src/include/openssl/ex_data.h
@@ -134,16 +134,14 @@
#if 0 /* Sample */
-/* TYPE_get_ex_new_index allocates a new index for |TYPE|. See the
- * descriptions of the callback typedefs for details of when they are
- * called. Any of the callback arguments may be NULL. The |argl| and |argp|
- * arguments are opaque values that are passed to the callbacks. It returns the
- * new index or a negative number on error.
- *
- * TODO(fork): this should follow the standard calling convention. */
+/* TYPE_get_ex_new_index allocates a new index for |TYPE|. An optional
+ * |free_func| argument may be provided which is called when the owning object
+ * is destroyed. See |CRYPTO_EX_free| for details. The |argl| and |argp|
+ * arguments are opaque values that are passed to the callback. It returns the
+ * new index or a negative number on error. */
OPENSSL_EXPORT int TYPE_get_ex_new_index(long argl, void *argp,
CRYPTO_EX_unused *unused,
- CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_dup *dup_unused,
CRYPTO_EX_free *free_func);
/* TYPE_set_ex_data sets an extra data pointer on |t|. The |index| argument
@@ -176,24 +174,16 @@
typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int index, long argl, void *argp);
-/* CRYPTO_EX_dup is a callback function that is called when an object of the
- * class is being copied and thus the ex_data linked to it also needs to be
- * copied. On entry, |*from_d| points to the data for this index from the
- * original object. When the callback returns, |*from_d| will be set as the
- * data for this index in |to|.
- *
- * This callback may be called with a NULL value for |*from_d| if |from| has no
- * value set for this index. However, the callbacks may also be skipped entirely
- * if no extra data pointers are set on |from| at all. */
-typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
- void **from_d, int index, long argl, void *argp);
-
/* Deprecated functions. */
/* CRYPTO_cleanup_all_ex_data does nothing. */
OPENSSL_EXPORT void CRYPTO_cleanup_all_ex_data(void);
+/* CRYPTO_EX_dup is a legacy callback function type which is ignored. */
+typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
+ void **from_d, int index, long argl, void *argp);
+
/* Private structures. */
diff --git a/src/include/openssl/nid.h b/src/include/openssl/nid.h
index f023c1f..bc0ee33 100644
--- a/src/include/openssl/nid.h
+++ b/src/include/openssl/nid.h
@@ -65,6 +65,7 @@
extern "C" {
#endif
+
/* The nid library provides numbered values for ASN.1 object identifiers and
* other symbols. These values are used by other libraries to identify
* cryptographic primitives.
@@ -78,6 +79,7 @@
* These values should not be used outside of a single process; they are not
* stable identifiers. */
+
#define SN_undef "UNDEF"
#define LN_undef "undefined"
#define NID_undef 0
@@ -4192,9 +4194,9 @@
#define SN_X25519 "X25519"
#define NID_X25519 948
-#define SN_Ed25519 "Ed25519"
-#define NID_Ed25519 949
-#define OBJ_Ed25519 1L, 3L, 101L, 112L
+#define SN_ED25519 "ED25519"
+#define NID_ED25519 949
+#define OBJ_ED25519 1L, 3L, 101L, 112L
#if defined(__cplusplus)
diff --git a/src/include/openssl/pem.h b/src/include/openssl/pem.h
index 58aecaf..ae6c23c 100644
--- a/src/include/openssl/pem.h
+++ b/src/include/openssl/pem.h
@@ -76,41 +76,6 @@
#define PEM_BUFSIZE 1024
-#define PEM_OBJ_UNDEF 0
-#define PEM_OBJ_X509 1
-#define PEM_OBJ_X509_REQ 2
-#define PEM_OBJ_CRL 3
-#define PEM_OBJ_SSL_SESSION 4
-#define PEM_OBJ_PRIV_KEY 10
-#define PEM_OBJ_PRIV_RSA 11
-#define PEM_OBJ_PRIV_DSA 12
-#define PEM_OBJ_PRIV_DH 13
-#define PEM_OBJ_PUB_RSA 14
-#define PEM_OBJ_PUB_DSA 15
-#define PEM_OBJ_PUB_DH 16
-#define PEM_OBJ_DHPARAMS 17
-#define PEM_OBJ_DSAPARAMS 18
-#define PEM_OBJ_PRIV_RSA_PUBLIC 19
-#define PEM_OBJ_PRIV_ECDSA 20
-#define PEM_OBJ_PUB_ECDSA 21
-#define PEM_OBJ_ECPARAMETERS 22
-
-#define PEM_ERROR 30
-#define PEM_DEK_DES_CBC 40
-#define PEM_DEK_IDEA_CBC 45
-#define PEM_DEK_DES_EDE 50
-#define PEM_DEK_DES_ECB 60
-#define PEM_DEK_RSA 70
-#define PEM_DEK_RSA_MD2 80
-#define PEM_DEK_RSA_MD5 90
-
-#define PEM_MD_MD2 NID_md2
-#define PEM_MD_MD5 NID_md5
-#define PEM_MD_SHA NID_sha
-#define PEM_MD_MD2_RSA NID_md2WithRSAEncryption
-#define PEM_MD_MD5_RSA NID_md5WithRSAEncryption
-#define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption
-
#define PEM_STRING_X509_OLD "X509 CERTIFICATE"
#define PEM_STRING_X509 "CERTIFICATE"
#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR"
@@ -136,71 +101,12 @@
#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
#define PEM_STRING_CMS "CMS"
- /* Note that this structure is initialised by PEM_SealInit and cleaned up
- by PEM_SealFinal (at least for now) */
-typedef struct PEM_Encode_Seal_st
- {
- EVP_ENCODE_CTX encode;
- EVP_MD_CTX md;
- EVP_CIPHER_CTX cipher;
- } PEM_ENCODE_SEAL_CTX;
-
/* enc_type is one off */
#define PEM_TYPE_ENCRYPTED 10
#define PEM_TYPE_MIC_ONLY 20
#define PEM_TYPE_MIC_CLEAR 30
#define PEM_TYPE_CLEAR 40
-typedef struct pem_recip_st
- {
- char *name;
- X509_NAME *dn;
-
- int cipher;
- int key_enc;
- /* char iv[8]; unused and wrong size */
- } PEM_USER;
-
-typedef struct pem_ctx_st
- {
- int type; /* what type of object */
-
- struct {
- int version;
- int mode;
- } proc_type;
-
- char *domain;
-
- struct {
- int cipher;
- /* unused, and wrong size
- unsigned char iv[8]; */
- } DEK_info;
-
- PEM_USER *originator;
-
- int num_recipient;
- PEM_USER **recipient;
-
- EVP_MD *md; /* signature type */
-
- int md_enc; /* is the md encrypted or not? */
- int md_len; /* length of md_data */
- char *md_data; /* message digest, could be pkey encrypted */
-
- EVP_CIPHER *dec; /* date encryption cipher */
- int key_len; /* key length */
- unsigned char *key; /* key */
- /* unused, and wrong size
- unsigned char iv[8]; */
-
-
- int data_enc; /* is the data encrypted */
- int data_len;
- unsigned char *data;
- } PEM_CTX;
-
/* These macros make the PEM_read/PEM_write functions easier to maintain and
* write. Now they are all implemented with either:
* IMPLEMENT_PEM_rw(...) or IMPLEMENT_PEM_rw_cb(...)
@@ -404,14 +310,6 @@
OPENSSL_EXPORT int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, void *x,const EVP_CIPHER *enc,unsigned char *kstr, int klen,pem_password_cb *callback, void *u);
OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u);
-OPENSSL_EXPORT int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk);
-OPENSSL_EXPORT void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl);
-OPENSSL_EXPORT int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig,int *sigl, unsigned char *out, int *outl, EVP_PKEY *priv);
-
-OPENSSL_EXPORT void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
-OPENSSL_EXPORT void PEM_SignUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt);
-OPENSSL_EXPORT int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY *pkey);
-
/* PEM_def_callback treats |userdata| as a string and copies it into |buf|,
* assuming its |size| is sufficient. Returns the length of the string, or 0
* if there is not enough room. If either |buf| or |userdata| is NULL, 0 is
@@ -426,17 +324,11 @@
DECLARE_PEM_rw(X509_AUX, X509)
-DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR)
-
DECLARE_PEM_rw(X509_REQ, X509_REQ)
DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
DECLARE_PEM_rw(X509_CRL, X509_CRL)
-/* DECLARE_PEM_rw(PKCS7, PKCS7) */
-
-DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
-
DECLARE_PEM_rw(PKCS8, X509_SIG)
DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
@@ -481,18 +373,6 @@
OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, char *kstr,int klen, pem_password_cb *cd, void *u);
-OPENSSL_EXPORT EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);
-OPENSSL_EXPORT EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);
-OPENSSL_EXPORT EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
-OPENSSL_EXPORT EVP_PKEY *b2i_PublicKey_bio(BIO *in);
-OPENSSL_EXPORT int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk);
-OPENSSL_EXPORT int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk);
-OPENSSL_EXPORT EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
-OPENSSL_EXPORT int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, pem_password_cb *cb, void *u);
-
-
-void ERR_load_PEM_strings(void);
-
#ifdef __cplusplus
}
diff --git a/src/include/openssl/pool.h b/src/include/openssl/pool.h
index dc5c938..8a07af5 100644
--- a/src/include/openssl/pool.h
+++ b/src/include/openssl/pool.h
@@ -17,6 +17,8 @@
#include <openssl/base.h>
+#include <openssl/stack.h>
+
#if defined(__cplusplus)
extern "C" {
#endif
@@ -29,6 +31,8 @@
* given blob to be kept in memory and referenced from multiple places. */
+DEFINE_STACK_OF(CRYPTO_BUFFER)
+
/* CRYPTO_BUFFER_POOL_new returns a freshly allocated |CRYPTO_BUFFER_POOL| or
* NULL on error. */
OPENSSL_EXPORT CRYPTO_BUFFER_POOL* CRYPTO_BUFFER_POOL_new(void);
diff --git a/src/include/openssl/rsa.h b/src/include/openssl/rsa.h
index ee1bdde..caf4a42 100644
--- a/src/include/openssl/rsa.h
+++ b/src/include/openssl/rsa.h
@@ -122,6 +122,11 @@
OPENSSL_EXPORT int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e,
BN_GENCB *cb);
+/* RSA_generate_key_fips behaves like |RSA_generate_key_ex| but performs
+ * additional checks for FIPS compliance. The public exponent is always 65537
+ * and |bits| must be either 2048 or 3072. */
+OPENSSL_EXPORT int RSA_generate_key_fips(RSA *rsa, int bits, BN_GENCB *cb);
+
/* Encryption / Decryption */
@@ -206,6 +211,24 @@
unsigned int in_len, uint8_t *out,
unsigned int *out_len, RSA *rsa);
+/* RSA_sign_pss_mgf1 signs |in_len| bytes from |in| with the public key from
+ * |rsa| using RSASSA-PSS with MGF1 as the mask generation function. It writes,
+ * at most, |max_out| bytes of signature data to |out|. The |max_out| argument
+ * must be, at least, |RSA_size| in order to ensure success. It returns 1 on
+ * success or zero on error.
+ *
+ * The |md| and |mgf1_md| arguments identify the hash used to calculate |msg|
+ * and the MGF1 hash, respectively. If |mgf1_md| is NULL, |md| is
+ * used.
+ *
+ * |salt_len| specifies the expected salt length in bytes. If |salt_len| is -1,
+ * then the salt length is the same as the hash length. If -2, then the salt
+ * length is maximal given the size of |rsa|. If unsure, use -1. */
+OPENSSL_EXPORT int RSA_sign_pss_mgf1(RSA *rsa, size_t *out_len, uint8_t *out,
+ size_t max_out, const uint8_t *in,
+ size_t in_len, const EVP_MD *md,
+ const EVP_MD *mgf1_md, int salt_len);
+
/* RSA_sign_raw signs |in_len| bytes from |in| with the public key from |rsa|
* and writes, at most, |max_out| bytes of signature data to |out|. The
* |max_out| argument must be, at least, |RSA_size| in order to ensure success.
@@ -222,7 +245,7 @@
/* RSA_verify verifies that |sig_len| bytes from |sig| are a valid,
* RSASSA-PKCS1-v1_5 signature of |msg_len| bytes at |msg| by |rsa|.
*
- * The |hash_nid| argument identifies the hash function used to calculate |in|
+ * The |hash_nid| argument identifies the hash function used to calculate |msg|
* and is embedded in the resulting signature in order to prevent hash
* confusion attacks. For example, it might be |NID_sha256|.
*
@@ -233,6 +256,23 @@
OPENSSL_EXPORT int RSA_verify(int hash_nid, const uint8_t *msg, size_t msg_len,
const uint8_t *sig, size_t sig_len, RSA *rsa);
+/* RSA_verify_pss_mgf1 verifies that |sig_len| bytes from |sig| are a valid,
+ * RSASSA-PSS signature of |msg_len| bytes at |msg| by |rsa|. It returns one if
+ * the signature is valid and zero otherwise. MGF1 is used as the mask
+ * generation function.
+ *
+ * The |md| and |mgf1_md| arguments identify the hash used to calculate |msg|
+ * and the MGF1 hash, respectively. If |mgf1_md| is NULL, |md| is
+ * used. |salt_len| specifies the expected salt length in bytes.
+ *
+ * If |salt_len| is -1, then the salt length is the same as the hash length. If
+ * -2, then the salt length is recovered and all values accepted. If unsure, use
+ * -1. */
+OPENSSL_EXPORT int RSA_verify_pss_mgf1(RSA *rsa, const uint8_t *msg,
+ size_t msg_len, const EVP_MD *md,
+ const EVP_MD *mgf1_md, int salt_len,
+ const uint8_t *sig, size_t sig_len);
+
/* RSA_verify_raw verifies |in_len| bytes of signature from |in| using the
* public key from |rsa| and writes, at most, |max_out| bytes of plaintext to
* |out|. The |max_out| argument must be, at least, |RSA_size| in order to
@@ -301,13 +341,6 @@
* if they pass and zero otherwise. Opaque keys always fail. */
OPENSSL_EXPORT int RSA_check_fips(RSA *key);
-/* RSA_recover_crt_params uses |rsa->n|, |rsa->d| and |rsa->e| in order to
- * calculate the two primes used and thus the precomputed, CRT values. These
- * values are set in the |p|, |q|, |dmp1|, |dmq1| and |iqmp| members of |rsa|,
- * which must be |NULL| on entry. It returns one on success and zero
- * otherwise. */
-OPENSSL_EXPORT int RSA_recover_crt_params(RSA *rsa);
-
/* RSA_verify_PKCS1_PSS_mgf1 verifies that |EM| is a correct PSS padding of
* |mHash|, where |mHash| is a digest produced by |Hash|. |EM| must point to
* exactly |RSA_size(rsa)| bytes of data. The |mgf1Hash| argument specifies the
@@ -318,7 +351,10 @@
*
* If unsure, use -1.
*
- * It returns one on success or zero on error. */
+ * It returns one on success or zero on error.
+ *
+ * This function implements only the low-level padding logic. Use
+ * |RSA_verify_pss_mgf1| instead. */
OPENSSL_EXPORT int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const uint8_t *mHash,
const EVP_MD *Hash,
const EVP_MD *mgf1Hash,
@@ -332,7 +368,10 @@
* the salt length is the same as the hash length. If -2, then the salt length
* is maximal given the space in |EM|.
*
- * It returns one on success or zero on error. */
+ * It returns one on success or zero on error.
+ *
+ * This function implements only the low-level padding logic. Use
+ * |RSA_sign_pss_mgf1| instead. */
OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, uint8_t *EM,
const uint8_t *mHash,
const EVP_MD *Hash,
@@ -415,7 +454,7 @@
OPENSSL_EXPORT int RSA_get_ex_new_index(long argl, void *argp,
CRYPTO_EX_unused *unused,
- CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_dup *dup_unused,
CRYPTO_EX_free *free_func);
OPENSSL_EXPORT int RSA_set_ex_data(RSA *r, int idx, void *arg);
OPENSSL_EXPORT void *RSA_get_ex_data(const RSA *r, int idx);
@@ -497,13 +536,19 @@
OPENSSL_EXPORT int i2d_RSAPrivateKey(const RSA *in, uint8_t **outp);
/* RSA_padding_add_PKCS1_PSS acts like |RSA_padding_add_PKCS1_PSS_mgf1| but the
- * |mgf1Hash| parameter of the latter is implicitly set to |Hash|. */
+ * |mgf1Hash| parameter of the latter is implicitly set to |Hash|.
+ *
+ * This function implements only the low-level padding logic. Use
+ * |RSA_sign_pss_mgf1| instead. */
OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS(RSA *rsa, uint8_t *EM,
const uint8_t *mHash,
const EVP_MD *Hash, int sLen);
/* RSA_verify_PKCS1_PSS acts like |RSA_verify_PKCS1_PSS_mgf1| but the
- * |mgf1Hash| parameter of the latter is implicitly set to |Hash|. */
+ * |mgf1Hash| parameter of the latter is implicitly set to |Hash|.
+ *
+ * This function implements only the low-level padding logic. Use
+ * |RSA_verify_pss_mgf1| instead. */
OPENSSL_EXPORT int RSA_verify_PKCS1_PSS(RSA *rsa, const uint8_t *mHash,
const EVP_MD *Hash, const uint8_t *EM,
int sLen);
@@ -536,13 +581,13 @@
int (*verify)(int dtype, const uint8_t *m, unsigned int m_length,
const uint8_t *sigbuf, unsigned int siglen, const RSA *rsa);
-
- /* These functions mirror the |RSA_*| functions of the same name. */
+ /* Ignored. Set this to NULL. */
int (*encrypt)(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
const uint8_t *in, size_t in_len, int padding);
+
+ /* These functions mirror the |RSA_*| functions of the same name. */
int (*sign_raw)(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
const uint8_t *in, size_t in_len, int padding);
-
int (*decrypt)(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
const uint8_t *in, size_t in_len, int padding);
/* Ignored. Set this to NULL. */
@@ -574,6 +619,7 @@
int flags;
+ /* Ignored. Set this to NULL. */
int (*keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
/* Ignored. Set this to NULL. */
diff --git a/src/include/openssl/ssl.h b/src/include/openssl/ssl.h
index 1ee7e5c..55e53da 100644
--- a/src/include/openssl/ssl.h
+++ b/src/include/openssl/ssl.h
@@ -1170,7 +1170,7 @@
*
* |SSL_CIPHER| objects represent cipher suites. */
-DECLARE_STACK_OF(SSL_CIPHER)
+DEFINE_CONST_STACK_OF(SSL_CIPHER)
/* SSL_get_cipher_by_value returns the structure representing a TLS cipher
* suite based on its assigned number, or NULL if unknown. See
@@ -1191,6 +1191,9 @@
/* SSL_CIPHER_has_SHA256_HMAC returns one if |cipher| uses HMAC-SHA256. */
OPENSSL_EXPORT int SSL_CIPHER_has_SHA256_HMAC(const SSL_CIPHER *cipher);
+/* SSL_CIPHER_has_SHA384_HMAC returns one if |cipher| uses HMAC-SHA384. */
+OPENSSL_EXPORT int SSL_CIPHER_has_SHA384_HMAC(const SSL_CIPHER *cipher);
+
/* SSL_CIPHER_is_AEAD returns one if |cipher| uses an AEAD cipher. */
OPENSSL_EXPORT int SSL_CIPHER_is_AEAD(const SSL_CIPHER *cipher);
@@ -2710,7 +2713,7 @@
unsigned long id;
} /* SRTP_PROTECTION_PROFILE */;
-DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE)
+DEFINE_CONST_STACK_OF(SRTP_PROTECTION_PROFILE)
/* SRTP_* define constants for SRTP profiles. */
#define SRTP_AES128_CM_SHA1_80 0x0001
@@ -2910,7 +2913,7 @@
OPENSSL_EXPORT void *SSL_get_ex_data(const SSL *ssl, int idx);
OPENSSL_EXPORT int SSL_get_ex_new_index(long argl, void *argp,
CRYPTO_EX_unused *unused,
- CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_dup *dup_unused,
CRYPTO_EX_free *free_func);
OPENSSL_EXPORT int SSL_SESSION_set_ex_data(SSL_SESSION *session, int idx,
@@ -2919,14 +2922,14 @@
int idx);
OPENSSL_EXPORT int SSL_SESSION_get_ex_new_index(long argl, void *argp,
CRYPTO_EX_unused *unused,
- CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_dup *dup_unused,
CRYPTO_EX_free *free_func);
OPENSSL_EXPORT int SSL_CTX_set_ex_data(SSL_CTX *ctx, int idx, void *data);
OPENSSL_EXPORT void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx);
OPENSSL_EXPORT int SSL_CTX_get_ex_new_index(long argl, void *argp,
CRYPTO_EX_unused *unused,
- CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_dup *dup_unused,
CRYPTO_EX_free *free_func);
@@ -3351,7 +3354,7 @@
typedef void COMP_METHOD;
/* SSL_COMP_get_compression_methods returns NULL. */
-OPENSSL_EXPORT COMP_METHOD *SSL_COMP_get_compression_methods(void);
+OPENSSL_EXPORT STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
/* SSL_COMP_add_compression_method returns one. */
OPENSSL_EXPORT int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
@@ -3598,7 +3601,7 @@
char *method;
};
-DECLARE_STACK_OF(SSL_COMP)
+DEFINE_STACK_OF(SSL_COMP)
/* The following flags do nothing and are included only to make it easier to
* compile code with BoringSSL. */
@@ -3807,18 +3810,6 @@
* netty-tcnative. */
OPENSSL_EXPORT void SSL_set_verify_result(SSL *ssl, long result);
-/* SSL_CTX_set_min_version calls |SSL_CTX_set_min_proto_version|. */
-OPENSSL_EXPORT int SSL_CTX_set_min_version(SSL_CTX *ctx, uint16_t version);
-
-/* SSL_CTX_set_max_version calls |SSL_CTX_set_max_proto_version|. */
-OPENSSL_EXPORT int SSL_CTX_set_max_version(SSL_CTX *ctx, uint16_t version);
-
-/* SSL_set_min_version calls |SSL_set_min_proto_version|. */
-OPENSSL_EXPORT int SSL_set_min_version(SSL *ssl, uint16_t version);
-
-/* SSL_set_max_version calls |SSL_set_max_proto_version|. */
-OPENSSL_EXPORT int SSL_set_max_version(SSL *ssl, uint16_t version);
-
/* SSL_CTX_enable_tls_channel_id calls |SSL_CTX_set_tls_channel_id_enabled|. */
OPENSSL_EXPORT int SSL_CTX_enable_tls_channel_id(SSL_CTX *ctx);
@@ -4034,6 +4025,8 @@
uint8_t *in_group_flags;
};
+DECLARE_STACK_OF(SSL_CUSTOM_EXTENSION)
+
/* ssl_ctx_st (aka |SSL_CTX|) contains configuration common to several SSL
* connections. */
struct ssl_ctx_st {
diff --git a/src/include/openssl/stack.h b/src/include/openssl/stack.h
index 70e09fb..5c4b506 100644
--- a/src/include/openssl/stack.h
+++ b/src/include/openssl/stack.h
@@ -74,16 +74,16 @@
* (once) with |DEFINE_STACK_OF(type)| and declared where needed with
* |DECLARE_STACK_OF(type)|. For example:
*
- * struct foo {
+ * typedef struct foo_st {
* int bar;
- * };
+ * } FOO;
*
- * DEFINE_STACK_OF(struct foo);
+ * DEFINE_STACK_OF(FOO);
*
- * Although note that the stack will contain /pointers/ to |foo|.
+ * Although note that the stack will contain /pointers/ to |FOO|.
*
* A macro will be defined for each of the sk_* functions below. For
- * STACK_OF(foo), the macros would be sk_foo_new, sk_foo_pop etc. */
+ * STACK_OF(FOO), the macros would be sk_FOO_new, sk_FOO_pop etc. */
/* stack_cmp_func is a comparison function that returns a value < 0, 0 or > 0
@@ -113,85 +113,6 @@
#define DECLARE_STACK_OF(type) STACK_OF(type);
-/* The make_macros.sh script in this directory parses the following lines and
- * generates the stack_macros.h file that contains macros for the following
- * types of stacks:
- *
- * STACK_OF:ACCESS_DESCRIPTION
- * STACK_OF:ASN1_ADB_TABLE
- * STACK_OF:ASN1_GENERALSTRING
- * STACK_OF:ASN1_INTEGER
- * STACK_OF:ASN1_OBJECT
- * STACK_OF:ASN1_STRING_TABLE
- * STACK_OF:ASN1_TYPE
- * STACK_OF:ASN1_VALUE
- * STACK_OF:BIO
- * STACK_OF:BY_DIR_ENTRY
- * STACK_OF:BY_DIR_HASH
- * STACK_OF:CONF_VALUE
- * STACK_OF:CRYPTO_BUFFER
- * STACK_OF:CRYPTO_EX_DATA_FUNCS
- * STACK_OF:DIST_POINT
- * STACK_OF:GENERAL_NAME
- * STACK_OF:GENERAL_NAMES
- * STACK_OF:GENERAL_SUBTREE
- * STACK_OF:POLICYINFO
- * STACK_OF:POLICYQUALINFO
- * STACK_OF:POLICY_MAPPING
- * STACK_OF:SSL_COMP
- * STACK_OF:SSL_CUSTOM_EXTENSION
- * STACK_OF:STACK_OF_X509_NAME_ENTRY
- * STACK_OF:SXNETID
- * STACK_OF:X509
- * STACK_OF:X509V3_EXT_METHOD
- * STACK_OF:X509_ALGOR
- * STACK_OF:X509_ATTRIBUTE
- * STACK_OF:X509_CRL
- * STACK_OF:X509_EXTENSION
- * STACK_OF:X509_INFO
- * STACK_OF:X509_LOOKUP
- * STACK_OF:X509_NAME
- * STACK_OF:X509_NAME_ENTRY
- * STACK_OF:X509_OBJECT
- * STACK_OF:X509_POLICY_DATA
- * STACK_OF:X509_POLICY_NODE
- * STACK_OF:X509_PURPOSE
- * STACK_OF:X509_REVOKED
- * STACK_OF:X509_TRUST
- * STACK_OF:X509_VERIFY_PARAM
- * STACK_OF:void
- *
- * Some stacks contain only const structures, so the stack should return const
- * pointers to retain type-checking.
- *
- * CONST_STACK_OF:SRTP_PROTECTION_PROFILE
- * CONST_STACK_OF:SSL_CIPHER */
-
-
-/* Some stacks are special because, although we would like STACK_OF(char *),
- * that would actually be a stack of pointers to char*, but we just want to
- * point to the string directly. In this case we call them "special" and use
- * |DEFINE_SPECIAL_STACK_OF(type)| */
-#define DEFINE_SPECIAL_STACK_OF(type, inner) \
- STACK_OF(type) { _STACK special_stack; }; \
- OPENSSL_COMPILE_ASSERT(sizeof(type) == sizeof(void *), \
- special_stack_of_non_pointer_##type);
-
-typedef char *OPENSSL_STRING;
-
-DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
-
-/* The make_macros.sh script in this directory parses the following lines and
- * generates the stack_macros.h file that contains macros for the following
- * types of stacks:
- *
- * SPECIAL_STACK_OF:OPENSSL_STRING */
-
-#define IN_STACK_H
-#include <openssl/stack_macros.h>
-#undef IN_STACK_H
-
-
/* These are the raw stack functions, you shouldn't be using them. Rather you
* should be using the type stack macros implemented above. */
@@ -286,6 +207,143 @@
void (*free_func)(void *));
+/* Defining stack types.
+ *
+ * This set of macros is used to emit the typed functions that act on a
+ * |STACK_OF(T)|. */
+
+/* Stack functions must be tagged unused to support file-local stack types.
+ * Clang's -Wunused-function only allows unused static inline functions if they
+ * are defined in a header. */
+
+#define DEFINE_STACK_OF_IMPL(name, ptrtype, constptrtype) \
+ DECLARE_STACK_OF(name); \
+ \
+ typedef int (*stack_##name##_cmp_func)(constptrtype *a, constptrtype *b); \
+ \
+ static inline OPENSSL_UNUSED STACK_OF(name) * \
+ sk_##name##_new(stack_##name##_cmp_func comp) { \
+ return (STACK_OF(name) *)sk_new((stack_cmp_func)comp); \
+ } \
+ \
+ static inline OPENSSL_UNUSED STACK_OF(name) *sk_##name##_new_null(void) { \
+ return (STACK_OF(name) *)sk_new_null(); \
+ } \
+ \
+ static inline OPENSSL_UNUSED size_t sk_##name##_num( \
+ const STACK_OF(name) *sk) { \
+ return sk_num((const _STACK *)sk); \
+ } \
+ \
+ static inline OPENSSL_UNUSED void sk_##name##_zero(STACK_OF(name) *sk) { \
+ sk_zero((_STACK *)sk); \
+ } \
+ \
+ static inline OPENSSL_UNUSED ptrtype sk_##name##_value( \
+ const STACK_OF(name) *sk, size_t i) { \
+ return (ptrtype)sk_value((const _STACK *)sk, i); \
+ } \
+ \
+ static inline OPENSSL_UNUSED ptrtype sk_##name##_set(STACK_OF(name) *sk, \
+ size_t i, ptrtype p) { \
+ return (ptrtype)sk_set((_STACK *)sk, i, (void *)p); \
+ } \
+ \
+ static inline OPENSSL_UNUSED void sk_##name##_free(STACK_OF(name) *sk) { \
+ sk_free((_STACK *)sk); \
+ } \
+ \
+ static inline OPENSSL_UNUSED void sk_##name##_pop_free( \
+ STACK_OF(name) *sk, void (*free_func)(ptrtype p)) { \
+ sk_pop_free((_STACK *)sk, (void (*)(void *))free_func); \
+ } \
+ \
+ static inline OPENSSL_UNUSED size_t sk_##name##_insert( \
+ STACK_OF(name) *sk, ptrtype p, size_t where) { \
+ return sk_insert((_STACK *)sk, (void *)p, where); \
+ } \
+ \
+ static inline OPENSSL_UNUSED ptrtype sk_##name##_delete(STACK_OF(name) *sk, \
+ size_t where) { \
+ return (ptrtype)sk_delete((_STACK *)sk, where); \
+ } \
+ \
+ static inline OPENSSL_UNUSED ptrtype sk_##name##_delete_ptr( \
+ STACK_OF(name) *sk, ptrtype p) { \
+ return (ptrtype)sk_delete_ptr((_STACK *)sk, (void *)p); \
+ } \
+ \
+ static inline OPENSSL_UNUSED int sk_##name##_find( \
+ STACK_OF(name) *sk, size_t *out_index, ptrtype p) { \
+ return sk_find((_STACK *)sk, out_index, (void *)p); \
+ } \
+ \
+ static inline OPENSSL_UNUSED ptrtype sk_##name##_shift(STACK_OF(name) *sk) { \
+ return (ptrtype)sk_shift((_STACK *)sk); \
+ } \
+ \
+ static inline OPENSSL_UNUSED size_t sk_##name##_push(STACK_OF(name) *sk, \
+ ptrtype p) { \
+ return sk_push((_STACK *)sk, (void *)p); \
+ } \
+ \
+ static inline OPENSSL_UNUSED ptrtype sk_##name##_pop(STACK_OF(name) *sk) { \
+ return (ptrtype)sk_pop((_STACK *)sk); \
+ } \
+ \
+ static inline OPENSSL_UNUSED STACK_OF(name) * \
+ sk_##name##_dup(const STACK_OF(name) *sk) { \
+ return (STACK_OF(name) *)sk_dup((const _STACK *)sk); \
+ } \
+ \
+ static inline OPENSSL_UNUSED void sk_##name##_sort(STACK_OF(name) *sk) { \
+ sk_sort((_STACK *)sk); \
+ } \
+ \
+ static inline OPENSSL_UNUSED int sk_##name##_is_sorted( \
+ const STACK_OF(name) *sk) { \
+ return sk_is_sorted((const _STACK *)sk); \
+ } \
+ \
+ static inline OPENSSL_UNUSED stack_##name##_cmp_func \
+ sk_##name##_set_cmp_func(STACK_OF(name) *sk, \
+ stack_##name##_cmp_func comp) { \
+ return (stack_##name##_cmp_func)sk_set_cmp_func((_STACK *)sk, \
+ (stack_cmp_func)comp); \
+ } \
+ \
+ static inline OPENSSL_UNUSED STACK_OF(name) * \
+ sk_##name##_deep_copy(const STACK_OF(name) *sk, \
+ ptrtype(*copy_func)(ptrtype), \
+ void (*free_func)(ptrtype)) { \
+ return (STACK_OF(name) *)sk_deep_copy((_STACK *)sk, \
+ (void *(*)(void *))copy_func, \
+ (void (*)(void *))free_func); \
+ }
+
+/* DEFINE_STACK_OF defines |STACK_OF(type)| to be a stack whose elements are
+ * |type| *. */
+#define DEFINE_STACK_OF(type) DEFINE_STACK_OF_IMPL(type, type *, const type *)
+
+/* DEFINE_CONST_STACK_OF defines |STACK_OF(type)| to be a stack whose elements
+ * are const |type| *. */
+#define DEFINE_CONST_STACK_OF(type) \
+ DEFINE_STACK_OF_IMPL(type, const type *, const type *)
+
+/* DEFINE_SPECIAL_STACK_OF defines |STACK_OF(type)| to be a stack whose elements
+ * are |type|, where |type| must be a typedef for a pointer. */
+#define DEFINE_SPECIAL_STACK_OF(type) \
+ OPENSSL_COMPILE_ASSERT(sizeof(type) == sizeof(void *), \
+ special_stack_of_non_pointer_##type); \
+ DEFINE_STACK_OF_IMPL(type, type, const type)
+
+
+typedef char *OPENSSL_STRING;
+
+DEFINE_STACK_OF(void)
+DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING)
+
+
#if defined(__cplusplus)
} /* extern C */
#endif
diff --git a/src/include/openssl/stack_macros.h b/src/include/openssl/stack_macros.h
deleted file mode 100644
index 5750572..0000000
--- a/src/include/openssl/stack_macros.h
+++ /dev/null
@@ -1,3892 +0,0 @@
-/* Copyright (c) 2014, Google Inc.
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
-
-#if !defined(IN_STACK_H)
-#error "Don't include this file directly. Include stack.h."
-#endif
-
-/* ACCESS_DESCRIPTION */
-#define sk_ACCESS_DESCRIPTION_new(comp) \
- ((STACK_OF(ACCESS_DESCRIPTION) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const ACCESS_DESCRIPTION **a, const ACCESS_DESCRIPTION **b), \
- comp)))
-
-#define sk_ACCESS_DESCRIPTION_new_null() \
- ((STACK_OF(ACCESS_DESCRIPTION) *)sk_new_null())
-
-#define sk_ACCESS_DESCRIPTION_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ACCESS_DESCRIPTION) *, sk))
-
-#define sk_ACCESS_DESCRIPTION_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk));
-
-#define sk_ACCESS_DESCRIPTION_value(sk, i) \
- ((ACCESS_DESCRIPTION *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ACCESS_DESCRIPTION) *, sk), \
- (i)))
-
-#define sk_ACCESS_DESCRIPTION_set(sk, i, p) \
- ((ACCESS_DESCRIPTION *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), (i), \
- CHECKED_CAST(void *, ACCESS_DESCRIPTION *, p)))
-
-#define sk_ACCESS_DESCRIPTION_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk))
-
-#define sk_ACCESS_DESCRIPTION_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(ACCESS_DESCRIPTION *), \
- free_func))
-
-#define sk_ACCESS_DESCRIPTION_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \
- CHECKED_CAST(void *, ACCESS_DESCRIPTION *, p), (where))
-
-#define sk_ACCESS_DESCRIPTION_delete(sk, where) \
- ((ACCESS_DESCRIPTION *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), (where)))
-
-#define sk_ACCESS_DESCRIPTION_delete_ptr(sk, p) \
- ((ACCESS_DESCRIPTION *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \
- CHECKED_CAST(void *, ACCESS_DESCRIPTION *, p)))
-
-#define sk_ACCESS_DESCRIPTION_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \
- (out_index), CHECKED_CAST(void *, ACCESS_DESCRIPTION *, p))
-
-#define sk_ACCESS_DESCRIPTION_shift(sk) \
- ((ACCESS_DESCRIPTION *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk)))
-
-#define sk_ACCESS_DESCRIPTION_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \
- CHECKED_CAST(void *, ACCESS_DESCRIPTION *, p))
-
-#define sk_ACCESS_DESCRIPTION_pop(sk) \
- ((ACCESS_DESCRIPTION *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk)))
-
-#define sk_ACCESS_DESCRIPTION_dup(sk) \
- ((STACK_OF(ACCESS_DESCRIPTION) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ACCESS_DESCRIPTION) *, sk)))
-
-#define sk_ACCESS_DESCRIPTION_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk))
-
-#define sk_ACCESS_DESCRIPTION_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ACCESS_DESCRIPTION) *, sk))
-
-#define sk_ACCESS_DESCRIPTION_set_cmp_func(sk, comp) \
- ((int (*)(const ACCESS_DESCRIPTION **a, const ACCESS_DESCRIPTION **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const ACCESS_DESCRIPTION **a, \
- const ACCESS_DESCRIPTION **b), \
- comp)))
-
-#define sk_ACCESS_DESCRIPTION_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(ACCESS_DESCRIPTION) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ACCESS_DESCRIPTION) *, sk), \
- CHECKED_CAST(void *(*)(void *), \
- ACCESS_DESCRIPTION *(*)(ACCESS_DESCRIPTION *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(ACCESS_DESCRIPTION *), \
- free_func)))
-
-/* ASN1_ADB_TABLE */
-#define sk_ASN1_ADB_TABLE_new(comp) \
- ((STACK_OF(ASN1_ADB_TABLE) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const ASN1_ADB_TABLE **a, const ASN1_ADB_TABLE **b), comp)))
-
-#define sk_ASN1_ADB_TABLE_new_null() ((STACK_OF(ASN1_ADB_TABLE) *)sk_new_null())
-
-#define sk_ASN1_ADB_TABLE_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_ADB_TABLE) *, sk))
-
-#define sk_ASN1_ADB_TABLE_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk));
-
-#define sk_ASN1_ADB_TABLE_value(sk, i) \
- ((ASN1_ADB_TABLE *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_ADB_TABLE) *, sk), \
- (i)))
-
-#define sk_ASN1_ADB_TABLE_set(sk, i, p) \
- ((ASN1_ADB_TABLE *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), (i), \
- CHECKED_CAST(void *, ASN1_ADB_TABLE *, p)))
-
-#define sk_ASN1_ADB_TABLE_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk))
-
-#define sk_ASN1_ADB_TABLE_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_ADB_TABLE *), free_func))
-
-#define sk_ASN1_ADB_TABLE_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), \
- CHECKED_CAST(void *, ASN1_ADB_TABLE *, p), (where))
-
-#define sk_ASN1_ADB_TABLE_delete(sk, where) \
- ((ASN1_ADB_TABLE *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), (where)))
-
-#define sk_ASN1_ADB_TABLE_delete_ptr(sk, p) \
- ((ASN1_ADB_TABLE *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), \
- CHECKED_CAST(void *, ASN1_ADB_TABLE *, p)))
-
-#define sk_ASN1_ADB_TABLE_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), (out_index), \
- CHECKED_CAST(void *, ASN1_ADB_TABLE *, p))
-
-#define sk_ASN1_ADB_TABLE_shift(sk) \
- ((ASN1_ADB_TABLE *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk)))
-
-#define sk_ASN1_ADB_TABLE_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), \
- CHECKED_CAST(void *, ASN1_ADB_TABLE *, p))
-
-#define sk_ASN1_ADB_TABLE_pop(sk) \
- ((ASN1_ADB_TABLE *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk)))
-
-#define sk_ASN1_ADB_TABLE_dup(sk) \
- ((STACK_OF(ASN1_ADB_TABLE) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_ADB_TABLE) *, sk)))
-
-#define sk_ASN1_ADB_TABLE_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk))
-
-#define sk_ASN1_ADB_TABLE_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_ADB_TABLE) *, sk))
-
-#define sk_ASN1_ADB_TABLE_set_cmp_func(sk, comp) \
- ((int (*)(const ASN1_ADB_TABLE **a, const ASN1_ADB_TABLE **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const ASN1_ADB_TABLE **a, \
- const ASN1_ADB_TABLE **b), \
- comp)))
-
-#define sk_ASN1_ADB_TABLE_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(ASN1_ADB_TABLE) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_ADB_TABLE) *, sk), \
- CHECKED_CAST(void *(*)(void *), ASN1_ADB_TABLE *(*)(ASN1_ADB_TABLE *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_ADB_TABLE *), free_func)))
-
-/* ASN1_GENERALSTRING */
-#define sk_ASN1_GENERALSTRING_new(comp) \
- ((STACK_OF(ASN1_GENERALSTRING) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const ASN1_GENERALSTRING **a, const ASN1_GENERALSTRING **b), \
- comp)))
-
-#define sk_ASN1_GENERALSTRING_new_null() \
- ((STACK_OF(ASN1_GENERALSTRING) *)sk_new_null())
-
-#define sk_ASN1_GENERALSTRING_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_GENERALSTRING) *, sk))
-
-#define sk_ASN1_GENERALSTRING_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk));
-
-#define sk_ASN1_GENERALSTRING_value(sk, i) \
- ((ASN1_GENERALSTRING *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_GENERALSTRING) *, sk), \
- (i)))
-
-#define sk_ASN1_GENERALSTRING_set(sk, i, p) \
- ((ASN1_GENERALSTRING *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), (i), \
- CHECKED_CAST(void *, ASN1_GENERALSTRING *, p)))
-
-#define sk_ASN1_GENERALSTRING_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk))
-
-#define sk_ASN1_GENERALSTRING_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_GENERALSTRING *), \
- free_func))
-
-#define sk_ASN1_GENERALSTRING_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \
- CHECKED_CAST(void *, ASN1_GENERALSTRING *, p), (where))
-
-#define sk_ASN1_GENERALSTRING_delete(sk, where) \
- ((ASN1_GENERALSTRING *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), (where)))
-
-#define sk_ASN1_GENERALSTRING_delete_ptr(sk, p) \
- ((ASN1_GENERALSTRING *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \
- CHECKED_CAST(void *, ASN1_GENERALSTRING *, p)))
-
-#define sk_ASN1_GENERALSTRING_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \
- (out_index), CHECKED_CAST(void *, ASN1_GENERALSTRING *, p))
-
-#define sk_ASN1_GENERALSTRING_shift(sk) \
- ((ASN1_GENERALSTRING *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk)))
-
-#define sk_ASN1_GENERALSTRING_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \
- CHECKED_CAST(void *, ASN1_GENERALSTRING *, p))
-
-#define sk_ASN1_GENERALSTRING_pop(sk) \
- ((ASN1_GENERALSTRING *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk)))
-
-#define sk_ASN1_GENERALSTRING_dup(sk) \
- ((STACK_OF(ASN1_GENERALSTRING) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_GENERALSTRING) *, sk)))
-
-#define sk_ASN1_GENERALSTRING_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk))
-
-#define sk_ASN1_GENERALSTRING_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_GENERALSTRING) *, sk))
-
-#define sk_ASN1_GENERALSTRING_set_cmp_func(sk, comp) \
- ((int (*)(const ASN1_GENERALSTRING **a, const ASN1_GENERALSTRING **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const ASN1_GENERALSTRING **a, \
- const ASN1_GENERALSTRING **b), \
- comp)))
-
-#define sk_ASN1_GENERALSTRING_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(ASN1_GENERALSTRING) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_GENERALSTRING) *, sk), \
- CHECKED_CAST(void *(*)(void *), \
- ASN1_GENERALSTRING *(*)(ASN1_GENERALSTRING *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_GENERALSTRING *), \
- free_func)))
-
-/* ASN1_INTEGER */
-#define sk_ASN1_INTEGER_new(comp) \
- ((STACK_OF(ASN1_INTEGER) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const ASN1_INTEGER **a, const ASN1_INTEGER **b), \
- comp)))
-
-#define sk_ASN1_INTEGER_new_null() ((STACK_OF(ASN1_INTEGER) *)sk_new_null())
-
-#define sk_ASN1_INTEGER_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_INTEGER) *, sk))
-
-#define sk_ASN1_INTEGER_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk));
-
-#define sk_ASN1_INTEGER_value(sk, i) \
- ((ASN1_INTEGER *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_INTEGER) *, sk), (i)))
-
-#define sk_ASN1_INTEGER_set(sk, i, p) \
- ((ASN1_INTEGER *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), (i), \
- CHECKED_CAST(void *, ASN1_INTEGER *, p)))
-
-#define sk_ASN1_INTEGER_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk))
-
-#define sk_ASN1_INTEGER_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_INTEGER *), free_func))
-
-#define sk_ASN1_INTEGER_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), \
- CHECKED_CAST(void *, ASN1_INTEGER *, p), (where))
-
-#define sk_ASN1_INTEGER_delete(sk, where) \
- ((ASN1_INTEGER *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), (where)))
-
-#define sk_ASN1_INTEGER_delete_ptr(sk, p) \
- ((ASN1_INTEGER *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), \
- CHECKED_CAST(void *, ASN1_INTEGER *, p)))
-
-#define sk_ASN1_INTEGER_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), (out_index), \
- CHECKED_CAST(void *, ASN1_INTEGER *, p))
-
-#define sk_ASN1_INTEGER_shift(sk) \
- ((ASN1_INTEGER *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk)))
-
-#define sk_ASN1_INTEGER_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), \
- CHECKED_CAST(void *, ASN1_INTEGER *, p))
-
-#define sk_ASN1_INTEGER_pop(sk) \
- ((ASN1_INTEGER *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk)))
-
-#define sk_ASN1_INTEGER_dup(sk) \
- ((STACK_OF(ASN1_INTEGER) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_INTEGER) *, sk)))
-
-#define sk_ASN1_INTEGER_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk))
-
-#define sk_ASN1_INTEGER_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_INTEGER) *, sk))
-
-#define sk_ASN1_INTEGER_set_cmp_func(sk, comp) \
- ((int (*)(const ASN1_INTEGER **a, const ASN1_INTEGER **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const ASN1_INTEGER **a, const ASN1_INTEGER **b), \
- comp)))
-
-#define sk_ASN1_INTEGER_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(ASN1_INTEGER) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_INTEGER) *, sk), \
- CHECKED_CAST(void *(*)(void *), ASN1_INTEGER *(*)(ASN1_INTEGER *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_INTEGER *), free_func)))
-
-/* ASN1_OBJECT */
-#define sk_ASN1_OBJECT_new(comp) \
- ((STACK_OF(ASN1_OBJECT) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const ASN1_OBJECT **a, const ASN1_OBJECT **b), \
- comp)))
-
-#define sk_ASN1_OBJECT_new_null() ((STACK_OF(ASN1_OBJECT) *)sk_new_null())
-
-#define sk_ASN1_OBJECT_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_OBJECT) *, sk))
-
-#define sk_ASN1_OBJECT_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk));
-
-#define sk_ASN1_OBJECT_value(sk, i) \
- ((ASN1_OBJECT *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_OBJECT) *, sk), (i)))
-
-#define sk_ASN1_OBJECT_set(sk, i, p) \
- ((ASN1_OBJECT *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \
- (i), CHECKED_CAST(void *, ASN1_OBJECT *, p)))
-
-#define sk_ASN1_OBJECT_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk))
-
-#define sk_ASN1_OBJECT_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_OBJECT *), free_func))
-
-#define sk_ASN1_OBJECT_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \
- CHECKED_CAST(void *, ASN1_OBJECT *, p), (where))
-
-#define sk_ASN1_OBJECT_delete(sk, where) \
- ((ASN1_OBJECT *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), (where)))
-
-#define sk_ASN1_OBJECT_delete_ptr(sk, p) \
- ((ASN1_OBJECT *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \
- CHECKED_CAST(void *, ASN1_OBJECT *, p)))
-
-#define sk_ASN1_OBJECT_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), (out_index), \
- CHECKED_CAST(void *, ASN1_OBJECT *, p))
-
-#define sk_ASN1_OBJECT_shift(sk) \
- ((ASN1_OBJECT *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk)))
-
-#define sk_ASN1_OBJECT_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \
- CHECKED_CAST(void *, ASN1_OBJECT *, p))
-
-#define sk_ASN1_OBJECT_pop(sk) \
- ((ASN1_OBJECT *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk)))
-
-#define sk_ASN1_OBJECT_dup(sk) \
- ((STACK_OF(ASN1_OBJECT) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_OBJECT) *, sk)))
-
-#define sk_ASN1_OBJECT_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk))
-
-#define sk_ASN1_OBJECT_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_OBJECT) *, sk))
-
-#define sk_ASN1_OBJECT_set_cmp_func(sk, comp) \
- ((int (*)(const ASN1_OBJECT **a, const ASN1_OBJECT **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const ASN1_OBJECT **a, const ASN1_OBJECT **b), \
- comp)))
-
-#define sk_ASN1_OBJECT_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(ASN1_OBJECT) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_OBJECT) *, sk), \
- CHECKED_CAST(void *(*)(void *), ASN1_OBJECT *(*)(ASN1_OBJECT *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_OBJECT *), free_func)))
-
-/* ASN1_STRING_TABLE */
-#define sk_ASN1_STRING_TABLE_new(comp) \
- ((STACK_OF(ASN1_STRING_TABLE) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const ASN1_STRING_TABLE **a, const ASN1_STRING_TABLE **b), \
- comp)))
-
-#define sk_ASN1_STRING_TABLE_new_null() \
- ((STACK_OF(ASN1_STRING_TABLE) *)sk_new_null())
-
-#define sk_ASN1_STRING_TABLE_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_STRING_TABLE) *, sk))
-
-#define sk_ASN1_STRING_TABLE_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk));
-
-#define sk_ASN1_STRING_TABLE_value(sk, i) \
- ((ASN1_STRING_TABLE *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_STRING_TABLE) *, sk), \
- (i)))
-
-#define sk_ASN1_STRING_TABLE_set(sk, i, p) \
- ((ASN1_STRING_TABLE *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), (i), \
- CHECKED_CAST(void *, ASN1_STRING_TABLE *, p)))
-
-#define sk_ASN1_STRING_TABLE_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk))
-
-#define sk_ASN1_STRING_TABLE_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_STRING_TABLE *), \
- free_func))
-
-#define sk_ASN1_STRING_TABLE_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \
- CHECKED_CAST(void *, ASN1_STRING_TABLE *, p), (where))
-
-#define sk_ASN1_STRING_TABLE_delete(sk, where) \
- ((ASN1_STRING_TABLE *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), (where)))
-
-#define sk_ASN1_STRING_TABLE_delete_ptr(sk, p) \
- ((ASN1_STRING_TABLE *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \
- CHECKED_CAST(void *, ASN1_STRING_TABLE *, p)))
-
-#define sk_ASN1_STRING_TABLE_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \
- (out_index), CHECKED_CAST(void *, ASN1_STRING_TABLE *, p))
-
-#define sk_ASN1_STRING_TABLE_shift(sk) \
- ((ASN1_STRING_TABLE *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk)))
-
-#define sk_ASN1_STRING_TABLE_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \
- CHECKED_CAST(void *, ASN1_STRING_TABLE *, p))
-
-#define sk_ASN1_STRING_TABLE_pop(sk) \
- ((ASN1_STRING_TABLE *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk)))
-
-#define sk_ASN1_STRING_TABLE_dup(sk) \
- ((STACK_OF(ASN1_STRING_TABLE) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_STRING_TABLE) *, sk)))
-
-#define sk_ASN1_STRING_TABLE_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk))
-
-#define sk_ASN1_STRING_TABLE_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_STRING_TABLE) *, sk))
-
-#define sk_ASN1_STRING_TABLE_set_cmp_func(sk, comp) \
- ((int (*)(const ASN1_STRING_TABLE **a, const ASN1_STRING_TABLE **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const ASN1_STRING_TABLE **a, \
- const ASN1_STRING_TABLE **b), \
- comp)))
-
-#define sk_ASN1_STRING_TABLE_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(ASN1_STRING_TABLE) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_STRING_TABLE) *, sk), \
- CHECKED_CAST(void *(*)(void *), \
- ASN1_STRING_TABLE *(*)(ASN1_STRING_TABLE *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_STRING_TABLE *), \
- free_func)))
-
-/* ASN1_TYPE */
-#define sk_ASN1_TYPE_new(comp) \
- ((STACK_OF(ASN1_TYPE) *)sk_new( \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const ASN1_TYPE **a, const ASN1_TYPE **b), comp)))
-
-#define sk_ASN1_TYPE_new_null() ((STACK_OF(ASN1_TYPE) *)sk_new_null())
-
-#define sk_ASN1_TYPE_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_TYPE) *, sk))
-
-#define sk_ASN1_TYPE_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk));
-
-#define sk_ASN1_TYPE_value(sk, i) \
- ((ASN1_TYPE *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_TYPE) *, sk), (i)))
-
-#define sk_ASN1_TYPE_set(sk, i, p) \
- ((ASN1_TYPE *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), (i), \
- CHECKED_CAST(void *, ASN1_TYPE *, p)))
-
-#define sk_ASN1_TYPE_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk))
-
-#define sk_ASN1_TYPE_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_TYPE *), free_func))
-
-#define sk_ASN1_TYPE_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \
- CHECKED_CAST(void *, ASN1_TYPE *, p), (where))
-
-#define sk_ASN1_TYPE_delete(sk, where) \
- ((ASN1_TYPE *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \
- (where)))
-
-#define sk_ASN1_TYPE_delete_ptr(sk, p) \
- ((ASN1_TYPE *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \
- CHECKED_CAST(void *, ASN1_TYPE *, p)))
-
-#define sk_ASN1_TYPE_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), (out_index), \
- CHECKED_CAST(void *, ASN1_TYPE *, p))
-
-#define sk_ASN1_TYPE_shift(sk) \
- ((ASN1_TYPE *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk)))
-
-#define sk_ASN1_TYPE_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \
- CHECKED_CAST(void *, ASN1_TYPE *, p))
-
-#define sk_ASN1_TYPE_pop(sk) \
- ((ASN1_TYPE *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk)))
-
-#define sk_ASN1_TYPE_dup(sk) \
- ((STACK_OF(ASN1_TYPE) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_TYPE) *, sk)))
-
-#define sk_ASN1_TYPE_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk))
-
-#define sk_ASN1_TYPE_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_TYPE) *, sk))
-
-#define sk_ASN1_TYPE_set_cmp_func(sk, comp) \
- ((int (*)(const ASN1_TYPE **a, const ASN1_TYPE **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const ASN1_TYPE **a, const ASN1_TYPE **b), comp)))
-
-#define sk_ASN1_TYPE_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(ASN1_TYPE) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_TYPE) *, sk), \
- CHECKED_CAST(void *(*)(void *), ASN1_TYPE *(*)(ASN1_TYPE *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_TYPE *), free_func)))
-
-/* ASN1_VALUE */
-#define sk_ASN1_VALUE_new(comp) \
- ((STACK_OF(ASN1_VALUE) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const ASN1_VALUE **a, const ASN1_VALUE **b), \
- comp)))
-
-#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)sk_new_null())
-
-#define sk_ASN1_VALUE_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_VALUE) *, sk))
-
-#define sk_ASN1_VALUE_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk));
-
-#define sk_ASN1_VALUE_value(sk, i) \
- ((ASN1_VALUE *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_VALUE) *, sk), (i)))
-
-#define sk_ASN1_VALUE_set(sk, i, p) \
- ((ASN1_VALUE *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \
- (i), CHECKED_CAST(void *, ASN1_VALUE *, p)))
-
-#define sk_ASN1_VALUE_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk))
-
-#define sk_ASN1_VALUE_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_VALUE *), free_func))
-
-#define sk_ASN1_VALUE_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \
- CHECKED_CAST(void *, ASN1_VALUE *, p), (where))
-
-#define sk_ASN1_VALUE_delete(sk, where) \
- ((ASN1_VALUE *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \
- (where)))
-
-#define sk_ASN1_VALUE_delete_ptr(sk, p) \
- ((ASN1_VALUE *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \
- CHECKED_CAST(void *, ASN1_VALUE *, p)))
-
-#define sk_ASN1_VALUE_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), (out_index), \
- CHECKED_CAST(void *, ASN1_VALUE *, p))
-
-#define sk_ASN1_VALUE_shift(sk) \
- ((ASN1_VALUE *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk)))
-
-#define sk_ASN1_VALUE_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \
- CHECKED_CAST(void *, ASN1_VALUE *, p))
-
-#define sk_ASN1_VALUE_pop(sk) \
- ((ASN1_VALUE *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk)))
-
-#define sk_ASN1_VALUE_dup(sk) \
- ((STACK_OF(ASN1_VALUE) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_VALUE) *, sk)))
-
-#define sk_ASN1_VALUE_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk))
-
-#define sk_ASN1_VALUE_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_VALUE) *, sk))
-
-#define sk_ASN1_VALUE_set_cmp_func(sk, comp) \
- ((int (*)(const ASN1_VALUE **a, const ASN1_VALUE **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const ASN1_VALUE **a, const ASN1_VALUE **b), \
- comp)))
-
-#define sk_ASN1_VALUE_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(ASN1_VALUE) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_VALUE) *, sk), \
- CHECKED_CAST(void *(*)(void *), ASN1_VALUE *(*)(ASN1_VALUE *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(ASN1_VALUE *), free_func)))
-
-/* BIO */
-#define sk_BIO_new(comp) \
- ((STACK_OF(BIO) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const BIO **a, const BIO **b), comp)))
-
-#define sk_BIO_new_null() ((STACK_OF(BIO) *)sk_new_null())
-
-#define sk_BIO_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(BIO) *, sk))
-
-#define sk_BIO_zero(sk) sk_zero(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk));
-
-#define sk_BIO_value(sk, i) \
- ((BIO *)sk_value(CHECKED_CAST(const _STACK *, const STACK_OF(BIO) *, sk), \
- (i)))
-
-#define sk_BIO_set(sk, i, p) \
- ((BIO *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), (i), \
- CHECKED_CAST(void *, BIO *, p)))
-
-#define sk_BIO_free(sk) sk_free(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk))
-
-#define sk_BIO_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(BIO *), free_func))
-
-#define sk_BIO_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), \
- CHECKED_CAST(void *, BIO *, p), (where))
-
-#define sk_BIO_delete(sk, where) \
- ((BIO *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), (where)))
-
-#define sk_BIO_delete_ptr(sk, p) \
- ((BIO *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), \
- CHECKED_CAST(void *, BIO *, p)))
-
-#define sk_BIO_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), (out_index), \
- CHECKED_CAST(void *, BIO *, p))
-
-#define sk_BIO_shift(sk) \
- ((BIO *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk)))
-
-#define sk_BIO_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), \
- CHECKED_CAST(void *, BIO *, p))
-
-#define sk_BIO_pop(sk) \
- ((BIO *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk)))
-
-#define sk_BIO_dup(sk) \
- ((STACK_OF(BIO) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(BIO) *, sk)))
-
-#define sk_BIO_sort(sk) sk_sort(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk))
-
-#define sk_BIO_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(BIO) *, sk))
-
-#define sk_BIO_set_cmp_func(sk, comp) \
- ((int (*)(const BIO **a, const BIO **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const BIO **a, const BIO **b), \
- comp)))
-
-#define sk_BIO_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(BIO) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(BIO) *, sk), \
- CHECKED_CAST(void *(*)(void *), BIO *(*)(BIO *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(BIO *), free_func)))
-
-/* BY_DIR_ENTRY */
-#define sk_BY_DIR_ENTRY_new(comp) \
- ((STACK_OF(BY_DIR_ENTRY) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const BY_DIR_ENTRY **a, const BY_DIR_ENTRY **b), \
- comp)))
-
-#define sk_BY_DIR_ENTRY_new_null() ((STACK_OF(BY_DIR_ENTRY) *)sk_new_null())
-
-#define sk_BY_DIR_ENTRY_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_ENTRY) *, sk))
-
-#define sk_BY_DIR_ENTRY_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk));
-
-#define sk_BY_DIR_ENTRY_value(sk, i) \
- ((BY_DIR_ENTRY *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_ENTRY) *, sk), (i)))
-
-#define sk_BY_DIR_ENTRY_set(sk, i, p) \
- ((BY_DIR_ENTRY *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), (i), \
- CHECKED_CAST(void *, BY_DIR_ENTRY *, p)))
-
-#define sk_BY_DIR_ENTRY_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk))
-
-#define sk_BY_DIR_ENTRY_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(BY_DIR_ENTRY *), free_func))
-
-#define sk_BY_DIR_ENTRY_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), \
- CHECKED_CAST(void *, BY_DIR_ENTRY *, p), (where))
-
-#define sk_BY_DIR_ENTRY_delete(sk, where) \
- ((BY_DIR_ENTRY *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), (where)))
-
-#define sk_BY_DIR_ENTRY_delete_ptr(sk, p) \
- ((BY_DIR_ENTRY *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), \
- CHECKED_CAST(void *, BY_DIR_ENTRY *, p)))
-
-#define sk_BY_DIR_ENTRY_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), (out_index), \
- CHECKED_CAST(void *, BY_DIR_ENTRY *, p))
-
-#define sk_BY_DIR_ENTRY_shift(sk) \
- ((BY_DIR_ENTRY *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk)))
-
-#define sk_BY_DIR_ENTRY_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), \
- CHECKED_CAST(void *, BY_DIR_ENTRY *, p))
-
-#define sk_BY_DIR_ENTRY_pop(sk) \
- ((BY_DIR_ENTRY *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk)))
-
-#define sk_BY_DIR_ENTRY_dup(sk) \
- ((STACK_OF(BY_DIR_ENTRY) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_ENTRY) *, sk)))
-
-#define sk_BY_DIR_ENTRY_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk))
-
-#define sk_BY_DIR_ENTRY_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_ENTRY) *, sk))
-
-#define sk_BY_DIR_ENTRY_set_cmp_func(sk, comp) \
- ((int (*)(const BY_DIR_ENTRY **a, const BY_DIR_ENTRY **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const BY_DIR_ENTRY **a, const BY_DIR_ENTRY **b), \
- comp)))
-
-#define sk_BY_DIR_ENTRY_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(BY_DIR_ENTRY) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_ENTRY) *, sk), \
- CHECKED_CAST(void *(*)(void *), BY_DIR_ENTRY *(*)(BY_DIR_ENTRY *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(BY_DIR_ENTRY *), free_func)))
-
-/* BY_DIR_HASH */
-#define sk_BY_DIR_HASH_new(comp) \
- ((STACK_OF(BY_DIR_HASH) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const BY_DIR_HASH **a, const BY_DIR_HASH **b), \
- comp)))
-
-#define sk_BY_DIR_HASH_new_null() ((STACK_OF(BY_DIR_HASH) *)sk_new_null())
-
-#define sk_BY_DIR_HASH_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_HASH) *, sk))
-
-#define sk_BY_DIR_HASH_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk));
-
-#define sk_BY_DIR_HASH_value(sk, i) \
- ((BY_DIR_HASH *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_HASH) *, sk), (i)))
-
-#define sk_BY_DIR_HASH_set(sk, i, p) \
- ((BY_DIR_HASH *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \
- (i), CHECKED_CAST(void *, BY_DIR_HASH *, p)))
-
-#define sk_BY_DIR_HASH_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk))
-
-#define sk_BY_DIR_HASH_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(BY_DIR_HASH *), free_func))
-
-#define sk_BY_DIR_HASH_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \
- CHECKED_CAST(void *, BY_DIR_HASH *, p), (where))
-
-#define sk_BY_DIR_HASH_delete(sk, where) \
- ((BY_DIR_HASH *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), (where)))
-
-#define sk_BY_DIR_HASH_delete_ptr(sk, p) \
- ((BY_DIR_HASH *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \
- CHECKED_CAST(void *, BY_DIR_HASH *, p)))
-
-#define sk_BY_DIR_HASH_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), (out_index), \
- CHECKED_CAST(void *, BY_DIR_HASH *, p))
-
-#define sk_BY_DIR_HASH_shift(sk) \
- ((BY_DIR_HASH *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk)))
-
-#define sk_BY_DIR_HASH_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \
- CHECKED_CAST(void *, BY_DIR_HASH *, p))
-
-#define sk_BY_DIR_HASH_pop(sk) \
- ((BY_DIR_HASH *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk)))
-
-#define sk_BY_DIR_HASH_dup(sk) \
- ((STACK_OF(BY_DIR_HASH) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_HASH) *, sk)))
-
-#define sk_BY_DIR_HASH_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk))
-
-#define sk_BY_DIR_HASH_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_HASH) *, sk))
-
-#define sk_BY_DIR_HASH_set_cmp_func(sk, comp) \
- ((int (*)(const BY_DIR_HASH **a, const BY_DIR_HASH **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const BY_DIR_HASH **a, const BY_DIR_HASH **b), \
- comp)))
-
-#define sk_BY_DIR_HASH_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(BY_DIR_HASH) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_HASH) *, sk), \
- CHECKED_CAST(void *(*)(void *), BY_DIR_HASH *(*)(BY_DIR_HASH *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(BY_DIR_HASH *), free_func)))
-
-/* CONF_VALUE */
-#define sk_CONF_VALUE_new(comp) \
- ((STACK_OF(CONF_VALUE) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const CONF_VALUE **a, const CONF_VALUE **b), \
- comp)))
-
-#define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)sk_new_null())
-
-#define sk_CONF_VALUE_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(CONF_VALUE) *, sk))
-
-#define sk_CONF_VALUE_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk));
-
-#define sk_CONF_VALUE_value(sk, i) \
- ((CONF_VALUE *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(CONF_VALUE) *, sk), (i)))
-
-#define sk_CONF_VALUE_set(sk, i, p) \
- ((CONF_VALUE *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \
- (i), CHECKED_CAST(void *, CONF_VALUE *, p)))
-
-#define sk_CONF_VALUE_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk))
-
-#define sk_CONF_VALUE_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(CONF_VALUE *), free_func))
-
-#define sk_CONF_VALUE_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \
- CHECKED_CAST(void *, CONF_VALUE *, p), (where))
-
-#define sk_CONF_VALUE_delete(sk, where) \
- ((CONF_VALUE *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \
- (where)))
-
-#define sk_CONF_VALUE_delete_ptr(sk, p) \
- ((CONF_VALUE *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \
- CHECKED_CAST(void *, CONF_VALUE *, p)))
-
-#define sk_CONF_VALUE_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), (out_index), \
- CHECKED_CAST(void *, CONF_VALUE *, p))
-
-#define sk_CONF_VALUE_shift(sk) \
- ((CONF_VALUE *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk)))
-
-#define sk_CONF_VALUE_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \
- CHECKED_CAST(void *, CONF_VALUE *, p))
-
-#define sk_CONF_VALUE_pop(sk) \
- ((CONF_VALUE *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk)))
-
-#define sk_CONF_VALUE_dup(sk) \
- ((STACK_OF(CONF_VALUE) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(CONF_VALUE) *, sk)))
-
-#define sk_CONF_VALUE_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk))
-
-#define sk_CONF_VALUE_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(CONF_VALUE) *, sk))
-
-#define sk_CONF_VALUE_set_cmp_func(sk, comp) \
- ((int (*)(const CONF_VALUE **a, const CONF_VALUE **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const CONF_VALUE **a, const CONF_VALUE **b), \
- comp)))
-
-#define sk_CONF_VALUE_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(CONF_VALUE) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(CONF_VALUE) *, sk), \
- CHECKED_CAST(void *(*)(void *), CONF_VALUE *(*)(CONF_VALUE *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(CONF_VALUE *), free_func)))
-
-/* CRYPTO_BUFFER */
-#define sk_CRYPTO_BUFFER_new(comp) \
- ((STACK_OF(CRYPTO_BUFFER) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const CRYPTO_BUFFER **a, const CRYPTO_BUFFER **b), comp)))
-
-#define sk_CRYPTO_BUFFER_new_null() ((STACK_OF(CRYPTO_BUFFER) *)sk_new_null())
-
-#define sk_CRYPTO_BUFFER_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_BUFFER) *, sk))
-
-#define sk_CRYPTO_BUFFER_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk));
-
-#define sk_CRYPTO_BUFFER_value(sk, i) \
- ((CRYPTO_BUFFER *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_BUFFER) *, sk), (i)))
-
-#define sk_CRYPTO_BUFFER_set(sk, i, p) \
- ((CRYPTO_BUFFER *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), (i), \
- CHECKED_CAST(void *, CRYPTO_BUFFER *, p)))
-
-#define sk_CRYPTO_BUFFER_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk))
-
-#define sk_CRYPTO_BUFFER_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(CRYPTO_BUFFER *), free_func))
-
-#define sk_CRYPTO_BUFFER_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), \
- CHECKED_CAST(void *, CRYPTO_BUFFER *, p), (where))
-
-#define sk_CRYPTO_BUFFER_delete(sk, where) \
- ((CRYPTO_BUFFER *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), (where)))
-
-#define sk_CRYPTO_BUFFER_delete_ptr(sk, p) \
- ((CRYPTO_BUFFER *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), \
- CHECKED_CAST(void *, CRYPTO_BUFFER *, p)))
-
-#define sk_CRYPTO_BUFFER_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), (out_index), \
- CHECKED_CAST(void *, CRYPTO_BUFFER *, p))
-
-#define sk_CRYPTO_BUFFER_shift(sk) \
- ((CRYPTO_BUFFER *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk)))
-
-#define sk_CRYPTO_BUFFER_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), \
- CHECKED_CAST(void *, CRYPTO_BUFFER *, p))
-
-#define sk_CRYPTO_BUFFER_pop(sk) \
- ((CRYPTO_BUFFER *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk)))
-
-#define sk_CRYPTO_BUFFER_dup(sk) \
- ((STACK_OF(CRYPTO_BUFFER) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_BUFFER) *, sk)))
-
-#define sk_CRYPTO_BUFFER_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk))
-
-#define sk_CRYPTO_BUFFER_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_BUFFER) *, sk))
-
-#define sk_CRYPTO_BUFFER_set_cmp_func(sk, comp) \
- ((int (*)(const CRYPTO_BUFFER **a, const CRYPTO_BUFFER **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const CRYPTO_BUFFER **a, const CRYPTO_BUFFER **b), \
- comp)))
-
-#define sk_CRYPTO_BUFFER_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(CRYPTO_BUFFER) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_BUFFER) *, sk), \
- CHECKED_CAST(void *(*)(void *), CRYPTO_BUFFER *(*)(CRYPTO_BUFFER *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(CRYPTO_BUFFER *), free_func)))
-
-/* CRYPTO_EX_DATA_FUNCS */
-#define sk_CRYPTO_EX_DATA_FUNCS_new(comp) \
- ((STACK_OF(CRYPTO_EX_DATA_FUNCS) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const CRYPTO_EX_DATA_FUNCS **a, const CRYPTO_EX_DATA_FUNCS **b), \
- comp)))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_new_null() \
- ((STACK_OF(CRYPTO_EX_DATA_FUNCS) *)sk_new_null())
-
-#define sk_CRYPTO_EX_DATA_FUNCS_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_EX_DATA_FUNCS) *, \
- sk))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk));
-
-#define sk_CRYPTO_EX_DATA_FUNCS_value(sk, i) \
- ((CRYPTO_EX_DATA_FUNCS *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_EX_DATA_FUNCS) *, \
- sk), \
- (i)))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_set(sk, i, p) \
- ((CRYPTO_EX_DATA_FUNCS *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), (i), \
- CHECKED_CAST(void *, CRYPTO_EX_DATA_FUNCS *, p)))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(CRYPTO_EX_DATA_FUNCS *), \
- free_func))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \
- CHECKED_CAST(void *, CRYPTO_EX_DATA_FUNCS *, p), (where))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_delete(sk, where) \
- ((CRYPTO_EX_DATA_FUNCS *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), (where)))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_delete_ptr(sk, p) \
- ((CRYPTO_EX_DATA_FUNCS *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \
- CHECKED_CAST(void *, CRYPTO_EX_DATA_FUNCS *, p)))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \
- (out_index), CHECKED_CAST(void *, CRYPTO_EX_DATA_FUNCS *, p))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_shift(sk) \
- ((CRYPTO_EX_DATA_FUNCS *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk)))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \
- CHECKED_CAST(void *, CRYPTO_EX_DATA_FUNCS *, p))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_pop(sk) \
- ((CRYPTO_EX_DATA_FUNCS *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk)))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_dup(sk) \
- ((STACK_OF(CRYPTO_EX_DATA_FUNCS) *)sk_dup(CHECKED_CAST( \
- const _STACK *, const STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk)))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, \
- const STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func(sk, comp) \
- ((int (*)(const CRYPTO_EX_DATA_FUNCS **a, const CRYPTO_EX_DATA_FUNCS **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const CRYPTO_EX_DATA_FUNCS **a, \
- const CRYPTO_EX_DATA_FUNCS **b), \
- comp)))
-
-#define sk_CRYPTO_EX_DATA_FUNCS_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(CRYPTO_EX_DATA_FUNCS) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_EX_DATA_FUNCS) *, \
- sk), \
- CHECKED_CAST(void *(*)(void *), \
- CRYPTO_EX_DATA_FUNCS *(*)(CRYPTO_EX_DATA_FUNCS *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(CRYPTO_EX_DATA_FUNCS *), \
- free_func)))
-
-/* DIST_POINT */
-#define sk_DIST_POINT_new(comp) \
- ((STACK_OF(DIST_POINT) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const DIST_POINT **a, const DIST_POINT **b), \
- comp)))
-
-#define sk_DIST_POINT_new_null() ((STACK_OF(DIST_POINT) *)sk_new_null())
-
-#define sk_DIST_POINT_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(DIST_POINT) *, sk))
-
-#define sk_DIST_POINT_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk));
-
-#define sk_DIST_POINT_value(sk, i) \
- ((DIST_POINT *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(DIST_POINT) *, sk), (i)))
-
-#define sk_DIST_POINT_set(sk, i, p) \
- ((DIST_POINT *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \
- (i), CHECKED_CAST(void *, DIST_POINT *, p)))
-
-#define sk_DIST_POINT_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk))
-
-#define sk_DIST_POINT_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(DIST_POINT *), free_func))
-
-#define sk_DIST_POINT_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \
- CHECKED_CAST(void *, DIST_POINT *, p), (where))
-
-#define sk_DIST_POINT_delete(sk, where) \
- ((DIST_POINT *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \
- (where)))
-
-#define sk_DIST_POINT_delete_ptr(sk, p) \
- ((DIST_POINT *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \
- CHECKED_CAST(void *, DIST_POINT *, p)))
-
-#define sk_DIST_POINT_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), (out_index), \
- CHECKED_CAST(void *, DIST_POINT *, p))
-
-#define sk_DIST_POINT_shift(sk) \
- ((DIST_POINT *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk)))
-
-#define sk_DIST_POINT_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \
- CHECKED_CAST(void *, DIST_POINT *, p))
-
-#define sk_DIST_POINT_pop(sk) \
- ((DIST_POINT *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk)))
-
-#define sk_DIST_POINT_dup(sk) \
- ((STACK_OF(DIST_POINT) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(DIST_POINT) *, sk)))
-
-#define sk_DIST_POINT_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk))
-
-#define sk_DIST_POINT_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(DIST_POINT) *, sk))
-
-#define sk_DIST_POINT_set_cmp_func(sk, comp) \
- ((int (*)(const DIST_POINT **a, const DIST_POINT **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const DIST_POINT **a, const DIST_POINT **b), \
- comp)))
-
-#define sk_DIST_POINT_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(DIST_POINT) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(DIST_POINT) *, sk), \
- CHECKED_CAST(void *(*)(void *), DIST_POINT *(*)(DIST_POINT *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(DIST_POINT *), free_func)))
-
-/* GENERAL_NAME */
-#define sk_GENERAL_NAME_new(comp) \
- ((STACK_OF(GENERAL_NAME) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const GENERAL_NAME **a, const GENERAL_NAME **b), \
- comp)))
-
-#define sk_GENERAL_NAME_new_null() ((STACK_OF(GENERAL_NAME) *)sk_new_null())
-
-#define sk_GENERAL_NAME_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAME) *, sk))
-
-#define sk_GENERAL_NAME_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk));
-
-#define sk_GENERAL_NAME_value(sk, i) \
- ((GENERAL_NAME *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAME) *, sk), (i)))
-
-#define sk_GENERAL_NAME_set(sk, i, p) \
- ((GENERAL_NAME *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), (i), \
- CHECKED_CAST(void *, GENERAL_NAME *, p)))
-
-#define sk_GENERAL_NAME_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk))
-
-#define sk_GENERAL_NAME_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(GENERAL_NAME *), free_func))
-
-#define sk_GENERAL_NAME_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), \
- CHECKED_CAST(void *, GENERAL_NAME *, p), (where))
-
-#define sk_GENERAL_NAME_delete(sk, where) \
- ((GENERAL_NAME *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), (where)))
-
-#define sk_GENERAL_NAME_delete_ptr(sk, p) \
- ((GENERAL_NAME *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), \
- CHECKED_CAST(void *, GENERAL_NAME *, p)))
-
-#define sk_GENERAL_NAME_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), (out_index), \
- CHECKED_CAST(void *, GENERAL_NAME *, p))
-
-#define sk_GENERAL_NAME_shift(sk) \
- ((GENERAL_NAME *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk)))
-
-#define sk_GENERAL_NAME_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), \
- CHECKED_CAST(void *, GENERAL_NAME *, p))
-
-#define sk_GENERAL_NAME_pop(sk) \
- ((GENERAL_NAME *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk)))
-
-#define sk_GENERAL_NAME_dup(sk) \
- ((STACK_OF(GENERAL_NAME) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAME) *, sk)))
-
-#define sk_GENERAL_NAME_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk))
-
-#define sk_GENERAL_NAME_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAME) *, sk))
-
-#define sk_GENERAL_NAME_set_cmp_func(sk, comp) \
- ((int (*)(const GENERAL_NAME **a, const GENERAL_NAME **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const GENERAL_NAME **a, const GENERAL_NAME **b), \
- comp)))
-
-#define sk_GENERAL_NAME_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(GENERAL_NAME) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAME) *, sk), \
- CHECKED_CAST(void *(*)(void *), GENERAL_NAME *(*)(GENERAL_NAME *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(GENERAL_NAME *), free_func)))
-
-/* GENERAL_NAMES */
-#define sk_GENERAL_NAMES_new(comp) \
- ((STACK_OF(GENERAL_NAMES) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const GENERAL_NAMES **a, const GENERAL_NAMES **b), comp)))
-
-#define sk_GENERAL_NAMES_new_null() ((STACK_OF(GENERAL_NAMES) *)sk_new_null())
-
-#define sk_GENERAL_NAMES_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAMES) *, sk))
-
-#define sk_GENERAL_NAMES_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk));
-
-#define sk_GENERAL_NAMES_value(sk, i) \
- ((GENERAL_NAMES *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAMES) *, sk), (i)))
-
-#define sk_GENERAL_NAMES_set(sk, i, p) \
- ((GENERAL_NAMES *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), (i), \
- CHECKED_CAST(void *, GENERAL_NAMES *, p)))
-
-#define sk_GENERAL_NAMES_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk))
-
-#define sk_GENERAL_NAMES_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(GENERAL_NAMES *), free_func))
-
-#define sk_GENERAL_NAMES_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), \
- CHECKED_CAST(void *, GENERAL_NAMES *, p), (where))
-
-#define sk_GENERAL_NAMES_delete(sk, where) \
- ((GENERAL_NAMES *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), (where)))
-
-#define sk_GENERAL_NAMES_delete_ptr(sk, p) \
- ((GENERAL_NAMES *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), \
- CHECKED_CAST(void *, GENERAL_NAMES *, p)))
-
-#define sk_GENERAL_NAMES_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), (out_index), \
- CHECKED_CAST(void *, GENERAL_NAMES *, p))
-
-#define sk_GENERAL_NAMES_shift(sk) \
- ((GENERAL_NAMES *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk)))
-
-#define sk_GENERAL_NAMES_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), \
- CHECKED_CAST(void *, GENERAL_NAMES *, p))
-
-#define sk_GENERAL_NAMES_pop(sk) \
- ((GENERAL_NAMES *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk)))
-
-#define sk_GENERAL_NAMES_dup(sk) \
- ((STACK_OF(GENERAL_NAMES) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAMES) *, sk)))
-
-#define sk_GENERAL_NAMES_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk))
-
-#define sk_GENERAL_NAMES_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAMES) *, sk))
-
-#define sk_GENERAL_NAMES_set_cmp_func(sk, comp) \
- ((int (*)(const GENERAL_NAMES **a, const GENERAL_NAMES **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const GENERAL_NAMES **a, const GENERAL_NAMES **b), \
- comp)))
-
-#define sk_GENERAL_NAMES_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(GENERAL_NAMES) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAMES) *, sk), \
- CHECKED_CAST(void *(*)(void *), GENERAL_NAMES *(*)(GENERAL_NAMES *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(GENERAL_NAMES *), free_func)))
-
-/* GENERAL_SUBTREE */
-#define sk_GENERAL_SUBTREE_new(comp) \
- ((STACK_OF(GENERAL_SUBTREE) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const GENERAL_SUBTREE **a, const GENERAL_SUBTREE **b), comp)))
-
-#define sk_GENERAL_SUBTREE_new_null() \
- ((STACK_OF(GENERAL_SUBTREE) *)sk_new_null())
-
-#define sk_GENERAL_SUBTREE_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_SUBTREE) *, sk))
-
-#define sk_GENERAL_SUBTREE_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk));
-
-#define sk_GENERAL_SUBTREE_value(sk, i) \
- ((GENERAL_SUBTREE *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_SUBTREE) *, sk), \
- (i)))
-
-#define sk_GENERAL_SUBTREE_set(sk, i, p) \
- ((GENERAL_SUBTREE *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), (i), \
- CHECKED_CAST(void *, GENERAL_SUBTREE *, p)))
-
-#define sk_GENERAL_SUBTREE_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk))
-
-#define sk_GENERAL_SUBTREE_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(GENERAL_SUBTREE *), free_func))
-
-#define sk_GENERAL_SUBTREE_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \
- CHECKED_CAST(void *, GENERAL_SUBTREE *, p), (where))
-
-#define sk_GENERAL_SUBTREE_delete(sk, where) \
- ((GENERAL_SUBTREE *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), (where)))
-
-#define sk_GENERAL_SUBTREE_delete_ptr(sk, p) \
- ((GENERAL_SUBTREE *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \
- CHECKED_CAST(void *, GENERAL_SUBTREE *, p)))
-
-#define sk_GENERAL_SUBTREE_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \
- (out_index), CHECKED_CAST(void *, GENERAL_SUBTREE *, p))
-
-#define sk_GENERAL_SUBTREE_shift(sk) \
- ((GENERAL_SUBTREE *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk)))
-
-#define sk_GENERAL_SUBTREE_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \
- CHECKED_CAST(void *, GENERAL_SUBTREE *, p))
-
-#define sk_GENERAL_SUBTREE_pop(sk) \
- ((GENERAL_SUBTREE *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk)))
-
-#define sk_GENERAL_SUBTREE_dup(sk) \
- ((STACK_OF(GENERAL_SUBTREE) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_SUBTREE) *, sk)))
-
-#define sk_GENERAL_SUBTREE_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk))
-
-#define sk_GENERAL_SUBTREE_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_SUBTREE) *, sk))
-
-#define sk_GENERAL_SUBTREE_set_cmp_func(sk, comp) \
- ((int (*)(const GENERAL_SUBTREE **a, const GENERAL_SUBTREE **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const GENERAL_SUBTREE **a, \
- const GENERAL_SUBTREE **b), \
- comp)))
-
-#define sk_GENERAL_SUBTREE_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(GENERAL_SUBTREE) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_SUBTREE) *, sk), \
- CHECKED_CAST(void *(*)(void *), GENERAL_SUBTREE *(*)(GENERAL_SUBTREE *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(GENERAL_SUBTREE *), free_func)))
-
-/* POLICYINFO */
-#define sk_POLICYINFO_new(comp) \
- ((STACK_OF(POLICYINFO) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const POLICYINFO **a, const POLICYINFO **b), \
- comp)))
-
-#define sk_POLICYINFO_new_null() ((STACK_OF(POLICYINFO) *)sk_new_null())
-
-#define sk_POLICYINFO_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(POLICYINFO) *, sk))
-
-#define sk_POLICYINFO_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk));
-
-#define sk_POLICYINFO_value(sk, i) \
- ((POLICYINFO *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(POLICYINFO) *, sk), (i)))
-
-#define sk_POLICYINFO_set(sk, i, p) \
- ((POLICYINFO *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \
- (i), CHECKED_CAST(void *, POLICYINFO *, p)))
-
-#define sk_POLICYINFO_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk))
-
-#define sk_POLICYINFO_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(POLICYINFO *), free_func))
-
-#define sk_POLICYINFO_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \
- CHECKED_CAST(void *, POLICYINFO *, p), (where))
-
-#define sk_POLICYINFO_delete(sk, where) \
- ((POLICYINFO *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \
- (where)))
-
-#define sk_POLICYINFO_delete_ptr(sk, p) \
- ((POLICYINFO *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \
- CHECKED_CAST(void *, POLICYINFO *, p)))
-
-#define sk_POLICYINFO_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), (out_index), \
- CHECKED_CAST(void *, POLICYINFO *, p))
-
-#define sk_POLICYINFO_shift(sk) \
- ((POLICYINFO *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk)))
-
-#define sk_POLICYINFO_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \
- CHECKED_CAST(void *, POLICYINFO *, p))
-
-#define sk_POLICYINFO_pop(sk) \
- ((POLICYINFO *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk)))
-
-#define sk_POLICYINFO_dup(sk) \
- ((STACK_OF(POLICYINFO) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(POLICYINFO) *, sk)))
-
-#define sk_POLICYINFO_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk))
-
-#define sk_POLICYINFO_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(POLICYINFO) *, sk))
-
-#define sk_POLICYINFO_set_cmp_func(sk, comp) \
- ((int (*)(const POLICYINFO **a, const POLICYINFO **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const POLICYINFO **a, const POLICYINFO **b), \
- comp)))
-
-#define sk_POLICYINFO_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(POLICYINFO) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(POLICYINFO) *, sk), \
- CHECKED_CAST(void *(*)(void *), POLICYINFO *(*)(POLICYINFO *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(POLICYINFO *), free_func)))
-
-/* POLICYQUALINFO */
-#define sk_POLICYQUALINFO_new(comp) \
- ((STACK_OF(POLICYQUALINFO) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const POLICYQUALINFO **a, const POLICYQUALINFO **b), comp)))
-
-#define sk_POLICYQUALINFO_new_null() ((STACK_OF(POLICYQUALINFO) *)sk_new_null())
-
-#define sk_POLICYQUALINFO_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(POLICYQUALINFO) *, sk))
-
-#define sk_POLICYQUALINFO_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk));
-
-#define sk_POLICYQUALINFO_value(sk, i) \
- ((POLICYQUALINFO *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(POLICYQUALINFO) *, sk), \
- (i)))
-
-#define sk_POLICYQUALINFO_set(sk, i, p) \
- ((POLICYQUALINFO *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), (i), \
- CHECKED_CAST(void *, POLICYQUALINFO *, p)))
-
-#define sk_POLICYQUALINFO_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk))
-
-#define sk_POLICYQUALINFO_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(POLICYQUALINFO *), free_func))
-
-#define sk_POLICYQUALINFO_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), \
- CHECKED_CAST(void *, POLICYQUALINFO *, p), (where))
-
-#define sk_POLICYQUALINFO_delete(sk, where) \
- ((POLICYQUALINFO *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), (where)))
-
-#define sk_POLICYQUALINFO_delete_ptr(sk, p) \
- ((POLICYQUALINFO *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), \
- CHECKED_CAST(void *, POLICYQUALINFO *, p)))
-
-#define sk_POLICYQUALINFO_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), (out_index), \
- CHECKED_CAST(void *, POLICYQUALINFO *, p))
-
-#define sk_POLICYQUALINFO_shift(sk) \
- ((POLICYQUALINFO *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk)))
-
-#define sk_POLICYQUALINFO_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), \
- CHECKED_CAST(void *, POLICYQUALINFO *, p))
-
-#define sk_POLICYQUALINFO_pop(sk) \
- ((POLICYQUALINFO *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk)))
-
-#define sk_POLICYQUALINFO_dup(sk) \
- ((STACK_OF(POLICYQUALINFO) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(POLICYQUALINFO) *, sk)))
-
-#define sk_POLICYQUALINFO_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk))
-
-#define sk_POLICYQUALINFO_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(POLICYQUALINFO) *, sk))
-
-#define sk_POLICYQUALINFO_set_cmp_func(sk, comp) \
- ((int (*)(const POLICYQUALINFO **a, const POLICYQUALINFO **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const POLICYQUALINFO **a, \
- const POLICYQUALINFO **b), \
- comp)))
-
-#define sk_POLICYQUALINFO_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(POLICYQUALINFO) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(POLICYQUALINFO) *, sk), \
- CHECKED_CAST(void *(*)(void *), POLICYQUALINFO *(*)(POLICYQUALINFO *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(POLICYQUALINFO *), free_func)))
-
-/* POLICY_MAPPING */
-#define sk_POLICY_MAPPING_new(comp) \
- ((STACK_OF(POLICY_MAPPING) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const POLICY_MAPPING **a, const POLICY_MAPPING **b), comp)))
-
-#define sk_POLICY_MAPPING_new_null() ((STACK_OF(POLICY_MAPPING) *)sk_new_null())
-
-#define sk_POLICY_MAPPING_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(POLICY_MAPPING) *, sk))
-
-#define sk_POLICY_MAPPING_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk));
-
-#define sk_POLICY_MAPPING_value(sk, i) \
- ((POLICY_MAPPING *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(POLICY_MAPPING) *, sk), \
- (i)))
-
-#define sk_POLICY_MAPPING_set(sk, i, p) \
- ((POLICY_MAPPING *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), (i), \
- CHECKED_CAST(void *, POLICY_MAPPING *, p)))
-
-#define sk_POLICY_MAPPING_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk))
-
-#define sk_POLICY_MAPPING_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(POLICY_MAPPING *), free_func))
-
-#define sk_POLICY_MAPPING_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), \
- CHECKED_CAST(void *, POLICY_MAPPING *, p), (where))
-
-#define sk_POLICY_MAPPING_delete(sk, where) \
- ((POLICY_MAPPING *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), (where)))
-
-#define sk_POLICY_MAPPING_delete_ptr(sk, p) \
- ((POLICY_MAPPING *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), \
- CHECKED_CAST(void *, POLICY_MAPPING *, p)))
-
-#define sk_POLICY_MAPPING_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), (out_index), \
- CHECKED_CAST(void *, POLICY_MAPPING *, p))
-
-#define sk_POLICY_MAPPING_shift(sk) \
- ((POLICY_MAPPING *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk)))
-
-#define sk_POLICY_MAPPING_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), \
- CHECKED_CAST(void *, POLICY_MAPPING *, p))
-
-#define sk_POLICY_MAPPING_pop(sk) \
- ((POLICY_MAPPING *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk)))
-
-#define sk_POLICY_MAPPING_dup(sk) \
- ((STACK_OF(POLICY_MAPPING) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(POLICY_MAPPING) *, sk)))
-
-#define sk_POLICY_MAPPING_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk))
-
-#define sk_POLICY_MAPPING_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(POLICY_MAPPING) *, sk))
-
-#define sk_POLICY_MAPPING_set_cmp_func(sk, comp) \
- ((int (*)(const POLICY_MAPPING **a, const POLICY_MAPPING **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const POLICY_MAPPING **a, \
- const POLICY_MAPPING **b), \
- comp)))
-
-#define sk_POLICY_MAPPING_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(POLICY_MAPPING) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(POLICY_MAPPING) *, sk), \
- CHECKED_CAST(void *(*)(void *), POLICY_MAPPING *(*)(POLICY_MAPPING *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(POLICY_MAPPING *), free_func)))
-
-/* SSL_COMP */
-#define sk_SSL_COMP_new(comp) \
- ((STACK_OF(SSL_COMP) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const SSL_COMP **a, const SSL_COMP **b), comp)))
-
-#define sk_SSL_COMP_new_null() ((STACK_OF(SSL_COMP) *)sk_new_null())
-
-#define sk_SSL_COMP_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(SSL_COMP) *, sk))
-
-#define sk_SSL_COMP_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk));
-
-#define sk_SSL_COMP_value(sk, i) \
- ((SSL_COMP *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SSL_COMP) *, sk), (i)))
-
-#define sk_SSL_COMP_set(sk, i, p) \
- ((SSL_COMP *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), (i), \
- CHECKED_CAST(void *, SSL_COMP *, p)))
-
-#define sk_SSL_COMP_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk))
-
-#define sk_SSL_COMP_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(SSL_COMP *), free_func))
-
-#define sk_SSL_COMP_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \
- CHECKED_CAST(void *, SSL_COMP *, p), (where))
-
-#define sk_SSL_COMP_delete(sk, where) \
- ((SSL_COMP *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \
- (where)))
-
-#define sk_SSL_COMP_delete_ptr(sk, p) \
- ((SSL_COMP *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \
- CHECKED_CAST(void *, SSL_COMP *, p)))
-
-#define sk_SSL_COMP_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), (out_index), \
- CHECKED_CAST(void *, SSL_COMP *, p))
-
-#define sk_SSL_COMP_shift(sk) \
- ((SSL_COMP *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk)))
-
-#define sk_SSL_COMP_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \
- CHECKED_CAST(void *, SSL_COMP *, p))
-
-#define sk_SSL_COMP_pop(sk) \
- ((SSL_COMP *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk)))
-
-#define sk_SSL_COMP_dup(sk) \
- ((STACK_OF(SSL_COMP) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SSL_COMP) *, sk)))
-
-#define sk_SSL_COMP_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk))
-
-#define sk_SSL_COMP_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(SSL_COMP) *, sk))
-
-#define sk_SSL_COMP_set_cmp_func(sk, comp) \
- ((int (*)(const SSL_COMP **a, const SSL_COMP **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const SSL_COMP **a, const SSL_COMP **b), comp)))
-
-#define sk_SSL_COMP_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(SSL_COMP) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SSL_COMP) *, sk), \
- CHECKED_CAST(void *(*)(void *), SSL_COMP *(*)(SSL_COMP *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(SSL_COMP *), free_func)))
-
-/* SSL_CUSTOM_EXTENSION */
-#define sk_SSL_CUSTOM_EXTENSION_new(comp) \
- ((STACK_OF(SSL_CUSTOM_EXTENSION) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const SSL_CUSTOM_EXTENSION **a, const SSL_CUSTOM_EXTENSION **b), \
- comp)))
-
-#define sk_SSL_CUSTOM_EXTENSION_new_null() \
- ((STACK_OF(SSL_CUSTOM_EXTENSION) *)sk_new_null())
-
-#define sk_SSL_CUSTOM_EXTENSION_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CUSTOM_EXTENSION) *, \
- sk))
-
-#define sk_SSL_CUSTOM_EXTENSION_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk));
-
-#define sk_SSL_CUSTOM_EXTENSION_value(sk, i) \
- ((SSL_CUSTOM_EXTENSION *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CUSTOM_EXTENSION) *, \
- sk), \
- (i)))
-
-#define sk_SSL_CUSTOM_EXTENSION_set(sk, i, p) \
- ((SSL_CUSTOM_EXTENSION *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), (i), \
- CHECKED_CAST(void *, SSL_CUSTOM_EXTENSION *, p)))
-
-#define sk_SSL_CUSTOM_EXTENSION_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk))
-
-#define sk_SSL_CUSTOM_EXTENSION_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(SSL_CUSTOM_EXTENSION *), \
- free_func))
-
-#define sk_SSL_CUSTOM_EXTENSION_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \
- CHECKED_CAST(void *, SSL_CUSTOM_EXTENSION *, p), (where))
-
-#define sk_SSL_CUSTOM_EXTENSION_delete(sk, where) \
- ((SSL_CUSTOM_EXTENSION *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), (where)))
-
-#define sk_SSL_CUSTOM_EXTENSION_delete_ptr(sk, p) \
- ((SSL_CUSTOM_EXTENSION *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \
- CHECKED_CAST(void *, SSL_CUSTOM_EXTENSION *, p)))
-
-#define sk_SSL_CUSTOM_EXTENSION_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \
- (out_index), CHECKED_CAST(void *, SSL_CUSTOM_EXTENSION *, p))
-
-#define sk_SSL_CUSTOM_EXTENSION_shift(sk) \
- ((SSL_CUSTOM_EXTENSION *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk)))
-
-#define sk_SSL_CUSTOM_EXTENSION_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \
- CHECKED_CAST(void *, SSL_CUSTOM_EXTENSION *, p))
-
-#define sk_SSL_CUSTOM_EXTENSION_pop(sk) \
- ((SSL_CUSTOM_EXTENSION *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk)))
-
-#define sk_SSL_CUSTOM_EXTENSION_dup(sk) \
- ((STACK_OF(SSL_CUSTOM_EXTENSION) *)sk_dup(CHECKED_CAST( \
- const _STACK *, const STACK_OF(SSL_CUSTOM_EXTENSION) *, sk)))
-
-#define sk_SSL_CUSTOM_EXTENSION_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk))
-
-#define sk_SSL_CUSTOM_EXTENSION_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, \
- const STACK_OF(SSL_CUSTOM_EXTENSION) *, sk))
-
-#define sk_SSL_CUSTOM_EXTENSION_set_cmp_func(sk, comp) \
- ((int (*)(const SSL_CUSTOM_EXTENSION **a, const SSL_CUSTOM_EXTENSION **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const SSL_CUSTOM_EXTENSION **a, \
- const SSL_CUSTOM_EXTENSION **b), \
- comp)))
-
-#define sk_SSL_CUSTOM_EXTENSION_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(SSL_CUSTOM_EXTENSION) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CUSTOM_EXTENSION) *, \
- sk), \
- CHECKED_CAST(void *(*)(void *), \
- SSL_CUSTOM_EXTENSION *(*)(SSL_CUSTOM_EXTENSION *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(SSL_CUSTOM_EXTENSION *), \
- free_func)))
-
-/* STACK_OF_X509_NAME_ENTRY */
-#define sk_STACK_OF_X509_NAME_ENTRY_new(comp) \
- ((STACK_OF(STACK_OF_X509_NAME_ENTRY) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const STACK_OF_X509_NAME_ENTRY **a, \
- const STACK_OF_X509_NAME_ENTRY **b), \
- comp)))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_new_null() \
- ((STACK_OF(STACK_OF_X509_NAME_ENTRY) *)sk_new_null())
-
-#define sk_STACK_OF_X509_NAME_ENTRY_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, \
- const STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk));
-
-#define sk_STACK_OF_X509_NAME_ENTRY_value(sk, i) \
- ((STACK_OF_X509_NAME_ENTRY *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(STACK_OF_X509_NAME_ENTRY) *, \
- sk), \
- (i)))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_set(sk, i, p) \
- ((STACK_OF_X509_NAME_ENTRY *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), (i), \
- CHECKED_CAST(void *, STACK_OF_X509_NAME_ENTRY *, p)))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(STACK_OF_X509_NAME_ENTRY *), \
- free_func))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \
- CHECKED_CAST(void *, STACK_OF_X509_NAME_ENTRY *, p), (where))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_delete(sk, where) \
- ((STACK_OF_X509_NAME_ENTRY *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \
- (where)))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_delete_ptr(sk, p) \
- ((STACK_OF_X509_NAME_ENTRY *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \
- CHECKED_CAST(void *, STACK_OF_X509_NAME_ENTRY *, p)))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \
- (out_index), CHECKED_CAST(void *, STACK_OF_X509_NAME_ENTRY *, p))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_shift(sk) \
- ((STACK_OF_X509_NAME_ENTRY *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk)))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \
- CHECKED_CAST(void *, STACK_OF_X509_NAME_ENTRY *, p))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_pop(sk) \
- ((STACK_OF_X509_NAME_ENTRY *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk)))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_dup(sk) \
- ((STACK_OF(STACK_OF_X509_NAME_ENTRY) *)sk_dup(CHECKED_CAST( \
- const _STACK *, const STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk)))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, \
- const STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_set_cmp_func(sk, comp) \
- ((int (*)(const STACK_OF_X509_NAME_ENTRY **a, \
- const STACK_OF_X509_NAME_ENTRY **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const STACK_OF_X509_NAME_ENTRY **a, \
- const STACK_OF_X509_NAME_ENTRY **b), \
- comp)))
-
-#define sk_STACK_OF_X509_NAME_ENTRY_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(STACK_OF_X509_NAME_ENTRY) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(STACK_OF_X509_NAME_ENTRY) *, \
- sk), \
- CHECKED_CAST(void *(*)(void *), \
- STACK_OF_X509_NAME_ENTRY *(*)(STACK_OF_X509_NAME_ENTRY *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(STACK_OF_X509_NAME_ENTRY *), \
- free_func)))
-
-/* SXNETID */
-#define sk_SXNETID_new(comp) \
- ((STACK_OF(SXNETID) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const SXNETID **a, const SXNETID **b), comp)))
-
-#define sk_SXNETID_new_null() ((STACK_OF(SXNETID) *)sk_new_null())
-
-#define sk_SXNETID_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(SXNETID) *, sk))
-
-#define sk_SXNETID_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk));
-
-#define sk_SXNETID_value(sk, i) \
- ((SXNETID *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SXNETID) *, sk), (i)))
-
-#define sk_SXNETID_set(sk, i, p) \
- ((SXNETID *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), (i), \
- CHECKED_CAST(void *, SXNETID *, p)))
-
-#define sk_SXNETID_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk))
-
-#define sk_SXNETID_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(SXNETID *), free_func))
-
-#define sk_SXNETID_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \
- CHECKED_CAST(void *, SXNETID *, p), (where))
-
-#define sk_SXNETID_delete(sk, where) \
- ((SXNETID *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \
- (where)))
-
-#define sk_SXNETID_delete_ptr(sk, p) \
- ((SXNETID *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \
- CHECKED_CAST(void *, SXNETID *, p)))
-
-#define sk_SXNETID_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), (out_index), \
- CHECKED_CAST(void *, SXNETID *, p))
-
-#define sk_SXNETID_shift(sk) \
- ((SXNETID *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk)))
-
-#define sk_SXNETID_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \
- CHECKED_CAST(void *, SXNETID *, p))
-
-#define sk_SXNETID_pop(sk) \
- ((SXNETID *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk)))
-
-#define sk_SXNETID_dup(sk) \
- ((STACK_OF(SXNETID) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SXNETID) *, sk)))
-
-#define sk_SXNETID_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk))
-
-#define sk_SXNETID_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(SXNETID) *, sk))
-
-#define sk_SXNETID_set_cmp_func(sk, comp) \
- ((int (*)(const SXNETID **a, const SXNETID **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const SXNETID **a, const SXNETID **b), comp)))
-
-#define sk_SXNETID_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(SXNETID) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SXNETID) *, sk), \
- CHECKED_CAST(void *(*)(void *), SXNETID *(*)(SXNETID *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(SXNETID *), free_func)))
-
-/* X509 */
-#define sk_X509_new(comp) \
- ((STACK_OF(X509) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const X509 **a, const X509 **b), comp)))
-
-#define sk_X509_new_null() ((STACK_OF(X509) *)sk_new_null())
-
-#define sk_X509_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509) *, sk))
-
-#define sk_X509_zero(sk) sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk));
-
-#define sk_X509_value(sk, i) \
- ((X509 *)sk_value(CHECKED_CAST(const _STACK *, const STACK_OF(X509) *, sk), \
- (i)))
-
-#define sk_X509_set(sk, i, p) \
- ((X509 *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), (i), \
- CHECKED_CAST(void *, X509 *, p)))
-
-#define sk_X509_free(sk) sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk))
-
-#define sk_X509_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509 *), free_func))
-
-#define sk_X509_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), \
- CHECKED_CAST(void *, X509 *, p), (where))
-
-#define sk_X509_delete(sk, where) \
- ((X509 *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), (where)))
-
-#define sk_X509_delete_ptr(sk, p) \
- ((X509 *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), \
- CHECKED_CAST(void *, X509 *, p)))
-
-#define sk_X509_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), (out_index), \
- CHECKED_CAST(void *, X509 *, p))
-
-#define sk_X509_shift(sk) \
- ((X509 *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk)))
-
-#define sk_X509_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), \
- CHECKED_CAST(void *, X509 *, p))
-
-#define sk_X509_pop(sk) \
- ((X509 *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk)))
-
-#define sk_X509_dup(sk) \
- ((STACK_OF(X509) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509) *, sk)))
-
-#define sk_X509_sort(sk) sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk))
-
-#define sk_X509_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509) *, sk))
-
-#define sk_X509_set_cmp_func(sk, comp) \
- ((int (*)(const X509 **a, const X509 **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const X509 **a, const X509 **b), \
- comp)))
-
-#define sk_X509_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509 *(*)(X509 *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509 *), free_func)))
-
-/* X509V3_EXT_METHOD */
-#define sk_X509V3_EXT_METHOD_new(comp) \
- ((STACK_OF(X509V3_EXT_METHOD) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const X509V3_EXT_METHOD **a, const X509V3_EXT_METHOD **b), \
- comp)))
-
-#define sk_X509V3_EXT_METHOD_new_null() \
- ((STACK_OF(X509V3_EXT_METHOD) *)sk_new_null())
-
-#define sk_X509V3_EXT_METHOD_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509V3_EXT_METHOD) *, sk))
-
-#define sk_X509V3_EXT_METHOD_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk));
-
-#define sk_X509V3_EXT_METHOD_value(sk, i) \
- ((X509V3_EXT_METHOD *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509V3_EXT_METHOD) *, sk), \
- (i)))
-
-#define sk_X509V3_EXT_METHOD_set(sk, i, p) \
- ((X509V3_EXT_METHOD *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), (i), \
- CHECKED_CAST(void *, X509V3_EXT_METHOD *, p)))
-
-#define sk_X509V3_EXT_METHOD_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk))
-
-#define sk_X509V3_EXT_METHOD_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509V3_EXT_METHOD *), \
- free_func))
-
-#define sk_X509V3_EXT_METHOD_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \
- CHECKED_CAST(void *, X509V3_EXT_METHOD *, p), (where))
-
-#define sk_X509V3_EXT_METHOD_delete(sk, where) \
- ((X509V3_EXT_METHOD *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), (where)))
-
-#define sk_X509V3_EXT_METHOD_delete_ptr(sk, p) \
- ((X509V3_EXT_METHOD *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \
- CHECKED_CAST(void *, X509V3_EXT_METHOD *, p)))
-
-#define sk_X509V3_EXT_METHOD_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \
- (out_index), CHECKED_CAST(void *, X509V3_EXT_METHOD *, p))
-
-#define sk_X509V3_EXT_METHOD_shift(sk) \
- ((X509V3_EXT_METHOD *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk)))
-
-#define sk_X509V3_EXT_METHOD_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \
- CHECKED_CAST(void *, X509V3_EXT_METHOD *, p))
-
-#define sk_X509V3_EXT_METHOD_pop(sk) \
- ((X509V3_EXT_METHOD *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk)))
-
-#define sk_X509V3_EXT_METHOD_dup(sk) \
- ((STACK_OF(X509V3_EXT_METHOD) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509V3_EXT_METHOD) *, sk)))
-
-#define sk_X509V3_EXT_METHOD_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk))
-
-#define sk_X509V3_EXT_METHOD_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509V3_EXT_METHOD) *, sk))
-
-#define sk_X509V3_EXT_METHOD_set_cmp_func(sk, comp) \
- ((int (*)(const X509V3_EXT_METHOD **a, const X509V3_EXT_METHOD **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const X509V3_EXT_METHOD **a, \
- const X509V3_EXT_METHOD **b), \
- comp)))
-
-#define sk_X509V3_EXT_METHOD_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509V3_EXT_METHOD) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509V3_EXT_METHOD) *, sk), \
- CHECKED_CAST(void *(*)(void *), \
- X509V3_EXT_METHOD *(*)(X509V3_EXT_METHOD *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509V3_EXT_METHOD *), \
- free_func)))
-
-/* X509_ALGOR */
-#define sk_X509_ALGOR_new(comp) \
- ((STACK_OF(X509_ALGOR) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const X509_ALGOR **a, const X509_ALGOR **b), \
- comp)))
-
-#define sk_X509_ALGOR_new_null() ((STACK_OF(X509_ALGOR) *)sk_new_null())
-
-#define sk_X509_ALGOR_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_ALGOR) *, sk))
-
-#define sk_X509_ALGOR_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk));
-
-#define sk_X509_ALGOR_value(sk, i) \
- ((X509_ALGOR *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_ALGOR) *, sk), (i)))
-
-#define sk_X509_ALGOR_set(sk, i, p) \
- ((X509_ALGOR *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \
- (i), CHECKED_CAST(void *, X509_ALGOR *, p)))
-
-#define sk_X509_ALGOR_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk))
-
-#define sk_X509_ALGOR_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_ALGOR *), free_func))
-
-#define sk_X509_ALGOR_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \
- CHECKED_CAST(void *, X509_ALGOR *, p), (where))
-
-#define sk_X509_ALGOR_delete(sk, where) \
- ((X509_ALGOR *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \
- (where)))
-
-#define sk_X509_ALGOR_delete_ptr(sk, p) \
- ((X509_ALGOR *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \
- CHECKED_CAST(void *, X509_ALGOR *, p)))
-
-#define sk_X509_ALGOR_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), (out_index), \
- CHECKED_CAST(void *, X509_ALGOR *, p))
-
-#define sk_X509_ALGOR_shift(sk) \
- ((X509_ALGOR *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk)))
-
-#define sk_X509_ALGOR_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \
- CHECKED_CAST(void *, X509_ALGOR *, p))
-
-#define sk_X509_ALGOR_pop(sk) \
- ((X509_ALGOR *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk)))
-
-#define sk_X509_ALGOR_dup(sk) \
- ((STACK_OF(X509_ALGOR) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_ALGOR) *, sk)))
-
-#define sk_X509_ALGOR_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk))
-
-#define sk_X509_ALGOR_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_ALGOR) *, sk))
-
-#define sk_X509_ALGOR_set_cmp_func(sk, comp) \
- ((int (*)(const X509_ALGOR **a, const X509_ALGOR **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const X509_ALGOR **a, const X509_ALGOR **b), \
- comp)))
-
-#define sk_X509_ALGOR_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_ALGOR) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_ALGOR) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_ALGOR *(*)(X509_ALGOR *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_ALGOR *), free_func)))
-
-/* X509_ATTRIBUTE */
-#define sk_X509_ATTRIBUTE_new(comp) \
- ((STACK_OF(X509_ATTRIBUTE) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const X509_ATTRIBUTE **a, const X509_ATTRIBUTE **b), comp)))
-
-#define sk_X509_ATTRIBUTE_new_null() ((STACK_OF(X509_ATTRIBUTE) *)sk_new_null())
-
-#define sk_X509_ATTRIBUTE_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_ATTRIBUTE) *, sk))
-
-#define sk_X509_ATTRIBUTE_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk));
-
-#define sk_X509_ATTRIBUTE_value(sk, i) \
- ((X509_ATTRIBUTE *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_ATTRIBUTE) *, sk), \
- (i)))
-
-#define sk_X509_ATTRIBUTE_set(sk, i, p) \
- ((X509_ATTRIBUTE *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), (i), \
- CHECKED_CAST(void *, X509_ATTRIBUTE *, p)))
-
-#define sk_X509_ATTRIBUTE_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk))
-
-#define sk_X509_ATTRIBUTE_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_ATTRIBUTE *), free_func))
-
-#define sk_X509_ATTRIBUTE_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), \
- CHECKED_CAST(void *, X509_ATTRIBUTE *, p), (where))
-
-#define sk_X509_ATTRIBUTE_delete(sk, where) \
- ((X509_ATTRIBUTE *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), (where)))
-
-#define sk_X509_ATTRIBUTE_delete_ptr(sk, p) \
- ((X509_ATTRIBUTE *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), \
- CHECKED_CAST(void *, X509_ATTRIBUTE *, p)))
-
-#define sk_X509_ATTRIBUTE_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), (out_index), \
- CHECKED_CAST(void *, X509_ATTRIBUTE *, p))
-
-#define sk_X509_ATTRIBUTE_shift(sk) \
- ((X509_ATTRIBUTE *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk)))
-
-#define sk_X509_ATTRIBUTE_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), \
- CHECKED_CAST(void *, X509_ATTRIBUTE *, p))
-
-#define sk_X509_ATTRIBUTE_pop(sk) \
- ((X509_ATTRIBUTE *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk)))
-
-#define sk_X509_ATTRIBUTE_dup(sk) \
- ((STACK_OF(X509_ATTRIBUTE) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_ATTRIBUTE) *, sk)))
-
-#define sk_X509_ATTRIBUTE_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk))
-
-#define sk_X509_ATTRIBUTE_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_ATTRIBUTE) *, sk))
-
-#define sk_X509_ATTRIBUTE_set_cmp_func(sk, comp) \
- ((int (*)(const X509_ATTRIBUTE **a, const X509_ATTRIBUTE **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const X509_ATTRIBUTE **a, \
- const X509_ATTRIBUTE **b), \
- comp)))
-
-#define sk_X509_ATTRIBUTE_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_ATTRIBUTE) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_ATTRIBUTE) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_ATTRIBUTE *(*)(X509_ATTRIBUTE *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_ATTRIBUTE *), free_func)))
-
-/* X509_CRL */
-#define sk_X509_CRL_new(comp) \
- ((STACK_OF(X509_CRL) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const X509_CRL **a, const X509_CRL **b), comp)))
-
-#define sk_X509_CRL_new_null() ((STACK_OF(X509_CRL) *)sk_new_null())
-
-#define sk_X509_CRL_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_CRL) *, sk))
-
-#define sk_X509_CRL_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk));
-
-#define sk_X509_CRL_value(sk, i) \
- ((X509_CRL *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_CRL) *, sk), (i)))
-
-#define sk_X509_CRL_set(sk, i, p) \
- ((X509_CRL *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), (i), \
- CHECKED_CAST(void *, X509_CRL *, p)))
-
-#define sk_X509_CRL_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk))
-
-#define sk_X509_CRL_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_CRL *), free_func))
-
-#define sk_X509_CRL_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \
- CHECKED_CAST(void *, X509_CRL *, p), (where))
-
-#define sk_X509_CRL_delete(sk, where) \
- ((X509_CRL *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \
- (where)))
-
-#define sk_X509_CRL_delete_ptr(sk, p) \
- ((X509_CRL *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \
- CHECKED_CAST(void *, X509_CRL *, p)))
-
-#define sk_X509_CRL_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), (out_index), \
- CHECKED_CAST(void *, X509_CRL *, p))
-
-#define sk_X509_CRL_shift(sk) \
- ((X509_CRL *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk)))
-
-#define sk_X509_CRL_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \
- CHECKED_CAST(void *, X509_CRL *, p))
-
-#define sk_X509_CRL_pop(sk) \
- ((X509_CRL *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk)))
-
-#define sk_X509_CRL_dup(sk) \
- ((STACK_OF(X509_CRL) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_CRL) *, sk)))
-
-#define sk_X509_CRL_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk))
-
-#define sk_X509_CRL_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_CRL) *, sk))
-
-#define sk_X509_CRL_set_cmp_func(sk, comp) \
- ((int (*)(const X509_CRL **a, const X509_CRL **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const X509_CRL **a, const X509_CRL **b), comp)))
-
-#define sk_X509_CRL_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_CRL) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_CRL) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_CRL *(*)(X509_CRL *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_CRL *), free_func)))
-
-/* X509_EXTENSION */
-#define sk_X509_EXTENSION_new(comp) \
- ((STACK_OF(X509_EXTENSION) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const X509_EXTENSION **a, const X509_EXTENSION **b), comp)))
-
-#define sk_X509_EXTENSION_new_null() ((STACK_OF(X509_EXTENSION) *)sk_new_null())
-
-#define sk_X509_EXTENSION_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_EXTENSION) *, sk))
-
-#define sk_X509_EXTENSION_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk));
-
-#define sk_X509_EXTENSION_value(sk, i) \
- ((X509_EXTENSION *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_EXTENSION) *, sk), \
- (i)))
-
-#define sk_X509_EXTENSION_set(sk, i, p) \
- ((X509_EXTENSION *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), (i), \
- CHECKED_CAST(void *, X509_EXTENSION *, p)))
-
-#define sk_X509_EXTENSION_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk))
-
-#define sk_X509_EXTENSION_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_EXTENSION *), free_func))
-
-#define sk_X509_EXTENSION_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), \
- CHECKED_CAST(void *, X509_EXTENSION *, p), (where))
-
-#define sk_X509_EXTENSION_delete(sk, where) \
- ((X509_EXTENSION *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), (where)))
-
-#define sk_X509_EXTENSION_delete_ptr(sk, p) \
- ((X509_EXTENSION *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), \
- CHECKED_CAST(void *, X509_EXTENSION *, p)))
-
-#define sk_X509_EXTENSION_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), (out_index), \
- CHECKED_CAST(void *, X509_EXTENSION *, p))
-
-#define sk_X509_EXTENSION_shift(sk) \
- ((X509_EXTENSION *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk)))
-
-#define sk_X509_EXTENSION_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), \
- CHECKED_CAST(void *, X509_EXTENSION *, p))
-
-#define sk_X509_EXTENSION_pop(sk) \
- ((X509_EXTENSION *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk)))
-
-#define sk_X509_EXTENSION_dup(sk) \
- ((STACK_OF(X509_EXTENSION) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_EXTENSION) *, sk)))
-
-#define sk_X509_EXTENSION_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk))
-
-#define sk_X509_EXTENSION_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_EXTENSION) *, sk))
-
-#define sk_X509_EXTENSION_set_cmp_func(sk, comp) \
- ((int (*)(const X509_EXTENSION **a, const X509_EXTENSION **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const X509_EXTENSION **a, \
- const X509_EXTENSION **b), \
- comp)))
-
-#define sk_X509_EXTENSION_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_EXTENSION) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_EXTENSION) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_EXTENSION *(*)(X509_EXTENSION *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_EXTENSION *), free_func)))
-
-/* X509_INFO */
-#define sk_X509_INFO_new(comp) \
- ((STACK_OF(X509_INFO) *)sk_new( \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const X509_INFO **a, const X509_INFO **b), comp)))
-
-#define sk_X509_INFO_new_null() ((STACK_OF(X509_INFO) *)sk_new_null())
-
-#define sk_X509_INFO_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_INFO) *, sk))
-
-#define sk_X509_INFO_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk));
-
-#define sk_X509_INFO_value(sk, i) \
- ((X509_INFO *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_INFO) *, sk), (i)))
-
-#define sk_X509_INFO_set(sk, i, p) \
- ((X509_INFO *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), (i), \
- CHECKED_CAST(void *, X509_INFO *, p)))
-
-#define sk_X509_INFO_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk))
-
-#define sk_X509_INFO_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_INFO *), free_func))
-
-#define sk_X509_INFO_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \
- CHECKED_CAST(void *, X509_INFO *, p), (where))
-
-#define sk_X509_INFO_delete(sk, where) \
- ((X509_INFO *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \
- (where)))
-
-#define sk_X509_INFO_delete_ptr(sk, p) \
- ((X509_INFO *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \
- CHECKED_CAST(void *, X509_INFO *, p)))
-
-#define sk_X509_INFO_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), (out_index), \
- CHECKED_CAST(void *, X509_INFO *, p))
-
-#define sk_X509_INFO_shift(sk) \
- ((X509_INFO *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk)))
-
-#define sk_X509_INFO_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \
- CHECKED_CAST(void *, X509_INFO *, p))
-
-#define sk_X509_INFO_pop(sk) \
- ((X509_INFO *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk)))
-
-#define sk_X509_INFO_dup(sk) \
- ((STACK_OF(X509_INFO) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_INFO) *, sk)))
-
-#define sk_X509_INFO_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk))
-
-#define sk_X509_INFO_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_INFO) *, sk))
-
-#define sk_X509_INFO_set_cmp_func(sk, comp) \
- ((int (*)(const X509_INFO **a, const X509_INFO **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const X509_INFO **a, const X509_INFO **b), comp)))
-
-#define sk_X509_INFO_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_INFO) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_INFO) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_INFO *(*)(X509_INFO *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_INFO *), free_func)))
-
-/* X509_LOOKUP */
-#define sk_X509_LOOKUP_new(comp) \
- ((STACK_OF(X509_LOOKUP) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const X509_LOOKUP **a, const X509_LOOKUP **b), \
- comp)))
-
-#define sk_X509_LOOKUP_new_null() ((STACK_OF(X509_LOOKUP) *)sk_new_null())
-
-#define sk_X509_LOOKUP_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_LOOKUP) *, sk))
-
-#define sk_X509_LOOKUP_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk));
-
-#define sk_X509_LOOKUP_value(sk, i) \
- ((X509_LOOKUP *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_LOOKUP) *, sk), (i)))
-
-#define sk_X509_LOOKUP_set(sk, i, p) \
- ((X509_LOOKUP *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \
- (i), CHECKED_CAST(void *, X509_LOOKUP *, p)))
-
-#define sk_X509_LOOKUP_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk))
-
-#define sk_X509_LOOKUP_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_LOOKUP *), free_func))
-
-#define sk_X509_LOOKUP_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \
- CHECKED_CAST(void *, X509_LOOKUP *, p), (where))
-
-#define sk_X509_LOOKUP_delete(sk, where) \
- ((X509_LOOKUP *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), (where)))
-
-#define sk_X509_LOOKUP_delete_ptr(sk, p) \
- ((X509_LOOKUP *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \
- CHECKED_CAST(void *, X509_LOOKUP *, p)))
-
-#define sk_X509_LOOKUP_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), (out_index), \
- CHECKED_CAST(void *, X509_LOOKUP *, p))
-
-#define sk_X509_LOOKUP_shift(sk) \
- ((X509_LOOKUP *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk)))
-
-#define sk_X509_LOOKUP_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \
- CHECKED_CAST(void *, X509_LOOKUP *, p))
-
-#define sk_X509_LOOKUP_pop(sk) \
- ((X509_LOOKUP *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk)))
-
-#define sk_X509_LOOKUP_dup(sk) \
- ((STACK_OF(X509_LOOKUP) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_LOOKUP) *, sk)))
-
-#define sk_X509_LOOKUP_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk))
-
-#define sk_X509_LOOKUP_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_LOOKUP) *, sk))
-
-#define sk_X509_LOOKUP_set_cmp_func(sk, comp) \
- ((int (*)(const X509_LOOKUP **a, const X509_LOOKUP **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const X509_LOOKUP **a, const X509_LOOKUP **b), \
- comp)))
-
-#define sk_X509_LOOKUP_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_LOOKUP) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_LOOKUP) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_LOOKUP *(*)(X509_LOOKUP *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_LOOKUP *), free_func)))
-
-/* X509_NAME */
-#define sk_X509_NAME_new(comp) \
- ((STACK_OF(X509_NAME) *)sk_new( \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const X509_NAME **a, const X509_NAME **b), comp)))
-
-#define sk_X509_NAME_new_null() ((STACK_OF(X509_NAME) *)sk_new_null())
-
-#define sk_X509_NAME_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME) *, sk))
-
-#define sk_X509_NAME_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk));
-
-#define sk_X509_NAME_value(sk, i) \
- ((X509_NAME *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME) *, sk), (i)))
-
-#define sk_X509_NAME_set(sk, i, p) \
- ((X509_NAME *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), (i), \
- CHECKED_CAST(void *, X509_NAME *, p)))
-
-#define sk_X509_NAME_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk))
-
-#define sk_X509_NAME_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_NAME *), free_func))
-
-#define sk_X509_NAME_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \
- CHECKED_CAST(void *, X509_NAME *, p), (where))
-
-#define sk_X509_NAME_delete(sk, where) \
- ((X509_NAME *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \
- (where)))
-
-#define sk_X509_NAME_delete_ptr(sk, p) \
- ((X509_NAME *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \
- CHECKED_CAST(void *, X509_NAME *, p)))
-
-#define sk_X509_NAME_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), (out_index), \
- CHECKED_CAST(void *, X509_NAME *, p))
-
-#define sk_X509_NAME_shift(sk) \
- ((X509_NAME *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk)))
-
-#define sk_X509_NAME_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \
- CHECKED_CAST(void *, X509_NAME *, p))
-
-#define sk_X509_NAME_pop(sk) \
- ((X509_NAME *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk)))
-
-#define sk_X509_NAME_dup(sk) \
- ((STACK_OF(X509_NAME) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME) *, sk)))
-
-#define sk_X509_NAME_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk))
-
-#define sk_X509_NAME_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME) *, sk))
-
-#define sk_X509_NAME_set_cmp_func(sk, comp) \
- ((int (*)(const X509_NAME **a, const X509_NAME **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const X509_NAME **a, const X509_NAME **b), comp)))
-
-#define sk_X509_NAME_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_NAME) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_NAME *(*)(X509_NAME *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_NAME *), free_func)))
-
-/* X509_NAME_ENTRY */
-#define sk_X509_NAME_ENTRY_new(comp) \
- ((STACK_OF(X509_NAME_ENTRY) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const X509_NAME_ENTRY **a, const X509_NAME_ENTRY **b), comp)))
-
-#define sk_X509_NAME_ENTRY_new_null() \
- ((STACK_OF(X509_NAME_ENTRY) *)sk_new_null())
-
-#define sk_X509_NAME_ENTRY_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME_ENTRY) *, sk))
-
-#define sk_X509_NAME_ENTRY_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk));
-
-#define sk_X509_NAME_ENTRY_value(sk, i) \
- ((X509_NAME_ENTRY *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME_ENTRY) *, sk), \
- (i)))
-
-#define sk_X509_NAME_ENTRY_set(sk, i, p) \
- ((X509_NAME_ENTRY *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), (i), \
- CHECKED_CAST(void *, X509_NAME_ENTRY *, p)))
-
-#define sk_X509_NAME_ENTRY_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk))
-
-#define sk_X509_NAME_ENTRY_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_NAME_ENTRY *), free_func))
-
-#define sk_X509_NAME_ENTRY_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \
- CHECKED_CAST(void *, X509_NAME_ENTRY *, p), (where))
-
-#define sk_X509_NAME_ENTRY_delete(sk, where) \
- ((X509_NAME_ENTRY *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), (where)))
-
-#define sk_X509_NAME_ENTRY_delete_ptr(sk, p) \
- ((X509_NAME_ENTRY *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \
- CHECKED_CAST(void *, X509_NAME_ENTRY *, p)))
-
-#define sk_X509_NAME_ENTRY_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \
- (out_index), CHECKED_CAST(void *, X509_NAME_ENTRY *, p))
-
-#define sk_X509_NAME_ENTRY_shift(sk) \
- ((X509_NAME_ENTRY *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk)))
-
-#define sk_X509_NAME_ENTRY_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \
- CHECKED_CAST(void *, X509_NAME_ENTRY *, p))
-
-#define sk_X509_NAME_ENTRY_pop(sk) \
- ((X509_NAME_ENTRY *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk)))
-
-#define sk_X509_NAME_ENTRY_dup(sk) \
- ((STACK_OF(X509_NAME_ENTRY) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME_ENTRY) *, sk)))
-
-#define sk_X509_NAME_ENTRY_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk))
-
-#define sk_X509_NAME_ENTRY_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME_ENTRY) *, sk))
-
-#define sk_X509_NAME_ENTRY_set_cmp_func(sk, comp) \
- ((int (*)(const X509_NAME_ENTRY **a, const X509_NAME_ENTRY **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const X509_NAME_ENTRY **a, \
- const X509_NAME_ENTRY **b), \
- comp)))
-
-#define sk_X509_NAME_ENTRY_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_NAME_ENTRY) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME_ENTRY) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_NAME_ENTRY *(*)(X509_NAME_ENTRY *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_NAME_ENTRY *), free_func)))
-
-/* X509_OBJECT */
-#define sk_X509_OBJECT_new(comp) \
- ((STACK_OF(X509_OBJECT) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const X509_OBJECT **a, const X509_OBJECT **b), \
- comp)))
-
-#define sk_X509_OBJECT_new_null() ((STACK_OF(X509_OBJECT) *)sk_new_null())
-
-#define sk_X509_OBJECT_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_OBJECT) *, sk))
-
-#define sk_X509_OBJECT_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk));
-
-#define sk_X509_OBJECT_value(sk, i) \
- ((X509_OBJECT *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_OBJECT) *, sk), (i)))
-
-#define sk_X509_OBJECT_set(sk, i, p) \
- ((X509_OBJECT *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \
- (i), CHECKED_CAST(void *, X509_OBJECT *, p)))
-
-#define sk_X509_OBJECT_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk))
-
-#define sk_X509_OBJECT_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_OBJECT *), free_func))
-
-#define sk_X509_OBJECT_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \
- CHECKED_CAST(void *, X509_OBJECT *, p), (where))
-
-#define sk_X509_OBJECT_delete(sk, where) \
- ((X509_OBJECT *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), (where)))
-
-#define sk_X509_OBJECT_delete_ptr(sk, p) \
- ((X509_OBJECT *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \
- CHECKED_CAST(void *, X509_OBJECT *, p)))
-
-#define sk_X509_OBJECT_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), (out_index), \
- CHECKED_CAST(void *, X509_OBJECT *, p))
-
-#define sk_X509_OBJECT_shift(sk) \
- ((X509_OBJECT *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk)))
-
-#define sk_X509_OBJECT_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \
- CHECKED_CAST(void *, X509_OBJECT *, p))
-
-#define sk_X509_OBJECT_pop(sk) \
- ((X509_OBJECT *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk)))
-
-#define sk_X509_OBJECT_dup(sk) \
- ((STACK_OF(X509_OBJECT) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_OBJECT) *, sk)))
-
-#define sk_X509_OBJECT_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk))
-
-#define sk_X509_OBJECT_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_OBJECT) *, sk))
-
-#define sk_X509_OBJECT_set_cmp_func(sk, comp) \
- ((int (*)(const X509_OBJECT **a, const X509_OBJECT **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const X509_OBJECT **a, const X509_OBJECT **b), \
- comp)))
-
-#define sk_X509_OBJECT_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_OBJECT) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_OBJECT) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_OBJECT *(*)(X509_OBJECT *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_OBJECT *), free_func)))
-
-/* X509_POLICY_DATA */
-#define sk_X509_POLICY_DATA_new(comp) \
- ((STACK_OF(X509_POLICY_DATA) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const X509_POLICY_DATA **a, const X509_POLICY_DATA **b), comp)))
-
-#define sk_X509_POLICY_DATA_new_null() \
- ((STACK_OF(X509_POLICY_DATA) *)sk_new_null())
-
-#define sk_X509_POLICY_DATA_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_DATA) *, sk))
-
-#define sk_X509_POLICY_DATA_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk));
-
-#define sk_X509_POLICY_DATA_value(sk, i) \
- ((X509_POLICY_DATA *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_DATA) *, sk), \
- (i)))
-
-#define sk_X509_POLICY_DATA_set(sk, i, p) \
- ((X509_POLICY_DATA *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), (i), \
- CHECKED_CAST(void *, X509_POLICY_DATA *, p)))
-
-#define sk_X509_POLICY_DATA_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk))
-
-#define sk_X509_POLICY_DATA_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_POLICY_DATA *), free_func))
-
-#define sk_X509_POLICY_DATA_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \
- CHECKED_CAST(void *, X509_POLICY_DATA *, p), (where))
-
-#define sk_X509_POLICY_DATA_delete(sk, where) \
- ((X509_POLICY_DATA *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), (where)))
-
-#define sk_X509_POLICY_DATA_delete_ptr(sk, p) \
- ((X509_POLICY_DATA *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \
- CHECKED_CAST(void *, X509_POLICY_DATA *, p)))
-
-#define sk_X509_POLICY_DATA_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \
- (out_index), CHECKED_CAST(void *, X509_POLICY_DATA *, p))
-
-#define sk_X509_POLICY_DATA_shift(sk) \
- ((X509_POLICY_DATA *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk)))
-
-#define sk_X509_POLICY_DATA_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \
- CHECKED_CAST(void *, X509_POLICY_DATA *, p))
-
-#define sk_X509_POLICY_DATA_pop(sk) \
- ((X509_POLICY_DATA *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk)))
-
-#define sk_X509_POLICY_DATA_dup(sk) \
- ((STACK_OF(X509_POLICY_DATA) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_DATA) *, sk)))
-
-#define sk_X509_POLICY_DATA_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk))
-
-#define sk_X509_POLICY_DATA_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_DATA) *, sk))
-
-#define sk_X509_POLICY_DATA_set_cmp_func(sk, comp) \
- ((int (*)(const X509_POLICY_DATA **a, const X509_POLICY_DATA **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const X509_POLICY_DATA **a, \
- const X509_POLICY_DATA **b), \
- comp)))
-
-#define sk_X509_POLICY_DATA_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_POLICY_DATA) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_DATA) *, sk), \
- CHECKED_CAST(void *(*)(void *), \
- X509_POLICY_DATA *(*)(X509_POLICY_DATA *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_POLICY_DATA *), \
- free_func)))
-
-/* X509_POLICY_NODE */
-#define sk_X509_POLICY_NODE_new(comp) \
- ((STACK_OF(X509_POLICY_NODE) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const X509_POLICY_NODE **a, const X509_POLICY_NODE **b), comp)))
-
-#define sk_X509_POLICY_NODE_new_null() \
- ((STACK_OF(X509_POLICY_NODE) *)sk_new_null())
-
-#define sk_X509_POLICY_NODE_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_NODE) *, sk))
-
-#define sk_X509_POLICY_NODE_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk));
-
-#define sk_X509_POLICY_NODE_value(sk, i) \
- ((X509_POLICY_NODE *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_NODE) *, sk), \
- (i)))
-
-#define sk_X509_POLICY_NODE_set(sk, i, p) \
- ((X509_POLICY_NODE *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), (i), \
- CHECKED_CAST(void *, X509_POLICY_NODE *, p)))
-
-#define sk_X509_POLICY_NODE_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk))
-
-#define sk_X509_POLICY_NODE_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_POLICY_NODE *), free_func))
-
-#define sk_X509_POLICY_NODE_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \
- CHECKED_CAST(void *, X509_POLICY_NODE *, p), (where))
-
-#define sk_X509_POLICY_NODE_delete(sk, where) \
- ((X509_POLICY_NODE *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), (where)))
-
-#define sk_X509_POLICY_NODE_delete_ptr(sk, p) \
- ((X509_POLICY_NODE *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \
- CHECKED_CAST(void *, X509_POLICY_NODE *, p)))
-
-#define sk_X509_POLICY_NODE_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \
- (out_index), CHECKED_CAST(void *, X509_POLICY_NODE *, p))
-
-#define sk_X509_POLICY_NODE_shift(sk) \
- ((X509_POLICY_NODE *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk)))
-
-#define sk_X509_POLICY_NODE_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \
- CHECKED_CAST(void *, X509_POLICY_NODE *, p))
-
-#define sk_X509_POLICY_NODE_pop(sk) \
- ((X509_POLICY_NODE *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk)))
-
-#define sk_X509_POLICY_NODE_dup(sk) \
- ((STACK_OF(X509_POLICY_NODE) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_NODE) *, sk)))
-
-#define sk_X509_POLICY_NODE_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk))
-
-#define sk_X509_POLICY_NODE_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_NODE) *, sk))
-
-#define sk_X509_POLICY_NODE_set_cmp_func(sk, comp) \
- ((int (*)(const X509_POLICY_NODE **a, const X509_POLICY_NODE **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const X509_POLICY_NODE **a, \
- const X509_POLICY_NODE **b), \
- comp)))
-
-#define sk_X509_POLICY_NODE_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_POLICY_NODE) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_NODE) *, sk), \
- CHECKED_CAST(void *(*)(void *), \
- X509_POLICY_NODE *(*)(X509_POLICY_NODE *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_POLICY_NODE *), \
- free_func)))
-
-/* X509_PURPOSE */
-#define sk_X509_PURPOSE_new(comp) \
- ((STACK_OF(X509_PURPOSE) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const X509_PURPOSE **a, const X509_PURPOSE **b), \
- comp)))
-
-#define sk_X509_PURPOSE_new_null() ((STACK_OF(X509_PURPOSE) *)sk_new_null())
-
-#define sk_X509_PURPOSE_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_PURPOSE) *, sk))
-
-#define sk_X509_PURPOSE_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk));
-
-#define sk_X509_PURPOSE_value(sk, i) \
- ((X509_PURPOSE *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_PURPOSE) *, sk), (i)))
-
-#define sk_X509_PURPOSE_set(sk, i, p) \
- ((X509_PURPOSE *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), (i), \
- CHECKED_CAST(void *, X509_PURPOSE *, p)))
-
-#define sk_X509_PURPOSE_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk))
-
-#define sk_X509_PURPOSE_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_PURPOSE *), free_func))
-
-#define sk_X509_PURPOSE_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), \
- CHECKED_CAST(void *, X509_PURPOSE *, p), (where))
-
-#define sk_X509_PURPOSE_delete(sk, where) \
- ((X509_PURPOSE *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), (where)))
-
-#define sk_X509_PURPOSE_delete_ptr(sk, p) \
- ((X509_PURPOSE *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), \
- CHECKED_CAST(void *, X509_PURPOSE *, p)))
-
-#define sk_X509_PURPOSE_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), (out_index), \
- CHECKED_CAST(void *, X509_PURPOSE *, p))
-
-#define sk_X509_PURPOSE_shift(sk) \
- ((X509_PURPOSE *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk)))
-
-#define sk_X509_PURPOSE_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), \
- CHECKED_CAST(void *, X509_PURPOSE *, p))
-
-#define sk_X509_PURPOSE_pop(sk) \
- ((X509_PURPOSE *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk)))
-
-#define sk_X509_PURPOSE_dup(sk) \
- ((STACK_OF(X509_PURPOSE) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_PURPOSE) *, sk)))
-
-#define sk_X509_PURPOSE_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk))
-
-#define sk_X509_PURPOSE_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_PURPOSE) *, sk))
-
-#define sk_X509_PURPOSE_set_cmp_func(sk, comp) \
- ((int (*)(const X509_PURPOSE **a, const X509_PURPOSE **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const X509_PURPOSE **a, const X509_PURPOSE **b), \
- comp)))
-
-#define sk_X509_PURPOSE_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_PURPOSE) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_PURPOSE) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_PURPOSE *(*)(X509_PURPOSE *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_PURPOSE *), free_func)))
-
-/* X509_REVOKED */
-#define sk_X509_REVOKED_new(comp) \
- ((STACK_OF(X509_REVOKED) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const X509_REVOKED **a, const X509_REVOKED **b), \
- comp)))
-
-#define sk_X509_REVOKED_new_null() ((STACK_OF(X509_REVOKED) *)sk_new_null())
-
-#define sk_X509_REVOKED_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_REVOKED) *, sk))
-
-#define sk_X509_REVOKED_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk));
-
-#define sk_X509_REVOKED_value(sk, i) \
- ((X509_REVOKED *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_REVOKED) *, sk), (i)))
-
-#define sk_X509_REVOKED_set(sk, i, p) \
- ((X509_REVOKED *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), (i), \
- CHECKED_CAST(void *, X509_REVOKED *, p)))
-
-#define sk_X509_REVOKED_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk))
-
-#define sk_X509_REVOKED_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_REVOKED *), free_func))
-
-#define sk_X509_REVOKED_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), \
- CHECKED_CAST(void *, X509_REVOKED *, p), (where))
-
-#define sk_X509_REVOKED_delete(sk, where) \
- ((X509_REVOKED *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), (where)))
-
-#define sk_X509_REVOKED_delete_ptr(sk, p) \
- ((X509_REVOKED *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), \
- CHECKED_CAST(void *, X509_REVOKED *, p)))
-
-#define sk_X509_REVOKED_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), (out_index), \
- CHECKED_CAST(void *, X509_REVOKED *, p))
-
-#define sk_X509_REVOKED_shift(sk) \
- ((X509_REVOKED *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk)))
-
-#define sk_X509_REVOKED_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), \
- CHECKED_CAST(void *, X509_REVOKED *, p))
-
-#define sk_X509_REVOKED_pop(sk) \
- ((X509_REVOKED *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk)))
-
-#define sk_X509_REVOKED_dup(sk) \
- ((STACK_OF(X509_REVOKED) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_REVOKED) *, sk)))
-
-#define sk_X509_REVOKED_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk))
-
-#define sk_X509_REVOKED_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_REVOKED) *, sk))
-
-#define sk_X509_REVOKED_set_cmp_func(sk, comp) \
- ((int (*)(const X509_REVOKED **a, const X509_REVOKED **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const X509_REVOKED **a, const X509_REVOKED **b), \
- comp)))
-
-#define sk_X509_REVOKED_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_REVOKED) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_REVOKED) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_REVOKED *(*)(X509_REVOKED *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_REVOKED *), free_func)))
-
-/* X509_TRUST */
-#define sk_X509_TRUST_new(comp) \
- ((STACK_OF(X509_TRUST) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const X509_TRUST **a, const X509_TRUST **b), \
- comp)))
-
-#define sk_X509_TRUST_new_null() ((STACK_OF(X509_TRUST) *)sk_new_null())
-
-#define sk_X509_TRUST_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_TRUST) *, sk))
-
-#define sk_X509_TRUST_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk));
-
-#define sk_X509_TRUST_value(sk, i) \
- ((X509_TRUST *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_TRUST) *, sk), (i)))
-
-#define sk_X509_TRUST_set(sk, i, p) \
- ((X509_TRUST *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \
- (i), CHECKED_CAST(void *, X509_TRUST *, p)))
-
-#define sk_X509_TRUST_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk))
-
-#define sk_X509_TRUST_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_TRUST *), free_func))
-
-#define sk_X509_TRUST_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \
- CHECKED_CAST(void *, X509_TRUST *, p), (where))
-
-#define sk_X509_TRUST_delete(sk, where) \
- ((X509_TRUST *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \
- (where)))
-
-#define sk_X509_TRUST_delete_ptr(sk, p) \
- ((X509_TRUST *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \
- CHECKED_CAST(void *, X509_TRUST *, p)))
-
-#define sk_X509_TRUST_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), (out_index), \
- CHECKED_CAST(void *, X509_TRUST *, p))
-
-#define sk_X509_TRUST_shift(sk) \
- ((X509_TRUST *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk)))
-
-#define sk_X509_TRUST_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \
- CHECKED_CAST(void *, X509_TRUST *, p))
-
-#define sk_X509_TRUST_pop(sk) \
- ((X509_TRUST *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk)))
-
-#define sk_X509_TRUST_dup(sk) \
- ((STACK_OF(X509_TRUST) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_TRUST) *, sk)))
-
-#define sk_X509_TRUST_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk))
-
-#define sk_X509_TRUST_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_TRUST) *, sk))
-
-#define sk_X509_TRUST_set_cmp_func(sk, comp) \
- ((int (*)(const X509_TRUST **a, const X509_TRUST **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const X509_TRUST **a, const X509_TRUST **b), \
- comp)))
-
-#define sk_X509_TRUST_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_TRUST) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_TRUST) *, sk), \
- CHECKED_CAST(void *(*)(void *), X509_TRUST *(*)(X509_TRUST *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_TRUST *), free_func)))
-
-/* X509_VERIFY_PARAM */
-#define sk_X509_VERIFY_PARAM_new(comp) \
- ((STACK_OF(X509_VERIFY_PARAM) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const X509_VERIFY_PARAM **a, const X509_VERIFY_PARAM **b), \
- comp)))
-
-#define sk_X509_VERIFY_PARAM_new_null() \
- ((STACK_OF(X509_VERIFY_PARAM) *)sk_new_null())
-
-#define sk_X509_VERIFY_PARAM_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_VERIFY_PARAM) *, sk))
-
-#define sk_X509_VERIFY_PARAM_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk));
-
-#define sk_X509_VERIFY_PARAM_value(sk, i) \
- ((X509_VERIFY_PARAM *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_VERIFY_PARAM) *, sk), \
- (i)))
-
-#define sk_X509_VERIFY_PARAM_set(sk, i, p) \
- ((X509_VERIFY_PARAM *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), (i), \
- CHECKED_CAST(void *, X509_VERIFY_PARAM *, p)))
-
-#define sk_X509_VERIFY_PARAM_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk))
-
-#define sk_X509_VERIFY_PARAM_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_VERIFY_PARAM *), \
- free_func))
-
-#define sk_X509_VERIFY_PARAM_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \
- CHECKED_CAST(void *, X509_VERIFY_PARAM *, p), (where))
-
-#define sk_X509_VERIFY_PARAM_delete(sk, where) \
- ((X509_VERIFY_PARAM *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), (where)))
-
-#define sk_X509_VERIFY_PARAM_delete_ptr(sk, p) \
- ((X509_VERIFY_PARAM *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \
- CHECKED_CAST(void *, X509_VERIFY_PARAM *, p)))
-
-#define sk_X509_VERIFY_PARAM_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \
- (out_index), CHECKED_CAST(void *, X509_VERIFY_PARAM *, p))
-
-#define sk_X509_VERIFY_PARAM_shift(sk) \
- ((X509_VERIFY_PARAM *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk)))
-
-#define sk_X509_VERIFY_PARAM_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \
- CHECKED_CAST(void *, X509_VERIFY_PARAM *, p))
-
-#define sk_X509_VERIFY_PARAM_pop(sk) \
- ((X509_VERIFY_PARAM *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk)))
-
-#define sk_X509_VERIFY_PARAM_dup(sk) \
- ((STACK_OF(X509_VERIFY_PARAM) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_VERIFY_PARAM) *, sk)))
-
-#define sk_X509_VERIFY_PARAM_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk))
-
-#define sk_X509_VERIFY_PARAM_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_VERIFY_PARAM) *, sk))
-
-#define sk_X509_VERIFY_PARAM_set_cmp_func(sk, comp) \
- ((int (*)(const X509_VERIFY_PARAM **a, const X509_VERIFY_PARAM **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const X509_VERIFY_PARAM **a, \
- const X509_VERIFY_PARAM **b), \
- comp)))
-
-#define sk_X509_VERIFY_PARAM_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(X509_VERIFY_PARAM) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(X509_VERIFY_PARAM) *, sk), \
- CHECKED_CAST(void *(*)(void *), \
- X509_VERIFY_PARAM *(*)(X509_VERIFY_PARAM *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(X509_VERIFY_PARAM *), \
- free_func)))
-
-/* void */
-#define sk_void_new(comp) \
- ((STACK_OF(void) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const void **a, const void **b), comp)))
-
-#define sk_void_new_null() ((STACK_OF(void) *)sk_new_null())
-
-#define sk_void_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(void) *, sk))
-
-#define sk_void_zero(sk) sk_zero(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk));
-
-#define sk_void_value(sk, i) \
- ((void *)sk_value(CHECKED_CAST(const _STACK *, const STACK_OF(void) *, sk), \
- (i)))
-
-#define sk_void_set(sk, i, p) \
- ((void *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), (i), \
- CHECKED_CAST(void *, void *, p)))
-
-#define sk_void_free(sk) sk_free(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk))
-
-#define sk_void_pop_free(sk, free_func) \
- sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(void *), free_func))
-
-#define sk_void_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), \
- CHECKED_CAST(void *, void *, p), (where))
-
-#define sk_void_delete(sk, where) \
- ((void *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), (where)))
-
-#define sk_void_delete_ptr(sk, p) \
- ((void *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), \
- CHECKED_CAST(void *, void *, p)))
-
-#define sk_void_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), (out_index), \
- CHECKED_CAST(void *, void *, p))
-
-#define sk_void_shift(sk) \
- ((void *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk)))
-
-#define sk_void_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), \
- CHECKED_CAST(void *, void *, p))
-
-#define sk_void_pop(sk) \
- ((void *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk)))
-
-#define sk_void_dup(sk) \
- ((STACK_OF(void) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(void) *, sk)))
-
-#define sk_void_sort(sk) sk_sort(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk))
-
-#define sk_void_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(void) *, sk))
-
-#define sk_void_set_cmp_func(sk, comp) \
- ((int (*)(const void **a, const void **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const void **a, const void **b), \
- comp)))
-
-#define sk_void_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(void) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(void) *, sk), \
- CHECKED_CAST(void *(*)(void *), void *(*)(void *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(void *), free_func)))
-
-/* SRTP_PROTECTION_PROFILE */
-#define sk_SRTP_PROTECTION_PROFILE_new(comp) \
- ((STACK_OF(SRTP_PROTECTION_PROFILE) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, int (*)(const const SRTP_PROTECTION_PROFILE **a, \
- const const SRTP_PROTECTION_PROFILE **b), \
- comp)))
-
-#define sk_SRTP_PROTECTION_PROFILE_new_null() \
- ((STACK_OF(SRTP_PROTECTION_PROFILE) *)sk_new_null())
-
-#define sk_SRTP_PROTECTION_PROFILE_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, \
- const STACK_OF(SRTP_PROTECTION_PROFILE) *, sk))
-
-#define sk_SRTP_PROTECTION_PROFILE_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk));
-
-#define sk_SRTP_PROTECTION_PROFILE_value(sk, i) \
- ((const SRTP_PROTECTION_PROFILE *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SRTP_PROTECTION_PROFILE) *, \
- sk), \
- (i)))
-
-#define sk_SRTP_PROTECTION_PROFILE_set(sk, i, p) \
- ((const SRTP_PROTECTION_PROFILE *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), (i), \
- CHECKED_CAST(void *, const SRTP_PROTECTION_PROFILE *, p)))
-
-#define sk_SRTP_PROTECTION_PROFILE_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk))
-
-#define sk_SRTP_PROTECTION_PROFILE_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \
- CHECKED_CAST(void (*)(void *), \
- void (*)(const SRTP_PROTECTION_PROFILE *), free_func))
-
-#define sk_SRTP_PROTECTION_PROFILE_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \
- CHECKED_CAST(void *, const SRTP_PROTECTION_PROFILE *, p), (where))
-
-#define sk_SRTP_PROTECTION_PROFILE_delete(sk, where) \
- ((const SRTP_PROTECTION_PROFILE *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \
- (where)))
-
-#define sk_SRTP_PROTECTION_PROFILE_delete_ptr(sk, p) \
- ((const SRTP_PROTECTION_PROFILE *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \
- CHECKED_CAST(void *, const SRTP_PROTECTION_PROFILE *, p)))
-
-#define sk_SRTP_PROTECTION_PROFILE_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \
- (out_index), \
- CHECKED_CAST(void *, const SRTP_PROTECTION_PROFILE *, p))
-
-#define sk_SRTP_PROTECTION_PROFILE_shift(sk) \
- ((const SRTP_PROTECTION_PROFILE *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk)))
-
-#define sk_SRTP_PROTECTION_PROFILE_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \
- CHECKED_CAST(void *, const SRTP_PROTECTION_PROFILE *, p))
-
-#define sk_SRTP_PROTECTION_PROFILE_pop(sk) \
- ((const SRTP_PROTECTION_PROFILE *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk)))
-
-#define sk_SRTP_PROTECTION_PROFILE_dup(sk) \
- ((STACK_OF(SRTP_PROTECTION_PROFILE) *)sk_dup(CHECKED_CAST( \
- const _STACK *, const STACK_OF(SRTP_PROTECTION_PROFILE) *, sk)))
-
-#define sk_SRTP_PROTECTION_PROFILE_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk))
-
-#define sk_SRTP_PROTECTION_PROFILE_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, \
- const STACK_OF(SRTP_PROTECTION_PROFILE) *, sk))
-
-#define sk_SRTP_PROTECTION_PROFILE_set_cmp_func(sk, comp) \
- ((int (*)(const SRTP_PROTECTION_PROFILE **a, \
- const SRTP_PROTECTION_PROFILE **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const SRTP_PROTECTION_PROFILE **a, \
- const SRTP_PROTECTION_PROFILE **b), \
- comp)))
-
-#define sk_SRTP_PROTECTION_PROFILE_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(SRTP_PROTECTION_PROFILE) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SRTP_PROTECTION_PROFILE) *, \
- sk), \
- CHECKED_CAST( \
- void *(*)(void *), \
- const SRTP_PROTECTION_PROFILE *(*)(const SRTP_PROTECTION_PROFILE *), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), \
- void (*)(const SRTP_PROTECTION_PROFILE *), free_func)))
-
-/* SSL_CIPHER */
-#define sk_SSL_CIPHER_new(comp) \
- ((STACK_OF(SSL_CIPHER) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const const SSL_CIPHER **a, const const SSL_CIPHER **b), comp)))
-
-#define sk_SSL_CIPHER_new_null() ((STACK_OF(SSL_CIPHER) *)sk_new_null())
-
-#define sk_SSL_CIPHER_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CIPHER) *, sk))
-
-#define sk_SSL_CIPHER_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk));
-
-#define sk_SSL_CIPHER_value(sk, i) \
- ((const SSL_CIPHER *)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CIPHER) *, sk), (i)))
-
-#define sk_SSL_CIPHER_set(sk, i, p) \
- ((const SSL_CIPHER *)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), (i), \
- CHECKED_CAST(void *, const SSL_CIPHER *, p)))
-
-#define sk_SSL_CIPHER_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk))
-
-#define sk_SSL_CIPHER_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(const SSL_CIPHER *), free_func))
-
-#define sk_SSL_CIPHER_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), \
- CHECKED_CAST(void *, const SSL_CIPHER *, p), (where))
-
-#define sk_SSL_CIPHER_delete(sk, where) \
- ((const SSL_CIPHER *)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), (where)))
-
-#define sk_SSL_CIPHER_delete_ptr(sk, p) \
- ((const SSL_CIPHER *)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), \
- CHECKED_CAST(void *, const SSL_CIPHER *, p)))
-
-#define sk_SSL_CIPHER_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), (out_index), \
- CHECKED_CAST(void *, const SSL_CIPHER *, p))
-
-#define sk_SSL_CIPHER_shift(sk) \
- ((const SSL_CIPHER *)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk)))
-
-#define sk_SSL_CIPHER_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), \
- CHECKED_CAST(void *, const SSL_CIPHER *, p))
-
-#define sk_SSL_CIPHER_pop(sk) \
- ((const SSL_CIPHER *)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk)))
-
-#define sk_SSL_CIPHER_dup(sk) \
- ((STACK_OF(SSL_CIPHER) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CIPHER) *, sk)))
-
-#define sk_SSL_CIPHER_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk))
-
-#define sk_SSL_CIPHER_is_sorted(sk) \
- sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CIPHER) *, sk))
-
-#define sk_SSL_CIPHER_set_cmp_func(sk, comp) \
- ((int (*)(const SSL_CIPHER **a, const SSL_CIPHER **b))sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), \
- CHECKED_CAST(stack_cmp_func, \
- int (*)(const SSL_CIPHER **a, const SSL_CIPHER **b), \
- comp)))
-
-#define sk_SSL_CIPHER_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(SSL_CIPHER) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CIPHER) *, sk), \
- CHECKED_CAST(void *(*)(void *), \
- const SSL_CIPHER *(*)(const SSL_CIPHER *), copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(const SSL_CIPHER *), \
- free_func)))
-
-/* OPENSSL_STRING */
-#define sk_OPENSSL_STRING_new(comp) \
- ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_CAST( \
- stack_cmp_func, \
- int (*)(const OPENSSL_STRING *a, const OPENSSL_STRING *b), comp)))
-
-#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null())
-
-#define sk_OPENSSL_STRING_num(sk) \
- sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(OPENSSL_STRING) *, sk))
-
-#define sk_OPENSSL_STRING_zero(sk) \
- sk_zero(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk));
-
-#define sk_OPENSSL_STRING_value(sk, i) \
- ((OPENSSL_STRING)sk_value( \
- CHECKED_CAST(const _STACK *, const STACK_OF(OPENSSL_STRING) *, sk), \
- (i)))
-
-#define sk_OPENSSL_STRING_set(sk, i, p) \
- ((OPENSSL_STRING)sk_set( \
- CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), (i), \
- CHECKED_CAST(void *, OPENSSL_STRING, p)))
-
-#define sk_OPENSSL_STRING_free(sk) \
- sk_free(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk))
-
-#define sk_OPENSSL_STRING_pop_free(sk, free_func) \
- sk_pop_free( \
- CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), \
- CHECKED_CAST(void (*)(void *), void (*)(OPENSSL_STRING), free_func))
-
-#define sk_OPENSSL_STRING_insert(sk, p, where) \
- sk_insert(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), \
- CHECKED_CAST(void *, OPENSSL_STRING, p), (where))
-
-#define sk_OPENSSL_STRING_delete(sk, where) \
- ((OPENSSL_STRING)sk_delete( \
- CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), (where)))
-
-#define sk_OPENSSL_STRING_delete_ptr(sk, p) \
- ((OPENSSL_STRING)sk_delete_ptr( \
- CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), \
- CHECKED_CAST(void *, OPENSSL_STRING, p)))
-
-#define sk_OPENSSL_STRING_find(sk, out_index, p) \
- sk_find(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), (out_index), \
- CHECKED_CAST(void *, OPENSSL_STRING, p))
-
-#define sk_OPENSSL_STRING_shift(sk) \
- ((OPENSSL_STRING)sk_shift( \
- CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk)))
-
-#define sk_OPENSSL_STRING_push(sk, p) \
- sk_push(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), \
- CHECKED_CAST(void *, OPENSSL_STRING, p))
-
-#define sk_OPENSSL_STRING_pop(sk) \
- ((OPENSSL_STRING)sk_pop( \
- CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk)))
-
-#define sk_OPENSSL_STRING_dup(sk) \
- ((STACK_OF(OPENSSL_STRING) *)sk_dup( \
- CHECKED_CAST(const _STACK *, const STACK_OF(OPENSSL_STRING) *, sk)))
-
-#define sk_OPENSSL_STRING_sort(sk) \
- sk_sort(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk))
-
-#define sk_OPENSSL_STRING_is_sorted(sk) \
- sk_is_sorted( \
- CHECKED_CAST(const _STACK *, const STACK_OF(OPENSSL_STRING) *, sk))
-
-#define sk_OPENSSL_STRING_set_cmp_func(sk, comp) \
- ((int (*)(const OPENSSL_STRING **a, const OPENSSL_STRING **b)) \
- sk_set_cmp_func( \
- CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), \
- CHECKED_CAST(stack_cmp_func, int (*)(const OPENSSL_STRING **a, \
- const OPENSSL_STRING **b), \
- comp)))
-
-#define sk_OPENSSL_STRING_deep_copy(sk, copy_func, free_func) \
- ((STACK_OF(OPENSSL_STRING) *)sk_deep_copy( \
- CHECKED_CAST(const _STACK *, const STACK_OF(OPENSSL_STRING) *, sk), \
- CHECKED_CAST(void *(*)(void *), OPENSSL_STRING (*)(OPENSSL_STRING), \
- copy_func), \
- CHECKED_CAST(void (*)(void *), void (*)(OPENSSL_STRING), free_func)))
diff --git a/src/include/openssl/x509.h b/src/include/openssl/x509.h
index 914b275..efd8c78 100644
--- a/src/include/openssl/x509.h
+++ b/src/include/openssl/x509.h
@@ -89,6 +89,14 @@
#endif
+/* Legacy X.509 library.
+ *
+ * This header is part of OpenSSL's X.509 implementation. It is retained for
+ * compatibility but otherwise underdocumented and not actively maintained. In
+ * the future, a replacement library will be available. Meanwhile, minimize
+ * dependencies on this header where possible. */
+
+
#define X509_FILETYPE_PEM 1
#define X509_FILETYPE_ASN1 2
#define X509_FILETYPE_DEFAULT 3
@@ -104,13 +112,7 @@
#define X509v3_KU_DECIPHER_ONLY 0x8000
#define X509v3_KU_UNDEF 0xffff
-struct X509_objects_st
- {
- int nid;
- int (*a2i)(void);
- int (*i2a)(void);
- } /* X509_OBJECTS */;
-
+DEFINE_STACK_OF(X509_ALGOR)
DECLARE_ASN1_SET_OF(X509_ALGOR)
typedef STACK_OF(X509_ALGOR) X509_ALGORS;
@@ -142,7 +144,7 @@
int size; /* temp variable */
} /* X509_NAME_ENTRY */;
-DECLARE_STACK_OF(X509_NAME_ENTRY)
+DEFINE_STACK_OF(X509_NAME_ENTRY)
DECLARE_ASN1_SET_OF(X509_NAME_ENTRY)
/* we always keep X509_NAMEs in 2 forms. */
@@ -150,20 +152,14 @@
{
STACK_OF(X509_NAME_ENTRY) *entries;
int modified; /* true if 'bytes' needs to be built */
-#ifndef OPENSSL_NO_BUFFER
BUF_MEM *bytes;
-#else
- char *bytes;
-#endif
/* unsigned long hash; Keep the hash around for lookups */
unsigned char *canon_enc;
int canon_enclen;
} /* X509_NAME */;
-DECLARE_STACK_OF(X509_NAME)
+DEFINE_STACK_OF(X509_NAME)
-#define X509_EX_V_NETSCAPE_HACK 0x8000
-#define X509_EX_V_INIT 0x0001
struct X509_extension_st
{
ASN1_OBJECT *object;
@@ -173,7 +169,7 @@
typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
-DECLARE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF(X509_EXTENSION)
DECLARE_ASN1_SET_OF(X509_EXTENSION)
/* a sequence of these are used */
@@ -188,7 +184,7 @@
} value;
} /* X509_ATTRIBUTE */;
-DECLARE_STACK_OF(X509_ATTRIBUTE)
+DEFINE_STACK_OF(X509_ATTRIBUTE)
DECLARE_ASN1_SET_OF(X509_ATTRIBUTE)
@@ -240,6 +236,9 @@
STACK_OF(X509_ALGOR) *other; /* other unspecified info */
} /* X509_CERT_AUX */;
+DECLARE_STACK_OF(DIST_POINT)
+DECLARE_STACK_OF(GENERAL_NAME)
+
struct x509_st
{
X509_CINF *cert_info;
@@ -267,7 +266,7 @@
CRYPTO_MUTEX lock;
} /* X509 */;
-DECLARE_STACK_OF(X509)
+DEFINE_STACK_OF(X509)
DECLARE_ASN1_SET_OF(X509)
/* This is used for a table of trust checking functions */
@@ -281,12 +280,7 @@
void *arg2;
} /* X509_TRUST */;
-DECLARE_STACK_OF(X509_TRUST)
-
-struct x509_cert_pair_st {
- X509 *forward;
- X509 *reverse;
-} /* X509_CERT_PAIR */;
+DEFINE_STACK_OF(X509_TRUST)
/* standard trust ids */
@@ -403,7 +397,7 @@
int sequence; /* load sequence */
};
-DECLARE_STACK_OF(X509_REVOKED)
+DEFINE_STACK_OF(X509_REVOKED)
DECLARE_ASN1_SET_OF(X509_REVOKED)
struct X509_crl_info_st
@@ -418,6 +412,8 @@
ASN1_ENCODING enc;
} /* X509_CRL_INFO */;
+DECLARE_STACK_OF(GENERAL_NAMES)
+
struct X509_crl_st
{
/* actual signature */
@@ -441,7 +437,7 @@
void *meth_data;
} /* X509_CRL */;
-DECLARE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(X509_CRL)
DECLARE_ASN1_SET_OF(X509_CRL)
struct private_key_st
@@ -476,7 +472,7 @@
} /* X509_INFO */;
-DECLARE_STACK_OF(X509_INFO)
+DEFINE_STACK_OF(X509_INFO)
#endif
/* The next 2 structures and their 8 routines were sent to me by
@@ -496,20 +492,6 @@
ASN1_BIT_STRING *signature;
} /* NETSCAPE_SPKI */;
-/* Netscape certificate sequence structure */
-struct Netscape_certificate_sequence
- {
- ASN1_OBJECT *type;
- STACK_OF(X509) *certs;
- } /* NETSCAPE_CERT_SEQUENCE */;
-
-/* Unused (and iv length is wrong)
-typedef struct CBCParameter_st
- {
- unsigned char iv[8];
- } CBC_PARAM;
-*/
-
/* PKCS#8 private key info structure */
struct pkcs8_priv_key_info_st
@@ -536,9 +518,6 @@
extern "C" {
#endif
-#define X509_EXT_PACK_UNKNOWN 1
-#define X509_EXT_PACK_STRING 2
-
#define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version)
/* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */
#define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore)
@@ -767,13 +746,11 @@
DECLARE_ASN1_FUNCTIONS(X509)
DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)
-DECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR)
-
/* X509_up_ref adds one to the reference count of |x| and returns one. */
OPENSSL_EXPORT int X509_up_ref(X509 *x);
OPENSSL_EXPORT int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused,
- CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+ CRYPTO_EX_dup *dup_unused, CRYPTO_EX_free *free_func);
OPENSSL_EXPORT int X509_set_ex_data(X509 *r, int idx, void *arg);
OPENSSL_EXPORT void *X509_get_ex_data(X509 *r, int idx);
OPENSSL_EXPORT int i2d_X509_AUX(X509 *a,unsigned char **pp);
@@ -808,7 +785,6 @@
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
-DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)
#ifndef OPENSSL_NO_EVP
OPENSSL_EXPORT X509_INFO * X509_INFO_new(void);
@@ -844,7 +820,6 @@
OPENSSL_EXPORT int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
OPENSSL_EXPORT EVP_PKEY * X509_get_pubkey(X509 *x);
OPENSSL_EXPORT ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x);
-OPENSSL_EXPORT int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */);
OPENSSL_EXPORT STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x);
OPENSSL_EXPORT int X509_REQ_set_version(X509_REQ *x,long version);
@@ -1116,32 +1091,6 @@
DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)
-/* EVP_PK values indicate the algorithm of the public key in a certificate. */
-
-#define EVP_PK_RSA 0x0001
-#define EVP_PK_DSA 0x0002
-#define EVP_PK_DH 0x0004
-#define EVP_PK_EC 0x0008
-
-/* EVP_PKS values indicate the algorithm used to sign a certificate. */
-
-#define EVP_PKS_RSA 0x0100
-#define EVP_PKS_DSA 0x0200
-#define EVP_PKS_EC 0x0400
-
-/* EVP_PKT values are flags that define what public-key operations can be
- * performed with the public key from a certificate. */
-
-/* EVP_PKT_SIGN indicates that the public key can be used for signing. */
-#define EVP_PKT_SIGN 0x0010
-/* EVP_PKT_ENC indicates that a session key can be encrypted to the public
- * key. */
-#define EVP_PKT_ENC 0x0020
-/* EVP_PKT_EXCH indicates that key-agreement can be performed. */
-#define EVP_PKT_EXCH 0x0040
-/* EVP_PKT_EXP indicates that key is weak (i.e. "export"). */
-#define EVP_PKT_EXP 0x1000
-
#ifdef __cplusplus
}
diff --git a/src/include/openssl/x509_vfy.h b/src/include/openssl/x509_vfy.h
index f069cb2..ac739ea 100644
--- a/src/include/openssl/x509_vfy.h
+++ b/src/include/openssl/x509_vfy.h
@@ -72,24 +72,13 @@
extern "C" {
#endif
-#if 0
-/* Outer object */
-typedef struct x509_hash_dir_st
- {
- int num_dirs;
- char **dirs;
- int *dirs_type;
- int num_dirs_alloced;
- } X509_HASH_DIR_CTX;
-#endif
+/* Legacy X.509 library.
+ *
+ * This header is part of OpenSSL's X.509 implementation. It is retained for
+ * compatibility but otherwise underdocumented and not actively maintained. In
+ * the future, a replacement library will be available. Meanwhile, minimize
+ * dependencies on this header where possible. */
-typedef struct x509_file_st
- {
- int num_paths; /* number of paths to files or directories */
- int num_alloced;
- char **paths; /* the list of paths or directories */
- int *path_type;
- } X509_CERT_FILE_CTX;
/*******************************/
/*
@@ -109,10 +98,6 @@
certificate chain.
*/
-/* The following are legacy constants that should not be used. */
-#define X509_LU_RETRY (-1)
-#define X509_LU_FAIL 0
-
#define X509_LU_X509 1
#define X509_LU_CRL 2
#define X509_LU_PKEY 3
@@ -129,8 +114,8 @@
} data;
} X509_OBJECT;
-DECLARE_STACK_OF(X509_LOOKUP)
-DECLARE_STACK_OF(X509_OBJECT)
+DEFINE_STACK_OF(X509_LOOKUP)
+DEFINE_STACK_OF(X509_OBJECT)
/* This is a static that defines the function interface */
typedef struct x509_lookup_method_st
@@ -173,7 +158,7 @@
X509_VERIFY_PARAM_ID *id; /* opaque ID data */
};
-DECLARE_STACK_OF(X509_VERIFY_PARAM)
+DEFINE_STACK_OF(X509_VERIFY_PARAM)
/* This is used to hold everything. It is used for all certificate
* validation. Once we have a certificate chain, the 'verify'
@@ -513,7 +498,7 @@
#endif
OPENSSL_EXPORT int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused,
- CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+ CRYPTO_EX_dup *dup_unused, CRYPTO_EX_free *free_func);
OPENSSL_EXPORT int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx,int idx,void *data);
OPENSSL_EXPORT void * X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx,int idx);
OPENSSL_EXPORT int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
diff --git a/src/include/openssl/x509v3.h b/src/include/openssl/x509v3.h
index 4754f71..7375d23 100644
--- a/src/include/openssl/x509v3.h
+++ b/src/include/openssl/x509v3.h
@@ -63,6 +63,15 @@
extern "C" {
#endif
+
+/* Legacy X.509 library.
+ *
+ * This header is part of OpenSSL's X.509 implementation. It is retained for
+ * compatibility but otherwise underdocumented and not actively maintained. In
+ * the future, a replacement library will be available. Meanwhile, minimize
+ * dependencies on this header where possible. */
+
+
/* Forward reference */
struct v3_ext_method;
struct v3_ext_ctx;
@@ -137,7 +146,7 @@
typedef struct v3_ext_method X509V3_EXT_METHOD;
-DECLARE_STACK_OF(X509V3_EXT_METHOD)
+DEFINE_STACK_OF(X509V3_EXT_METHOD)
/* ext_flags values */
#define X509V3_EXT_DYNAMIC 0x1
@@ -201,23 +210,25 @@
} d;
} GENERAL_NAME;
+DEFINE_STACK_OF(GENERAL_NAME)
+DECLARE_ASN1_SET_OF(GENERAL_NAME)
+
typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;
+DEFINE_STACK_OF(GENERAL_NAMES)
+
typedef struct ACCESS_DESCRIPTION_st {
ASN1_OBJECT *method;
GENERAL_NAME *location;
} ACCESS_DESCRIPTION;
+DEFINE_STACK_OF(ACCESS_DESCRIPTION)
+DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION)
+
typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE;
-DECLARE_STACK_OF(GENERAL_NAME)
-DECLARE_ASN1_SET_OF(GENERAL_NAME)
-
-DECLARE_STACK_OF(ACCESS_DESCRIPTION)
-DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION)
-
typedef struct DIST_POINT_NAME_st {
int type;
union {
@@ -251,7 +262,7 @@
typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
-DECLARE_STACK_OF(DIST_POINT)
+DEFINE_STACK_OF(DIST_POINT)
DECLARE_ASN1_SET_OF(DIST_POINT)
struct AUTHORITY_KEYID_st {
@@ -267,7 +278,7 @@
ASN1_OCTET_STRING *user;
} SXNETID;
-DECLARE_STACK_OF(SXNETID)
+DEFINE_STACK_OF(SXNETID)
DECLARE_ASN1_SET_OF(SXNETID)
typedef struct SXNET_st {
@@ -294,7 +305,7 @@
} d;
} POLICYQUALINFO;
-DECLARE_STACK_OF(POLICYQUALINFO)
+DEFINE_STACK_OF(POLICYQUALINFO)
DECLARE_ASN1_SET_OF(POLICYQUALINFO)
typedef struct POLICYINFO_st {
@@ -304,7 +315,7 @@
typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
-DECLARE_STACK_OF(POLICYINFO)
+DEFINE_STACK_OF(POLICYINFO)
DECLARE_ASN1_SET_OF(POLICYINFO)
typedef struct POLICY_MAPPING_st {
@@ -312,7 +323,7 @@
ASN1_OBJECT *subjectDomainPolicy;
} POLICY_MAPPING;
-DECLARE_STACK_OF(POLICY_MAPPING)
+DEFINE_STACK_OF(POLICY_MAPPING)
typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS;
@@ -322,7 +333,7 @@
ASN1_INTEGER *maximum;
} GENERAL_SUBTREE;
-DECLARE_STACK_OF(GENERAL_SUBTREE)
+DEFINE_STACK_OF(GENERAL_SUBTREE)
struct NAME_CONSTRAINTS_st {
STACK_OF(GENERAL_SUBTREE) *permittedSubtrees;
@@ -501,7 +512,7 @@
#define X509V3_ADD_DELETE 5L
#define X509V3_ADD_SILENT 0x10
-DECLARE_STACK_OF(X509_PURPOSE)
+DEFINE_STACK_OF(X509_PURPOSE)
DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
@@ -721,13 +732,12 @@
unsigned long chtype);
OPENSSL_EXPORT void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent);
-DECLARE_STACK_OF(X509_POLICY_NODE)
+DEFINE_STACK_OF(X509_POLICY_NODE)
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
-void ERR_load_X509V3_strings(void);
#ifdef __cplusplus