summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-07-26 18:11:55 +0200
committerRichard Levitte <levitte@openssl.org>2019-09-12 18:34:06 +0200
commite5d4233fbd07eac52227c7ec5f479a46f15914bf (patch)
treeb1721a511174bca38d434ea844baae1187e30d38 /crypto
parent14e275e8fb736be4ea83441b630515f7be97d06b (diff)
Deprecate ERR_get_state()
Internally, we still need this function, so we make it internal and then add a new ERR_get_state() that simply calls the internal variant, unless it's "removed" by configuration. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9462)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/err/err.c26
-rw-r--r--crypto/err/err_blocks.c6
-rw-r--r--crypto/err/err_locl.h2
3 files changed, 22 insertions, 12 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c
index 25426be730..51115fd00a 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -365,7 +365,7 @@ void ERR_clear_error(void)
int i;
ERR_STATE *es;
- es = ERR_get_state();
+ es = err_get_state_int();
if (es == NULL)
return;
@@ -488,7 +488,7 @@ static unsigned long get_error_values(int inc, int top, const char **file,
ERR_STATE *es;
unsigned long ret;
- es = ERR_get_state();
+ es = err_get_state_int();
if (es == NULL)
return 0;
@@ -685,7 +685,7 @@ DEFINE_RUN_ONCE_STATIC(err_do_init)
return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
}
-ERR_STATE *ERR_get_state(void)
+ERR_STATE *err_get_state_int(void)
{
ERR_STATE *state;
int saveerrno = get_last_sys_error();
@@ -724,6 +724,14 @@ ERR_STATE *ERR_get_state(void)
return state;
}
+#if !OPENSSL_API_3
+ERR_STATE *ERR_get_state(void)
+{
+ return err_get_state_int();
+}
+#endif
+
+
/*
* err_shelve_state returns the current thread local error state
* and freezes the error module until err_unshelve_state is called.
@@ -786,7 +794,7 @@ static int err_set_error_data_int(char *data, size_t size, int flags,
{
ERR_STATE *es;
- es = ERR_get_state();
+ es = err_get_state_int();
if (es == NULL)
return 0;
@@ -831,7 +839,7 @@ void ERR_add_error_vdata(int num, va_list args)
ERR_STATE *es;
/* Get the current error data; if an allocated string get it. */
- es = ERR_get_state();
+ es = err_get_state_int();
if (es == NULL)
return;
i = es->top;
@@ -886,7 +894,7 @@ int ERR_set_mark(void)
{
ERR_STATE *es;
- es = ERR_get_state();
+ es = err_get_state_int();
if (es == NULL)
return 0;
@@ -900,7 +908,7 @@ int ERR_pop_to_mark(void)
{
ERR_STATE *es;
- es = ERR_get_state();
+ es = err_get_state_int();
if (es == NULL)
return 0;
@@ -921,7 +929,7 @@ int ERR_clear_last_mark(void)
ERR_STATE *es;
int top;
- es = ERR_get_state();
+ es = err_get_state_int();
if (es == NULL)
return 0;
@@ -942,7 +950,7 @@ void err_clear_last_constant_time(int clear)
ERR_STATE *es;
int top;
- es = ERR_get_state();
+ es = err_get_state_int();
if (es == NULL)
return;
diff --git a/crypto/err/err_blocks.c b/crypto/err/err_blocks.c
index c2ff7c0823..e50f580b33 100644
--- a/crypto/err/err_blocks.c
+++ b/crypto/err/err_blocks.c
@@ -18,7 +18,7 @@ void ERR_new(void)
{
ERR_STATE *es;
- es = ERR_get_state();
+ es = err_get_state_int();
if (es == NULL)
return;
@@ -31,7 +31,7 @@ void ERR_set_debug(const char *file, int line, const char *func)
{
ERR_STATE *es;
- es = ERR_get_state();
+ es = err_get_state_int();
if (es == NULL)
return;
@@ -55,7 +55,7 @@ void ERR_vset_error(int lib, int reason, const char *fmt, va_list args)
unsigned long flags = 0;
size_t i;
- es = ERR_get_state();
+ es = err_get_state_int();
if (es == NULL)
return;
i = es->top;
diff --git a/crypto/err/err_locl.h b/crypto/err/err_locl.h
index d45a00e746..0374bf6a6f 100644
--- a/crypto/err/err_locl.h
+++ b/crypto/err/err_locl.h
@@ -66,3 +66,5 @@ static ossl_inline void err_clear(ERR_STATE *es, size_t i, int deall)
es->err_file[i] = NULL;
es->err_line[i] = -1;
}
+
+ERR_STATE *err_get_state_int(void);