Latest update.

This commit is contained in:
2020-01-22 16:36:28 +09:00
parent f2d048b604
commit 047a30700b
9 changed files with 244 additions and 46 deletions
+52 -11
View File
@@ -2,7 +2,7 @@
/.dir-locals.el /.dir-locals.el
# Top level excludes # Top level excludes
/Makefile.orig /Makefile
/MINFO /MINFO
/TABLE /TABLE
/*.pc /*.pc
@@ -13,11 +13,6 @@
/tmp.* /tmp.*
/configdata.pm /configdata.pm
# *all* Makefiles
Makefile
# ... except in demos
!/demos/*/Makefile
# Links under apps # Links under apps
/apps/CA.pl /apps/CA.pl
/apps/tsget /apps/tsget
@@ -26,9 +21,51 @@ Makefile
# Auto generated headers # Auto generated headers
/crypto/buildinf.h /crypto/buildinf.h
/crypto/include/internal/*_conf.h /include/crypto/*_conf.h
/openssl/include/opensslconf.h /include/openssl/configuration.h
/util/domd /include/openssl/opensslv.h
# Auto generated doc files
doc/man1/openssl-ca.pod
doc/man1/openssl-cms.pod
doc/man1/openssl-crl.pod
doc/man1/openssl-dgst.pod
doc/man1/openssl-dhparam.pod
doc/man1/openssl-dsa.pod
doc/man1/openssl-dsaparam.pod
doc/man1/openssl-ec.pod
doc/man1/openssl-ecparam.pod
doc/man1/openssl-enc.pod
doc/man1/openssl-engine.pod
doc/man1/openssl-gendsa.pod
doc/man1/openssl-genpkey.pod
doc/man1/openssl-genrsa.pod
doc/man1/openssl-info.pod
doc/man1/openssl-list.pod
doc/man1/openssl-ocsp.pod
doc/man1/openssl-passwd.pod
doc/man1/openssl-pkcs12.pod
doc/man1/openssl-pkcs7.pod
doc/man1/openssl-pkcs8.pod
doc/man1/openssl-pkey.pod
doc/man1/openssl-pkeyparam.pod
doc/man1/openssl-pkeyutl.pod
doc/man1/openssl-rand.pod
doc/man1/openssl-req.pod
doc/man1/openssl-rsa.pod
doc/man1/openssl-rsautl.pod
doc/man1/openssl-s_client.pod
doc/man1/openssl-s_server.pod
doc/man1/openssl-s_time.pod
doc/man1/openssl-smime.pod
doc/man1/openssl-speed.pod
doc/man1/openssl-spkac.pod
doc/man1/openssl-srp.pod
doc/man1/openssl-storeutl.pod
doc/man1/openssl-ts.pod
doc/man1/openssl-verify.pod
doc/man1/openssl-x509.pod
doc/man1/openssl.pod
# error code files # error code files
/crypto/err/openssl.txt.old /crypto/err/openssl.txt.old
@@ -59,6 +96,8 @@ Makefile
/test/versions /test/versions
/test/ossl_shim/ossl_shim /test/ossl_shim/ossl_shim
/test/rsa_complex /test/rsa_complex
/test/confdump
/test/bio_prefix_text
# Other generated files in test/ # Other generated files in test/
/test/provider_internal_test.conf /test/provider_internal_test.conf
/test/fipsinstall.conf /test/fipsinstall.conf
@@ -80,7 +119,6 @@ Makefile
# Misc auto generated files # Misc auto generated files
/doc/man7/openssl_user_macros.pod /doc/man7/openssl_user_macros.pod
/include/openssl/opensslconf.h
/tools/c_rehash /tools/c_rehash
/tools/c_rehash.pl /tools/c_rehash.pl
/util/shlib_wrap.sh /util/shlib_wrap.sh
@@ -100,7 +138,6 @@ Makefile
/out32dll.dbg /out32dll.dbg
/inc32 /inc32
/MINFO /MINFO
/ms/.rnd
/ms/bcb.mak /ms/bcb.mak
/ms/libeay32.def /ms/libeay32.def
/ms/nt.mak /ms/nt.mak
@@ -134,6 +171,10 @@ Makefile
/test/fips_test_suite.c /test/fips_test_suite.c
/test/shatest.c /test/shatest.c
# Generated docs directories
/doc/html
/doc/man
##### Generic patterns ##### Generic patterns
# Auto generated assembly language source files # Auto generated assembly language source files
*.s *.s
+24 -4
View File
@@ -175,6 +175,12 @@ int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx)
evp_pkey_ctx_free_old_ops(ctx); evp_pkey_ctx_free_old_ops(ctx);
ctx->operation = EVP_PKEY_OP_DERIVE; ctx->operation = EVP_PKEY_OP_DERIVE;
/*
* TODO when we stop falling back to legacy, this and the ERR_pop_to_mark()
* calls can be removed.
*/
ERR_set_mark();
if (ctx->engine != NULL || ctx->keytype == NULL) if (ctx->engine != NULL || ctx->keytype == NULL)
goto legacy; goto legacy;
@@ -185,6 +191,7 @@ int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx)
if (provkey == NULL) if (provkey == NULL)
goto legacy; goto legacy;
if (!EVP_KEYMGMT_up_ref(tmp_keymgmt)) { if (!EVP_KEYMGMT_up_ref(tmp_keymgmt)) {
ERR_clear_last_mark();
ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR); ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
goto err; goto err;
} }
@@ -211,15 +218,21 @@ int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx)
|| (EVP_KEYMGMT_provider(ctx->keymgmt) || (EVP_KEYMGMT_provider(ctx->keymgmt)
!= EVP_KEYEXCH_provider(exchange))) { != EVP_KEYEXCH_provider(exchange))) {
/* /*
* We don't have the full support we need with provided methods, * We don't need to free ctx->keymgmt here, as it's not necessarily
* let's go see if legacy does. Also, we don't need to free * tied to this operation. It will be freed by EVP_PKEY_CTX_free().
* ctx->keymgmt here, as it's not necessarily tied to this
* operation. It will be freed by EVP_PKEY_CTX_free().
*/ */
EVP_KEYEXCH_free(exchange); EVP_KEYEXCH_free(exchange);
goto legacy; goto legacy;
} }
/*
* TODO remove this when legacy is gone
* If we don't have the full support we need with provided methods,
* let's go see if legacy does.
*/
ERR_pop_to_mark();
/* No more legacy from here down to legacy: */
ctx->op.kex.exchange = exchange; ctx->op.kex.exchange = exchange;
ctx->op.kex.exchprovctx = exchange->newctx(ossl_provider_ctx(exchange->prov)); ctx->op.kex.exchprovctx = exchange->newctx(ossl_provider_ctx(exchange->prov));
@@ -236,6 +249,13 @@ int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx)
return 0; return 0;
legacy: legacy:
/*
* TODO remove this when legacy is gone
* If we don't have the full support we need with provided methods,
* let's go see if legacy does.
*/
ERR_pop_to_mark();
if (ctx->pmeth == NULL || ctx->pmeth->derive == NULL) { if (ctx->pmeth == NULL || ctx->pmeth->derive == NULL) {
EVPerr(0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); EVPerr(0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
return -2; return -2;
+23 -4
View File
@@ -54,6 +54,12 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
locpctx = ctx->pctx; locpctx = ctx->pctx;
evp_pkey_ctx_free_old_ops(locpctx); evp_pkey_ctx_free_old_ops(locpctx);
/*
* TODO when we stop falling back to legacy, this and the ERR_pop_to_mark()
* calls can be removed.
*/
ERR_set_mark();
if (locpctx->keytype == NULL) if (locpctx->keytype == NULL)
goto legacy; goto legacy;
@@ -80,6 +86,7 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
if (provkey == NULL) if (provkey == NULL)
goto legacy; goto legacy;
if (!EVP_KEYMGMT_up_ref(tmp_keymgmt)) { if (!EVP_KEYMGMT_up_ref(tmp_keymgmt)) {
ERR_clear_last_mark();
ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR); ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
goto err; goto err;
} }
@@ -108,15 +115,20 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
|| (EVP_KEYMGMT_provider(locpctx->keymgmt) || (EVP_KEYMGMT_provider(locpctx->keymgmt)
!= EVP_SIGNATURE_provider(signature))) { != EVP_SIGNATURE_provider(signature))) {
/* /*
* We don't have the full support we need with provided methods, * We don't need to free ctx->keymgmt here, as it's not necessarily
* let's go see if legacy does. Also, we don't need to free * tied to this operation. It will be freed by EVP_PKEY_CTX_free().
* ctx->keymgmt here, as it's not necessarily tied to this
* operation. It will be freed by EVP_PKEY_CTX_free().
*/ */
EVP_SIGNATURE_free(signature); EVP_SIGNATURE_free(signature);
goto legacy; goto legacy;
} }
/*
* TODO remove this when legacy is gone
* If we don't have the full support we need with provided methods,
* let's go see if legacy does.
*/
ERR_pop_to_mark();
/* No more legacy from here down to legacy: */ /* No more legacy from here down to legacy: */
locpctx->op.sig.signature = signature; locpctx->op.sig.signature = signature;
@@ -164,6 +176,13 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
return 0; return 0;
legacy: legacy:
/*
* TODO remove this when legacy is gone
* If we don't have the full support we need with provided methods,
* let's go see if legacy does.
*/
ERR_pop_to_mark();
if (ctx->pctx->pmeth == NULL) { if (ctx->pctx->pmeth == NULL) {
EVPerr(0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); EVPerr(0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
return 0; return 0;
+29 -5
View File
@@ -32,6 +32,12 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation)
evp_pkey_ctx_free_old_ops(ctx); evp_pkey_ctx_free_old_ops(ctx);
ctx->operation = operation; ctx->operation = operation;
/*
* TODO when we stop falling back to legacy, this and the ERR_pop_to_mark()
* calls can be removed.
*/
ERR_set_mark();
if (ctx->keytype == NULL || ctx->engine != NULL) if (ctx->keytype == NULL || ctx->engine != NULL)
goto legacy; goto legacy;
@@ -41,7 +47,11 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation)
&tmp_keymgmt, ctx->propquery, 0); &tmp_keymgmt, ctx->propquery, 0);
if (provkey == NULL) if (provkey == NULL)
goto legacy; goto legacy;
EVP_KEYMGMT_up_ref(tmp_keymgmt); if (!EVP_KEYMGMT_up_ref(tmp_keymgmt)) {
ERR_clear_last_mark();
ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
goto err;
}
EVP_KEYMGMT_free(ctx->keymgmt); EVP_KEYMGMT_free(ctx->keymgmt);
ctx->keymgmt = tmp_keymgmt; ctx->keymgmt = tmp_keymgmt;
@@ -67,15 +77,22 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation)
|| (EVP_KEYMGMT_provider(ctx->keymgmt) || (EVP_KEYMGMT_provider(ctx->keymgmt)
!= EVP_ASYM_CIPHER_provider(cipher))) { != EVP_ASYM_CIPHER_provider(cipher))) {
/* /*
* We don't have the full support we need with provided methods, * We don't need to free ctx->keymgmt here, as it's not necessarily
* let's go see if legacy does. Also, we don't need to free * tied to this operation. It will be freed by EVP_PKEY_CTX_free().
* ctx->keymgmt here, as it's not necessarily tied to this
* operation. It will be freed by EVP_PKEY_CTX_free().
*/ */
EVP_ASYM_CIPHER_free(cipher); EVP_ASYM_CIPHER_free(cipher);
goto legacy; goto legacy;
} }
/*
* TODO remove this when legacy is gone
* If we don't have the full support we need with provided methods,
* let's go see if legacy does.
*/
ERR_pop_to_mark();
/* No more legacy from here down to legacy: */
ctx->op.ciph.cipher = cipher; ctx->op.ciph.cipher = cipher;
ctx->op.ciph.ciphprovctx = cipher->newctx(ossl_provider_ctx(cipher->prov)); ctx->op.ciph.ciphprovctx = cipher->newctx(ossl_provider_ctx(cipher->prov));
if (ctx->op.ciph.ciphprovctx == NULL) { if (ctx->op.ciph.ciphprovctx == NULL) {
@@ -114,6 +131,13 @@ static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation)
return 1; return 1;
legacy: legacy:
/*
* TODO remove this when legacy is gone
* If we don't have the full support we need with provided methods,
* let's go see if legacy does.
*/
ERR_pop_to_mark();
if (ctx->pmeth == NULL || ctx->pmeth->encrypt == NULL) { if (ctx->pmeth == NULL || ctx->pmeth->encrypt == NULL) {
EVPerr(0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); EVPerr(0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
return -2; return -2;
+25 -4
View File
@@ -333,6 +333,12 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation)
evp_pkey_ctx_free_old_ops(ctx); evp_pkey_ctx_free_old_ops(ctx);
ctx->operation = operation; ctx->operation = operation;
/*
* TODO when we stop falling back to legacy, this and the ERR_pop_to_mark()
* calls can be removed.
*/
ERR_set_mark();
if (ctx->keytype == NULL) if (ctx->keytype == NULL)
goto legacy; goto legacy;
@@ -343,6 +349,7 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation)
if (provkey == NULL) if (provkey == NULL)
goto legacy; goto legacy;
if (!EVP_KEYMGMT_up_ref(tmp_keymgmt)) { if (!EVP_KEYMGMT_up_ref(tmp_keymgmt)) {
ERR_clear_last_mark();
ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR); ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
goto err; goto err;
} }
@@ -370,15 +377,22 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation)
|| (EVP_KEYMGMT_provider(ctx->keymgmt) || (EVP_KEYMGMT_provider(ctx->keymgmt)
!= EVP_SIGNATURE_provider(signature))) { != EVP_SIGNATURE_provider(signature))) {
/* /*
* We don't have the full support we need with provided methods, * We don't need to free ctx->keymgmt here, as it's not necessarily
* let's go see if legacy does. Also, we don't need to free * tied to this operation. It will be freed by EVP_PKEY_CTX_free().
* ctx->keymgmt here, as it's not necessarily tied to this
* operation. It will be freed by EVP_PKEY_CTX_free().
*/ */
EVP_SIGNATURE_free(signature); EVP_SIGNATURE_free(signature);
goto legacy; goto legacy;
} }
/*
* TODO remove this when legacy is gone
* If we don't have the full support we need with provided methods,
* let's go see if legacy does.
*/
ERR_pop_to_mark();
/* No more legacy from here down to legacy: */
ctx->op.sig.signature = signature; ctx->op.sig.signature = signature;
ctx->op.sig.sigprovctx = signature->newctx(ossl_provider_ctx(signature->prov)); ctx->op.sig.sigprovctx = signature->newctx(ossl_provider_ctx(signature->prov));
if (ctx->op.sig.sigprovctx == NULL) { if (ctx->op.sig.sigprovctx == NULL) {
@@ -425,6 +439,13 @@ static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, int operation)
return 1; return 1;
legacy: legacy:
/*
* TODO remove this when legacy is gone
* If we don't have the full support we need with provided methods,
* let's go see if legacy does.
*/
ERR_pop_to_mark();
if (ctx->pmeth == NULL if (ctx->pmeth == NULL
|| (operation == EVP_PKEY_OP_SIGN && ctx->pmeth->sign == NULL) || (operation == EVP_PKEY_OP_SIGN && ctx->pmeth->sign == NULL)
|| (operation == EVP_PKEY_OP_VERIFY && ctx->pmeth->verify == NULL) || (operation == EVP_PKEY_OP_VERIFY && ctx->pmeth->verify == NULL)
+23
View File
@@ -774,6 +774,9 @@ static OSSL_core_get_library_context_fn core_get_libctx;
static OSSL_core_new_error_fn core_new_error; static OSSL_core_new_error_fn core_new_error;
static OSSL_core_set_error_debug_fn core_set_error_debug; static OSSL_core_set_error_debug_fn core_set_error_debug;
static OSSL_core_vset_error_fn core_vset_error; static OSSL_core_vset_error_fn core_vset_error;
static OSSL_core_set_error_mark_fn core_set_error_mark;
static OSSL_core_clear_last_error_mark_fn core_clear_last_error_mark;
static OSSL_core_pop_error_to_mark_fn core_pop_error_to_mark;
#endif #endif
static const OSSL_PARAM *core_gettable_params(const OSSL_PROVIDER *prov) static const OSSL_PARAM *core_gettable_params(const OSSL_PROVIDER *prov)
@@ -857,6 +860,21 @@ static void core_vset_error(const OSSL_PROVIDER *prov,
ERR_vset_error(prov->error_lib, (int)reason, fmt, args); ERR_vset_error(prov->error_lib, (int)reason, fmt, args);
} }
} }
static int core_set_error_mark(const OSSL_PROVIDER *prov)
{
return ERR_set_mark();
}
static int core_clear_last_error_mark(const OSSL_PROVIDER *prov)
{
return ERR_clear_last_mark();
}
static int core_pop_error_to_mark(const OSSL_PROVIDER *prov)
{
return ERR_pop_to_mark();
}
#endif #endif
/* /*
@@ -872,6 +890,11 @@ static const OSSL_DISPATCH core_dispatch_[] = {
{ OSSL_FUNC_CORE_NEW_ERROR, (void (*)(void))core_new_error }, { OSSL_FUNC_CORE_NEW_ERROR, (void (*)(void))core_new_error },
{ OSSL_FUNC_CORE_SET_ERROR_DEBUG, (void (*)(void))core_set_error_debug }, { OSSL_FUNC_CORE_SET_ERROR_DEBUG, (void (*)(void))core_set_error_debug },
{ OSSL_FUNC_CORE_VSET_ERROR, (void (*)(void))core_vset_error }, { OSSL_FUNC_CORE_VSET_ERROR, (void (*)(void))core_vset_error },
{ OSSL_FUNC_CORE_SET_ERROR_MARK, (void (*)(void))core_set_error_mark },
{ OSSL_FUNC_CORE_CLEAR_LAST_ERROR_MARK,
(void (*)(void))core_clear_last_error_mark },
{ OSSL_FUNC_CORE_POP_ERROR_TO_MARK,
(void (*)(void))core_pop_error_to_mark },
{ OSSL_FUNC_BIO_NEW_FILE, (void (*)(void))BIO_new_file }, { OSSL_FUNC_BIO_NEW_FILE, (void (*)(void))BIO_new_file },
{ OSSL_FUNC_BIO_NEW_MEMBUF, (void (*)(void))BIO_new_mem_buf }, { OSSL_FUNC_BIO_NEW_MEMBUF, (void (*)(void))BIO_new_mem_buf },
{ OSSL_FUNC_BIO_READ_EX, (void (*)(void))BIO_read_ex }, { OSSL_FUNC_BIO_READ_EX, (void (*)(void))BIO_read_ex },
+25 -18
View File
@@ -80,53 +80,60 @@ OSSL_CORE_MAKE_FUNC(void,core_set_error_debug,
OSSL_CORE_MAKE_FUNC(void,core_vset_error, OSSL_CORE_MAKE_FUNC(void,core_vset_error,
(const OSSL_PROVIDER *prov, (const OSSL_PROVIDER *prov,
uint32_t reason, const char *fmt, va_list args)) uint32_t reason, const char *fmt, va_list args))
# define OSSL_FUNC_CORE_SET_ERROR_MARK 8
OSSL_CORE_MAKE_FUNC(int, core_set_error_mark, (const OSSL_PROVIDER *prov))
# define OSSL_FUNC_CORE_CLEAR_LAST_ERROR_MARK 9
OSSL_CORE_MAKE_FUNC(int, core_clear_last_error_mark,
(const OSSL_PROVIDER *prov))
# define OSSL_FUNC_CORE_POP_ERROR_TO_MARK 10
OSSL_CORE_MAKE_FUNC(int, core_pop_error_to_mark, (const OSSL_PROVIDER *prov))
/* Memory allocation, freeing, clearing. */ /* Memory allocation, freeing, clearing. */
#define OSSL_FUNC_CRYPTO_MALLOC 10 #define OSSL_FUNC_CRYPTO_MALLOC 20
OSSL_CORE_MAKE_FUNC(void *, OSSL_CORE_MAKE_FUNC(void *,
CRYPTO_malloc, (size_t num, const char *file, int line)) CRYPTO_malloc, (size_t num, const char *file, int line))
#define OSSL_FUNC_CRYPTO_ZALLOC 11 #define OSSL_FUNC_CRYPTO_ZALLOC 21
OSSL_CORE_MAKE_FUNC(void *, OSSL_CORE_MAKE_FUNC(void *,
CRYPTO_zalloc, (size_t num, const char *file, int line)) CRYPTO_zalloc, (size_t num, const char *file, int line))
#define OSSL_FUNC_CRYPTO_FREE 12 #define OSSL_FUNC_CRYPTO_FREE 22
OSSL_CORE_MAKE_FUNC(void, OSSL_CORE_MAKE_FUNC(void,
CRYPTO_free, (void *ptr, const char *file, int line)) CRYPTO_free, (void *ptr, const char *file, int line))
#define OSSL_FUNC_CRYPTO_CLEAR_FREE 13 #define OSSL_FUNC_CRYPTO_CLEAR_FREE 23
OSSL_CORE_MAKE_FUNC(void, OSSL_CORE_MAKE_FUNC(void,
CRYPTO_clear_free, (void *ptr, size_t num, const char *file, int line)) CRYPTO_clear_free, (void *ptr, size_t num, const char *file, int line))
#define OSSL_FUNC_CRYPTO_REALLOC 14 #define OSSL_FUNC_CRYPTO_REALLOC 24
OSSL_CORE_MAKE_FUNC(void *, OSSL_CORE_MAKE_FUNC(void *,
CRYPTO_realloc, (void *addr, size_t num, const char *file, int line)) CRYPTO_realloc, (void *addr, size_t num, const char *file, int line))
#define OSSL_FUNC_CRYPTO_CLEAR_REALLOC 15 #define OSSL_FUNC_CRYPTO_CLEAR_REALLOC 25
OSSL_CORE_MAKE_FUNC(void *, OSSL_CORE_MAKE_FUNC(void *,
CRYPTO_clear_realloc, (void *addr, size_t old_num, size_t num, CRYPTO_clear_realloc, (void *addr, size_t old_num, size_t num,
const char *file, int line)) const char *file, int line))
#define OSSL_FUNC_CRYPTO_SECURE_MALLOC 16 #define OSSL_FUNC_CRYPTO_SECURE_MALLOC 26
OSSL_CORE_MAKE_FUNC(void *, OSSL_CORE_MAKE_FUNC(void *,
CRYPTO_secure_malloc, (size_t num, const char *file, int line)) CRYPTO_secure_malloc, (size_t num, const char *file, int line))
#define OSSL_FUNC_CRYPTO_SECURE_ZALLOC 17 #define OSSL_FUNC_CRYPTO_SECURE_ZALLOC 27
OSSL_CORE_MAKE_FUNC(void *, OSSL_CORE_MAKE_FUNC(void *,
CRYPTO_secure_zalloc, (size_t num, const char *file, int line)) CRYPTO_secure_zalloc, (size_t num, const char *file, int line))
#define OSSL_FUNC_CRYPTO_SECURE_FREE 18 #define OSSL_FUNC_CRYPTO_SECURE_FREE 28
OSSL_CORE_MAKE_FUNC(void, OSSL_CORE_MAKE_FUNC(void,
CRYPTO_secure_free, (void *ptr, const char *file, int line)) CRYPTO_secure_free, (void *ptr, const char *file, int line))
#define OSSL_FUNC_CRYPTO_SECURE_CLEAR_FREE 19 #define OSSL_FUNC_CRYPTO_SECURE_CLEAR_FREE 29
OSSL_CORE_MAKE_FUNC(void, OSSL_CORE_MAKE_FUNC(void,
CRYPTO_secure_clear_free, (void *ptr, size_t num, const char *file, CRYPTO_secure_clear_free, (void *ptr, size_t num, const char *file,
int line)) int line))
#define OSSL_FUNC_CRYPTO_SECURE_ALLOCATED 20 #define OSSL_FUNC_CRYPTO_SECURE_ALLOCATED 30
OSSL_CORE_MAKE_FUNC(int, OSSL_CORE_MAKE_FUNC(int,
CRYPTO_secure_allocated, (const void *ptr)) CRYPTO_secure_allocated, (const void *ptr))
#define OSSL_FUNC_OPENSSL_CLEANSE 21 #define OSSL_FUNC_OPENSSL_CLEANSE 31
OSSL_CORE_MAKE_FUNC(void, OSSL_CORE_MAKE_FUNC(void,
OPENSSL_cleanse, (void *ptr, size_t len)) OPENSSL_cleanse, (void *ptr, size_t len))
/* Bio functions provided by the core */ /* Bio functions provided by the core */
#define OSSL_FUNC_BIO_NEW_FILE 23 #define OSSL_FUNC_BIO_NEW_FILE 40
#define OSSL_FUNC_BIO_NEW_MEMBUF 24 #define OSSL_FUNC_BIO_NEW_MEMBUF 41
#define OSSL_FUNC_BIO_READ_EX 25 #define OSSL_FUNC_BIO_READ_EX 42
#define OSSL_FUNC_BIO_FREE 26 #define OSSL_FUNC_BIO_FREE 43
#define OSSL_FUNC_BIO_VPRINTF 27 #define OSSL_FUNC_BIO_VPRINTF 44
OSSL_CORE_MAKE_FUNC(BIO *, BIO_new_file, (const char *filename, const char *mode)) OSSL_CORE_MAKE_FUNC(BIO *, BIO_new_file, (const char *filename, const char *mode))
OSSL_CORE_MAKE_FUNC(BIO *, BIO_new_membuf, (const void *buf, int len)) OSSL_CORE_MAKE_FUNC(BIO *, BIO_new_membuf, (const void *buf, int len))
@@ -136,7 +143,7 @@ OSSL_CORE_MAKE_FUNC(int, BIO_free, (BIO *bio))
OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (BIO *bio, const char *format, OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (BIO *bio, const char *format,
va_list args)) va_list args))
#define OSSL_FUNC_SELF_TEST_CB 28 #define OSSL_FUNC_SELF_TEST_CB 100
OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CTX *ctx, OSSL_CALLBACK **cb, OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CTX *ctx, OSSL_CALLBACK **cb,
void **cbarg)) void **cbarg))
+16
View File
@@ -0,0 +1,16 @@
/*
* Copyright 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 OPENSSL_OPENSSLCONF_H
# define OPENSSL_OPENSSLCONF_H
#include <openssl/configuration.h>
#include <openssl/macros.h>
#endif /* OPENSSL_OPENSSLCONF_H */
+27
View File
@@ -54,6 +54,9 @@ OSSL_core_thread_start_fn *c_thread_start;
static OSSL_core_new_error_fn *c_new_error; static OSSL_core_new_error_fn *c_new_error;
static OSSL_core_set_error_debug_fn *c_set_error_debug; static OSSL_core_set_error_debug_fn *c_set_error_debug;
static OSSL_core_vset_error_fn *c_vset_error; static OSSL_core_vset_error_fn *c_vset_error;
static OSSL_core_set_error_mark_fn *c_set_error_mark;
static OSSL_core_clear_last_error_mark_fn *c_clear_last_error_mark;
static OSSL_core_pop_error_to_mark_fn *c_pop_error_to_mark;
static OSSL_CRYPTO_malloc_fn *c_CRYPTO_malloc; static OSSL_CRYPTO_malloc_fn *c_CRYPTO_malloc;
static OSSL_CRYPTO_zalloc_fn *c_CRYPTO_zalloc; static OSSL_CRYPTO_zalloc_fn *c_CRYPTO_zalloc;
static OSSL_CRYPTO_free_fn *c_CRYPTO_free; static OSSL_CRYPTO_free_fn *c_CRYPTO_free;
@@ -675,6 +678,15 @@ int OSSL_provider_init(const OSSL_PROVIDER *provider,
case OSSL_FUNC_CORE_VSET_ERROR: case OSSL_FUNC_CORE_VSET_ERROR:
c_vset_error = OSSL_get_core_vset_error(in); c_vset_error = OSSL_get_core_vset_error(in);
break; break;
case OSSL_FUNC_CORE_SET_ERROR_MARK:
c_set_error_mark = OSSL_get_core_set_error_mark(in);
break;
case OSSL_FUNC_CORE_CLEAR_LAST_ERROR_MARK:
c_clear_last_error_mark = OSSL_get_core_clear_last_error_mark(in);
break;
case OSSL_FUNC_CORE_POP_ERROR_TO_MARK:
c_pop_error_to_mark = OSSL_get_core_pop_error_to_mark(in);
break;
case OSSL_FUNC_CRYPTO_MALLOC: case OSSL_FUNC_CRYPTO_MALLOC:
c_CRYPTO_malloc = OSSL_get_CRYPTO_malloc(in); c_CRYPTO_malloc = OSSL_get_CRYPTO_malloc(in);
break; break;
@@ -839,6 +851,21 @@ void ERR_vset_error(int lib, int reason, const char *fmt, va_list args)
c_vset_error(NULL, ERR_PACK(lib, 0, reason), fmt, args); c_vset_error(NULL, ERR_PACK(lib, 0, reason), fmt, args);
} }
int ERR_set_mark(void)
{
return c_set_error_mark(NULL);
}
int ERR_clear_last_mark(void)
{
return c_clear_last_error_mark(NULL);
}
int ERR_pop_to_mark(void)
{
return c_pop_error_to_mark(NULL);
}
const OSSL_PROVIDER *FIPS_get_provider(OPENSSL_CTX *ctx) const OSSL_PROVIDER *FIPS_get_provider(OPENSSL_CTX *ctx)
{ {
FIPS_GLOBAL *fgbl = openssl_ctx_get_data(ctx, OPENSSL_CTX_FIPS_PROV_INDEX, FIPS_GLOBAL *fgbl = openssl_ctx_get_data(ctx, OPENSSL_CTX_FIPS_PROV_INDEX,