Latest update
This commit is contained in:
@@ -95,4 +95,13 @@ uint32_t OPENSSL_rdtsc(void);
|
||||
size_t OPENSSL_instrument_bus(unsigned int *, size_t);
|
||||
size_t OPENSSL_instrument_bus2(unsigned int *, size_t, size_t);
|
||||
|
||||
typedef struct openssl_ctx_method {
|
||||
void *(*new_func)(void);
|
||||
void (*free_func)(void *);
|
||||
} OPENSSL_CTX_METHOD;
|
||||
/* For each type of data to store in the context, an index must be created */
|
||||
int openssl_ctx_new_index(const OPENSSL_CTX_METHOD *);
|
||||
/* Functions to retrieve pointers to data by index */
|
||||
void *openssl_ctx_get_data(OPENSSL_CTX *, int /* index */);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2019, Oracle and/or its affiliates. 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
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_PROPERTY_H
|
||||
# define HEADER_PROPERTY_H
|
||||
|
||||
typedef struct ossl_method_store_st OSSL_METHOD_STORE;
|
||||
|
||||
/* Implementation store functions */
|
||||
OSSL_METHOD_STORE *ossl_method_store_new(void);
|
||||
void ossl_method_store_free(OSSL_METHOD_STORE *store);
|
||||
int ossl_method_store_add(OSSL_METHOD_STORE *store, int nid,
|
||||
const char *properties, void *implementation,
|
||||
void (*implementation_destruct)(void *));
|
||||
int ossl_method_store_remove(OSSL_METHOD_STORE *store,
|
||||
int nid, const void *implementation);
|
||||
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);
|
||||
|
||||
/* proeprty query cache functions */
|
||||
int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, int nid,
|
||||
const char *prop_query, void **result);
|
||||
int ossl_method_store_cache_set(OSSL_METHOD_STORE *store, int nid,
|
||||
const char *prop_query, void *result);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2019 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
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_PROPERR_H
|
||||
# define HEADER_PROPERR_H
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_PROP_strings(void);
|
||||
|
||||
/*
|
||||
* PROP function codes.
|
||||
*/
|
||||
# define PROP_F_OSSL_PARSE_PROPERTY 100
|
||||
# define PROP_F_OSSL_PARSE_QUERY 101
|
||||
# define PROP_F_PARSE_HEX 102
|
||||
# define PROP_F_PARSE_NAME 103
|
||||
# define PROP_F_PARSE_NUMBER 104
|
||||
# define PROP_F_PARSE_OCT 105
|
||||
# define PROP_F_PARSE_STRING 106
|
||||
# define PROP_F_PARSE_UNQUOTED 107
|
||||
|
||||
/*
|
||||
* PROP reason codes.
|
||||
*/
|
||||
# define PROP_R_NAME_TOO_LONG 100
|
||||
# define PROP_R_NOT_AN_ASCII_CHARACTER 101
|
||||
# define PROP_R_NOT_AN_HEXADECIMAL_DIGIT 102
|
||||
# define PROP_R_NOT_AN_IDENTIFIER 103
|
||||
# define PROP_R_NOT_AN_OCTAL_DIGIT 104
|
||||
# define PROP_R_NOT_A_DECIMAL_DIGIT 105
|
||||
# define PROP_R_NO_MATCHING_STRING_DELIMETER 106
|
||||
# define PROP_R_NO_VALUE 107
|
||||
# define PROP_R_PARSE_FAILED 108
|
||||
# define PROP_R_STRING_TOO_LONG 109
|
||||
# define PROP_R_TRAILING_CHARACTERS 110
|
||||
|
||||
#endif
|
||||
@@ -107,7 +107,8 @@ DEFINE_STACK_OF(void)
|
||||
# define CRYPTO_EX_INDEX_APP 13
|
||||
# define CRYPTO_EX_INDEX_UI_METHOD 14
|
||||
# define CRYPTO_EX_INDEX_DRBG 15
|
||||
# define CRYPTO_EX_INDEX__COUNT 16
|
||||
# define CRYPTO_EX_INDEX_OPENSSL_CTX 16
|
||||
# define CRYPTO_EX_INDEX__COUNT 17
|
||||
|
||||
/* No longer needed, so this is a no-op */
|
||||
#define OPENSSL_malloc_init() while(0) continue
|
||||
@@ -187,6 +188,10 @@ int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
|
||||
|
||||
void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
|
||||
|
||||
/* Allocate a single item in the CRYPTO_EX_DATA variable */
|
||||
int CRYPTO_alloc_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad,
|
||||
int idx);
|
||||
|
||||
/*
|
||||
* Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular
|
||||
* index (relative to the class type involved)
|
||||
@@ -446,6 +451,8 @@ int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key);
|
||||
CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void);
|
||||
int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b);
|
||||
|
||||
OPENSSL_CTX *OPENSSL_CTX_new(void);
|
||||
void OPENSSL_CTX_free(OPENSSL_CTX *);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -287,6 +287,13 @@ typedef unsigned __int64 uint64_t;
|
||||
# define ossl_noreturn
|
||||
# endif
|
||||
|
||||
/* ossl_unused: portable unused attribute for use in public headers */
|
||||
# if defined(__GNUC__)
|
||||
# define ossl_unused __attribute__((unused))
|
||||
# else
|
||||
# define ossl_unused
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -212,6 +212,12 @@ void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
|
||||
*/
|
||||
int EC_GROUP_get_curve_name(const EC_GROUP *group);
|
||||
|
||||
/** Gets the field of an EC_GROUP
|
||||
* \param group EC_GROUP object
|
||||
* \return the group field
|
||||
*/
|
||||
const BIGNUM *EC_GROUP_get0_field(const EC_GROUP *group);
|
||||
|
||||
void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
|
||||
int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 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
|
||||
@@ -62,6 +62,7 @@ int ERR_load_EC_strings(void);
|
||||
# define EC_F_EC_ASN1_GROUP2CURVE 153
|
||||
# define EC_F_EC_ASN1_GROUP2FIELDID 154
|
||||
# define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208
|
||||
# define EC_F_EC_GF2M_SIMPLE_FIELD_INV 296
|
||||
# define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159
|
||||
# define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195
|
||||
# define EC_F_EC_GF2M_SIMPLE_LADDER_POST 285
|
||||
@@ -74,6 +75,7 @@ int ERR_load_EC_strings(void);
|
||||
# define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164
|
||||
# define EC_F_EC_GFP_MONT_FIELD_DECODE 133
|
||||
# define EC_F_EC_GFP_MONT_FIELD_ENCODE 134
|
||||
# define EC_F_EC_GFP_MONT_FIELD_INV 297
|
||||
# define EC_F_EC_GFP_MONT_FIELD_MUL 131
|
||||
# define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209
|
||||
# define EC_F_EC_GFP_MONT_FIELD_SQR 132
|
||||
@@ -91,6 +93,7 @@ int ERR_load_EC_strings(void);
|
||||
# define EC_F_EC_GFP_NIST_FIELD_SQR 201
|
||||
# define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202
|
||||
# define EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES 287
|
||||
# define EC_F_EC_GFP_SIMPLE_FIELD_INV 298
|
||||
# define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165
|
||||
# define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166
|
||||
# define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102
|
||||
@@ -202,6 +205,7 @@ int ERR_load_EC_strings(void);
|
||||
# define EC_R_BAD_SIGNATURE 156
|
||||
# define EC_R_BIGNUM_OUT_OF_RANGE 144
|
||||
# define EC_R_BUFFER_TOO_SMALL 100
|
||||
# define EC_R_CANNOT_INVERT 165
|
||||
# define EC_R_COORDINATES_OUT_OF_RANGE 146
|
||||
# define EC_R_CURVE_DOES_NOT_SUPPORT_ECDH 160
|
||||
# define EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING 159
|
||||
|
||||
@@ -95,6 +95,7 @@ typedef struct err_state_st {
|
||||
# define ERR_LIB_KDF 52
|
||||
# define ERR_LIB_SM2 53
|
||||
# define ERR_LIB_ESS 54
|
||||
# define ERR_LIB_PROP 55
|
||||
|
||||
# define ERR_LIB_USER 128
|
||||
|
||||
@@ -135,6 +136,7 @@ typedef struct err_state_st {
|
||||
# define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define SM2err(f,r) ERR_PUT_error(ERR_LIB_SM2,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define ESSerr(f,r) ERR_PUT_error(ERR_LIB_ESS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define PROPerr(f,r) ERR_PUT_error(ERR_LIB_PROP,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
|
||||
# define ERR_PACK(l,f,r) ( \
|
||||
(((unsigned int)(l) & 0x0FF) << 24L) | \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 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
|
||||
@@ -55,6 +55,9 @@ int ERR_load_EVP_strings(void);
|
||||
# define EVP_F_EVP_ENCRYPTDECRYPTUPDATE 219
|
||||
# define EVP_F_EVP_ENCRYPTFINAL_EX 127
|
||||
# define EVP_F_EVP_ENCRYPTUPDATE 167
|
||||
# define EVP_F_EVP_KDF_CTRL 224
|
||||
# define EVP_F_EVP_KDF_CTRL_STR 225
|
||||
# define EVP_F_EVP_KDF_CTX_NEW_ID 226
|
||||
# define EVP_F_EVP_MAC_CTRL 209
|
||||
# define EVP_F_EVP_MAC_CTRL_STR 210
|
||||
# define EVP_F_EVP_MAC_CTX_COPY 211
|
||||
@@ -125,6 +128,7 @@ int ERR_load_EVP_strings(void);
|
||||
# define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118
|
||||
# define EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN 164
|
||||
# define EVP_F_PKCS5_V2_SCRYPT_KEYIVGEN 180
|
||||
# define EVP_F_PKEY_KDF_CTRL 227
|
||||
# define EVP_F_PKEY_MAC_INIT 214
|
||||
# define EVP_F_PKEY_SET_TYPE 158
|
||||
# define EVP_F_POLY1305_CTRL 216
|
||||
@@ -132,6 +136,7 @@ int ERR_load_EVP_strings(void);
|
||||
# define EVP_F_RC5_CTRL 125
|
||||
# define EVP_F_S390X_AES_GCM_CTRL 201
|
||||
# define EVP_F_S390X_AES_GCM_TLS_CIPHER 208
|
||||
# define EVP_F_SCRYPT_ALG 228
|
||||
# define EVP_F_UPDATE 173
|
||||
|
||||
/*
|
||||
@@ -188,6 +193,7 @@ int ERR_load_EVP_strings(void);
|
||||
# define EVP_R_ONLY_ONESHOT_SUPPORTED 177
|
||||
# define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150
|
||||
# define EVP_R_OPERATON_NOT_INITIALIZED 151
|
||||
# define EVP_R_PARAMETER_TOO_LARGE 187
|
||||
# define EVP_R_PARTIALLY_OVERLAPPING 162
|
||||
# define EVP_R_PBKDF2_ERROR 181
|
||||
# define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 179
|
||||
|
||||
+51
-6
@@ -10,10 +10,52 @@
|
||||
#ifndef HEADER_KDF_H
|
||||
# define HEADER_KDF_H
|
||||
|
||||
# include <stdarg.h>
|
||||
# include <stddef.h>
|
||||
# include <openssl/ossl_typ.h>
|
||||
# include <openssl/kdferr.h>
|
||||
#ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# endif
|
||||
|
||||
# define EVP_KDF_PBKDF2 NID_id_pbkdf2
|
||||
# define EVP_KDF_SCRYPT NID_id_scrypt
|
||||
# define EVP_KDF_TLS1_PRF NID_tls1_prf
|
||||
# define EVP_KDF_HKDF NID_hkdf
|
||||
|
||||
EVP_KDF_CTX *EVP_KDF_CTX_new_id(int id);
|
||||
void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx);
|
||||
|
||||
void EVP_KDF_reset(EVP_KDF_CTX *ctx);
|
||||
int EVP_KDF_ctrl(EVP_KDF_CTX *ctx, int cmd, ...);
|
||||
int EVP_KDF_vctrl(EVP_KDF_CTX *ctx, int cmd, va_list args);
|
||||
int EVP_KDF_ctrl_str(EVP_KDF_CTX *ctx, const char *type, const char *value);
|
||||
size_t EVP_KDF_size(EVP_KDF_CTX *ctx);
|
||||
int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen);
|
||||
|
||||
|
||||
# define EVP_KDF_CTRL_SET_PASS 0x01 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_SALT 0x02 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_ITER 0x03 /* int */
|
||||
# define EVP_KDF_CTRL_SET_MD 0x04 /* EVP_MD * */
|
||||
# define EVP_KDF_CTRL_SET_KEY 0x05 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_MAXMEM_BYTES 0x06 /* uint64_t */
|
||||
# define EVP_KDF_CTRL_SET_TLS_SECRET 0x07 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_RESET_TLS_SEED 0x08
|
||||
# define EVP_KDF_CTRL_ADD_TLS_SEED 0x09 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_RESET_HKDF_INFO 0x0a
|
||||
# define EVP_KDF_CTRL_ADD_HKDF_INFO 0x0b /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_HKDF_MODE 0x0c /* int */
|
||||
# define EVP_KDF_CTRL_SET_SCRYPT_N 0x0d /* uint64_t */
|
||||
# define EVP_KDF_CTRL_SET_SCRYPT_R 0x0e /* uint32_t */
|
||||
# define EVP_KDF_CTRL_SET_SCRYPT_P 0x0f /* uint32_t */
|
||||
|
||||
# define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND 0
|
||||
# define EVP_KDF_HKDF_MODE_EXTRACT_ONLY 1
|
||||
# define EVP_KDF_HKDF_MODE_EXPAND_ONLY 2
|
||||
|
||||
|
||||
/**** The legacy PKEY-based KDF API follows. ****/
|
||||
|
||||
# define EVP_PKEY_CTRL_TLS_MD (EVP_PKEY_ALG_CTRL)
|
||||
# define EVP_PKEY_CTRL_TLS_SECRET (EVP_PKEY_ALG_CTRL + 1)
|
||||
@@ -30,9 +72,12 @@ extern "C" {
|
||||
# define EVP_PKEY_CTRL_SCRYPT_P (EVP_PKEY_ALG_CTRL + 12)
|
||||
# define EVP_PKEY_CTRL_SCRYPT_MAXMEM_BYTES (EVP_PKEY_ALG_CTRL + 13)
|
||||
|
||||
# define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND 0
|
||||
# define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY 1
|
||||
# define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY 2
|
||||
# define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND \
|
||||
EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND
|
||||
# define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY \
|
||||
EVP_KDF_HKDF_MODE_EXTRACT_ONLY
|
||||
# define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY \
|
||||
EVP_KDF_HKDF_MODE_EXPAND_ONLY
|
||||
|
||||
# define EVP_PKEY_CTX_set_tls1_prf_md(pctx, md) \
|
||||
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
|
||||
@@ -91,7 +136,7 @@ extern "C" {
|
||||
EVP_PKEY_CTRL_SCRYPT_MAXMEM_BYTES, maxmem_bytes)
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 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,6 +19,23 @@ int ERR_load_KDF_strings(void);
|
||||
/*
|
||||
* KDF function codes.
|
||||
*/
|
||||
# define KDF_F_HKDF_EXTRACT 112
|
||||
# define KDF_F_KDF_HKDF_DERIVE 113
|
||||
# define KDF_F_KDF_HKDF_NEW 114
|
||||
# define KDF_F_KDF_HKDF_SIZE 115
|
||||
# define KDF_F_KDF_MD2CTRL 116
|
||||
# define KDF_F_KDF_PBKDF2_CTRL_STR 117
|
||||
# define KDF_F_KDF_PBKDF2_DERIVE 118
|
||||
# define KDF_F_KDF_PBKDF2_NEW 119
|
||||
# define KDF_F_KDF_SCRYPT_CTRL_STR 120
|
||||
# define KDF_F_KDF_SCRYPT_CTRL_UINT32 121
|
||||
# define KDF_F_KDF_SCRYPT_CTRL_UINT64 122
|
||||
# define KDF_F_KDF_SCRYPT_DERIVE 123
|
||||
# define KDF_F_KDF_SCRYPT_NEW 124
|
||||
# define KDF_F_KDF_TLS1_PRF_CTRL_STR 125
|
||||
# define KDF_F_KDF_TLS1_PRF_DERIVE 126
|
||||
# define KDF_F_KDF_TLS1_PRF_NEW 127
|
||||
# define KDF_F_PBKDF2_SET_MEMBUF 128
|
||||
# define KDF_F_PKEY_HKDF_CTRL_STR 103
|
||||
# define KDF_F_PKEY_HKDF_DERIVE 102
|
||||
# define KDF_F_PKEY_HKDF_INIT 108
|
||||
@@ -30,6 +47,7 @@ int ERR_load_KDF_strings(void);
|
||||
# define KDF_F_PKEY_TLS1_PRF_CTRL_STR 100
|
||||
# define KDF_F_PKEY_TLS1_PRF_DERIVE 101
|
||||
# define KDF_F_PKEY_TLS1_PRF_INIT 110
|
||||
# define KDF_F_SCRYPT_SET_MEMBUF 129
|
||||
# define KDF_F_TLS1_PRF_ALG 111
|
||||
|
||||
/*
|
||||
@@ -47,5 +65,6 @@ int ERR_load_KDF_strings(void);
|
||||
# define KDF_R_UNKNOWN_PARAMETER_TYPE 103
|
||||
# define KDF_R_VALUE_ERROR 108
|
||||
# define KDF_R_VALUE_MISSING 102
|
||||
# define KDF_R_WRONG_OUTPUT_BUFFER_SIZE 112
|
||||
|
||||
#endif
|
||||
+19
-14
@@ -72,6 +72,7 @@ typedef struct lhash_st OPENSSL_LHASH;
|
||||
int OPENSSL_LH_error(OPENSSL_LHASH *lh);
|
||||
OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c);
|
||||
void OPENSSL_LH_free(OPENSSL_LHASH *lh);
|
||||
void OPENSSL_LH_flush(OPENSSL_LHASH *lh);
|
||||
void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data);
|
||||
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data);
|
||||
void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data);
|
||||
@@ -127,52 +128,56 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
||||
return (LHASH_OF(type) *) \
|
||||
OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
|
||||
} \
|
||||
static ossl_inline void lh_##type##_free(LHASH_OF(type) *lh) \
|
||||
static ossl_unused ossl_inline void lh_##type##_free(LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
|
||||
} \
|
||||
static ossl_inline type *lh_##type##_insert(LHASH_OF(type) *lh, type *d) \
|
||||
static ossl_unused ossl_inline void lh_##type##_flush(LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
|
||||
} \
|
||||
static ossl_unused ossl_inline type *lh_##type##_insert(LHASH_OF(type) *lh, type *d) \
|
||||
{ \
|
||||
return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
|
||||
} \
|
||||
static ossl_inline type *lh_##type##_delete(LHASH_OF(type) *lh, const type *d) \
|
||||
static ossl_unused ossl_inline type *lh_##type##_delete(LHASH_OF(type) *lh, const type *d) \
|
||||
{ \
|
||||
return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
|
||||
} \
|
||||
static ossl_inline type *lh_##type##_retrieve(LHASH_OF(type) *lh, const type *d) \
|
||||
static ossl_unused ossl_inline type *lh_##type##_retrieve(LHASH_OF(type) *lh, const type *d) \
|
||||
{ \
|
||||
return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
|
||||
} \
|
||||
static ossl_inline int lh_##type##_error(LHASH_OF(type) *lh) \
|
||||
static ossl_unused ossl_inline int lh_##type##_error(LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
|
||||
} \
|
||||
static ossl_inline unsigned long lh_##type##_num_items(LHASH_OF(type) *lh) \
|
||||
static ossl_unused ossl_inline unsigned long lh_##type##_num_items(LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
|
||||
} \
|
||||
static ossl_inline void lh_##type##_node_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
||||
static ossl_unused ossl_inline void lh_##type##_node_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
||||
{ \
|
||||
OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
||||
} \
|
||||
static ossl_inline void lh_##type##_node_usage_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
||||
static ossl_unused ossl_inline void lh_##type##_node_usage_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
||||
{ \
|
||||
OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
||||
} \
|
||||
static ossl_inline void lh_##type##_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
||||
static ossl_unused ossl_inline void lh_##type##_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
||||
{ \
|
||||
OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
||||
} \
|
||||
static ossl_inline unsigned long lh_##type##_get_down_load(LHASH_OF(type) *lh) \
|
||||
static ossl_unused ossl_inline unsigned long lh_##type##_get_down_load(LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
|
||||
} \
|
||||
static ossl_inline void lh_##type##_set_down_load(LHASH_OF(type) *lh, unsigned long dl) \
|
||||
static ossl_unused ossl_inline void lh_##type##_set_down_load(LHASH_OF(type) *lh, unsigned long dl) \
|
||||
{ \
|
||||
OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
|
||||
} \
|
||||
static ossl_inline void lh_##type##_doall(LHASH_OF(type) *lh, \
|
||||
void (*doall)(type *)) \
|
||||
static ossl_unused ossl_inline void lh_##type##_doall(LHASH_OF(type) *lh, \
|
||||
void (*doall)(type *)) \
|
||||
{ \
|
||||
OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
|
||||
} \
|
||||
@@ -185,7 +190,7 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
||||
int_implement_lhash_doall(type, argtype, type)
|
||||
|
||||
#define int_implement_lhash_doall(type, argtype, cbargtype) \
|
||||
static ossl_inline void \
|
||||
static ossl_unused ossl_inline void \
|
||||
lh_##type##_doall_##argtype(LHASH_OF(type) *lh, \
|
||||
void (*fn)(cbargtype *, argtype *), \
|
||||
argtype *arg) \
|
||||
|
||||
@@ -99,6 +99,8 @@ typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
|
||||
typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
|
||||
typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
|
||||
|
||||
typedef struct evp_kdf_ctx_st EVP_KDF_CTX;
|
||||
|
||||
typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
|
||||
|
||||
typedef struct hmac_ctx_st HMAC_CTX;
|
||||
@@ -177,6 +179,8 @@ typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX;
|
||||
typedef struct ossl_store_info_st OSSL_STORE_INFO;
|
||||
typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
|
||||
|
||||
typedef struct openssl_ctx_st OPENSSL_CTX;
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
|
||||
defined(INTMAX_MAX) && defined(UINTMAX_MAX)
|
||||
typedef intmax_t ossl_intmax_t;
|
||||
|
||||
+24
-24
@@ -24,96 +24,96 @@ extern "C" {
|
||||
typedef int (*sk_##t1##_compfunc)(const t3 * const *a, const t3 *const *b); \
|
||||
typedef void (*sk_##t1##_freefunc)(t3 *a); \
|
||||
typedef t3 * (*sk_##t1##_copyfunc)(const t3 *a); \
|
||||
static ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \
|
||||
static ossl_unused ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
|
||||
} \
|
||||
static ossl_inline STACK_OF(t1) *sk_##t1##_new(sk_##t1##_compfunc compare) \
|
||||
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new(sk_##t1##_compfunc compare) \
|
||||
{ \
|
||||
return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
|
||||
} \
|
||||
static ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \
|
||||
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \
|
||||
{ \
|
||||
return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
|
||||
} \
|
||||
static ossl_inline STACK_OF(t1) *sk_##t1##_new_reserve(sk_##t1##_compfunc compare, int n) \
|
||||
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_reserve(sk_##t1##_compfunc compare, int n) \
|
||||
{ \
|
||||
return (STACK_OF(t1) *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \
|
||||
} \
|
||||
static ossl_inline int sk_##t1##_reserve(STACK_OF(t1) *sk, int n) \
|
||||
static ossl_unused ossl_inline int sk_##t1##_reserve(STACK_OF(t1) *sk, int n) \
|
||||
{ \
|
||||
return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); \
|
||||
} \
|
||||
static ossl_inline void sk_##t1##_free(STACK_OF(t1) *sk) \
|
||||
static ossl_unused ossl_inline void sk_##t1##_free(STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
OPENSSL_sk_free((OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_inline void sk_##t1##_zero(STACK_OF(t1) *sk) \
|
||||
static ossl_unused ossl_inline void sk_##t1##_zero(STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
OPENSSL_sk_zero((OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_inline t2 *sk_##t1##_delete(STACK_OF(t1) *sk, int i) \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_delete(STACK_OF(t1) *sk, int i) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
|
||||
} \
|
||||
static ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, \
|
||||
(const void *)ptr); \
|
||||
} \
|
||||
static ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
static ossl_unused ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
{ \
|
||||
return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
|
||||
} \
|
||||
static ossl_inline int sk_##t1##_unshift(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
static ossl_unused ossl_inline int sk_##t1##_unshift(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
{ \
|
||||
return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); \
|
||||
} \
|
||||
static ossl_inline t2 *sk_##t1##_pop(STACK_OF(t1) *sk) \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_pop(STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_inline t2 *sk_##t1##_shift(STACK_OF(t1) *sk) \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_shift(STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, sk_##t1##_freefunc freefunc) \
|
||||
static ossl_unused ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, sk_##t1##_freefunc freefunc) \
|
||||
{ \
|
||||
OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
|
||||
} \
|
||||
static ossl_inline int sk_##t1##_insert(STACK_OF(t1) *sk, t2 *ptr, int idx) \
|
||||
static ossl_unused ossl_inline int sk_##t1##_insert(STACK_OF(t1) *sk, t2 *ptr, int idx) \
|
||||
{ \
|
||||
return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); \
|
||||
} \
|
||||
static ossl_inline t2 *sk_##t1##_set(STACK_OF(t1) *sk, int idx, t2 *ptr) \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_set(STACK_OF(t1) *sk, int idx, t2 *ptr) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \
|
||||
} \
|
||||
static ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
static ossl_unused ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
{ \
|
||||
return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
|
||||
} \
|
||||
static ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
static ossl_unused ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
{ \
|
||||
return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); \
|
||||
} \
|
||||
static ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk) \
|
||||
static ossl_unused ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_inline int sk_##t1##_is_sorted(const STACK_OF(t1) *sk) \
|
||||
static ossl_unused ossl_inline int sk_##t1##_is_sorted(const STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_inline STACK_OF(t1) * sk_##t1##_dup(const STACK_OF(t1) *sk) \
|
||||
static ossl_unused ossl_inline STACK_OF(t1) * sk_##t1##_dup(const STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_inline STACK_OF(t1) *sk_##t1##_deep_copy(const STACK_OF(t1) *sk, \
|
||||
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_deep_copy(const STACK_OF(t1) *sk, \
|
||||
sk_##t1##_copyfunc copyfunc, \
|
||||
sk_##t1##_freefunc freefunc) \
|
||||
{ \
|
||||
@@ -121,7 +121,7 @@ extern "C" {
|
||||
(OPENSSL_sk_copyfunc)copyfunc, \
|
||||
(OPENSSL_sk_freefunc)freefunc); \
|
||||
} \
|
||||
static ossl_inline sk_##t1##_compfunc sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, sk_##t1##_compfunc compare) \
|
||||
static ossl_unused ossl_inline sk_##t1##_compfunc sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, sk_##t1##_compfunc compare) \
|
||||
{ \
|
||||
return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); \
|
||||
}
|
||||
|
||||
+12
-9
@@ -298,23 +298,26 @@ typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx);
|
||||
typedef int (*SSL_async_callback_fn)(SSL *s, void *arg);
|
||||
|
||||
/*
|
||||
* Some values are reserved until OpenSSL 1.2.0 because they were previously
|
||||
* Some values are reserved until OpenSSL 3.0.0 because they were previously
|
||||
* included in SSL_OP_ALL in a 1.1.x release.
|
||||
*
|
||||
* Reserved value (until OpenSSL 1.2.0) 0x00000001U
|
||||
* Reserved value (until OpenSSL 1.2.0) 0x00000002U
|
||||
*/
|
||||
|
||||
/* Disable Extended master secret */
|
||||
# define SSL_OP_NO_EXTENDED_MASTER_SECRET 0x00000001U
|
||||
|
||||
/* Reserved value (until OpenSSL 3.0.0) 0x00000002U */
|
||||
|
||||
/* Allow initial connection to servers that don't support RI */
|
||||
# define SSL_OP_LEGACY_SERVER_CONNECT 0x00000004U
|
||||
|
||||
/* Reserved value (until OpenSSL 1.2.0) 0x00000008U */
|
||||
/* Reserved value (until OpenSSL 3.0.0) 0x00000008U */
|
||||
# define SSL_OP_TLSEXT_PADDING 0x00000010U
|
||||
/* Reserved value (until OpenSSL 1.2.0) 0x00000020U */
|
||||
/* Reserved value (until OpenSSL 3.0.0) 0x00000020U */
|
||||
# define SSL_OP_SAFARI_ECDHE_ECDSA_BUG 0x00000040U
|
||||
/*
|
||||
* Reserved value (until OpenSSL 1.2.0) 0x00000080U
|
||||
* Reserved value (until OpenSSL 1.2.0) 0x00000100U
|
||||
* Reserved value (until OpenSSL 1.2.0) 0x00000200U
|
||||
* Reserved value (until OpenSSL 3.0.0) 0x00000080U
|
||||
* Reserved value (until OpenSSL 3.0.0) 0x00000100U
|
||||
* Reserved value (until OpenSSL 3.0.0) 0x00000200U
|
||||
*/
|
||||
|
||||
/* In TLSv1.3 allow a non-(ec)dhe based kex_mode */
|
||||
|
||||
@@ -596,8 +596,9 @@ int ERR_load_SSL_strings(void);
|
||||
# define SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION 209
|
||||
# define SSL_R_MISSING_TMP_DH_KEY 171
|
||||
# define SSL_R_MISSING_TMP_ECDH_KEY 311
|
||||
# define SSL_R_MIXED_SPECIAL_OPERATOR_WITH_GROUPS 293
|
||||
# define SSL_R_NESTED_GROUP 294
|
||||
# define SSL_R_MIXED_SPECIAL_OPERATOR_WITH_GROUPS 101
|
||||
# define SSL_R_NESTED_GROUP 108
|
||||
# define SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA 293
|
||||
# define SSL_R_NOT_ON_RECORD_BOUNDARY 182
|
||||
# define SSL_R_NOT_REPLACING_CERTIFICATE 289
|
||||
# define SSL_R_NOT_SERVER 284
|
||||
@@ -728,11 +729,11 @@ int ERR_load_SSL_strings(void);
|
||||
# define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239
|
||||
# define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242
|
||||
# define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
|
||||
# define SSL_R_UNEXPECTED_GROUP_CLOSE 109
|
||||
# define SSL_R_UNEXPECTED_CCS_MESSAGE 262
|
||||
# define SSL_R_UNEXPECTED_END_OF_EARLY_DATA 178
|
||||
# define SSL_R_UNEXPECTED_GROUP_CLOSE 295
|
||||
# define SSL_R_UNEXPECTED_MESSAGE 244
|
||||
# define SSL_R_UNEXPECTED_OPERATOR_IN_GROUP 296
|
||||
# define SSL_R_UNEXPECTED_OPERATOR_IN_GROUP 110
|
||||
# define SSL_R_UNEXPECTED_RECORD 245
|
||||
# define SSL_R_UNINITIALIZED 276
|
||||
# define SSL_R_UNKNOWN_ALERT_TYPE 246
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 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
|
||||
|
||||
Reference in New Issue
Block a user