Latest update.

This commit is contained in:
2020-05-17 20:27:18 +09:00
parent ad9fce94c2
commit 3a6d64bb68
619 changed files with 13638 additions and 4698 deletions
+3 -1
View File
@@ -61,6 +61,7 @@ typedef enum {
: EVP_PKEY_ED448)))
struct ecx_key_st {
OPENSSL_CTX *libctx;
unsigned int haspubkey:1;
unsigned char pubkey[MAX_KEYLEN];
unsigned char *privkey;
@@ -73,7 +74,7 @@ struct ecx_key_st {
typedef struct ecx_key_st ECX_KEY;
size_t ecx_key_length(ECX_KEY_TYPE type);
ECX_KEY *ecx_key_new(ECX_KEY_TYPE type, int haspubkey);
ECX_KEY *ecx_key_new(OPENSSL_CTX *libctx, ECX_KEY_TYPE type, int haspubkey);
unsigned char *ecx_key_allocate_privkey(ECX_KEY *key);
void ecx_key_free(ECX_KEY *key);
int ecx_key_up_ref(ECX_KEY *key);
@@ -109,6 +110,7 @@ void X448_public_from_private(uint8_t out_public_value[56],
const uint8_t private_key[56]);
/* Backend support */
int ecx_public_from_private(ECX_KEY *key);
int ecx_key_fromdata(ECX_KEY *ecx, const OSSL_PARAM params[],
int include_private);
+6 -10
View File
@@ -526,7 +526,7 @@ struct evp_pkey_st {
int type;
int save_type;
# ifndef FIPS_MODE
# ifndef FIPS_MODULE
/*
* Legacy key "origin" is composed of a pointer to an EVP_PKEY_ASN1_METHOD,
* a pointer to a low level key and possibly a pointer to an engine.
@@ -557,7 +557,7 @@ struct evp_pkey_st {
CRYPTO_RWLOCK *lock;
STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
int save_parameters;
#ifndef FIPS_MODE
#ifndef FIPS_MODULE
CRYPTO_EX_DATA ex_data;
#endif
@@ -633,7 +633,7 @@ void evp_app_cleanup_int(void);
void *evp_pkey_export_to_provider(EVP_PKEY *pk, OPENSSL_CTX *libctx,
EVP_KEYMGMT **keymgmt,
const char *propquery);
#ifndef FIPS_MODE
#ifndef FIPS_MODULE
int evp_pkey_downgrade(EVP_PKEY *pk);
void evp_pkey_free_legacy(EVP_PKEY *x);
#endif
@@ -678,10 +678,6 @@ int evp_keymgmt_gen_set_params(const EVP_KEYMGMT *keymgmt, void *genctx,
const OSSL_PARAM params[]);
const OSSL_PARAM *
evp_keymgmt_gen_settable_params(const EVP_KEYMGMT *keymgmt);
int evp_keymgmt_gen_get_params(const EVP_KEYMGMT *keymgmt, void *genctx,
OSSL_PARAM params[]);
const OSSL_PARAM *
evp_keymgmt_gen_gettable_params(const EVP_KEYMGMT *keymgmt);
void *evp_keymgmt_gen(const EVP_KEYMGMT *keymgmt, void *genctx,
OSSL_CALLBACK *cb, void *cbarg);
void evp_keymgmt_gen_cleanup(const EVP_KEYMGMT *keymgmt, void *genctx);
@@ -723,7 +719,7 @@ void evp_encode_ctx_set_flags(EVP_ENCODE_CTX *ctx, unsigned int flags);
const EVP_CIPHER *evp_get_cipherbyname_ex(OPENSSL_CTX *libctx, const char *name);
const EVP_MD *evp_get_digestbyname_ex(OPENSSL_CTX *libctx, const char *name);
#ifndef FIPS_MODE
#ifndef FIPS_MODULE
/*
* Internal helpers for stricter EVP_PKEY_CTX_{set,get}_params().
*
@@ -731,7 +727,7 @@ const EVP_MD *evp_get_digestbyname_ex(OPENSSL_CTX *libctx, const char *name);
*
* In particular they return -2 if any of the params is not supported.
*
* They are not available in FIPS_MODE as they depend on
* They are not available in FIPS_MODULE as they depend on
* - EVP_PKEY_CTX_{get,set}_params()
* - EVP_PKEY_CTX_{gettable,settable}_params()
*
@@ -741,4 +737,4 @@ int evp_pkey_ctx_get_params_strict(EVP_PKEY_CTX *ctx, OSSL_PARAM *params);
EVP_PKEY *evp_pkcs82pkey_int(const PKCS8_PRIV_KEY_INFO *p8, OPENSSL_CTX *libctx,
const char *propq);
#endif /* !defined(FIPS_MODE) */
#endif /* !defined(FIPS_MODULE) */
+42
View File
@@ -13,7 +13,43 @@
#include <openssl/core.h>
#include <openssl/rsa.h>
typedef struct rsa_pss_params_30_st {
int hash_algorithm_nid;
struct {
int algorithm_nid; /* Currently always NID_mgf1 */
int hash_algorithm_nid;
} mask_gen;
unsigned int salt_len;
unsigned int trailer_field;
} RSA_PSS_PARAMS_30;
RSA_PSS_PARAMS_30 *rsa_get0_pss_params_30(RSA *r);
int rsa_pss_params_30_set_defaults(RSA_PSS_PARAMS_30 *rsa_pss_params);
int rsa_pss_params_30_copy(RSA_PSS_PARAMS_30 *to,
const RSA_PSS_PARAMS_30 *from);
int rsa_pss_params_30_is_unrestricted(const RSA_PSS_PARAMS_30 *rsa_pss_params);
int rsa_pss_params_30_set_hashalg(RSA_PSS_PARAMS_30 *rsa_pss_params,
int hashalg_nid);
int rsa_pss_params_30_set_maskgenalg(RSA_PSS_PARAMS_30 *rsa_pss_params,
int maskgenalg_nid);
int rsa_pss_params_30_set_maskgenhashalg(RSA_PSS_PARAMS_30 *rsa_pss_params,
int maskgenhashalg_nid);
int rsa_pss_params_30_set_saltlen(RSA_PSS_PARAMS_30 *rsa_pss_params,
int saltlen);
int rsa_pss_params_30_set_trailerfield(RSA_PSS_PARAMS_30 *rsa_pss_params,
int trailerfield);
int rsa_pss_params_30_hashalg(const RSA_PSS_PARAMS_30 *rsa_pss_params);
int rsa_pss_params_30_maskgenalg(const RSA_PSS_PARAMS_30 *rsa_pss_params);
int rsa_pss_params_30_maskgenhashalg(const RSA_PSS_PARAMS_30 *rsa_pss_params);
int rsa_pss_params_30_saltlen(const RSA_PSS_PARAMS_30 *rsa_pss_params);
int rsa_pss_params_30_trailerfield(const RSA_PSS_PARAMS_30 *rsa_pss_params);
const char *rsa_mgf_nid2name(int mgf);
int rsa_oaeppss_md2nid(const EVP_MD *md);
const char *rsa_oaeppss_nid2name(int md);
RSA *rsa_new_with_ctx(OPENSSL_CTX *libctx);
OPENSSL_CTX *rsa_get0_libctx(RSA *r);
int rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes,
const STACK_OF(BIGNUM) *exps,
@@ -21,7 +57,13 @@ int rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes,
int rsa_get0_all_params(RSA *r, STACK_OF(BIGNUM_const) *primes,
STACK_OF(BIGNUM_const) *exps,
STACK_OF(BIGNUM_const) *coeffs);
int rsa_todata(RSA *rsa, OSSL_PARAM_BLD *bld, OSSL_PARAM params[]);
int rsa_fromdata(RSA *rsa, const OSSL_PARAM params[]);
int rsa_pss_params_30_todata(const RSA_PSS_PARAMS_30 *pss, const char *propq,
OSSL_PARAM_BLD *bld, OSSL_PARAM params[]);
int rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
const OSSL_PARAM params[], OPENSSL_CTX *libctx);
int rsa_padding_check_PKCS1_type_2_TLS(OPENSSL_CTX *ctx, unsigned char *to,
size_t tlen, const unsigned char *from,
+3 -1
View File
@@ -157,7 +157,8 @@ typedef struct ossl_ex_data_global_st {
# define OPENSSL_CTX_FIPS_PROV_INDEX 9
# define OPENSSL_CTX_SERIALIZER_STORE_INDEX 10
# define OPENSSL_CTX_SELF_TEST_CB_INDEX 11
# define OPENSSL_CTX_MAX_INDEXES 12
# define OPENSSL_CTX_BIO_PROV_INDEX 12
# define OPENSSL_CTX_MAX_INDEXES 13
typedef struct openssl_ctx_method {
void *(*new_func)(OPENSSL_CTX *ctx);
@@ -238,5 +239,6 @@ static ossl_inline void ossl_sleep(unsigned long millis)
char *sk_ASN1_UTF8STRING2text(STACK_OF(ASN1_UTF8STRING) *text, const char *sep,
size_t max_len);
char *ipaddr_to_asc(unsigned char *p, int len);
#endif
+2 -2
View File
@@ -118,9 +118,9 @@ void ffc_params_get_validate_params(const FFC_PARAMS *params,
int ffc_params_copy(FFC_PARAMS *dst, const FFC_PARAMS *src);
int ffc_params_cmp(const FFC_PARAMS *a, const FFC_PARAMS *b, int ignore_q);
#ifndef FIPS_MODE
#ifndef FIPS_MODULE
int ffc_params_print(BIO *bp, const FFC_PARAMS *ffc, int indent);
#endif /* FIPS_MODE */
#endif /* FIPS_MODULE */
int ffc_params_FIPS186_4_generate(OPENSSL_CTX *libctx, FFC_PARAMS *params,
+6
View File
@@ -26,6 +26,8 @@ OSSL_PROPERTY_LIST *ossl_parse_query(OPENSSL_CTX *ctx, const char *s);
/* Property checker of query vs definition */
int ossl_property_match_count(const OSSL_PROPERTY_LIST *query,
const OSSL_PROPERTY_LIST *defn);
int ossl_property_is_enabled(OPENSSL_CTX *ctx, const char *property_name,
const OSSL_PROPERTY_LIST *prop_list);
/* Free a parsed property list */
void ossl_property_free(OSSL_PROPERTY_LIST *p);
@@ -43,6 +45,10 @@ int ossl_method_store_fetch(OSSL_METHOD_STORE *store, int nid,
const char *prop_query, void **result);
int ossl_method_store_set_global_properties(OSSL_METHOD_STORE *store,
const char *prop_query);
int ossl_method_store_merge_global_properties(OSSL_METHOD_STORE *store,
const char *prop_query);
int ossl_method_store_global_property_is_enabled(OSSL_METHOD_STORE *store,
const char *prop_name);
/* property query cache functions */
int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, int nid,
+2 -2
View File
@@ -154,9 +154,9 @@ struct servent *PASCAL getservbyname(const char *, const char *);
/* also in apps/include/apps.h */
# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINCE)
# define openssl_fdset(a,b) FD_SET((unsigned int)a, b)
# define openssl_fdset(a, b) FD_SET((unsigned int)(a), b)
# else
# define openssl_fdset(a,b) FD_SET(a, b)
# define openssl_fdset(a, b) FD_SET(a, b)
# endif
#endif
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -15,7 +15,7 @@
* OPENSSL_CTX object. In this way data will get cleaned up correctly when the
* module gets unloaded.
*/
#if !defined(FIPS_MODE) || defined(ALLOW_RUN_ONCE_IN_FIPS)
#if !defined(FIPS_MODULE) || defined(ALLOW_RUN_ONCE_IN_FIPS)
/*
* DEFINE_RUN_ONCE: Define an initialiser function that should be run exactly
* once. It takes no arguments and returns and int result (1 for success or
@@ -143,4 +143,4 @@
# define RUN_ONCE_ALT(once, initalt, init) \
(CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
#endif /* FIPS_MODE */
#endif /* FIPS_MODULE */
+17 -14
View File
@@ -119,8 +119,9 @@ extern "C" {
# define SMIME_OLDMIME 0x400
# define SMIME_CRLFEOL 0x800
# define SMIME_STREAM 0x1000
struct X509_algor_st;
DEFINE_STACK_OF(X509_ALGOR)
/* Stacks for types not otherwise defined in this header */
DEFINE_OR_DECLARE_STACK_OF(X509_ALGOR)
# define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */
/*
@@ -187,15 +188,15 @@ typedef struct ASN1_ENCODING_st {
(B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
# define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
typedef struct asn1_string_table_st {
struct asn1_string_table_st {
int nid;
long minsize;
long maxsize;
unsigned long mask;
unsigned long flags;
} ASN1_STRING_TABLE;
};
DEFINE_STACK_OF(ASN1_STRING_TABLE)
DEFINE_OR_DECLARE_STACK_OF(ASN1_STRING_TABLE)
/* size limits: this stuff is taken straight from RFC2459 */
@@ -419,13 +420,8 @@ typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
ASN1_STRFLGS_DUMP_UNKNOWN | \
ASN1_STRFLGS_DUMP_DER)
DEFINE_STACK_OF(ASN1_INTEGER)
DEFINE_STACK_OF(ASN1_GENERALSTRING)
DEFINE_STACK_OF(ASN1_UTF8STRING)
typedef struct asn1_type_st {
struct asn1_type_st {
int type;
union {
char *ptr;
@@ -454,9 +450,9 @@ typedef struct asn1_type_st {
ASN1_STRING *sequence;
ASN1_VALUE *asn1_value;
} value;
} ASN1_TYPE;
};
DEFINE_STACK_OF(ASN1_TYPE)
DEFINE_OR_DECLARE_STACK_OF(ASN1_TYPE)
typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
@@ -510,8 +506,9 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t);
void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t);
DEFINE_OR_DECLARE_STACK_OF(ASN1_OBJECT)
DECLARE_ASN1_FUNCTIONS(ASN1_OBJECT)
DEFINE_STACK_OF(ASN1_OBJECT)
ASN1_STRING *ASN1_STRING_new(void);
void ASN1_STRING_free(ASN1_STRING *a);
@@ -545,6 +542,8 @@ int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl);
int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
BIT_STRING_BITNAME *tbl);
DEFINE_OR_DECLARE_STACK_OF(ASN1_INTEGER)
DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)
ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
long length);
@@ -578,6 +577,8 @@ int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,
int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data,
int len);
DEFINE_OR_DECLARE_STACK_OF(ASN1_UTF8STRING)
DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)
@@ -587,6 +588,8 @@ DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)
int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
int UTF8_putc(unsigned char *str, int len, unsigned long value);
DEFINE_OR_DECLARE_STACK_OF(ASN1_GENERALSTRING)
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING)
+1 -1
View File
@@ -880,7 +880,7 @@ DECLARE_ASN1_ITEM(LONG)
DECLARE_ASN1_ITEM(ZLONG)
# endif
DEFINE_STACK_OF(ASN1_VALUE)
DEFINE_OR_DECLARE_STACK_OF(ASN1_VALUE)
/* Functions used internally by the ASN1 code */
+2 -1
View File
@@ -61,6 +61,7 @@ extern "C" {
# ifndef OPENSSL_NO_SCTP
# define BIO_TYPE_DGRAM_SCTP (24|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
# endif
# define BIO_TYPE_CORE_TO_PROV (25|BIO_TYPE_FILTER)
#define BIO_TYPE_START 128
@@ -286,7 +287,7 @@ int BIO_method_type(const BIO *b);
typedef int BIO_info_cb(BIO *, int, int);
typedef BIO_info_cb bio_info_cb; /* backward compatibility */
DEFINE_STACK_OF(BIO)
DEFINE_OR_DECLARE_STACK_OF(BIO)
/* Prefix and suffix callback in ASN1 BIO */
typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,
+16 -13
View File
@@ -210,21 +210,21 @@ typedef struct ossl_cmp_msg_st OSSL_CMP_MSG;
DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_MSG)
DECLARE_ASN1_ENCODE_FUNCTIONS(OSSL_CMP_MSG, OSSL_CMP_MSG, OSSL_CMP_MSG)
typedef struct ossl_cmp_certstatus_st OSSL_CMP_CERTSTATUS;
DEFINE_STACK_OF(OSSL_CMP_CERTSTATUS)
DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_CERTSTATUS)
typedef struct ossl_cmp_itav_st OSSL_CMP_ITAV;
DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_ITAV)
DEFINE_STACK_OF(OSSL_CMP_ITAV)
DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_ITAV)
typedef struct ossl_cmp_revrepcontent_st OSSL_CMP_REVREPCONTENT;
typedef struct ossl_cmp_pkisi_st OSSL_CMP_PKISI;
DECLARE_ASN1_FUNCTIONS(OSSL_CMP_PKISI)
DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_PKISI)
DEFINE_STACK_OF(OSSL_CMP_PKISI)
DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_PKISI)
typedef struct ossl_cmp_certrepmessage_st OSSL_CMP_CERTREPMESSAGE;
DEFINE_STACK_OF(OSSL_CMP_CERTREPMESSAGE)
DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_CERTREPMESSAGE)
typedef struct ossl_cmp_pollrep_st OSSL_CMP_POLLREP;
typedef STACK_OF(OSSL_CMP_POLLREP) OSSL_CMP_POLLREPCONTENT;
typedef struct ossl_cmp_certresponse_st OSSL_CMP_CERTRESPONSE;
DEFINE_STACK_OF(OSSL_CMP_CERTRESPONSE)
DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_CERTRESPONSE)
typedef STACK_OF(ASN1_UTF8STRING) OSSL_CMP_PKIFREETEXT;
/*
@@ -294,7 +294,7 @@ X509_STORE *OSSL_CMP_CTX_get0_trustedStore(const OSSL_CMP_CTX *ctx);
int OSSL_CMP_CTX_set1_untrusted_certs(OSSL_CMP_CTX *ctx, STACK_OF(X509) *certs);
STACK_OF(X509) *OSSL_CMP_CTX_get0_untrusted_certs(const OSSL_CMP_CTX *ctx);
/* client authentication: */
int OSSL_CMP_CTX_set1_clCert(OSSL_CMP_CTX *ctx, X509 *cert);
int OSSL_CMP_CTX_set1_cert(OSSL_CMP_CTX *ctx, X509 *cert);
int OSSL_CMP_CTX_set1_pkey(OSSL_CMP_CTX *ctx, EVP_PKEY *pkey);
int OSSL_CMP_CTX_set1_referenceValue(OSSL_CMP_CTX *ctx,
const unsigned char *ref, int len);
@@ -310,7 +310,8 @@ int OSSL_CMP_CTX_set0_newPkey(OSSL_CMP_CTX *ctx, int priv, EVP_PKEY *pkey);
EVP_PKEY *OSSL_CMP_CTX_get0_newPkey(const OSSL_CMP_CTX *ctx, int priv);
int OSSL_CMP_CTX_set1_issuer(OSSL_CMP_CTX *ctx, const X509_NAME *name);
int OSSL_CMP_CTX_set1_subjectName(OSSL_CMP_CTX *ctx, const X509_NAME *name);
int OSSL_CMP_CTX_push1_subjectAltName(OSSL_CMP_CTX *ctx, const GENERAL_NAME *name);
int OSSL_CMP_CTX_push1_subjectAltName(OSSL_CMP_CTX *ctx,
const GENERAL_NAME *name);
int OSSL_CMP_CTX_set0_reqExtensions(OSSL_CMP_CTX *ctx, X509_EXTENSIONS *exts);
int OSSL_CMP_CTX_reqExtensions_have_SAN(OSSL_CMP_CTX *ctx);
int OSSL_CMP_CTX_push0_policy(OSSL_CMP_CTX *ctx, POLICYINFO *pinfo);
@@ -346,11 +347,13 @@ OSSL_CMP_PKISI *
OSSL_CMP_STATUSINFO_new(int status, int fail_info, const char *text);
/* from cmp_hdr.c */
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_transactionID(const OSSL_CMP_PKIHEADER *hdr);
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_transactionID(const
OSSL_CMP_PKIHEADER *hdr);
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_recipNonce(const OSSL_CMP_PKIHEADER *hdr);
/* from cmp_msg.c */
OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg);
int OSSL_CMP_MSG_update_transactionID(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
OSSL_CMP_MSG *d2i_OSSL_CMP_MSG_bio(BIO *bio, OSSL_CMP_MSG **msg);
int i2d_OSSL_CMP_MSG_bio(BIO *bio, const OSSL_CMP_MSG *msg);
@@ -387,7 +390,7 @@ typedef void (*OSSL_CMP_SRV_error_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
const OSSL_CMP_MSG *req,
const OSSL_CMP_PKISI *statusInfo,
const ASN1_INTEGER *errorCode,
const OSSL_CMP_PKIFREETEXT *errorDetails);
const OSSL_CMP_PKIFREETEXT *errDetails);
typedef int (*OSSL_CMP_SRV_certConf_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
const OSSL_CMP_MSG *req,
int certReqId,
@@ -418,10 +421,10 @@ X509 *OSSL_CMP_exec_IR_ses(OSSL_CMP_CTX *ctx);
X509 *OSSL_CMP_exec_CR_ses(OSSL_CMP_CTX *ctx);
X509 *OSSL_CMP_exec_P10CR_ses(OSSL_CMP_CTX *ctx);
X509 *OSSL_CMP_exec_KUR_ses(OSSL_CMP_CTX *ctx);
# define OSSL_CMP_IR OSSL_CMP_PKIBODY_IR
# define OSSL_CMP_CR OSSL_CMP_PKIBODY_CR
# define OSSL_CMP_P10CR OSSL_CMP_PKIBODY_P10CR
# define OSSL_CMP_KUR OSSL_CMP_PKIBODY_KUR
# define OSSL_CMP_IR OSSL_CMP_PKIBODY_IR
# define OSSL_CMP_CR OSSL_CMP_PKIBODY_CR
# define OSSL_CMP_P10CR OSSL_CMP_PKIBODY_P10CR
# define OSSL_CMP_KUR OSSL_CMP_PKIBODY_KUR
int OSSL_CMP_try_certreq(OSSL_CMP_CTX *ctx, int req_type, int *checkAfter);
int OSSL_CMP_certConf_cb(OSSL_CMP_CTX *ctx, X509 *cert, int fail_info,
const char **text);
+5 -4
View File
@@ -36,10 +36,11 @@ typedef struct CMS_Receipt_st CMS_Receipt;
typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
DEFINE_STACK_OF(CMS_SignerInfo)
DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
DEFINE_STACK_OF(CMS_RecipientInfo)
DEFINE_STACK_OF(CMS_RevocationInfoChoice)
DEFINE_OR_DECLARE_STACK_OF(CMS_SignerInfo)
DEFINE_OR_DECLARE_STACK_OF(CMS_RecipientEncryptedKey)
DEFINE_OR_DECLARE_STACK_OF(CMS_RecipientInfo)
DEFINE_OR_DECLARE_STACK_OF(CMS_RevocationInfoChoice)
DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
+4 -3
View File
@@ -33,7 +33,8 @@ typedef struct {
char *value;
} CONF_VALUE;
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_OR_DECLARE_STACK_OF(CONF_VALUE)
DEFINE_LHASH_OF(CONF_VALUE);
struct conf_st;
@@ -58,8 +59,8 @@ struct conf_method_st {
typedef struct conf_imodule_st CONF_IMODULE;
typedef struct conf_module_st CONF_MODULE;
DEFINE_STACK_OF(CONF_MODULE)
DEFINE_STACK_OF(CONF_IMODULE)
STACK_OF(CONF_MODULE);
STACK_OF(CONF_IMODULE);
/* DSO module function typedefs */
typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);
+7 -2
View File
@@ -25,6 +25,11 @@ extern "C" {
* to communicate data between them.
*/
/* Opaque handles to be used with core upcall functions from providers */
typedef struct ossl_core_handle_st OSSL_CORE_HANDLE;
typedef struct openssl_core_ctx_st OPENSSL_CORE_CTX;
typedef struct ossl_core_bio_st OSSL_CORE_BIO;
/*
* Dispatch table element. function_id numbers are defined further down,
* see macros with '_FUNC' in their names.
@@ -171,7 +176,7 @@ typedef void (*OSSL_thread_stop_handler_fn)(void *arg);
* module, that module is not an OpenSSL provider module.
*/
/*-
* |provider| pointer to opaque type OSSL_PROVIDER. This can be used
* |handle| pointer to opaque type OSSL_CORE_HANDLE. This can be used
* together with some functions passed via |in| to query data.
* |in| is the array of functions that the Core passes to the provider.
* |out| will be the array of base functions that the provider passes
@@ -180,7 +185,7 @@ typedef void (*OSSL_thread_stop_handler_fn)(void *arg);
* provider needs it. This value is passed to other provider
* functions, notably other context constructors.
*/
typedef int (OSSL_provider_init_fn)(const OSSL_PROVIDER *provider,
typedef int (OSSL_provider_init_fn)(const OSSL_CORE_HANDLE *handle,
const OSSL_DISPATCH *in,
const OSSL_DISPATCH **out,
void **provctx);
+10 -3
View File
@@ -94,6 +94,8 @@ extern "C" {
#define OSSL_DIGEST_NAME_SHA2_256 "SHA2-256"
#define OSSL_DIGEST_NAME_SHA2_384 "SHA2-384"
#define OSSL_DIGEST_NAME_SHA2_512 "SHA2-512"
#define OSSL_DIGEST_NAME_SHA2_512_224 "SHA2-512/224"
#define OSSL_DIGEST_NAME_SHA2_512_256 "SHA2-512/256"
#define OSSL_DIGEST_NAME_MD2 "MD2"
#define OSSL_DIGEST_NAME_MD4 "MD4"
#define OSSL_DIGEST_NAME_MDC2 "MDC2"
@@ -180,6 +182,7 @@ extern "C" {
#define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
#define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
#define OSSL_PKEY_PARAM_DIGEST_SIZE "digest-size"
#define OSSL_PKEY_PARAM_MASKGENFUNC "mgf"
#define OSSL_PKEY_PARAM_MGF1_DIGEST "mgf1-digest"
#define OSSL_PKEY_PARAM_MGF1_PROPERTIES "mgf1-properties"
@@ -269,8 +272,12 @@ extern "C" {
/* Key generation parameters */
#define OSSL_PKEY_PARAM_RSA_BITS OSSL_PKEY_PARAM_BITS
#define OSSL_PKEY_PARAM_RSA_PRIMES "primes"
#define OSSL_PKEY_PARAM_RSA_BITS OSSL_PKEY_PARAM_BITS
#define OSSL_PKEY_PARAM_RSA_PRIMES "primes"
#define OSSL_PKEY_PARAM_RSA_DIGEST OSSL_PKEY_PARAM_DIGEST
#define OSSL_PKEY_PARAM_RSA_MASKGENFUNC OSSL_PKEY_PARAM_MASKGENFUNC
#define OSSL_PKEY_PARAM_RSA_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
#define OSSL_PKEY_PARAM_RSA_PSS_SALTLEN "saltlen"
/* Key generation parameters */
#define OSSL_PKEY_PARAM_FFC_TYPE "type"
@@ -308,7 +315,7 @@ extern "C" {
#define OSSL_SIGNATURE_PARAM_PAD_MODE OSSL_PKEY_PARAM_PAD_MODE
#define OSSL_SIGNATURE_PARAM_DIGEST OSSL_PKEY_PARAM_DIGEST
#define OSSL_SIGNATURE_PARAM_PROPERTIES OSSL_PKEY_PARAM_PROPERTIES
#define OSSL_SIGNATURE_PARAM_PSS_SALTLEN "pss-saltlen"
#define OSSL_SIGNATURE_PARAM_PSS_SALTLEN "saltlen"
#define OSSL_SIGNATURE_PARAM_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
#define OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES \
OSSL_PKEY_PARAM_MGF1_PROPERTIES
+34 -34
View File
@@ -12,7 +12,6 @@
# include <stdarg.h>
# include <openssl/core.h>
# include <openssl/self_test.h>
# ifdef __cplusplus
extern "C" {
@@ -60,33 +59,33 @@ extern "C" {
/* Functions provided by the Core to the provider, reserved numbers 1-1023 */
# define OSSL_FUNC_CORE_GETTABLE_PARAMS 1
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
core_gettable_params,(const OSSL_PROVIDER *prov))
core_gettable_params,(const OSSL_CORE_HANDLE *prov))
# define OSSL_FUNC_CORE_GET_PARAMS 2
OSSL_CORE_MAKE_FUNC(int,core_get_params,(const OSSL_PROVIDER *prov,
OSSL_CORE_MAKE_FUNC(int,core_get_params,(const OSSL_CORE_HANDLE *prov,
OSSL_PARAM params[]))
# define OSSL_FUNC_CORE_THREAD_START 3
OSSL_CORE_MAKE_FUNC(int,core_thread_start,(const OSSL_PROVIDER *prov,
OSSL_CORE_MAKE_FUNC(int,core_thread_start,(const OSSL_CORE_HANDLE *prov,
OSSL_thread_stop_handler_fn handfn))
# define OSSL_FUNC_CORE_GET_LIBRARY_CONTEXT 4
OSSL_CORE_MAKE_FUNC(OPENSSL_CTX *,core_get_library_context,
(const OSSL_PROVIDER *prov))
OSSL_CORE_MAKE_FUNC(OPENSSL_CORE_CTX *,core_get_library_context,
(const OSSL_CORE_HANDLE *prov))
# define OSSL_FUNC_CORE_NEW_ERROR 5
OSSL_CORE_MAKE_FUNC(void,core_new_error,(const OSSL_PROVIDER *prov))
OSSL_CORE_MAKE_FUNC(void,core_new_error,(const OSSL_CORE_HANDLE *prov))
# define OSSL_FUNC_CORE_SET_ERROR_DEBUG 6
OSSL_CORE_MAKE_FUNC(void,core_set_error_debug,
(const OSSL_PROVIDER *prov,
(const OSSL_CORE_HANDLE *prov,
const char *file, int line, const char *func))
# define OSSL_FUNC_CORE_VSET_ERROR 7
OSSL_CORE_MAKE_FUNC(void,core_vset_error,
(const OSSL_PROVIDER *prov,
(const OSSL_CORE_HANDLE *prov,
uint32_t reason, const char *fmt, va_list args))
# define OSSL_FUNC_CORE_SET_ERROR_MARK 8
OSSL_CORE_MAKE_FUNC(int, core_set_error_mark, (const OSSL_PROVIDER *prov))
OSSL_CORE_MAKE_FUNC(int, core_set_error_mark, (const OSSL_CORE_HANDLE *prov))
# define OSSL_FUNC_CORE_CLEAR_LAST_ERROR_MARK 9
OSSL_CORE_MAKE_FUNC(int, core_clear_last_error_mark,
(const OSSL_PROVIDER *prov))
(const OSSL_CORE_HANDLE *prov))
# define OSSL_FUNC_CORE_POP_ERROR_TO_MARK 10
OSSL_CORE_MAKE_FUNC(int, core_pop_error_to_mark, (const OSSL_PROVIDER *prov))
OSSL_CORE_MAKE_FUNC(int, core_pop_error_to_mark, (const OSSL_CORE_HANDLE *prov))
/* Memory allocation, freeing, clearing. */
#define OSSL_FUNC_CRYPTO_MALLOC 20
@@ -132,22 +131,26 @@ OSSL_CORE_MAKE_FUNC(void,
#define OSSL_FUNC_BIO_NEW_FILE 40
#define OSSL_FUNC_BIO_NEW_MEMBUF 41
#define OSSL_FUNC_BIO_READ_EX 42
#define OSSL_FUNC_BIO_FREE 43
#define OSSL_FUNC_BIO_VPRINTF 44
#define OSSL_FUNC_BIO_VSNPRINTF 45
#define OSSL_FUNC_BIO_WRITE_EX 43
#define OSSL_FUNC_BIO_FREE 44
#define OSSL_FUNC_BIO_VPRINTF 45
#define OSSL_FUNC_BIO_VSNPRINTF 46
OSSL_CORE_MAKE_FUNC(BIO *, BIO_new_file, (const char *filename, const char *mode))
OSSL_CORE_MAKE_FUNC(BIO *, BIO_new_membuf, (const void *buf, int len))
OSSL_CORE_MAKE_FUNC(int, BIO_read_ex, (BIO *bio, void *data, size_t data_len,
size_t *bytes_read))
OSSL_CORE_MAKE_FUNC(int, BIO_free, (BIO *bio))
OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (BIO *bio, const char *format,
OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_file, (const char *filename,
const char *mode))
OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_membuf, (const void *buf, int len))
OSSL_CORE_MAKE_FUNC(int, BIO_read_ex, (OSSL_CORE_BIO *bio, void *data,
size_t data_len, size_t *bytes_read))
OSSL_CORE_MAKE_FUNC(int, BIO_write_ex, (OSSL_CORE_BIO *bio, const void *data,
size_t data_len, size_t *written))
OSSL_CORE_MAKE_FUNC(int, BIO_free, (OSSL_CORE_BIO *bio))
OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (OSSL_CORE_BIO *bio, const char *format,
va_list args))
OSSL_CORE_MAKE_FUNC(int, BIO_vsnprintf,
(char *buf, size_t n, const char *fmt, va_list args))
#define OSSL_FUNC_SELF_TEST_CB 100
OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CTX *ctx, OSSL_CALLBACK **cb,
OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CORE_CTX *ctx, OSSL_CALLBACK **cb,
void **cbarg))
/* Functions provided by the provider to the Core, reserved numbers 1024-1535 */
@@ -161,7 +164,7 @@ OSSL_CORE_MAKE_FUNC(int,provider_get_params,(void *provctx,
OSSL_PARAM params[]))
# define OSSL_FUNC_PROVIDER_QUERY_OPERATION 1027
OSSL_CORE_MAKE_FUNC(const OSSL_ALGORITHM *,provider_query_operation,
(void *provctx, int operation_id, const int *no_store))
(void *provctx, int operation_id, int *no_store))
# define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1028
OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,provider_get_reason_strings,
(void *provctx))
@@ -392,10 +395,8 @@ OSSL_CORE_MAKE_FUNC(void *, OP_keymgmt_new, (void *provctx))
# define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE 3
# define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS 4
# define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS 5
# define OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS 6
# define OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS 7
# define OSSL_FUNC_KEYMGMT_GEN 8
# define OSSL_FUNC_KEYMGMT_GEN_CLEANUP 9
# define OSSL_FUNC_KEYMGMT_GEN 6
# define OSSL_FUNC_KEYMGMT_GEN_CLEANUP 7
OSSL_CORE_MAKE_FUNC(void *, OP_keymgmt_gen_init,
(void *provctx, int selection))
OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_gen_set_template,
@@ -526,7 +527,8 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keyexch_gettable_ctx_params,
# define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS 24
# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25
OSSL_CORE_MAKE_FUNC(void *, OP_signature_newctx, (void *provctx))
OSSL_CORE_MAKE_FUNC(void *, OP_signature_newctx, (void *provctx,
const char *propq))
OSSL_CORE_MAKE_FUNC(int, OP_signature_sign_init, (void *ctx, void *provkey))
OSSL_CORE_MAKE_FUNC(int, OP_signature_sign, (void *ctx, unsigned char *sig,
size_t *siglen, size_t sigsize,
@@ -547,8 +549,7 @@ OSSL_CORE_MAKE_FUNC(int, OP_signature_verify_recover, (void *ctx,
const unsigned char *sig,
size_t siglen))
OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign_init,
(void *ctx, const char *mdname, const char *props,
void *provkey))
(void *ctx, const char *mdname, void *provkey))
OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign_update,
(void *ctx, const unsigned char *data, size_t datalen))
OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign_final,
@@ -558,8 +559,7 @@ OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign,
(void *ctx, unsigned char *sigret, size_t *siglen,
size_t sigsize, const unsigned char *tbs, size_t tbslen))
OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_init,
(void *ctx, const char *mdname, const char *props,
void *provkey))
(void *ctx, const char *mdname, void *provkey))
OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_update,
(void *ctx, const unsigned char *data, size_t datalen))
OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_final,
@@ -640,10 +640,10 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_serializer_settable_ctx_params,
(void))
OSSL_CORE_MAKE_FUNC(int, OP_serializer_serialize_data,
(void *ctx, const OSSL_PARAM[], BIO *out,
(void *ctx, const OSSL_PARAM[], OSSL_CORE_BIO *out,
OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg))
OSSL_CORE_MAKE_FUNC(int, OP_serializer_serialize_object,
(void *ctx, void *obj, BIO *out,
(void *ctx, void *obj, OSSL_CORE_BIO *out,
OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg))
# ifdef __cplusplus
+2 -2
View File
@@ -43,7 +43,7 @@ typedef struct ossl_crmf_encryptedvalue_st OSSL_CRMF_ENCRYPTEDVALUE;
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDVALUE)
typedef struct ossl_crmf_msg_st OSSL_CRMF_MSG;
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSG)
DEFINE_STACK_OF(OSSL_CRMF_MSG)
DEFINE_OR_DECLARE_STACK_OF(OSSL_CRMF_MSG)
typedef struct ossl_crmf_attributetypeandvalue_st OSSL_CRMF_ATTRIBUTETYPEANDVALUE;
typedef struct ossl_crmf_pbmparameter_st OSSL_CRMF_PBMPARAMETER;
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PBMPARAMETER)
@@ -51,7 +51,7 @@ typedef struct ossl_crmf_poposigningkey_st OSSL_CRMF_POPOSIGNINGKEY;
typedef struct ossl_crmf_certrequest_st OSSL_CRMF_CERTREQUEST;
typedef struct ossl_crmf_certid_st OSSL_CRMF_CERTID;
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTID)
DEFINE_STACK_OF(OSSL_CRMF_CERTID)
DEFINE_OR_DECLARE_STACK_OF(OSSL_CRMF_CERTID)
typedef struct ossl_crmf_pkipublicationinfo_st OSSL_CRMF_PKIPUBLICATIONINFO;
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PKIPUBLICATIONINFO)
+2 -4
View File
@@ -169,7 +169,8 @@ struct crypto_ex_data_st {
OPENSSL_CTX *ctx;
STACK_OF(void) *sk;
};
DEFINE_STACK_OF(void)
DEFINE_OR_DECLARE_STACK_OF(void)
/*
* Per class, we have a STACK of function pointers.
@@ -376,9 +377,6 @@ ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line
int OPENSSL_isservice(void);
int FIPS_mode(void);
int FIPS_mode_set(int r);
void OPENSSL_init(void);
# ifdef OPENSSL_SYS_UNIX
void OPENSSL_fork_prepare(void);
+3 -3
View File
@@ -34,6 +34,9 @@ extern "C" {
/* All hashes are SHA256 in v1 of Certificate Transparency */
# define CT_V1_HASHLEN SHA256_DIGEST_LENGTH
DEFINE_OR_DECLARE_STACK_OF(SCT)
DEFINE_OR_DECLARE_STACK_OF(CTLOG)
typedef enum {
CT_LOG_ENTRY_TYPE_NOT_SET = -1,
CT_LOG_ENTRY_TYPE_X509 = 0,
@@ -61,9 +64,6 @@ typedef enum {
SCT_VALIDATION_STATUS_UNKNOWN_VERSION
} sct_validation_status_t;
DEFINE_STACK_OF(SCT)
DEFINE_STACK_OF(CTLOG)
/******************************************
* CT policy evaluation context functions *
******************************************/
+1 -1
View File
@@ -146,7 +146,7 @@ DEPRECATEDIN_3_0(DH *DH_new_method(ENGINE *engine))
DH *DH_new(void);
void DH_free(DH *dh);
int DH_up_ref(DH *dh);
DEPRECATEDIN_3_0(int DH_bits(const DH *dh))
int DH_bits(const DH *dh);
DEPRECATEDIN_3_0(int DH_size(const DH *dh))
DEPRECATEDIN_3_0(int DH_security_bits(const DH *dh))
# ifndef OPENSSL_NO_DEPRECATED_3_0
+1 -1
View File
@@ -114,7 +114,7 @@ void DSA_free(DSA *r);
/* "up" the DSA object's reference count */
int DSA_up_ref(DSA *r);
DEPRECATEDIN_3_0(int DSA_size(const DSA *))
DEPRECATEDIN_3_0(int DSA_bits(const DSA *d))
int DSA_bits(const DSA *d);
DEPRECATEDIN_3_0(int DSA_security_bits(const DSA *d))
/* next 4 return -1 on error */
DEPRECATEDIN_3_0(int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
+4 -3
View File
@@ -775,9 +775,10 @@ int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,
* \param ctx BN_CTX object (optional)
* \return 1 on success and 0 if an error occurred
*/
int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,
size_t num, const EC_POINT *p[], const BIGNUM *m[],
BN_CTX *ctx);
DEPRECATEDIN_3_0(int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r,
const BIGNUM *n, size_t num,
const EC_POINT *p[], const BIGNUM *m[],
BN_CTX *ctx))
/** Computes r = generator * n + q * m
* \param group underlying EC_GROUP object
+1
View File
@@ -170,6 +170,7 @@ int ERR_load_EC_strings(void);
# define EC_F_EC_POINT_IS_AT_INFINITY 0
# define EC_F_EC_POINT_IS_ON_CURVE 0
# define EC_F_EC_POINT_MAKE_AFFINE 0
# define EC_F_EC_POINT_MUL 0
# define EC_F_EC_POINT_NEW 0
# define EC_F_EC_POINT_OCT2POINT 0
# define EC_F_EC_POINT_POINT2BUF 0
+4 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -19,16 +19,17 @@ extern "C" {
# include <openssl/x509.h>
# include <openssl/esserr.h>
typedef struct ESS_issuer_serial ESS_ISSUER_SERIAL;
typedef struct ESS_cert_id ESS_CERT_ID;
typedef struct ESS_signing_cert ESS_SIGNING_CERT;
DEFINE_STACK_OF(ESS_CERT_ID)
DEFINE_OR_DECLARE_STACK_OF(ESS_CERT_ID)
typedef struct ESS_signing_cert_v2_st ESS_SIGNING_CERT_V2;
typedef struct ESS_cert_id_v2_st ESS_CERT_ID_V2;
DEFINE_STACK_OF(ESS_CERT_ID_V2)
DEFINE_OR_DECLARE_STACK_OF(ESS_CERT_ID_V2)
DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_ISSUER_SERIAL)
DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_ISSUER_SERIAL, ESS_ISSUER_SERIAL)
+13 -1
View File
@@ -78,6 +78,8 @@ extern "C" {
#endif
int EVP_set_default_properties(OPENSSL_CTX *libctx, const char *propq);
int EVP_default_properties_is_fips_enabled(OPENSSL_CTX *libctx);
int EVP_default_properties_enable_fips(OPENSSL_CTX *libctx, int enable);
# define EVP_PKEY_MO_SIGN 0x0001
# define EVP_PKEY_MO_VERIFY 0x0002
@@ -435,7 +437,7 @@ typedef int (EVP_PBE_KEYGEN) (EVP_CIPHER_CTX *ctx, const char *pass,
# ifndef OPENSSL_NO_RSA
# define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\
(rsa))
(rsa))
# endif
# ifndef OPENSSL_NO_DSA
@@ -1517,9 +1519,19 @@ void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen);
EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,
const unsigned char *key, int keylen);
EVP_PKEY *EVP_PKEY_new_raw_private_key_with_libctx(OPENSSL_CTX *libctx,
const char *keytype,
const char *propq,
const unsigned char *priv,
size_t len);
EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e,
const unsigned char *priv,
size_t len);
EVP_PKEY *EVP_PKEY_new_raw_public_key_with_libctx(OPENSSL_CTX *libctx,
const char *keytype,
const char *propq,
const unsigned char *pub,
size_t len);
EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e,
const unsigned char *pub,
size_t len);
+3
View File
@@ -10,6 +10,7 @@
#ifndef OPENSSL_EVPERR_H
# define OPENSSL_EVPERR_H
# pragma once
# include <openssl/opensslconf.h>
# include <openssl/symhacks.h>
@@ -223,6 +224,7 @@ int ERR_load_EVP_strings(void);
# define EVP_R_NO_KEYMGMT_PRESENT 196
# define EVP_R_NO_KEY_SET 154
# define EVP_R_NO_OPERATION_SET 149
# define EVP_R_NULL_MAC_PKEY_CTX 208
# define EVP_R_ONLY_ONESHOT_SUPPORTED 177
# define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150
# define EVP_R_OPERATON_NOT_INITIALIZED 151
@@ -233,6 +235,7 @@ int ERR_load_EVP_strings(void);
# define EVP_R_PRIVATE_KEY_DECODE_ERROR 145
# define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146
# define EVP_R_PUBLIC_KEY_NOT_RSA 106
# define EVP_R_SET_DEFAULT_PROPERTY_FAILURE 209
# define EVP_R_TOO_MANY_RECORDS 183
# define EVP_R_UNKNOWN_CIPHER 160
# define EVP_R_UNKNOWN_DIGEST 161
+1 -1
View File
@@ -56,7 +56,7 @@ ASN1_VALUE *OSSL_HTTP_post_asn1(const char *server, const char *port,
OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
const STACK_OF(CONF_VALUE) *headers,
const char *content_type,
ASN1_VALUE *req, const ASN1_ITEM *req_it,
const ASN1_VALUE *req, const ASN1_ITEM *req_it,
int maxline, unsigned long max_resp_len,
int timeout, const char *expected_ct,
const ASN1_ITEM *rsp_it);
+5 -8
View File
@@ -103,17 +103,14 @@ extern "C" {
# define OCSP_NOTIME 0x800
typedef struct ocsp_cert_id_st OCSP_CERTID;
DEFINE_STACK_OF(OCSP_CERTID)
typedef struct ocsp_one_request_st OCSP_ONEREQ;
DEFINE_STACK_OF(OCSP_ONEREQ)
typedef struct ocsp_req_info_st OCSP_REQINFO;
typedef struct ocsp_signature_st OCSP_SIGNATURE;
typedef struct ocsp_request_st OCSP_REQUEST;
DEFINE_OR_DECLARE_STACK_OF(OCSP_CERTID)
DEFINE_OR_DECLARE_STACK_OF(OCSP_ONEREQ)
# define OCSP_RESPONSE_STATUS_SUCCESSFUL 0
# define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1
# define OCSP_RESPONSE_STATUS_INTERNALERROR 2
@@ -126,7 +123,7 @@ typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES;
# define V_OCSP_RESPID_NAME 0
# define V_OCSP_RESPID_KEY 1
DEFINE_STACK_OF(OCSP_RESPID)
DEFINE_OR_DECLARE_STACK_OF(OCSP_RESPID)
typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
@@ -137,7 +134,7 @@ typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
typedef struct ocsp_cert_status_st OCSP_CERTSTATUS;
typedef struct ocsp_single_response_st OCSP_SINGLERESP;
DEFINE_STACK_OF(OCSP_SINGLERESP)
DEFINE_OR_DECLARE_STACK_OF(OCSP_SINGLERESP)
typedef struct ocsp_response_data_st OCSP_RESPDATA;
+3 -3
View File
@@ -1,7 +1,7 @@
/*
* {- join("\n * ", @autowarntext) -}
*
* Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -91,9 +91,9 @@ extern "C" {
/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PPSL */
# ifdef OPENSSL_VERSION_PRE_RELEASE
# define _OPENSSL_VERSION_PRE_RELEASE 0x0
# define _OPENSSL_VERSION_PRE_RELEASE 0x0L
# else
# define _OPENSSL_VERSION_PRE_RELEASE 0xf
# define _OPENSSL_VERSION_PRE_RELEASE 0xfL
# endif
# define OPENSSL_VERSION_NUMBER \
( (OPENSSL_VERSION_MAJOR<<28) \
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -52,7 +52,7 @@ typedef struct PKCS12_st PKCS12;
typedef struct PKCS12_SAFEBAG_st PKCS12_SAFEBAG;
DEFINE_STACK_OF(PKCS12_SAFEBAG)
DEFINE_OR_DECLARE_STACK_OF(PKCS12_SAFEBAG)
typedef struct pkcs12_bag_st PKCS12_BAGS;
+5 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -28,6 +28,7 @@
extern "C" {
#endif
/*-
Encryption_ID DES-CBC
Digest_ID MD5
@@ -51,8 +52,7 @@ typedef struct pkcs7_signer_info_st {
/* The private key to sign with */
EVP_PKEY *pkey;
} PKCS7_SIGNER_INFO;
DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
DEFINE_OR_DECLARE_STACK_OF(PKCS7_SIGNER_INFO)
typedef struct pkcs7_recip_info_st {
ASN1_INTEGER *version; /* version 0 */
@@ -61,8 +61,8 @@ typedef struct pkcs7_recip_info_st {
ASN1_OCTET_STRING *enc_key;
X509 *cert; /* get the pub-key from this */
} PKCS7_RECIP_INFO;
DEFINE_OR_DECLARE_STACK_OF(PKCS7_RECIP_INFO)
DEFINE_STACK_OF(PKCS7_RECIP_INFO)
typedef struct pkcs7_signed_st {
ASN1_INTEGER *version; /* version 1 */
@@ -148,8 +148,8 @@ typedef struct pkcs7_st {
ASN1_TYPE *other;
} d;
} PKCS7;
DEFINE_OR_DECLARE_STACK_OF(PKCS7)
DEFINE_STACK_OF(PKCS7)
# define PKCS7_OP_SET_DETACHED_SIGNATURE 1
# define PKCS7_OP_GET_DETACHED_SIGNATURE 2
+22 -9
View File
@@ -100,6 +100,24 @@ extern "C" {
# define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME
# endif
/*-
* New with 3.0: use part of the flags to denote exact type of RSA key,
* some of which are limited to specific signature and encryption schemes.
* These different types share the same RSA structure, but indicate the
* use of certain fields in that structure.
* Currently known are:
* RSA - this is the "normal" unlimited RSA structure (typenum 0)
* RSASSA-PSS - indicates that the PSS parameters are used.
* RSAES-OAEP - no specific field used for the moment, but OAEP padding
* is expected. (currently unused)
*
* 4 bits allow for 16 types
*/
# define RSA_FLAG_TYPE_MASK 0xF000
# define RSA_FLAG_TYPE_RSA 0x0000
# define RSA_FLAG_TYPE_RSASSAPSS 0x1000
# define RSA_FLAG_TYPE_RSAESOAEP 0x2000
int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int pad_mode);
int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *pad_mode);
@@ -109,6 +127,7 @@ int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *saltlen);
int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int bits);
int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes);
int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, int saltlen);
/* Salt length matches digest */
# define RSA_PSS_SALTLEN_DIGEST -1
@@ -119,21 +138,15 @@ int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes);
/* Old compatible max salt length for sign only */
# define RSA_PSS_SALTLEN_MAX_SIGN -2
# define EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(ctx, len) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, EVP_PKEY_OP_KEYGEN, \
EVP_PKEY_CTRL_RSA_PSS_SALTLEN, len, NULL)
int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
int EVP_PKEY_CTX_set_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
const char *mdprops);
int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
int EVP_PKEY_CTX_get_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, char *name,
size_t namelen);
# define EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(ctx, md) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, EVP_PKEY_OP_KEYGEN, \
EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)(md))
int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name(EVP_PKEY_CTX *ctx,
const char *mdname);
int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
int EVP_PKEY_CTX_set_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
+30 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -132,11 +132,11 @@ extern "C" {
return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); \
}
# define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2)
# define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t)
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
# define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2)
# define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2) \
SKM_DEFINE_STACK_OF(t1, const t2, t2)
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
/*-
* Strings are special: normally an lhash entry will point to a single
@@ -155,6 +155,28 @@ extern "C" {
typedef char *OPENSSL_STRING;
typedef const char *OPENSSL_CSTRING;
# define DEFINE_STACK_OF_STRING() \
DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
# define DEFINE_STACK_OF_CSTRING() \
DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char)
/*
* If we're building OpenSSL, or we have no-deprecated configured,
* then we don't define the inline functions (see |SKM_DEFINE_STACK_OF|,
* above), we just declare the stack datatypes. Otherwise, for compatibility
* and to not remove the API's, we define the functions. We have the
* trailing semicolon so that uses of this never need it.
*/
#if defined(OPENSSL_BUILDING_OPENSSL) || defined(OPENSSL_NO_DEPRECATED_3_0)
# define DEFINE_OR_DECLARE_STACK_OF(s) STACK_OF(s);
# define DEFINE_OR_DECLARE_STACK_OF_STRING() STACK_OF(OPENSSL_STRING);
# define DEFINE_OR_DECLARE_STACK_OF_CSTRING() STACK_OF(OPENSSL_CSTRING);
#else
# define DEFINE_OR_DECLARE_STACK_OF(s) DEFINE_STACK_OF(s)
# define DEFINE_OR_DECLARE_STACK_OF_STRING() DEFINE_STACK_OF_STRING()
# define DEFINE_OR_DECLARE_STACK_OF_CSTRING() DEFINE_STACK_OF_CSTRING()
#endif
/*-
* Confusingly, LHASH_OF(STRING) deals with char ** throughout, but
* STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned
@@ -162,15 +184,17 @@ typedef const char *OPENSSL_CSTRING;
* chars. So, we have to implement STRING specially for STACK_OF. This is
* dealt with in the autogenerated macros below.
*/
DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char)
DEFINE_OR_DECLARE_STACK_OF_STRING()
DEFINE_OR_DECLARE_STACK_OF_CSTRING()
#if !defined(OPENSSL_NO_DEPRECATED_3_0)
/*
* Similarly, we sometimes use a block of characters, NOT nul-terminated.
* This is not used by OpenSSL. A block of bytes, NOT nul-terminated.
* These should also be distinguished from "normal" stacks.
*/
typedef void *OPENSSL_BLOCK;
DEFINE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
#endif
/*
* If called without higher optimization (min. -xO3) the Oracle Developer
+1 -1
View File
@@ -1,7 +1,7 @@
/*
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
+3 -7
View File
@@ -37,9 +37,7 @@ typedef struct SRP_gN_cache_st {
char *b64_bn;
BIGNUM *bn;
} SRP_gN_cache;
DEFINE_STACK_OF(SRP_gN_cache)
DEFINE_OR_DECLARE_STACK_OF(SRP_gN_cache)
typedef struct SRP_user_pwd_st {
/* Owned by us. */
@@ -52,6 +50,7 @@ typedef struct SRP_user_pwd_st {
/* Owned by us. */
char *info;
} SRP_user_pwd;
DEFINE_OR_DECLARE_STACK_OF(SRP_user_pwd)
SRP_user_pwd *SRP_user_pwd_new(void);
void SRP_user_pwd_free(SRP_user_pwd *user_pwd);
@@ -60,8 +59,6 @@ void SRP_user_pwd_set_gN(SRP_user_pwd *user_pwd, const BIGNUM *g, const BIGNUM *
int SRP_user_pwd_set1_ids(SRP_user_pwd *user_pwd, const char *id, const char *info);
int SRP_user_pwd_set0_sv(SRP_user_pwd *user_pwd, BIGNUM *s, BIGNUM *v);
DEFINE_STACK_OF(SRP_user_pwd)
typedef struct SRP_VBASE_st {
STACK_OF(SRP_user_pwd) *users_pwd;
STACK_OF(SRP_gN_cache) *gN_cache;
@@ -79,8 +76,7 @@ typedef struct SRP_gN_st {
const BIGNUM *g;
const BIGNUM *N;
} SRP_gN;
DEFINE_STACK_OF(SRP_gN)
DEFINE_OR_DECLARE_STACK_OF(SRP_gN)
SRP_VBASE *SRP_VBASE_new(char *seed_key);
void SRP_VBASE_free(SRP_VBASE *vb);
+7 -5
View File
@@ -239,8 +239,8 @@ typedef struct srtp_protection_profile_st {
const char *name;
unsigned long id;
} SRTP_PROTECTION_PROFILE;
DEFINE_OR_DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE)
DEFINE_STACK_OF(SRTP_PROTECTION_PROFILE)
typedef int (*tls_session_ticket_ext_cb_fn)(SSL *s, const unsigned char *data,
int len, void *arg);
@@ -332,9 +332,10 @@ typedef int (*SSL_async_callback_fn)(SSL *s, void *arg);
/*
* Reserved value (until OpenSSL 3.0.0) 0x00000080U
* Reserved value (until OpenSSL 3.0.0) 0x00000100U
* Reserved value (until OpenSSL 3.0.0) 0x00000200U
*/
# define SSL_OP_DISABLE_TLSEXT_CA_NAMES 0x00000200U
/* In TLSv1.3 allow a non-(ec)dhe based kex_mode */
# define SSL_OP_ALLOW_NO_DHE_KEX 0x00000400U
@@ -980,8 +981,8 @@ extern "C" {
* These need to be after the above set of includes due to a compiler bug
* in VisualStudio 2015
*/
DEFINE_STACK_OF_CONST(SSL_CIPHER)
DEFINE_STACK_OF(SSL_COMP)
DEFINE_OR_DECLARE_STACK_OF(SSL_CIPHER)
DEFINE_OR_DECLARE_STACK_OF(SSL_COMP)
/* compatibility */
# define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)(arg)))
@@ -1418,7 +1419,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
# define SSL_get1_groups(s, glist) \
SSL_ctrl(s,SSL_CTRL_GET_GROUPS,0,(int*)(glist))
# define SSL_CTX_set1_groups(ctx, glist, glistlen) \
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS,glistlen,(char *)(glist))
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS,glistlen,(int *)(glist))
# define SSL_CTX_set1_groups_list(ctx, s) \
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS_LIST,0,(char *)(s))
# define SSL_set1_groups(s, glist, glistlen) \
@@ -1961,6 +1962,7 @@ int SSL_get_key_update_type(const SSL *s);
int SSL_renegotiate(SSL *s);
int SSL_renegotiate_abbreviated(SSL *s);
__owur int SSL_renegotiate_pending(const SSL *s);
int SSL_new_session_ticket(SSL *s);
int SSL_shutdown(SSL *s);
__owur int SSL_verify_client_post_handshake(SSL *s);
void SSL_CTX_set_post_handshake_auth(SSL_CTX *ctx, int val);
+29 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -102,6 +102,24 @@ int OSSL_STORE_error(OSSL_STORE_CTX *ctx);
*/
int OSSL_STORE_close(OSSL_STORE_CTX *ctx);
/*
* Attach to a BIO. This works like OSSL_STORE_open() except it takes a
* BIO instead of a uri, along with a scheme to use when reading.
* The given UI method will be used any time the loader needs extra input,
* for example when a password or pin is needed, and will be passed the
* same user data every time it's needed in this context.
*
* Returns a context reference which represents the channel to communicate
* through.
*
* Note that this function is considered unsafe, all depending on what the
* BIO actually reads.
*/
OSSL_STORE_CTX *OSSL_STORE_attach(BIO *bio, OPENSSL_CTX *libctx,
const char *scheme, const char *propq,
const UI_METHOD *ui_method, void *ui_data,
OSSL_STORE_post_process_info_fn post_process,
void *post_process_data);
/*-
* Extracting OpenSSL types from and creating new OSSL_STORE_INFOs
@@ -228,6 +246,16 @@ typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_fn)(const OSSL_STORE_LOADER
void *ui_data);
int OSSL_STORE_LOADER_set_open(OSSL_STORE_LOADER *loader,
OSSL_STORE_open_fn open_function);
typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_attach_fn)(const OSSL_STORE_LOADER
*loader,
BIO *bio,
OPENSSL_CTX *libctx,
const char *propq,
const UI_METHOD
*ui_method,
void *ui_data);
int OSSL_STORE_LOADER_set_attach(OSSL_STORE_LOADER *loader,
OSSL_STORE_attach_fn attach_function);
typedef int (*OSSL_STORE_ctrl_fn)(OSSL_STORE_LOADER_CTX *ctx, int cmd,
va_list args);
int OSSL_STORE_LOADER_set_ctrl(OSSL_STORE_LOADER *loader,
+4 -4
View File
@@ -8,8 +8,8 @@
* https://www.openssl.org/source/license.html
*/
#ifndef OPENSSL_STOREERR_H
# define OPENSSL_STOREERR_H
#ifndef OPENSSL_OSSL_STOREERR_H
# define OPENSSL_OSSL_STOREERR_H
# pragma once
# include <openssl/opensslconf.h>
@@ -25,6 +25,7 @@ int ERR_load_OSSL_STORE_strings(void);
* OSSL_STORE function codes.
*/
# ifndef OPENSSL_NO_DEPRECATED_3_0
# define OSSL_STORE_F_FILE_ATTACH 0
# define OSSL_STORE_F_FILE_CTRL 0
# define OSSL_STORE_F_FILE_FIND 0
# define OSSL_STORE_F_FILE_GET_PASS 0
@@ -32,9 +33,8 @@ int ERR_load_OSSL_STORE_strings(void);
# define OSSL_STORE_F_FILE_LOAD_TRY_DECODE 0
# define OSSL_STORE_F_FILE_NAME_TO_URI 0
# define OSSL_STORE_F_FILE_OPEN 0
# define OSSL_STORE_F_OSSL_STORE_ATTACH_PEM_BIO 0
# define OSSL_STORE_F_OSSL_STORE_ATTACH 0
# define OSSL_STORE_F_OSSL_STORE_EXPECT 0
# define OSSL_STORE_F_OSSL_STORE_FILE_ATTACH_PEM_BIO_INT 0
# define OSSL_STORE_F_OSSL_STORE_FIND 0
# define OSSL_STORE_F_OSSL_STORE_GET0_LOADER_INT 0
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_CERT 0
+1 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -264,8 +264,6 @@ typedef int (*TS_extension_cb) (struct TS_resp_ctx *, X509_EXTENSION *,
typedef struct TS_resp_ctx TS_RESP_CTX;
DEFINE_STACK_OF_CONST(EVP_MD)
/* Creates a response context that can be used for generating responses. */
TS_RESP_CTX *TS_RESP_CTX_new(void);
void TS_RESP_CTX_free(TS_RESP_CTX *ctx);
+2
View File
@@ -60,7 +60,9 @@ typedef int ASN1_BOOLEAN;
typedef int ASN1_NULL;
# endif
typedef struct asn1_type_st ASN1_TYPE;
typedef struct asn1_object_st ASN1_OBJECT;
typedef struct asn1_string_table_st ASN1_STRING_TABLE;
typedef struct ASN1_ITEM_st ASN1_ITEM;
typedef struct asn1_pctx_st ASN1_PCTX;
+2 -1
View File
@@ -283,7 +283,8 @@ const UI_METHOD *UI_null(void);
* about a string or a prompt, including test data for a verification prompt.
*/
typedef struct ui_string_st UI_STRING;
DEFINE_STACK_OF(UI_STRING)
DEFINE_OR_DECLARE_STACK_OF(UI_STRING)
/*
* The different types of strings that are currently supported. This is only
+10 -22
View File
@@ -40,6 +40,11 @@
extern "C" {
#endif
/* Needed stacks for types defined in other headers */
DEFINE_OR_DECLARE_STACK_OF(X509_NAME)
DEFINE_OR_DECLARE_STACK_OF(X509)
DEFINE_OR_DECLARE_STACK_OF(X509_REVOKED)
DEFINE_OR_DECLARE_STACK_OF(X509_CRL)
/* Flags for X509_get_signature_info() */
/* Signature info is valid */
@@ -77,33 +82,21 @@ typedef struct X509_val_st {
typedef struct X509_sig_st X509_SIG;
typedef struct X509_name_entry_st X509_NAME_ENTRY;
DEFINE_OR_DECLARE_STACK_OF(X509_NAME_ENTRY)
DEFINE_STACK_OF(X509_NAME_ENTRY)
DEFINE_STACK_OF(X509_NAME)
# define X509_EX_V_NETSCAPE_HACK 0x8000
# define X509_EX_V_INIT 0x0001
typedef struct X509_extension_st X509_EXTENSION;
DEFINE_OR_DECLARE_STACK_OF(X509_EXTENSION)
typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
DEFINE_STACK_OF(X509_EXTENSION)
typedef struct x509_attributes_st X509_ATTRIBUTE;
DEFINE_STACK_OF(X509_ATTRIBUTE)
DEFINE_OR_DECLARE_STACK_OF(X509_ATTRIBUTE)
typedef struct X509_req_info_st X509_REQ_INFO;
typedef struct X509_req_st X509_REQ;
typedef struct x509_cert_aux_st X509_CERT_AUX;
typedef struct x509_cinf_st X509_CINF;
DEFINE_STACK_OF(X509)
/* This is used for a table of trust checking functions */
typedef struct x509_trust_st {
@@ -114,8 +107,8 @@ typedef struct x509_trust_st {
int arg1;
void *arg2;
} X509_TRUST;
DEFINE_OR_DECLARE_STACK_OF(X509_TRUST)
DEFINE_STACK_OF(X509_TRUST)
/* standard trust ids */
@@ -227,12 +220,8 @@ DEFINE_STACK_OF(X509_TRUST)
XN_FLAG_FN_LN | \
XN_FLAG_FN_ALIGN)
DEFINE_STACK_OF(X509_REVOKED)
typedef struct X509_crl_info_st X509_CRL_INFO;
DEFINE_STACK_OF(X509_CRL)
typedef struct private_key_st {
int version;
/* The PKCS#8 data types */
@@ -256,8 +245,7 @@ typedef struct X509_info_st {
int enc_len;
char *enc_data;
} X509_INFO;
DEFINE_STACK_OF(X509_INFO)
DEFINE_OR_DECLARE_STACK_OF(X509_INFO)
/*
* The next 2 structures and their 8 routines are used to manipulate Netscape's
+6 -3
View File
@@ -60,9 +60,9 @@ typedef enum {
#define X509_LU_FAIL 0
#endif
DEFINE_STACK_OF(X509_LOOKUP)
DEFINE_STACK_OF(X509_OBJECT)
DEFINE_STACK_OF(X509_VERIFY_PARAM)
DEFINE_OR_DECLARE_STACK_OF(X509_LOOKUP)
DEFINE_OR_DECLARE_STACK_OF(X509_OBJECT)
DEFINE_OR_DECLARE_STACK_OF(X509_VERIFY_PARAM)
int X509_STORE_set_depth(X509_STORE *store, int depth);
@@ -585,6 +585,7 @@ int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param,
uint32_t flags);
uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param);
char *X509_VERIFY_PARAM_get0_host(X509_VERIFY_PARAM *param, int idx);
int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
const char *name, size_t namelen);
int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
@@ -594,8 +595,10 @@ void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param);
char *X509_VERIFY_PARAM_get0_peername(const X509_VERIFY_PARAM *param);
void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *);
char *X509_VERIFY_PARAM_get0_email(X509_VERIFY_PARAM *param);
int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
const char *email, size_t emaillen);
char *X509_VERIFY_PARAM_get1_ip_asc(X509_VERIFY_PARAM *param);
int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
const unsigned char *ip, size_t iplen);
int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param,
+25 -24
View File
@@ -97,7 +97,7 @@ struct v3_ext_ctx {
typedef struct v3_ext_method X509V3_EXT_METHOD;
DEFINE_STACK_OF(X509V3_EXT_METHOD)
DEFINE_OR_DECLARE_STACK_OF(X509V3_EXT_METHOD)
/* ext_flags values */
# define X509V3_EXT_DYNAMIC 0x1
@@ -163,17 +163,15 @@ typedef struct ACCESS_DESCRIPTION_st {
GENERAL_NAME *location;
} ACCESS_DESCRIPTION;
DEFINE_OR_DECLARE_STACK_OF(ACCESS_DESCRIPTION)
DEFINE_OR_DECLARE_STACK_OF(GENERAL_NAME)
typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE;
typedef STACK_OF(ASN1_INTEGER) TLS_FEATURE;
DEFINE_STACK_OF(GENERAL_NAME)
typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;
DEFINE_STACK_OF(GENERAL_NAMES)
DEFINE_STACK_OF(ACCESS_DESCRIPTION)
DEFINE_OR_DECLARE_STACK_OF(GENERAL_NAMES)
typedef struct DIST_POINT_NAME_st {
int type;
@@ -206,9 +204,9 @@ struct DIST_POINT_st {
int dp_reasons;
};
typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
DEFINE_OR_DECLARE_STACK_OF(DIST_POINT)
DEFINE_STACK_OF(DIST_POINT)
typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
struct AUTHORITY_KEYID_st {
ASN1_OCTET_STRING *keyid;
@@ -223,7 +221,7 @@ typedef struct SXNET_ID_st {
ASN1_OCTET_STRING *user;
} SXNETID;
DEFINE_STACK_OF(SXNETID)
DEFINE_OR_DECLARE_STACK_OF(SXNETID)
typedef struct SXNET_st {
ASN1_INTEGER *version;
@@ -256,23 +254,23 @@ typedef struct POLICYQUALINFO_st {
} d;
} POLICYQUALINFO;
DEFINE_STACK_OF(POLICYQUALINFO)
DEFINE_OR_DECLARE_STACK_OF(POLICYQUALINFO)
typedef struct POLICYINFO_st {
ASN1_OBJECT *policyid;
STACK_OF(POLICYQUALINFO) *qualifiers;
} POLICYINFO;
typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
DEFINE_OR_DECLARE_STACK_OF(POLICYINFO)
DEFINE_STACK_OF(POLICYINFO)
typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
typedef struct POLICY_MAPPING_st {
ASN1_OBJECT *issuerDomainPolicy;
ASN1_OBJECT *subjectDomainPolicy;
} POLICY_MAPPING;
DEFINE_STACK_OF(POLICY_MAPPING)
DEFINE_OR_DECLARE_STACK_OF(POLICY_MAPPING)
typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS;
@@ -282,7 +280,7 @@ typedef struct GENERAL_SUBTREE_st {
ASN1_INTEGER *maximum;
} GENERAL_SUBTREE;
DEFINE_STACK_OF(GENERAL_SUBTREE)
DEFINE_OR_DECLARE_STACK_OF(GENERAL_SUBTREE)
struct NAME_CONSTRAINTS_st {
STACK_OF(GENERAL_SUBTREE) *permittedSubtrees;
@@ -422,6 +420,8 @@ typedef struct x509_purpose_st {
void *usr_data;
} X509_PURPOSE;
DEFINE_OR_DECLARE_STACK_OF(X509_PURPOSE)
# define X509_PURPOSE_SSL_CLIENT 1
# define X509_PURPOSE_SSL_SERVER 2
# define X509_PURPOSE_NS_SSL_SERVER 3
@@ -458,8 +458,6 @@ typedef struct x509_purpose_st {
# define X509V3_ADD_DELETE 5L
# define X509V3_ADD_SILENT 0x10
DEFINE_STACK_OF(X509_PURPOSE)
DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
DECLARE_ASN1_FUNCTIONS(SXNET)
@@ -736,7 +734,7 @@ int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk,
unsigned long chtype);
void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent);
DEFINE_STACK_OF(X509_POLICY_NODE)
DEFINE_OR_DECLARE_STACK_OF(X509_POLICY_NODE)
#ifndef OPENSSL_NO_RFC3779
typedef struct ASRange_st {
@@ -754,8 +752,9 @@ typedef struct ASIdOrRange_st {
} u;
} ASIdOrRange;
DEFINE_OR_DECLARE_STACK_OF(ASIdOrRange)
typedef STACK_OF(ASIdOrRange) ASIdOrRanges;
DEFINE_STACK_OF(ASIdOrRange)
# define ASIdentifierChoice_inherit 0
# define ASIdentifierChoice_asIdsOrRanges 1
@@ -792,8 +791,9 @@ typedef struct IPAddressOrRange_st {
} u;
} IPAddressOrRange;
DEFINE_OR_DECLARE_STACK_OF(IPAddressOrRange)
typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges;
DEFINE_STACK_OF(IPAddressOrRange)
# define IPAddressChoice_inherit 0
# define IPAddressChoice_addressesOrRanges 1
@@ -811,8 +811,9 @@ typedef struct IPAddressFamily_st {
IPAddressChoice *ipAddressChoice;
} IPAddressFamily;
DEFINE_OR_DECLARE_STACK_OF(IPAddressFamily)
typedef STACK_OF(IPAddressFamily) IPAddrBlocks;
DEFINE_STACK_OF(IPAddressFamily)
DECLARE_ASN1_FUNCTIONS(IPAddressRange)
DECLARE_ASN1_FUNCTIONS(IPAddressOrRange)
@@ -884,7 +885,7 @@ int X509v3_addr_validate_resource_set(STACK_OF(X509) *chain,
#endif /* OPENSSL_NO_RFC3779 */
DEFINE_STACK_OF(ASN1_STRING)
DEFINE_OR_DECLARE_STACK_OF(ASN1_STRING)
/*
* Admission Syntax
@@ -897,8 +898,8 @@ DECLARE_ASN1_FUNCTIONS(NAMING_AUTHORITY)
DECLARE_ASN1_FUNCTIONS(PROFESSION_INFO)
DECLARE_ASN1_FUNCTIONS(ADMISSIONS)
DECLARE_ASN1_FUNCTIONS(ADMISSION_SYNTAX)
DEFINE_STACK_OF(ADMISSIONS)
DEFINE_STACK_OF(PROFESSION_INFO)
DEFINE_OR_DECLARE_STACK_OF(PROFESSION_INFO)
DEFINE_OR_DECLARE_STACK_OF(ADMISSIONS)
typedef STACK_OF(PROFESSION_INFO) PROFESSION_INFOS;
const ASN1_OBJECT *NAMING_AUTHORITY_get0_authorityId(