Latest update
This commit is contained in:
+4
-23
@@ -310,23 +310,6 @@ TYPEDEF_D2I2D_OF(void);
|
||||
*
|
||||
*/
|
||||
|
||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
|
||||
/* ASN1_ITEM pointer exported type */
|
||||
typedef const ASN1_ITEM ASN1_ITEM_EXP;
|
||||
|
||||
/* Macro to obtain ASN1_ITEM pointer from exported type */
|
||||
# define ASN1_ITEM_ptr(iptr) (iptr)
|
||||
|
||||
/* Macro to include ASN1_ITEM pointer from base type */
|
||||
# define ASN1_ITEM_ref(iptr) (&(iptr##_it))
|
||||
|
||||
# define ASN1_ITEM_rptr(ref) (&(ref##_it))
|
||||
|
||||
# define DECLARE_ASN1_ITEM(name) \
|
||||
OPENSSL_EXTERN const ASN1_ITEM name##_it;
|
||||
|
||||
# else
|
||||
|
||||
/*
|
||||
* Platforms that can't easily handle shared global variables are declared as
|
||||
@@ -337,18 +320,16 @@ typedef const ASN1_ITEM ASN1_ITEM_EXP;
|
||||
typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
|
||||
|
||||
/* Macro to obtain ASN1_ITEM pointer from exported type */
|
||||
# define ASN1_ITEM_ptr(iptr) (iptr())
|
||||
# define ASN1_ITEM_ptr(iptr) (iptr())
|
||||
|
||||
/* Macro to include ASN1_ITEM pointer from base type */
|
||||
# define ASN1_ITEM_ref(iptr) (iptr##_it)
|
||||
# define ASN1_ITEM_ref(iptr) (iptr##_it)
|
||||
|
||||
# define ASN1_ITEM_rptr(ref) (ref##_it())
|
||||
# define ASN1_ITEM_rptr(ref) (ref##_it())
|
||||
|
||||
# define DECLARE_ASN1_ITEM(name) \
|
||||
# define DECLARE_ASN1_ITEM(name) \
|
||||
const ASN1_ITEM * name##_it(void);
|
||||
|
||||
# endif
|
||||
|
||||
/* Parameters used by ASN1_STRING_print_ex() */
|
||||
|
||||
/*
|
||||
|
||||
+8
-50
@@ -25,44 +25,24 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
|
||||
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
|
||||
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))
|
||||
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
|
||||
|
||||
/* Macros for start and end of ASN1_ITEM definition */
|
||||
|
||||
# define ASN1_ITEM_start(itname) \
|
||||
const ASN1_ITEM itname##_it = {
|
||||
|
||||
# define static_ASN1_ITEM_start(itname) \
|
||||
static const ASN1_ITEM itname##_it = {
|
||||
|
||||
# define ASN1_ITEM_end(itname) \
|
||||
};
|
||||
|
||||
# else
|
||||
|
||||
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
|
||||
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
|
||||
|
||||
/* Macros for start and end of ASN1_ITEM definition */
|
||||
|
||||
# define ASN1_ITEM_start(itname) \
|
||||
# define ASN1_ITEM_start(itname) \
|
||||
const ASN1_ITEM * itname##_it(void) \
|
||||
{ \
|
||||
static const ASN1_ITEM local_it = {
|
||||
|
||||
# define static_ASN1_ITEM_start(itname) \
|
||||
# define static_ASN1_ITEM_start(itname) \
|
||||
static ASN1_ITEM_start(itname)
|
||||
|
||||
# define ASN1_ITEM_end(itname) \
|
||||
# define ASN1_ITEM_end(itname) \
|
||||
}; \
|
||||
return &local_it; \
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
/* Macros to aid ASN1 template writing */
|
||||
|
||||
# define ASN1_ITEM_TEMPLATE(tname) \
|
||||
@@ -335,13 +315,9 @@ extern "C" {
|
||||
|
||||
/* Any defined by macros: the field used is in the table itself */
|
||||
|
||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
|
||||
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
|
||||
# else
|
||||
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
|
||||
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
|
||||
# endif
|
||||
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
|
||||
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
|
||||
|
||||
/* Plain simple type */
|
||||
# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
|
||||
/* Embedded simple type */
|
||||
@@ -421,23 +397,7 @@ extern "C" {
|
||||
# define ASN1_ADB(name) \
|
||||
static const ASN1_ADB_TABLE name##_adbtbl[]
|
||||
|
||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
|
||||
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
|
||||
;\
|
||||
static const ASN1_ADB name##_adb = {\
|
||||
flags,\
|
||||
offsetof(name, field),\
|
||||
adb_cb,\
|
||||
name##_adbtbl,\
|
||||
sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
|
||||
def,\
|
||||
none\
|
||||
}
|
||||
|
||||
# else
|
||||
|
||||
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
|
||||
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
|
||||
;\
|
||||
static const ASN1_ITEM *name##_adb(void) \
|
||||
{ \
|
||||
@@ -455,8 +415,6 @@ extern "C" {
|
||||
} \
|
||||
void dummy_function(void)
|
||||
|
||||
# endif
|
||||
|
||||
# define ADB_ENTRY(val, template) {val, template}
|
||||
|
||||
# define ASN1_ADB_TEMPLATE(name) \
|
||||
|
||||
+3
-10
@@ -20,10 +20,6 @@
|
||||
# include <openssl/crypto.h>
|
||||
# include <openssl/bioerr.h>
|
||||
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
# include <openssl/e_os2.h>
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -178,12 +174,9 @@ extern "C" {
|
||||
# define BIO_FLAGS_IO_SPECIAL 0x04
|
||||
# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
|
||||
# define BIO_FLAGS_SHOULD_RETRY 0x08
|
||||
# ifndef BIO_FLAGS_UPLINK
|
||||
/*
|
||||
* "UPLINK" flag denotes file descriptors provided by application. It
|
||||
* defaults to 0, as most platforms don't require UPLINK interface.
|
||||
*/
|
||||
# define BIO_FLAGS_UPLINK 0
|
||||
# if !OPENSSL_API_3
|
||||
/* This #define was replaced by an internal constant and should not be used. */
|
||||
# define BIO_FLAGS_UPLINK 0
|
||||
# endif
|
||||
|
||||
# define BIO_FLAGS_BASE64_NO_NL 0x100
|
||||
|
||||
@@ -198,15 +198,21 @@ void BN_zero_ex(BIGNUM *a);
|
||||
|
||||
const BIGNUM *BN_value_one(void);
|
||||
char *BN_options(void);
|
||||
BN_CTX *BN_CTX_new_ex(OPENSSL_CTX *ctx);
|
||||
BN_CTX *BN_CTX_new(void);
|
||||
BN_CTX *BN_CTX_secure_new_ex(OPENSSL_CTX *ctx);
|
||||
BN_CTX *BN_CTX_secure_new(void);
|
||||
void BN_CTX_free(BN_CTX *c);
|
||||
void BN_CTX_start(BN_CTX *ctx);
|
||||
BIGNUM *BN_CTX_get(BN_CTX *ctx);
|
||||
void BN_CTX_end(BN_CTX *ctx);
|
||||
int BN_rand_ex(BIGNUM *rnd, int bits, int top, int bottom, BN_CTX *ctx);
|
||||
int BN_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
int BN_priv_rand_ex(BIGNUM *rnd, int bits, int top, int bottom, BN_CTX *ctx);
|
||||
int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
int BN_rand_range_ex(BIGNUM *r, const BIGNUM *range, BN_CTX *ctx);
|
||||
int BN_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
int BN_priv_rand_range_ex(BIGNUM *r, const BIGNUM *range, BN_CTX *ctx);
|
||||
int BN_priv_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
|
||||
@@ -35,6 +35,7 @@ int ERR_load_BN_strings(void);
|
||||
# define BN_F_BN_COMPUTE_WNAF 142
|
||||
# define BN_F_BN_CTX_GET 116
|
||||
# define BN_F_BN_CTX_NEW 106
|
||||
# define BN_F_BN_CTX_NEW_EX 151
|
||||
# define BN_F_BN_CTX_START 129
|
||||
# define BN_F_BN_DIV 107
|
||||
# define BN_F_BN_DIV_RECP 130
|
||||
@@ -92,6 +93,7 @@ int ERR_load_BN_strings(void);
|
||||
# define BN_R_NOT_INITIALIZED 107
|
||||
# define BN_R_NO_INVERSE 108
|
||||
# define BN_R_NO_SOLUTION 116
|
||||
# define BN_R_NO_SUITABLE_DIGEST 120
|
||||
# define BN_R_PRIVATE_KEY_TOO_LARGE 117
|
||||
# define BN_R_P_IS_NOT_PRIME 112
|
||||
# define BN_R_TOO_MANY_ITERATIONS 113
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
/*-
|
||||
* Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Nokia 2007-2019
|
||||
* Copyright Siemens AG 2015-2019
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* CMP (RFC 4210) implementation by M. Peylo, M. Viljanen, and D. von Oheimb.
|
||||
*/
|
||||
|
||||
#ifndef OSSL_HEADER_CMP_H
|
||||
# define OSSL_HEADER_CMP_H
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# ifndef OPENSSL_NO_CMP
|
||||
|
||||
# include <openssl/crmf.h>
|
||||
# include <openssl/cmperr.h>
|
||||
|
||||
/* explicit #includes not strictly needed since implied by the above: */
|
||||
# include <openssl/ossl_typ.h>
|
||||
# include <openssl/safestack.h>
|
||||
# include <openssl/x509.h>
|
||||
# include <openssl/x509v3.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define OSSL_CMP_PVNO 2
|
||||
|
||||
/*-
|
||||
* PKIFailureInfo ::= BIT STRING {
|
||||
* -- since we can fail in more than one way!
|
||||
* -- More codes may be added in the future if/when required.
|
||||
* badAlg (0),
|
||||
* -- unrecognized or unsupported Algorithm Identifier
|
||||
* badMessageCheck (1),
|
||||
* -- integrity check failed (e.g., signature did not verify)
|
||||
* badRequest (2),
|
||||
* -- transaction not permitted or supported
|
||||
* badTime (3),
|
||||
* -- messageTime was not sufficiently close to the system time,
|
||||
* -- as defined by local policy
|
||||
* badCertId (4),
|
||||
* -- no certificate could be found matching the provided criteria
|
||||
* badDataFormat (5),
|
||||
* -- the data submitted has the wrong format
|
||||
* wrongAuthority (6),
|
||||
* -- the authority indicated in the request is different from the
|
||||
* -- one creating the response token
|
||||
* incorrectData (7),
|
||||
* -- the requester's data is incorrect (for notary services)
|
||||
* missingTimeStamp (8),
|
||||
* -- when the timestamp is missing but should be there
|
||||
* -- (by policy)
|
||||
* badPOP (9),
|
||||
* -- the proof-of-possession failed
|
||||
* certRevoked (10),
|
||||
* -- the certificate has already been revoked
|
||||
* certConfirmed (11),
|
||||
* -- the certificate has already been confirmed
|
||||
* wrongIntegrity (12),
|
||||
* -- invalid integrity, password based instead of signature or
|
||||
* -- vice versa
|
||||
* badRecipientNonce (13),
|
||||
* -- invalid recipient nonce, either missing or wrong value
|
||||
* timeNotAvailable (14),
|
||||
* -- the TSA's time source is not available
|
||||
* unacceptedPolicy (15),
|
||||
* -- the requested TSA policy is not supported by the TSA.
|
||||
* unacceptedExtension (16),
|
||||
* -- the requested extension is not supported by the TSA.
|
||||
* addInfoNotAvailable (17),
|
||||
* -- the additional information requested could not be
|
||||
* -- understood or is not available
|
||||
* badSenderNonce (18),
|
||||
* -- invalid sender nonce, either missing or wrong size
|
||||
* badCertTemplate (19),
|
||||
* -- invalid cert. template or missing mandatory information
|
||||
* signerNotTrusted (20),
|
||||
* -- signer of the message unknown or not trusted
|
||||
* transactionIdInUse (21),
|
||||
* -- the transaction identifier is already in use
|
||||
* unsupportedVersion (22),
|
||||
* -- the version of the message is not supported
|
||||
* notAuthorized (23),
|
||||
* -- the sender was not authorized to make the preceding
|
||||
* -- request or perform the preceding action
|
||||
* systemUnavail (24),
|
||||
* -- the request cannot be handled due to system unavailability
|
||||
* systemFailure (25),
|
||||
* -- the request cannot be handled due to system failure
|
||||
* duplicateCertReq (26)
|
||||
* -- certificate cannot be issued because a duplicate
|
||||
* -- certificate already exists
|
||||
* }
|
||||
*/
|
||||
# define OSSL_CMP_PKIFAILUREINFO_badAlg 0
|
||||
# define OSSL_CMP_PKIFAILUREINFO_badMessageCheck 1
|
||||
# define OSSL_CMP_PKIFAILUREINFO_badRequest 2
|
||||
# define OSSL_CMP_PKIFAILUREINFO_badTime 3
|
||||
# define OSSL_CMP_PKIFAILUREINFO_badCertId 4
|
||||
# define OSSL_CMP_PKIFAILUREINFO_badDataFormat 5
|
||||
# define OSSL_CMP_PKIFAILUREINFO_wrongAuthority 6
|
||||
# define OSSL_CMP_PKIFAILUREINFO_incorrectData 7
|
||||
# define OSSL_CMP_PKIFAILUREINFO_missingTimeStamp 8
|
||||
# define OSSL_CMP_PKIFAILUREINFO_badPOP 9
|
||||
# define OSSL_CMP_PKIFAILUREINFO_certRevoked 10
|
||||
# define OSSL_CMP_PKIFAILUREINFO_certConfirmed 11
|
||||
# define OSSL_CMP_PKIFAILUREINFO_wrongIntegrity 12
|
||||
# define OSSL_CMP_PKIFAILUREINFO_badRecipientNonce 13
|
||||
# define OSSL_CMP_PKIFAILUREINFO_timeNotAvailable 14
|
||||
# define OSSL_CMP_PKIFAILUREINFO_unacceptedPolicy 15
|
||||
# define OSSL_CMP_PKIFAILUREINFO_unacceptedExtension 16
|
||||
# define OSSL_CMP_PKIFAILUREINFO_addInfoNotAvailable 17
|
||||
# define OSSL_CMP_PKIFAILUREINFO_badSenderNonce 18
|
||||
# define OSSL_CMP_PKIFAILUREINFO_badCertTemplate 19
|
||||
# define OSSL_CMP_PKIFAILUREINFO_signerNotTrusted 20
|
||||
# define OSSL_CMP_PKIFAILUREINFO_transactionIdInUse 21
|
||||
# define OSSL_CMP_PKIFAILUREINFO_unsupportedVersion 22
|
||||
# define OSSL_CMP_PKIFAILUREINFO_notAuthorized 23
|
||||
# define OSSL_CMP_PKIFAILUREINFO_systemUnavail 24
|
||||
# define OSSL_CMP_PKIFAILUREINFO_systemFailure 25
|
||||
# define OSSL_CMP_PKIFAILUREINFO_duplicateCertReq 26
|
||||
# define OSSL_CMP_PKIFAILUREINFO_MAX 26
|
||||
# define OSSL_CMP_PKIFAILUREINFO_MAX_BIT_PATTERN \
|
||||
( (1<<(OSSL_CMP_PKIFAILUREINFO_MAX+1)) - 1)
|
||||
# if OSSL_CMP_PKIFAILUREINFO_MAX_BIT_PATTERN > INT_MAX
|
||||
# error CMP_PKIFAILUREINFO_MAX bit pattern does not fit in type int
|
||||
# endif
|
||||
|
||||
typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO;
|
||||
|
||||
# define OSSL_CMP_CTX_FAILINFO_badAlg (1 << 0)
|
||||
# define OSSL_CMP_CTX_FAILINFO_badMessageCheck (1 << 1)
|
||||
# define OSSL_CMP_CTX_FAILINFO_badRequest (1 << 2)
|
||||
# define OSSL_CMP_CTX_FAILINFO_badTime (1 << 3)
|
||||
# define OSSL_CMP_CTX_FAILINFO_badCertId (1 << 4)
|
||||
# define OSSL_CMP_CTX_FAILINFO_badDataFormat (1 << 5)
|
||||
# define OSSL_CMP_CTX_FAILINFO_wrongAuthority (1 << 6)
|
||||
# define OSSL_CMP_CTX_FAILINFO_incorrectData (1 << 7)
|
||||
# define OSSL_CMP_CTX_FAILINFO_missingTimeStamp (1 << 8)
|
||||
# define OSSL_CMP_CTX_FAILINFO_badPOP (1 << 9)
|
||||
# define OSSL_CMP_CTX_FAILINFO_certRevoked (1 << 10)
|
||||
# define OSSL_CMP_CTX_FAILINFO_certConfirmed (1 << 11)
|
||||
# define OSSL_CMP_CTX_FAILINFO_wrongIntegrity (1 << 12)
|
||||
# define OSSL_CMP_CTX_FAILINFO_badRecipientNonce (1 << 13)
|
||||
# define OSSL_CMP_CTX_FAILINFO_timeNotAvailable (1 << 14)
|
||||
# define OSSL_CMP_CTX_FAILINFO_unacceptedPolicy (1 << 15)
|
||||
# define OSSL_CMP_CTX_FAILINFO_unacceptedExtension (1 << 16)
|
||||
# define OSSL_CMP_CTX_FAILINFO_addInfoNotAvailable (1 << 17)
|
||||
# define OSSL_CMP_CTX_FAILINFO_badSenderNonce (1 << 18)
|
||||
# define OSSL_CMP_CTX_FAILINFO_badCertTemplate (1 << 19)
|
||||
# define OSSL_CMP_CTX_FAILINFO_signerNotTrusted (1 << 20)
|
||||
# define OSSL_CMP_CTX_FAILINFO_transactionIdInUse (1 << 21)
|
||||
# define OSSL_CMP_CTX_FAILINFO_unsupportedVersion (1 << 22)
|
||||
# define OSSL_CMP_CTX_FAILINFO_notAuthorized (1 << 23)
|
||||
# define OSSL_CMP_CTX_FAILINFO_systemUnavail (1 << 24)
|
||||
# define OSSL_CMP_CTX_FAILINFO_systemFailure (1 << 25)
|
||||
# define OSSL_CMP_CTX_FAILINFO_duplicateCertReq (1 << 26)
|
||||
|
||||
/*-
|
||||
* PKIStatus ::= INTEGER {
|
||||
* accepted (0),
|
||||
* -- you got exactly what you asked for
|
||||
* grantedWithMods (1),
|
||||
* -- you got something like what you asked for; the
|
||||
* -- requester is responsible for ascertaining the differences
|
||||
* rejection (2),
|
||||
* -- you don't get it, more information elsewhere in the message
|
||||
* waiting (3),
|
||||
* -- the request body part has not yet been processed; expect to
|
||||
* -- hear more later (note: proper handling of this status
|
||||
* -- response MAY use the polling req/rep PKIMessages specified
|
||||
* -- in Section 5.3.22; alternatively, polling in the underlying
|
||||
* -- transport layer MAY have some utility in this regard)
|
||||
* revocationWarning (4),
|
||||
* -- this message contains a warning that a revocation is
|
||||
* -- imminent
|
||||
* revocationNotification (5),
|
||||
* -- notification that a revocation has occurred
|
||||
* keyUpdateWarning (6)
|
||||
* -- update already done for the oldCertId specified in
|
||||
* -- CertReqMsg
|
||||
* }
|
||||
*/
|
||||
# define OSSL_CMP_PKISTATUS_accepted 0
|
||||
# define OSSL_CMP_PKISTATUS_grantedWithMods 1
|
||||
# define OSSL_CMP_PKISTATUS_rejection 2
|
||||
# define OSSL_CMP_PKISTATUS_waiting 3
|
||||
# define OSSL_CMP_PKISTATUS_revocationWarning 4
|
||||
# define OSSL_CMP_PKISTATUS_revocationNotification 5
|
||||
# define OSSL_CMP_PKISTATUS_keyUpdateWarning 6
|
||||
|
||||
typedef ASN1_INTEGER OSSL_CMP_PKISTATUS;
|
||||
DECLARE_ASN1_ITEM(OSSL_CMP_PKISTATUS)
|
||||
|
||||
# define OSSL_CMP_CERTORENCCERT_CERTIFICATE 0
|
||||
# define OSSL_CMP_CERTORENCCERT_ENCRYPTEDCERT 1
|
||||
|
||||
/* data type declarations */
|
||||
typedef struct OSSL_cmp_ctx_st OSSL_CMP_CTX;
|
||||
typedef struct OSSL_cmp_pkiheader_st OSSL_CMP_PKIHEADER;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CMP_PKIHEADER)
|
||||
typedef struct OSSL_cmp_msg_st 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)
|
||||
typedef struct OSSL_cmp_itav_st OSSL_CMP_ITAV;
|
||||
DEFINE_STACK_OF(OSSL_CMP_ITAV)
|
||||
typedef struct OSSL_cmp_revrepcontent_st OSSL_CMP_REVREPCONTENT;
|
||||
typedef struct OSSL_cmp_pkisi_st OSSL_CMP_PKISI;
|
||||
DEFINE_STACK_OF(OSSL_CMP_PKISI)
|
||||
typedef struct OSSL_cmp_certrepmessage_st OSSL_CMP_CERTREPMESSAGE;
|
||||
DEFINE_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)
|
||||
typedef STACK_OF(ASN1_UTF8STRING) OSSL_CMP_PKIFREETEXT;
|
||||
|
||||
/* from cmp_asn.c */
|
||||
OSSL_CMP_ITAV *OSSL_CMP_ITAV_create(ASN1_OBJECT *type, ASN1_TYPE *value);
|
||||
void OSSL_CMP_ITAV_set0(OSSL_CMP_ITAV *itav, ASN1_OBJECT *type,
|
||||
ASN1_TYPE *value);
|
||||
ASN1_OBJECT *OSSL_CMP_ITAV_get0_type(const OSSL_CMP_ITAV *itav);
|
||||
ASN1_TYPE *OSSL_CMP_ITAV_get0_value(const OSSL_CMP_ITAV *itav);
|
||||
int OSSL_CMP_ITAV_push0_stack_item(STACK_OF(OSSL_CMP_ITAV) **itav_sk_p,
|
||||
OSSL_CMP_ITAV *itav);
|
||||
void OSSL_CMP_ITAV_free(OSSL_CMP_ITAV *itav);
|
||||
void OSSL_CMP_MSG_free(OSSL_CMP_MSG *msg);
|
||||
void OSSL_CMP_PKISI_free(OSSL_CMP_PKISI *si);
|
||||
DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_MSG)
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif /* !defined OPENSSL_NO_CMP */
|
||||
#endif /* !defined OSSL_HEADER_CMP_H */
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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_CMPERR_H
|
||||
# define HEADER_CMPERR_H
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_CMP
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_CMP_strings(void);
|
||||
|
||||
/*
|
||||
* CMP function codes.
|
||||
*/
|
||||
|
||||
/*
|
||||
* CMP reason codes.
|
||||
*/
|
||||
|
||||
# endif
|
||||
#endif
|
||||
@@ -107,6 +107,7 @@ int ERR_load_CMS_strings(void);
|
||||
# define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 153
|
||||
# define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 154
|
||||
# define CMS_F_CMS_SIGN_RECEIPT 163
|
||||
# define CMS_F_CMS_SI_CHECK_ATTRIBUTES 183
|
||||
# define CMS_F_CMS_STREAM 155
|
||||
# define CMS_F_CMS_UNCOMPRESS 156
|
||||
# define CMS_F_CMS_VERIFY 157
|
||||
@@ -116,6 +117,7 @@ int ERR_load_CMS_strings(void);
|
||||
* CMS reason codes.
|
||||
*/
|
||||
# define CMS_R_ADD_SIGNER_ERROR 99
|
||||
# define CMS_R_ATTRIBUTE_ERROR 161
|
||||
# define CMS_R_CERTIFICATE_ALREADY_PRESENT 175
|
||||
# define CMS_R_CERTIFICATE_HAS_NO_KEYID 160
|
||||
# define CMS_R_CERTIFICATE_VERIFY_ERROR 100
|
||||
|
||||
+14
-1
@@ -77,7 +77,7 @@ struct ossl_param_st {
|
||||
unsigned int data_type; /* declare what kind of content is in buffer */
|
||||
void *data; /* value being passed in or out */
|
||||
size_t data_size; /* data size */
|
||||
size_t *return_size; /* OPTIONAL: address to content size */
|
||||
size_t return_size; /* returned content size */
|
||||
};
|
||||
|
||||
/* Currently supported OSSL_PARAM data types */
|
||||
@@ -143,6 +143,19 @@ struct ossl_param_st {
|
||||
*/
|
||||
# define OSSL_PARAM_OCTET_PTR 7
|
||||
|
||||
/*
|
||||
* Typedef for the thread stop handling callback. Used both internally and by
|
||||
* providers.
|
||||
*
|
||||
* Providers may register for notifications about threads stopping by
|
||||
* registering a callback to hear about such events. Providers register the
|
||||
* callback using the OSSL_FUNC_CORE_THREAD_START function in the |in| dispatch
|
||||
* table passed to OSSL_provider_init(). The arg passed back to a provider will
|
||||
* be the provider side context object.
|
||||
*/
|
||||
typedef void (*OSSL_thread_stop_handler_fn)(void *arg);
|
||||
|
||||
|
||||
/*-
|
||||
* Provider entry point
|
||||
* --------------------
|
||||
|
||||
@@ -39,6 +39,18 @@ extern "C" {
|
||||
|
||||
#define OSSL_CIPHER_PARAM_PADDING "padding"
|
||||
#define OSSL_CIPHER_PARAM_MODE "mode"
|
||||
#define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize" /* OSSL_PARAM_INTEGER */
|
||||
#define OSSL_CIPHER_PARAM_FLAGS "flags" /* OSSL_PARAM_UNSIGNED_INTEGER */
|
||||
#define OSSL_CIPHER_PARAM_KEYLEN "keylen" /* OSSL_PARAM_INTEGER */
|
||||
#define OSSL_CIPHER_PARAM_IVLEN "ivlen" /* OSSL_PARAM_INTEGER */
|
||||
#define OSSL_CIPHER_PARAM_IV "iv" /* OSSL_PARAM_OCTET_PTR */
|
||||
#define OSSL_CIPHER_PARAM_NUM "num" /* OSSL_PARAM_INTEGER */
|
||||
|
||||
/* digest parameters */
|
||||
#define OSSL_DIGEST_PARAM_XOFLEN "xoflen"
|
||||
#define OSSL_DIGEST_PARAM_SSL3_MS "ssl3-ms"
|
||||
#define OSSL_DIGEST_PARAM_PAD_TYPE "pad_type"
|
||||
#define OSSL_DIGEST_PARAM_MICALG "micalg"
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -35,7 +35,12 @@ extern "C" {
|
||||
* - a function pointer extractor function with the name OSSL_'foo'
|
||||
*/
|
||||
|
||||
/* Helper macro to create the function signature typedef and the extractor */
|
||||
/*
|
||||
* Helper macro to create the function signature typedef and the extractor
|
||||
* |type| is the return-type of the function, |name| is the name of the
|
||||
* function to fetch, and |args| is a parenthesized list of parameters
|
||||
* for the function (that is, it is |name|'s function signature).
|
||||
*/
|
||||
#define OSSL_CORE_MAKE_FUNC(type,name,args) \
|
||||
typedef type (OSSL_##name##_fn)args; \
|
||||
static ossl_inline \
|
||||
@@ -57,14 +62,72 @@ OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,
|
||||
core_get_param_types,(const OSSL_PROVIDER *prov))
|
||||
# define OSSL_FUNC_CORE_GET_PARAMS 2
|
||||
OSSL_CORE_MAKE_FUNC(int,core_get_params,(const OSSL_PROVIDER *prov,
|
||||
const OSSL_PARAM params[]))
|
||||
# define OSSL_FUNC_CORE_PUT_ERROR 3
|
||||
OSSL_CORE_MAKE_FUNC(void,core_put_error,(int lib, int func, int reason,
|
||||
const char *file, int line))
|
||||
# define OSSL_FUNC_CORE_ADD_ERROR_VDATA 4
|
||||
OSSL_CORE_MAKE_FUNC(void,core_add_error_vdata,(int num, va_list args))
|
||||
OSSL_PARAM params[]))
|
||||
# define OSSL_FUNC_CORE_THREAD_START 3
|
||||
OSSL_CORE_MAKE_FUNC(int,core_thread_start,(const OSSL_PROVIDER *prov,
|
||||
OSSL_thread_stop_handler_fn handfn))
|
||||
# define OSSL_FUNC_CORE_PUT_ERROR 4
|
||||
OSSL_CORE_MAKE_FUNC(void,core_put_error,
|
||||
(const OSSL_PROVIDER *prov,
|
||||
uint32_t reason, const char *file, int line))
|
||||
# define OSSL_FUNC_CORE_ADD_ERROR_VDATA 5
|
||||
OSSL_CORE_MAKE_FUNC(void,core_add_error_vdata,(const OSSL_PROVIDER *prov,
|
||||
int num, va_list args))
|
||||
# define OSSL_FUNC_CORE_GET_LIBRARY_CONTEXT 6
|
||||
OSSL_CORE_MAKE_FUNC(OPENSSL_CTX *,core_get_library_context,
|
||||
(const OSSL_PROVIDER *prov))
|
||||
|
||||
|
||||
/* Memory allocation, freeing, clearing. */
|
||||
#define OSSL_FUNC_CRYPTO_MALLOC 10
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_malloc, (size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_ZALLOC 11
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_zalloc, (size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_MEMDUP 12
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_memdup, (const void *str, size_t siz, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_STRDUP 13
|
||||
OSSL_CORE_MAKE_FUNC(char *,
|
||||
CRYPTO_strdup, (const char *str, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_STRNDUP 14
|
||||
OSSL_CORE_MAKE_FUNC(char *,
|
||||
CRYPTO_strndup, (const char *str, size_t s, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_FREE 15
|
||||
OSSL_CORE_MAKE_FUNC(void,
|
||||
CRYPTO_free, (void *ptr, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_CLEAR_FREE 16
|
||||
OSSL_CORE_MAKE_FUNC(void,
|
||||
CRYPTO_clear_free, (void *ptr, size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_REALLOC 17
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_realloc, (void *addr, size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_CLEAR_REALLOC 18
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_clear_realloc, (void *addr, size_t old_num, size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_SECURE_MALLOC 19
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_secure_malloc, (size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_SECURE_ZALLOC 20
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_secure_zalloc, (size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_SECURE_FREE 21
|
||||
OSSL_CORE_MAKE_FUNC(void,
|
||||
CRYPTO_secure_free, (void *ptr, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_SECURE_CLEAR_FREE 22
|
||||
OSSL_CORE_MAKE_FUNC(void,
|
||||
CRYPTO_secure_clear_free, (void *ptr, size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_SECURE_ALLOCATED 23
|
||||
OSSL_CORE_MAKE_FUNC(int,
|
||||
CRYPTO_secure_allocated, (const void *ptr))
|
||||
#define OSSL_FUNC_OPENSSL_CLEANSE 24
|
||||
OSSL_CORE_MAKE_FUNC(void,
|
||||
OPENSSL_cleanse, (void *ptr, size_t len))
|
||||
# define OSSL_FUNC_OPENSSL_HEXSTR2BUF 25
|
||||
OSSL_CORE_MAKE_FUNC(unsigned char *,
|
||||
OPENSSL_hexstr2buf, (const char *str, long *len))
|
||||
|
||||
/* Functions provided by the provider to the Core, reserved numbers 1024-1535 */
|
||||
# define OSSL_FUNC_PROVIDER_TEARDOWN 1024
|
||||
OSSL_CORE_MAKE_FUNC(void,provider_teardown,(void *provctx))
|
||||
@@ -73,10 +136,13 @@ OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,
|
||||
provider_get_param_types,(void *provctx))
|
||||
# define OSSL_FUNC_PROVIDER_GET_PARAMS 1026
|
||||
OSSL_CORE_MAKE_FUNC(int,provider_get_params,(void *provctx,
|
||||
const OSSL_PARAM params[]))
|
||||
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))
|
||||
# define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1028
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,provider_get_reason_strings,
|
||||
(void *provctx))
|
||||
|
||||
/* Digests */
|
||||
|
||||
@@ -91,7 +157,8 @@ OSSL_CORE_MAKE_FUNC(const OSSL_ALGORITHM *,provider_query_operation,
|
||||
# define OSSL_FUNC_DIGEST_DUPCTX 7
|
||||
# define OSSL_FUNC_DIGEST_SIZE 8
|
||||
# define OSSL_FUNC_DIGEST_BLOCK_SIZE 9
|
||||
|
||||
# define OSSL_FUNC_DIGEST_SET_PARAMS 10
|
||||
# define OSSL_FUNC_DIGEST_GET_PARAMS 11
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *, OP_digest_newctx, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, OP_digest_init, (void *dctx))
|
||||
@@ -107,9 +174,13 @@ OSSL_CORE_MAKE_FUNC(int, OP_digest_digest,
|
||||
OSSL_CORE_MAKE_FUNC(void, OP_digest_cleanctx, (void *dctx))
|
||||
OSSL_CORE_MAKE_FUNC(void, OP_digest_freectx, (void *dctx))
|
||||
OSSL_CORE_MAKE_FUNC(void *, OP_digest_dupctx, (void *dctx))
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(size_t, OP_digest_size, (void))
|
||||
OSSL_CORE_MAKE_FUNC(size_t, OP_digest_block_size, (void))
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(int, OP_digest_set_params,
|
||||
(void *vctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, OP_digest_get_params,
|
||||
(void *vctx, OSSL_PARAM params[]))
|
||||
|
||||
/* Symmetric Ciphers */
|
||||
|
||||
@@ -123,12 +194,9 @@ OSSL_CORE_MAKE_FUNC(size_t, OP_digest_block_size, (void))
|
||||
# define OSSL_FUNC_CIPHER_CIPHER 6
|
||||
# define OSSL_FUNC_CIPHER_FREECTX 7
|
||||
# define OSSL_FUNC_CIPHER_DUPCTX 8
|
||||
# define OSSL_FUNC_CIPHER_KEY_LENGTH 9
|
||||
# define OSSL_FUNC_CIPHER_IV_LENGTH 10
|
||||
# define OSSL_FUNC_CIPHER_BLOCK_SIZE 11
|
||||
# define OSSL_FUNC_CIPHER_GET_PARAMS 12
|
||||
# define OSSL_FUNC_CIPHER_CTX_GET_PARAMS 13
|
||||
# define OSSL_FUNC_CIPHER_CTX_SET_PARAMS 14
|
||||
# define OSSL_FUNC_CIPHER_GET_PARAMS 9
|
||||
# define OSSL_FUNC_CIPHER_CTX_GET_PARAMS 10
|
||||
# define OSSL_FUNC_CIPHER_CTX_SET_PARAMS 11
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *, OP_cipher_newctx, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, OP_cipher_encrypt_init, (void *cctx,
|
||||
@@ -154,16 +222,12 @@ OSSL_CORE_MAKE_FUNC(int, OP_cipher_cipher,
|
||||
const unsigned char *in, size_t inl))
|
||||
OSSL_CORE_MAKE_FUNC(void, OP_cipher_freectx, (void *cctx))
|
||||
OSSL_CORE_MAKE_FUNC(void *, OP_cipher_dupctx, (void *cctx))
|
||||
OSSL_CORE_MAKE_FUNC(size_t, OP_cipher_key_length, (void))
|
||||
OSSL_CORE_MAKE_FUNC(size_t, OP_cipher_iv_length, (void))
|
||||
OSSL_CORE_MAKE_FUNC(size_t, OP_cipher_block_size, (void))
|
||||
OSSL_CORE_MAKE_FUNC(int, OP_cipher_get_params, (const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, OP_cipher_get_params, (OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, OP_cipher_ctx_get_params, (void *cctx,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, OP_cipher_ctx_set_params, (void *cctx,
|
||||
const OSSL_PARAM params[]))
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*-
|
||||
* Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Nokia 2007-2018
|
||||
* Copyright Siemens AG 2015-2018
|
||||
* Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Nokia 2007-2019
|
||||
* Copyright Siemens AG 2015-2019
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -415,6 +415,7 @@ void OPENSSL_cleanup(void);
|
||||
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
|
||||
int OPENSSL_atexit(void (*handler)(void));
|
||||
void OPENSSL_thread_stop(void);
|
||||
void OPENSSL_thread_stop_ex(OPENSSL_CTX *ctx);
|
||||
|
||||
/* Low-level control of initialization */
|
||||
OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void);
|
||||
|
||||
@@ -63,9 +63,6 @@ typedef struct DES_ks {
|
||||
# define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
|
||||
DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
|
||||
|
||||
OPENSSL_DECLARE_GLOBAL(int, DES_check_key); /* defaults to false */
|
||||
# define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key)
|
||||
|
||||
const char *DES_options(void);
|
||||
void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
|
||||
DES_key_schedule *ks1, DES_key_schedule *ks2,
|
||||
@@ -148,8 +145,7 @@ int DES_check_key_parity(const_DES_cblock *key);
|
||||
int DES_is_weak_key(const_DES_cblock *key);
|
||||
/*
|
||||
* DES_set_key (= set_key = DES_key_sched = key_sched) calls
|
||||
* DES_set_key_checked if global variable DES_check_key is set,
|
||||
* DES_set_key_unchecked otherwise.
|
||||
* DES_set_key_checked
|
||||
*/
|
||||
int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
|
||||
int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule);
|
||||
|
||||
@@ -29,6 +29,7 @@ int ERR_load_DH_strings(void);
|
||||
*/
|
||||
# define DH_F_COMPUTE_KEY 102
|
||||
# define DH_F_DHPARAMS_PRINT_FP 101
|
||||
# define DH_F_DH_BUF2KEY 126
|
||||
# define DH_F_DH_BUILTIN_GENPARAMS 106
|
||||
# define DH_F_DH_CHECK_EX 121
|
||||
# define DH_F_DH_CHECK_PARAMS_EX 122
|
||||
@@ -36,6 +37,7 @@ int ERR_load_DH_strings(void);
|
||||
# define DH_F_DH_CMS_DECRYPT 114
|
||||
# define DH_F_DH_CMS_SET_PEERKEY 115
|
||||
# define DH_F_DH_CMS_SET_SHARED_INFO 116
|
||||
# define DH_F_DH_KEY2BUF 127
|
||||
# define DH_F_DH_METH_DUP 117
|
||||
# define DH_F_DH_METH_NEW 118
|
||||
# define DH_F_DH_METH_SET1_NAME 119
|
||||
|
||||
+6
-32
@@ -136,15 +136,6 @@ extern "C" {
|
||||
* That's it for OS-specific stuff
|
||||
*****************************************************************************/
|
||||
|
||||
/* Specials for I/O an exit */
|
||||
# ifdef OPENSSL_SYS_MSDOS
|
||||
# define OPENSSL_UNISTD_IO <io.h>
|
||||
# define OPENSSL_DECLARE_EXIT extern void exit(int);
|
||||
# else
|
||||
# define OPENSSL_UNISTD_IO OPENSSL_UNISTD
|
||||
# define OPENSSL_DECLARE_EXIT /* declared in unistd.h */
|
||||
# endif
|
||||
|
||||
/*-
|
||||
* OPENSSL_EXTERN is normally used to declare a symbol with possible extra
|
||||
* attributes to handle its presence in a shared library.
|
||||
@@ -172,29 +163,6 @@ extern "C" {
|
||||
# define OPENSSL_EXTERN extern
|
||||
# endif
|
||||
|
||||
/*-
|
||||
* Macros to allow global variables to be reached through function calls when
|
||||
* required (if a shared library version requires it, for example.
|
||||
* The way it's done allows definitions like this:
|
||||
*
|
||||
* // in foobar.c
|
||||
* OPENSSL_IMPLEMENT_GLOBAL(int,foobar,0)
|
||||
* // in foobar.h
|
||||
* OPENSSL_DECLARE_GLOBAL(int,foobar);
|
||||
* #define foobar OPENSSL_GLOBAL_REF(foobar)
|
||||
*/
|
||||
# ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) \
|
||||
type *_shadow_##name(void) \
|
||||
{ static type _hide_##name=value; return &_hide_##name; }
|
||||
# define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)
|
||||
# define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
|
||||
# else
|
||||
# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) type _shadow_##name=value;
|
||||
# define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name
|
||||
# define OPENSSL_GLOBAL_REF(name) _shadow_##name
|
||||
# endif
|
||||
|
||||
# ifdef _WIN32
|
||||
# ifdef _WIN64
|
||||
# define ossl_ssize_t __int64
|
||||
@@ -228,6 +196,8 @@ extern "C" {
|
||||
# endif
|
||||
|
||||
/* Standard integer types */
|
||||
# define OPENSSL_NO_INTTYPES_H
|
||||
# define OPENSSL_NO_STDINT_H
|
||||
# if defined(OPENSSL_SYS_UEFI)
|
||||
typedef INT8 int8_t;
|
||||
typedef UINT8 uint8_t;
|
||||
@@ -241,6 +211,9 @@ typedef UINT64 uint64_t;
|
||||
defined(__osf__) || defined(__sgi) || defined(__hpux) || \
|
||||
defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__)
|
||||
# include <inttypes.h>
|
||||
# undef OPENSSL_NO_INTTYPES_H
|
||||
/* Because the specs say that inttypes.h includes stdint.h if present */
|
||||
# undef OPENSSL_NO_STDINT_H
|
||||
# elif defined(_MSC_VER) && _MSC_VER<=1500
|
||||
/*
|
||||
* minimally required typdefs for systems not supporting inttypes.h or
|
||||
@@ -256,6 +229,7 @@ typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
# else
|
||||
# include <stdint.h>
|
||||
# undef OPENSSL_NO_STDINT_H
|
||||
# endif
|
||||
|
||||
/* ossl_inline: portable inline definition usable in public headers */
|
||||
|
||||
@@ -142,7 +142,7 @@ const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
|
||||
*/
|
||||
int EC_METHOD_get_field_type(const EC_METHOD *meth);
|
||||
|
||||
/** Sets the generator and it's order/cofactor of a EC_GROUP object.
|
||||
/** Sets the generator and its order/cofactor of a EC_GROUP object.
|
||||
* \param group EC_GROUP object
|
||||
* \param generator EC_POINT object with the generator.
|
||||
* \param order the order of the group generated by the generator.
|
||||
|
||||
@@ -99,6 +99,7 @@ typedef struct err_state_st {
|
||||
# define ERR_LIB_PROP 55
|
||||
# define ERR_LIB_CRMF 56
|
||||
# define ERR_LIB_PROV 57
|
||||
# define ERR_LIB_CMP 58
|
||||
|
||||
# define ERR_LIB_USER 128
|
||||
|
||||
@@ -133,6 +134,7 @@ typedef struct err_state_st {
|
||||
# define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define CRMFerr(f,r) ERR_PUT_error(ERR_LIB_CRMF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define CMPerr(f,r) ERR_PUT_error(ERR_LIB_CMP,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/evperr.h>
|
||||
# include <openssl/params.h>
|
||||
|
||||
# define EVP_MAX_MD_SIZE 64/* longest known is SHA512 */
|
||||
# define EVP_MAX_KEY_LENGTH 64
|
||||
@@ -79,7 +80,7 @@ int EVP_set_default_properties(OPENSSL_CTX *libctx, const char *propq);
|
||||
# ifndef EVP_MD
|
||||
EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type);
|
||||
EVP_MD *EVP_MD_meth_dup(const EVP_MD *md);
|
||||
int EVP_MD_upref(EVP_MD *md);
|
||||
int EVP_MD_up_ref(EVP_MD *md);
|
||||
void EVP_MD_meth_free(EVP_MD *md);
|
||||
|
||||
int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize);
|
||||
@@ -190,7 +191,7 @@ int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd,
|
||||
EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len);
|
||||
EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher);
|
||||
void EVP_CIPHER_meth_free(EVP_CIPHER *cipher);
|
||||
int EVP_CIPHER_upref(EVP_CIPHER *cipher);
|
||||
int EVP_CIPHER_up_ref(EVP_CIPHER *cipher);
|
||||
|
||||
int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len);
|
||||
int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags);
|
||||
@@ -489,7 +490,7 @@ const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx);
|
||||
unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx);
|
||||
unsigned char *EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx);
|
||||
int EVP_CIPHER_CTX_num(const EVP_CIPHER_CTX *ctx);
|
||||
void EVP_CIPHER_CTX_set_num(EVP_CIPHER_CTX *ctx, int num);
|
||||
int EVP_CIPHER_CTX_set_num(EVP_CIPHER_CTX *ctx, int num);
|
||||
int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
|
||||
void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx);
|
||||
void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data);
|
||||
@@ -539,6 +540,8 @@ void BIO_set_md(BIO *, const EVP_MD *md);
|
||||
# define EVP_delete_digest_alias(alias) \
|
||||
OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS);
|
||||
|
||||
int EVP_MD_CTX_set_params(EVP_MD_CTX *ctx, const OSSL_PARAM params[]);
|
||||
int EVP_MD_CTX_get_params(EVP_MD_CTX *ctx, OSSL_PARAM params[]);
|
||||
int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
|
||||
EVP_MD_CTX *EVP_MD_CTX_new(void);
|
||||
int EVP_MD_CTX_reset(EVP_MD_CTX *ctx);
|
||||
@@ -1012,7 +1015,7 @@ void EVP_MD_do_all_sorted(void (*fn)
|
||||
EVP_MAC_CTX *EVP_MAC_CTX_new(const EVP_MAC *mac);
|
||||
EVP_MAC_CTX *EVP_MAC_CTX_new_id(int nid);
|
||||
void EVP_MAC_CTX_free(EVP_MAC_CTX *ctx);
|
||||
int EVP_MAC_CTX_copy(EVP_MAC_CTX *dest, const EVP_MAC_CTX *src);
|
||||
EVP_MAC_CTX *EVP_MAC_CTX_dup(const EVP_MAC_CTX *src);
|
||||
const EVP_MAC *EVP_MAC_CTX_mac(EVP_MAC_CTX *ctx);
|
||||
size_t EVP_MAC_size(EVP_MAC_CTX *ctx);
|
||||
int EVP_MAC_init(EVP_MAC_CTX *ctx);
|
||||
|
||||
@@ -74,7 +74,7 @@ int ERR_load_EVP_strings(void);
|
||||
# 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
|
||||
# define EVP_F_EVP_MAC_CTX_DUP 211
|
||||
# define EVP_F_EVP_MAC_CTX_NEW 213
|
||||
# define EVP_F_EVP_MAC_INIT 212
|
||||
# define EVP_F_EVP_MD_BLOCK_SIZE 232
|
||||
@@ -145,11 +145,13 @@ int ERR_load_EVP_strings(void);
|
||||
# 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_COPY 241
|
||||
# define EVP_F_PKEY_MAC_INIT 214
|
||||
# define EVP_F_PKEY_SET_TYPE 158
|
||||
# define EVP_F_POLY1305_CTRL 216
|
||||
# define EVP_F_RC2_MAGIC_TO_METH 109
|
||||
# define EVP_F_RC5_CTRL 125
|
||||
# define EVP_F_R_32_12_16_INIT_KEY 242
|
||||
# define EVP_F_S390X_AES_GCM_CTRL 201
|
||||
# define EVP_F_S390X_AES_GCM_TLS_CIPHER 208
|
||||
# define EVP_F_SCRYPT_ALG 228
|
||||
@@ -161,6 +163,7 @@ int ERR_load_EVP_strings(void);
|
||||
# define EVP_R_AES_KEY_SETUP_FAILED 143
|
||||
# define EVP_R_ARIA_KEY_SETUP_FAILED 176
|
||||
# define EVP_R_BAD_DECRYPT 100
|
||||
# define EVP_R_BAD_KEY_LENGTH 195
|
||||
# define EVP_R_BUFFER_TOO_SMALL 155
|
||||
# define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157
|
||||
# define EVP_R_CIPHER_NOT_GCM_MODE 184
|
||||
|
||||
+31
-27
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2016-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
|
||||
@@ -25,6 +25,7 @@ extern "C" {
|
||||
# define EVP_KDF_SSHKDF NID_sshkdf
|
||||
# define EVP_KDF_SS NID_sskdf
|
||||
# define EVP_KDF_X963 NID_x963kdf
|
||||
# define EVP_KDF_X942 NID_x942kdf
|
||||
|
||||
EVP_KDF_CTX *EVP_KDF_CTX_new_id(int id);
|
||||
EVP_KDF_CTX *EVP_KDF_CTX_new(const EVP_KDF *kdf);
|
||||
@@ -44,39 +45,42 @@ int EVP_KDF_nid(const EVP_KDF *kdf);
|
||||
# define EVP_KDF_name(o) OBJ_nid2sn(EVP_KDF_nid(o))
|
||||
const EVP_KDF *EVP_get_kdfbyname(const char *name);
|
||||
|
||||
# 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_CTRL_SET_SSHKDF_XCGHASH 0x10 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_SSHKDF_SESSION_ID 0x11 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_SSHKDF_TYPE 0x12 /* int */
|
||||
# define EVP_KDF_CTRL_SET_MAC 0x13 /* EVP_MAC * */
|
||||
# define EVP_KDF_CTRL_SET_MAC_SIZE 0x14 /* size_t */
|
||||
# define EVP_KDF_CTRL_SET_SSKDF_INFO 0x15 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_SHARED_INFO EVP_KDF_CTRL_SET_SSKDF_INFO
|
||||
# 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_CTRL_SET_SSHKDF_XCGHASH 0x10 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_SSHKDF_SESSION_ID 0x11 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_SSHKDF_TYPE 0x12 /* int */
|
||||
# define EVP_KDF_CTRL_SET_MAC 0x13 /* EVP_MAC * */
|
||||
# define EVP_KDF_CTRL_SET_MAC_SIZE 0x14 /* size_t */
|
||||
# define EVP_KDF_CTRL_SET_SSKDF_INFO 0x15 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_PBKDF2_PKCS5_MODE 0x16 /* int */
|
||||
# define EVP_KDF_CTRL_SET_UKM 0x17 /* unsigned char *, size_t */
|
||||
# define EVP_KDF_CTRL_SET_CEK_ALG 0x18 /* char * */
|
||||
# define EVP_KDF_CTRL_SET_SHARED_INFO EVP_KDF_CTRL_SET_SSKDF_INFO
|
||||
|
||||
# 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
|
||||
|
||||
#define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV 65
|
||||
#define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_SRV_TO_CLI 66
|
||||
#define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV 65
|
||||
#define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_SRV_TO_CLI 66
|
||||
#define EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_CLI_TO_SRV 67
|
||||
#define EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_SRV_TO_CLI 68
|
||||
#define EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_CLI_TO_SRV 69
|
||||
#define EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_SRV_TO_CLI 70
|
||||
#define EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_CLI_TO_SRV 69
|
||||
#define EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_SRV_TO_CLI 70
|
||||
|
||||
/**** The legacy PKEY-based KDF API follows. ****/
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ int ERR_load_KDF_strings(void);
|
||||
# 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 140
|
||||
# define KDF_F_KDF_PBKDF2_CTRL_STR 117
|
||||
# define KDF_F_KDF_PBKDF2_DERIVE 118
|
||||
# define KDF_F_KDF_PBKDF2_NEW 119
|
||||
@@ -43,6 +44,7 @@ int ERR_load_KDF_strings(void);
|
||||
# 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_DERIVE 141
|
||||
# define KDF_F_PBKDF2_SET_MEMBUF 128
|
||||
# define KDF_F_PKEY_HKDF_CTRL_STR 103
|
||||
# define KDF_F_PKEY_HKDF_DERIVE 102
|
||||
@@ -62,13 +64,25 @@ int ERR_load_KDF_strings(void);
|
||||
# define KDF_F_SSKDF_NEW 137
|
||||
# define KDF_F_SSKDF_SIZE 138
|
||||
# define KDF_F_TLS1_PRF_ALG 111
|
||||
# define KDF_F_X942KDF_CTRL 142
|
||||
# define KDF_F_X942KDF_DERIVE 143
|
||||
# define KDF_F_X942KDF_HASH_KDM 144
|
||||
# define KDF_F_X942KDF_NEW 145
|
||||
# define KDF_F_X942KDF_SIZE 146
|
||||
# define KDF_F_X963KDF_DERIVE 139
|
||||
|
||||
/*
|
||||
* KDF reason codes.
|
||||
*/
|
||||
# define KDF_R_BAD_ENCODING 122
|
||||
# define KDF_R_BAD_LENGTH 123
|
||||
# define KDF_R_INAVLID_UKM_LEN 124
|
||||
# define KDF_R_INVALID_DIGEST 100
|
||||
# define KDF_R_INVALID_ITERATION_COUNT 119
|
||||
# define KDF_R_INVALID_KEY_LEN 120
|
||||
# define KDF_R_INVALID_MAC_TYPE 116
|
||||
# define KDF_R_INVALID_SALT_LEN 121
|
||||
# define KDF_R_MISSING_CEK_ALG 125
|
||||
# define KDF_R_MISSING_ITERATION_COUNT 109
|
||||
# define KDF_R_MISSING_KEY 104
|
||||
# define KDF_R_MISSING_MESSAGE_DIGEST 105
|
||||
@@ -82,6 +96,7 @@ int ERR_load_KDF_strings(void);
|
||||
# define KDF_R_MISSING_XCGHASH 115
|
||||
# define KDF_R_NOT_SUPPORTED 118
|
||||
# define KDF_R_UNKNOWN_PARAMETER_TYPE 103
|
||||
# define KDF_R_UNSUPPORTED_CEK_ALG 126
|
||||
# define KDF_R_UNSUPPORTED_MAC_TYPE 117
|
||||
# define KDF_R_VALUE_ERROR 108
|
||||
# define KDF_R_VALUE_MISSING 102
|
||||
|
||||
@@ -202,32 +202,6 @@ int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len);
|
||||
void CRYPTO_ocb128_cleanup(OCB128_CONTEXT *ctx);
|
||||
# endif /* OPENSSL_NO_OCB */
|
||||
|
||||
# ifndef OPENSSL_NO_SIV
|
||||
|
||||
typedef struct siv128_context SIV128_CONTEXT;
|
||||
|
||||
# define SIV_LEN 16
|
||||
|
||||
SIV128_CONTEXT *CRYPTO_siv128_new(const unsigned char *key, int klen, EVP_CIPHER* cbc, EVP_CIPHER* ctr);
|
||||
int CRYPTO_siv128_init(SIV128_CONTEXT *ctx, const unsigned char *key, int klen,
|
||||
const EVP_CIPHER* cbc, const EVP_CIPHER* ctr);
|
||||
int CRYPTO_siv128_copy_ctx(SIV128_CONTEXT *dest, SIV128_CONTEXT *src);
|
||||
int CRYPTO_siv128_aad(SIV128_CONTEXT *ctx, const unsigned char *aad,
|
||||
size_t len);
|
||||
int CRYPTO_siv128_encrypt(SIV128_CONTEXT *ctx,
|
||||
const unsigned char *in, unsigned char *out,
|
||||
size_t len);
|
||||
int CRYPTO_siv128_decrypt(SIV128_CONTEXT *ctx,
|
||||
const unsigned char *in, unsigned char *out,
|
||||
size_t len);
|
||||
int CRYPTO_siv128_finish(SIV128_CONTEXT *ctx);
|
||||
int CRYPTO_siv128_set_tag(SIV128_CONTEXT *ctx, const unsigned char *tag, size_t len);
|
||||
int CRYPTO_siv128_get_tag(SIV128_CONTEXT *ctx, unsigned char *tag, size_t len);
|
||||
int CRYPTO_siv128_cleanup(SIV128_CONTEXT *ctx);
|
||||
int CRYPTO_siv128_speed(SIV128_CONTEXT *ctx, int arg);
|
||||
|
||||
# endif /* OPENSSL_NO_SIV */
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
+27
-19
@@ -49,22 +49,6 @@
|
||||
#define NID_gmac 1195
|
||||
#define OBJ_gmac OBJ_iso,0L,9797L,3L,4L
|
||||
|
||||
#define SN_kmac128 "KMAC128"
|
||||
#define LN_kmac128 "kmac128"
|
||||
#define NID_kmac128 1196
|
||||
|
||||
#define SN_kmac256 "KMAC256"
|
||||
#define LN_kmac256 "kmac256"
|
||||
#define NID_kmac256 1197
|
||||
|
||||
#define SN_blake2bmac "BLAKE2BMAC"
|
||||
#define LN_blake2bmac "blake2bmac"
|
||||
#define NID_blake2bmac 1201
|
||||
|
||||
#define SN_blake2smac "BLAKE2SMAC"
|
||||
#define LN_blake2smac "blake2smac"
|
||||
#define NID_blake2smac 1202
|
||||
|
||||
#define SN_hmac_md5 "HMAC-MD5"
|
||||
#define LN_hmac_md5 "hmac-md5"
|
||||
#define NID_hmac_md5 780
|
||||
@@ -2139,15 +2123,25 @@
|
||||
#define NID_ripemd160WithRSA 119
|
||||
#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L
|
||||
|
||||
#define SN_blake2bmac "BLAKE2BMAC"
|
||||
#define LN_blake2bmac "blake2bmac"
|
||||
#define NID_blake2bmac 1201
|
||||
#define OBJ_blake2bmac 1L,3L,6L,1L,4L,1L,1722L,12L,2L,1L
|
||||
|
||||
#define SN_blake2smac "BLAKE2SMAC"
|
||||
#define LN_blake2smac "blake2smac"
|
||||
#define NID_blake2smac 1202
|
||||
#define OBJ_blake2smac 1L,3L,6L,1L,4L,1L,1722L,12L,2L,2L
|
||||
|
||||
#define SN_blake2b512 "BLAKE2b512"
|
||||
#define LN_blake2b512 "blake2b512"
|
||||
#define NID_blake2b512 1056
|
||||
#define OBJ_blake2b512 1L,3L,6L,1L,4L,1L,1722L,12L,2L,1L,16L
|
||||
#define OBJ_blake2b512 OBJ_blake2bmac,16L
|
||||
|
||||
#define SN_blake2s256 "BLAKE2s256"
|
||||
#define LN_blake2s256 "blake2s256"
|
||||
#define NID_blake2s256 1057
|
||||
#define OBJ_blake2s256 1L,3L,6L,1L,4L,1L,1722L,12L,2L,2L,8L
|
||||
#define OBJ_blake2s256 OBJ_blake2smac,8L
|
||||
|
||||
#define SN_sxnet "SXNetID"
|
||||
#define LN_sxnet "Strong Extranet ID"
|
||||
@@ -2997,6 +2991,16 @@
|
||||
#define NID_hmac_sha3_512 1105
|
||||
#define OBJ_hmac_sha3_512 OBJ_nist_hashalgs,16L
|
||||
|
||||
#define SN_kmac128 "KMAC128"
|
||||
#define LN_kmac128 "kmac128"
|
||||
#define NID_kmac128 1196
|
||||
#define OBJ_kmac128 OBJ_nist_hashalgs,19L
|
||||
|
||||
#define SN_kmac256 "KMAC256"
|
||||
#define LN_kmac256 "kmac256"
|
||||
#define NID_kmac256 1197
|
||||
#define OBJ_kmac256 OBJ_nist_hashalgs,20L
|
||||
|
||||
#define OBJ_dsa_with_sha2 OBJ_nistAlgorithms,3L
|
||||
|
||||
#define SN_dsa_with_SHA224 "dsa_with_SHA224"
|
||||
@@ -4835,7 +4839,7 @@
|
||||
|
||||
#define SN_chacha20_poly1305_draft "ChaCha20-Poly1305-D"
|
||||
#define LN_chacha20_poly1305_draft "chacha20-poly1305-draft"
|
||||
#define NID_chacha20_poly1305_draft 1207
|
||||
#define NID_chacha20_poly1305_draft 1208
|
||||
|
||||
#define SN_chacha20 "ChaCha20"
|
||||
#define LN_chacha20 "chacha20"
|
||||
@@ -5008,6 +5012,10 @@
|
||||
#define LN_sskdf "sskdf"
|
||||
#define NID_sskdf 1205
|
||||
|
||||
#define SN_x942kdf "X942KDF"
|
||||
#define LN_x942kdf "x942kdf"
|
||||
#define NID_x942kdf 1207
|
||||
|
||||
#define SN_x963kdf "X963KDF"
|
||||
#define LN_x963kdf "x963kdf"
|
||||
#define NID_x963kdf 1206
|
||||
|
||||
@@ -123,7 +123,7 @@ typedef struct ocsp_service_locator_st OCSP_SERVICELOC;
|
||||
(char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST, \
|
||||
bp,(char **)(x),cb,NULL)
|
||||
|
||||
# define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\
|
||||
# define PEM_read_bio_OCSP_RESPONSE(bp,x,cb) (OCSP_RESPONSE *)PEM_ASN1_read_bio(\
|
||||
(char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE, \
|
||||
bp,(char **)(x),cb,NULL)
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ extern "C" {
|
||||
|
||||
/* In case someone defined both */
|
||||
# if defined(OPENSSL_API_COMPAT) && defined(OPENSSL_API_LEVEL)
|
||||
# error "Disallowed to defined both OPENSSL_API_COMPAT and OPENSSL_API_LEVEL"
|
||||
# error "Disallowed to define both OPENSSL_API_COMPAT and OPENSSL_API_LEVEL"
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_API_COMPAT
|
||||
@@ -100,7 +100,7 @@ extern "C" {
|
||||
# elif (OPENSSL_API_COMPAT & 0xFFF00000L) == 0x10100000L
|
||||
# define OPENSSL_API_LEVEL 2
|
||||
# else
|
||||
/ * Major number 3 to 15 */
|
||||
/* Major number 3 to 15 */
|
||||
# define OPENSSL_API_LEVEL ((OPENSSL_API_COMPAT >> 28) & 0xF)
|
||||
# endif
|
||||
# endif
|
||||
@@ -165,11 +165,6 @@ extern "C" {
|
||||
/* Generate 80386 code? */
|
||||
{- $config{processor} eq "386" ? "# define" : "# undef" -} I386_ONLY
|
||||
|
||||
# undef OPENSSL_UNISTD
|
||||
# define OPENSSL_UNISTD {- $target{unistd} -}
|
||||
|
||||
{- $config{export_var_as_fn} ? "# define" : "# undef" -} OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
|
||||
/*
|
||||
* The following are cipher-specific, but are part of the public API.
|
||||
*/
|
||||
|
||||
@@ -78,7 +78,7 @@ extern "C" {
|
||||
|
||||
/* For checking general API compatibility when preprocessing */
|
||||
# define OPENSSL_VERSION_PREREQ(maj,min) \
|
||||
((OPENSSL_VERSION_MAJOR << 16) + OPENSSL_VERSION_MINOR >= (maj << 16) + min)
|
||||
((OPENSSL_VERSION_MAJOR << 16) + OPENSSL_VERSION_MINOR >= ((maj) << 16) + (min))
|
||||
|
||||
/* Helper macros for CPP string composition */
|
||||
# define OPENSSL_MSTR_HELPER(x) #x
|
||||
|
||||
+51
-102
@@ -19,124 +19,74 @@ extern "C" {
|
||||
# endif
|
||||
|
||||
# define OSSL_PARAM_END \
|
||||
{ NULL, 0, NULL, 0, NULL }
|
||||
{ NULL, 0, NULL, 0, 0 }
|
||||
|
||||
# define OSSL_PARAM_DEFN(key, type, addr, sz, rsz) \
|
||||
{ (key), (type), (addr), (sz), (rsz) }
|
||||
# define OSSL_PARAM_DEFN(key, type, addr, sz) \
|
||||
{ (key), (type), (addr), (sz), 0 }
|
||||
|
||||
/* Basic parameter types without return sizes */
|
||||
# define OSSL_PARAM_int(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int), NULL)
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int))
|
||||
# define OSSL_PARAM_uint(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(unsigned int), NULL)
|
||||
sizeof(unsigned int))
|
||||
# define OSSL_PARAM_long(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(long int), \
|
||||
NULL)
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(long int))
|
||||
# define OSSL_PARAM_ulong(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(unsigned long int), NULL)
|
||||
sizeof(unsigned long int))
|
||||
# define OSSL_PARAM_int32(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int32_t), NULL)
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int32_t))
|
||||
# define OSSL_PARAM_uint32(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(uint32_t), NULL)
|
||||
sizeof(uint32_t))
|
||||
# define OSSL_PARAM_int64(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int64_t), NULL)
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int64_t))
|
||||
# define OSSL_PARAM_uint64(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(uint64_t), NULL)
|
||||
sizeof(uint64_t))
|
||||
# define OSSL_PARAM_size_t(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), sizeof(size_t), \
|
||||
NULL)
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), sizeof(size_t))
|
||||
# define OSSL_PARAM_double(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_REAL, (addr), sizeof(double), NULL)
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_REAL, (addr), sizeof(double))
|
||||
|
||||
# define OSSL_PARAM_BN(key, bn, sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (bn), (sz))
|
||||
# define OSSL_PARAM_utf8_string(key, addr, sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz, NULL)
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz)
|
||||
# define OSSL_PARAM_octet_string(key, addr, sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_STRING, (addr), sz, NULL)
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_STRING, (addr), sz)
|
||||
|
||||
# define OSSL_PARAM_utf8_ptr(key, addr, sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_PTR, &(addr), sz, NULL)
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_PTR, &(addr), sz)
|
||||
# define OSSL_PARAM_octet_ptr(key, addr, sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_PTR, &(addr), sz, NULL)
|
||||
|
||||
/* Basic parameter types including return sizes */
|
||||
# define OSSL_PARAM_SIZED_int(key, addr, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int), &(r_sz))
|
||||
# define OSSL_PARAM_SIZED_uint(key, addr, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(unsigned int), &(r_sz))
|
||||
# define OSSL_PARAM_SIZED_long(key, addr, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(long int), \
|
||||
&(r_sz))
|
||||
# define OSSL_PARAM_SIZED_ulong(key, addr, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(unsigned long int), &(r_sz))
|
||||
# define OSSL_PARAM_SIZED_int32(key, addr, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int32_t), &(r_sz))
|
||||
# define OSSL_PARAM_SIZED_uint32(key, addr, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(uint32_t), &(r_sz))
|
||||
# define OSSL_PARAM_SIZED_int64(key, addr, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int64_t), &(r_sz))
|
||||
# define OSSL_PARAM_SIZED_uint64(key, addr, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(uint64_t), &(r_sz))
|
||||
# define OSSL_PARAM_SIZED_size_t(key, addr, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(size_t), &(r_sz))
|
||||
# define OSSL_PARAM_SIZED_double(key, addr, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_REAL, (addr), sizeof(double), &(r_sz))
|
||||
|
||||
# define OSSL_PARAM_SIZED_BN(key, addr, sz, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), sz, \
|
||||
&(r_sz))
|
||||
|
||||
# define OSSL_PARAM_SIZED_utf8_string(key, addr, sz, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz, &(r_sz))
|
||||
# define OSSL_PARAM_SIZED_octet_string(key, addr, sz, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_STRING, (addr), sz, &(r_sz))
|
||||
|
||||
# define OSSL_PARAM_SIZED_utf8_ptr(key, addr, sz, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_PTR, &(addr), sz, &(r_sz))
|
||||
# define OSSL_PARAM_SIZED_octet_ptr(key, addr, sz, r_sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_PTR, &(addr), sz, &(r_sz))
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_PTR, &(addr), sz)
|
||||
|
||||
/* Search an OSSL_PARAM array for a matching name */
|
||||
const OSSL_PARAM *OSSL_PARAM_locate(const OSSL_PARAM *p, const char *key);
|
||||
OSSL_PARAM *OSSL_PARAM_locate(OSSL_PARAM *p, const char *key);
|
||||
const OSSL_PARAM *OSSL_PARAM_locate_const(const OSSL_PARAM *p, const char *key);
|
||||
|
||||
/* Basic parameter type run-time construction */
|
||||
OSSL_PARAM OSSL_PARAM_construct_int(const char *key, int *buf, size_t *ret);
|
||||
OSSL_PARAM OSSL_PARAM_construct_uint(const char *key, unsigned int *buf,
|
||||
size_t *ret);
|
||||
OSSL_PARAM OSSL_PARAM_construct_long(const char *key, long int *buf,
|
||||
size_t *ret);
|
||||
OSSL_PARAM OSSL_PARAM_construct_ulong(const char *key, unsigned long int *buf,
|
||||
size_t *ret);
|
||||
OSSL_PARAM OSSL_PARAM_construct_int32(const char *key, int32_t *buf,
|
||||
size_t *ret);
|
||||
OSSL_PARAM OSSL_PARAM_construct_uint32(const char *key, uint32_t *buf,
|
||||
size_t *ret);
|
||||
OSSL_PARAM OSSL_PARAM_construct_int64(const char *key, int64_t *buf,
|
||||
size_t *ret);
|
||||
OSSL_PARAM OSSL_PARAM_construct_uint64(const char *key, uint64_t *buf,
|
||||
size_t *ret);
|
||||
OSSL_PARAM OSSL_PARAM_construct_size_t(const char *key, size_t *buf,
|
||||
size_t *ret);
|
||||
OSSL_PARAM OSSL_PARAM_construct_int(const char *key, int *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_uint(const char *key, unsigned int *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_long(const char *key, long int *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_ulong(const char *key, unsigned long int *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_int32(const char *key, int32_t *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_uint32(const char *key, uint32_t *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_int64(const char *key, int64_t *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_uint64(const char *key, uint64_t *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_size_t(const char *key, size_t *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_BN(const char *key, unsigned char *buf,
|
||||
size_t bsize, size_t *rsize);
|
||||
OSSL_PARAM OSSL_PARAM_construct_double(const char *key, double *buf,
|
||||
size_t *rsize);
|
||||
size_t bsize);
|
||||
OSSL_PARAM OSSL_PARAM_construct_double(const char *key, double *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_utf8_string(const char *key, char *buf,
|
||||
size_t bsize, size_t *rsize);
|
||||
size_t bsize);
|
||||
OSSL_PARAM OSSL_PARAM_construct_utf8_ptr(const char *key, char **buf,
|
||||
size_t bsize, size_t *rsize);
|
||||
size_t bsize);
|
||||
OSSL_PARAM OSSL_PARAM_construct_octet_string(const char *key, void *buf,
|
||||
size_t bsize, size_t *rsize);
|
||||
size_t bsize);
|
||||
OSSL_PARAM OSSL_PARAM_construct_octet_ptr(const char *key, void **buf,
|
||||
size_t bsize, size_t *rsize);
|
||||
size_t bsize);
|
||||
OSSL_PARAM OSSL_PARAM_construct_end(void);
|
||||
|
||||
int OSSL_PARAM_get_int(const OSSL_PARAM *p, int *val);
|
||||
@@ -149,36 +99,35 @@ int OSSL_PARAM_get_int64(const OSSL_PARAM *p, int64_t *val);
|
||||
int OSSL_PARAM_get_uint64(const OSSL_PARAM *p, uint64_t *val);
|
||||
int OSSL_PARAM_get_size_t(const OSSL_PARAM *p, size_t *val);
|
||||
|
||||
int OSSL_PARAM_set_int(const OSSL_PARAM *p, int val);
|
||||
int OSSL_PARAM_set_uint(const OSSL_PARAM *p, unsigned int val);
|
||||
int OSSL_PARAM_set_long(const OSSL_PARAM *p, long int val);
|
||||
int OSSL_PARAM_set_ulong(const OSSL_PARAM *p, unsigned long int val);
|
||||
int OSSL_PARAM_set_int32(const OSSL_PARAM *p, int32_t val);
|
||||
int OSSL_PARAM_set_uint32(const OSSL_PARAM *p, uint32_t val);
|
||||
int OSSL_PARAM_set_int64(const OSSL_PARAM *p, int64_t val);
|
||||
int OSSL_PARAM_set_uint64(const OSSL_PARAM *p, uint64_t val);
|
||||
int OSSL_PARAM_set_size_t(const OSSL_PARAM *p, size_t val);
|
||||
int OSSL_PARAM_set_int(OSSL_PARAM *p, int val);
|
||||
int OSSL_PARAM_set_uint(OSSL_PARAM *p, unsigned int val);
|
||||
int OSSL_PARAM_set_long(OSSL_PARAM *p, long int val);
|
||||
int OSSL_PARAM_set_ulong(OSSL_PARAM *p, unsigned long int val);
|
||||
int OSSL_PARAM_set_int32(OSSL_PARAM *p, int32_t val);
|
||||
int OSSL_PARAM_set_uint32(OSSL_PARAM *p, uint32_t val);
|
||||
int OSSL_PARAM_set_int64(OSSL_PARAM *p, int64_t val);
|
||||
int OSSL_PARAM_set_uint64(OSSL_PARAM *p, uint64_t val);
|
||||
int OSSL_PARAM_set_size_t(OSSL_PARAM *p, size_t val);
|
||||
|
||||
int OSSL_PARAM_get_double(const OSSL_PARAM *p, double *val);
|
||||
int OSSL_PARAM_set_double(const OSSL_PARAM *p, double val);
|
||||
int OSSL_PARAM_set_double(OSSL_PARAM *p, double val);
|
||||
|
||||
int OSSL_PARAM_get_BN(const OSSL_PARAM *p, BIGNUM **val);
|
||||
int OSSL_PARAM_set_BN(const OSSL_PARAM *p, const BIGNUM *val);
|
||||
int OSSL_PARAM_set_BN(OSSL_PARAM *p, const BIGNUM *val);
|
||||
|
||||
int OSSL_PARAM_get_utf8_string(const OSSL_PARAM *p, char **val, size_t max_len);
|
||||
int OSSL_PARAM_set_utf8_string(const OSSL_PARAM *p, const char *val);
|
||||
int OSSL_PARAM_set_utf8_string(OSSL_PARAM *p, const char *val);
|
||||
|
||||
int OSSL_PARAM_get_octet_string(const OSSL_PARAM *p, void **val, size_t max_len,
|
||||
size_t *used_len);
|
||||
int OSSL_PARAM_set_octet_string(const OSSL_PARAM *p, const void *val,
|
||||
size_t len);
|
||||
int OSSL_PARAM_set_octet_string(OSSL_PARAM *p, const void *val, size_t len);
|
||||
|
||||
int OSSL_PARAM_get_utf8_ptr(const OSSL_PARAM *p, const char **val);
|
||||
int OSSL_PARAM_set_utf8_ptr(const OSSL_PARAM *p, const char *val);
|
||||
int OSSL_PARAM_set_utf8_ptr(OSSL_PARAM *p, const char *val);
|
||||
|
||||
int OSSL_PARAM_get_octet_ptr(const OSSL_PARAM *p, const void **val,
|
||||
size_t *used_len);
|
||||
int OSSL_PARAM_set_octet_ptr(const OSSL_PARAM *p, const void *val,
|
||||
int OSSL_PARAM_set_octet_ptr(OSSL_PARAM *p, const void *val,
|
||||
size_t used_len);
|
||||
|
||||
# ifdef __cplusplus
|
||||
|
||||
@@ -20,8 +20,8 @@ extern "C" {
|
||||
OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *, const char *name);
|
||||
int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
|
||||
|
||||
const OSSL_ITEM *OSSL_PROVIDER_get_param_types(OSSL_PROVIDER *prov);
|
||||
int OSSL_PROVIDER_get_params(OSSL_PROVIDER *prov, const OSSL_PARAM params[]);
|
||||
const OSSL_ITEM *OSSL_PROVIDER_get_param_types(const OSSL_PROVIDER *prov);
|
||||
int OSSL_PROVIDER_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]);
|
||||
|
||||
/* Add a built in providers */
|
||||
int OSSL_PROVIDER_add_builtin(OPENSSL_CTX *, const char *name,
|
||||
|
||||
@@ -72,6 +72,10 @@ extern "C" {
|
||||
/*
|
||||
* Object lifetime functions.
|
||||
*/
|
||||
RAND_DRBG *RAND_DRBG_new_ex(OPENSSL_CTX *ctx, int type, unsigned int flags,
|
||||
RAND_DRBG *parent);
|
||||
RAND_DRBG *RAND_DRBG_secure_new_ex(OPENSSL_CTX *ctx, int type,
|
||||
unsigned int flags, RAND_DRBG *parent);
|
||||
RAND_DRBG *RAND_DRBG_new(int type, unsigned int flags, RAND_DRBG *parent);
|
||||
RAND_DRBG *RAND_DRBG_secure_new(int type, unsigned int flags, RAND_DRBG *parent);
|
||||
int RAND_DRBG_set(RAND_DRBG *drbg, int type, unsigned int flags);
|
||||
@@ -102,6 +106,9 @@ int RAND_DRBG_set_reseed_defaults(
|
||||
time_t slave_reseed_time_interval
|
||||
);
|
||||
|
||||
RAND_DRBG *OPENSSL_CTX_get0_master_drbg(OPENSSL_CTX *ctx);
|
||||
RAND_DRBG *OPENSSL_CTX_get0_public_drbg(OPENSSL_CTX *ctx);
|
||||
RAND_DRBG *OPENSSL_CTX_get0_private_drbg(OPENSSL_CTX *ctx);
|
||||
RAND_DRBG *RAND_DRBG_get0_master(void);
|
||||
RAND_DRBG *RAND_DRBG_get0_public(void);
|
||||
RAND_DRBG *RAND_DRBG_get0_private(void);
|
||||
|
||||
@@ -29,6 +29,7 @@ int ERR_load_RAND_strings(void);
|
||||
# define RAND_F_DRBG_SETUP 117
|
||||
# define RAND_F_GET_ENTROPY 106
|
||||
# define RAND_F_RAND_BYTES 100
|
||||
# define RAND_F_RAND_BYTES_EX 126
|
||||
# define RAND_F_RAND_DRBG_ENABLE_LOCKING 119
|
||||
# define RAND_F_RAND_DRBG_GENERATE 107
|
||||
# define RAND_F_RAND_DRBG_GET_ENTROPY 120
|
||||
|
||||
@@ -39,8 +39,8 @@ typedef struct rc5_key_st {
|
||||
RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)];
|
||||
} RC5_32_KEY;
|
||||
|
||||
void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
|
||||
int rounds);
|
||||
int RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
|
||||
int rounds);
|
||||
void RC5_32_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
RC5_32_KEY *key, int enc);
|
||||
void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key);
|
||||
|
||||
+51
-39
@@ -170,17 +170,25 @@ extern "C" {
|
||||
* The following cipher list is used by default. It also is substituted when
|
||||
* an application-defined cipher list string starts with 'DEFAULT'.
|
||||
* This applies to ciphersuites for TLSv1.2 and below.
|
||||
* DEPRECATED IN 3.0.0, in favor of OSSL_default_cipher_list()
|
||||
* Update both macro and function simultaneously
|
||||
*/
|
||||
# define SSL_DEFAULT_CIPHER_LIST "ALL:!COMPLEMENTOFDEFAULT:!eNULL"
|
||||
/* This is the default set of TLSv1.3 ciphersuites */
|
||||
# if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
|
||||
# define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
|
||||
"TLS_CHACHA20_POLY1305_SHA256:" \
|
||||
# if !OPENSSL_API_3
|
||||
# define SSL_DEFAULT_CIPHER_LIST "ALL:!COMPLEMENTOFDEFAULT:!eNULL"
|
||||
/*
|
||||
* This is the default set of TLSv1.3 ciphersuites
|
||||
* DEPRECATED IN 3.0.0, in favor of OSSL_default_ciphersuites()
|
||||
* Update both macro and function simultaneously
|
||||
*/
|
||||
# if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
|
||||
# define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
|
||||
"TLS_CHACHA20_POLY1305_SHA256:" \
|
||||
"TLS_AES_128_GCM_SHA256"
|
||||
# else
|
||||
# define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
|
||||
"TLS_AES_128_GCM_SHA256"
|
||||
# else
|
||||
# define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
|
||||
"TLS_AES_128_GCM_SHA256"
|
||||
#endif
|
||||
# endif
|
||||
# endif
|
||||
/*
|
||||
* As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always
|
||||
* starts with a reasonable order, and all we have to do for DEFAULT is
|
||||
@@ -1370,24 +1378,24 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
|
||||
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)(st))
|
||||
# define SSL_CTX_set1_chain_cert_store(ctx,st) \
|
||||
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)(st))
|
||||
# define SSL_set0_chain(ctx,sk) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)(sk))
|
||||
# define SSL_set1_chain(ctx,sk) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_CHAIN,1,(char *)(sk))
|
||||
# define SSL_add0_chain_cert(ctx,x509) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,(char *)(x509))
|
||||
# define SSL_add1_chain_cert(ctx,x509) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)(x509))
|
||||
# define SSL_get0_chain_certs(ctx,px509) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509)
|
||||
# define SSL_clear_chain_certs(ctx) \
|
||||
SSL_set0_chain(ctx,NULL)
|
||||
# define SSL_set0_chain(s,sk) \
|
||||
SSL_ctrl(s,SSL_CTRL_CHAIN,0,(char *)(sk))
|
||||
# define SSL_set1_chain(s,sk) \
|
||||
SSL_ctrl(s,SSL_CTRL_CHAIN,1,(char *)(sk))
|
||||
# define SSL_add0_chain_cert(s,x509) \
|
||||
SSL_ctrl(s,SSL_CTRL_CHAIN_CERT,0,(char *)(x509))
|
||||
# define SSL_add1_chain_cert(s,x509) \
|
||||
SSL_ctrl(s,SSL_CTRL_CHAIN_CERT,1,(char *)(x509))
|
||||
# define SSL_get0_chain_certs(s,px509) \
|
||||
SSL_ctrl(s,SSL_CTRL_GET_CHAIN_CERTS,0,px509)
|
||||
# define SSL_clear_chain_certs(s) \
|
||||
SSL_set0_chain(s,NULL)
|
||||
# define SSL_build_cert_chain(s, flags) \
|
||||
SSL_ctrl(s,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL)
|
||||
# define SSL_select_current_cert(ctx,x509) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)(x509))
|
||||
# define SSL_set_current_cert(ctx,op) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_SET_CURRENT_CERT, op, NULL)
|
||||
# define SSL_select_current_cert(s,x509) \
|
||||
SSL_ctrl(s,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)(x509))
|
||||
# define SSL_set_current_cert(s,op) \
|
||||
SSL_ctrl(s,SSL_CTRL_SET_CURRENT_CERT, op, NULL)
|
||||
# define SSL_set0_verify_cert_store(s,st) \
|
||||
SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)(st))
|
||||
# define SSL_set1_verify_cert_store(s,st) \
|
||||
@@ -1396,34 +1404,34 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
|
||||
SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)(st))
|
||||
# define SSL_set1_chain_cert_store(s,st) \
|
||||
SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)(st))
|
||||
# define SSL_get1_groups(ctx, s) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_GET_GROUPS,0,(char *)(s))
|
||||
# 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))
|
||||
# define SSL_CTX_set1_groups_list(ctx, s) \
|
||||
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS_LIST,0,(char *)(s))
|
||||
# define SSL_set1_groups(ctx, glist, glistlen) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_SET_GROUPS,glistlen,(char *)(glist))
|
||||
# define SSL_set1_groups_list(ctx, s) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_SET_GROUPS_LIST,0,(char *)(s))
|
||||
# define SSL_set1_groups(s, glist, glistlen) \
|
||||
SSL_ctrl(s,SSL_CTRL_SET_GROUPS,glistlen,(char *)(glist))
|
||||
# define SSL_set1_groups_list(s, str) \
|
||||
SSL_ctrl(s,SSL_CTRL_SET_GROUPS_LIST,0,(char *)(str))
|
||||
# define SSL_get_shared_group(s, n) \
|
||||
SSL_ctrl(s,SSL_CTRL_GET_SHARED_GROUP,n,NULL)
|
||||
# define SSL_CTX_set1_sigalgs(ctx, slist, slistlen) \
|
||||
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)(slist))
|
||||
# define SSL_CTX_set1_sigalgs_list(ctx, s) \
|
||||
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)(s))
|
||||
# define SSL_set1_sigalgs(ctx, slist, slistlen) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)(slist))
|
||||
# define SSL_set1_sigalgs_list(ctx, s) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)(s))
|
||||
# define SSL_set1_sigalgs(s, slist, slistlen) \
|
||||
SSL_ctrl(s,SSL_CTRL_SET_SIGALGS,slistlen,(int *)(slist))
|
||||
# define SSL_set1_sigalgs_list(s, str) \
|
||||
SSL_ctrl(s,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)(str))
|
||||
# define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \
|
||||
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,slistlen,(int *)(slist))
|
||||
# define SSL_CTX_set1_client_sigalgs_list(ctx, s) \
|
||||
SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)(s))
|
||||
# define SSL_set1_client_sigalgs(ctx, slist, slistlen) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,clistlen,(int *)(slist))
|
||||
# define SSL_set1_client_sigalgs_list(ctx, s) \
|
||||
SSL_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)(s))
|
||||
# define SSL_set1_client_sigalgs(s, slist, slistlen) \
|
||||
SSL_ctrl(s,SSL_CTRL_SET_CLIENT_SIGALGS,slistlen,(int *)(slist))
|
||||
# define SSL_set1_client_sigalgs_list(s, str) \
|
||||
SSL_ctrl(s,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)(str))
|
||||
# define SSL_get0_certificate_types(s, clist) \
|
||||
SSL_ctrl(s, SSL_CTRL_GET_CLIENT_CERT_TYPES, 0, (char *)(clist))
|
||||
# define SSL_CTX_set1_client_certificate_types(ctx, clist, clistlen) \
|
||||
@@ -2445,6 +2453,10 @@ void SSL_set_allow_early_data_cb(SSL *s,
|
||||
SSL_allow_early_data_cb_fn cb,
|
||||
void *arg);
|
||||
|
||||
/* store the default cipher strings inside the library */
|
||||
const char *OSSL_default_cipher_list(void);
|
||||
const char *OSSL_default_ciphersuites(void);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
@@ -85,7 +85,7 @@ OSSL_STORE_INFO *OSSL_STORE_load(OSSL_STORE_CTX *ctx);
|
||||
int OSSL_STORE_eof(OSSL_STORE_CTX *ctx);
|
||||
|
||||
/*
|
||||
* Check if an error occured
|
||||
* Check if an error occurred
|
||||
* Returns 1 if it did, 0 otherwise.
|
||||
*/
|
||||
int OSSL_STORE_error(OSSL_STORE_CTX *ctx);
|
||||
@@ -117,7 +117,7 @@ int OSSL_STORE_close(OSSL_STORE_CTX *ctx);
|
||||
* Functions to generate OSSL_STORE_INFOs, one function for each type we
|
||||
* support having in them, as well as a generic constructor.
|
||||
*
|
||||
* In all cases, ownership of the object is transfered to the OSSL_STORE_INFO
|
||||
* In all cases, ownership of the object is transferred to the OSSL_STORE_INFO
|
||||
* and will therefore be freed when the OSSL_STORE_INFO is freed.
|
||||
*/
|
||||
OSSL_STORE_INFO *OSSL_STORE_INFO_new_NAME(char *name);
|
||||
|
||||
@@ -569,6 +569,8 @@ int X509_get_signature_nid(const X509 *x);
|
||||
# ifndef OPENSSL_NO_SM2
|
||||
void X509_set0_sm2_id(X509 *x, ASN1_OCTET_STRING *sm2_id);
|
||||
ASN1_OCTET_STRING *X509_get0_sm2_id(X509 *x);
|
||||
void X509_REQ_set0_sm2_id(X509_REQ *x, ASN1_OCTET_STRING *sm2_id);
|
||||
ASN1_OCTET_STRING *X509_REQ_get0_sm2_id(X509_REQ *x);
|
||||
# endif
|
||||
|
||||
int X509_trusted(const X509 *x);
|
||||
|
||||
@@ -28,6 +28,7 @@ int ERR_load_X509_strings(void);
|
||||
# define X509_F_BY_FILE_CTRL 101
|
||||
# define X509_F_CHECK_NAME_CONSTRAINTS 149
|
||||
# define X509_F_CHECK_POLICY 145
|
||||
# define X509_F_COMMON_VERIFY_SM2 165
|
||||
# define X509_F_DANE_I2D 107
|
||||
# define X509_F_DIR_CTRL 102
|
||||
# define X509_F_GET_CERT_BY_SUBJECT 103
|
||||
@@ -71,6 +72,8 @@ int ERR_load_X509_strings(void);
|
||||
# define X509_F_X509_REQ_PRINT_EX 121
|
||||
# define X509_F_X509_REQ_PRINT_FP 122
|
||||
# define X509_F_X509_REQ_TO_X509 123
|
||||
# define X509_F_X509_REQ_VERIFY 163
|
||||
# define X509_F_X509_REQ_VERIFY_SM2 164
|
||||
# define X509_F_X509_STORE_ADD_CERT 124
|
||||
# define X509_F_X509_STORE_ADD_CRL 125
|
||||
# define X509_F_X509_STORE_ADD_LOOKUP 157
|
||||
@@ -99,6 +102,7 @@ int ERR_load_X509_strings(void);
|
||||
# define X509_R_CRL_ALREADY_DELTA 127
|
||||
# define X509_R_CRL_VERIFY_FAILURE 131
|
||||
# define X509_R_IDP_MISMATCH 128
|
||||
# define X509_R_INVALID_ATTRIBUTES 138
|
||||
# define X509_R_INVALID_DIRECTORY 113
|
||||
# define X509_R_INVALID_FIELD_NAME 119
|
||||
# define X509_R_INVALID_TRUST 123
|
||||
|
||||
Reference in New Issue
Block a user