diff options
author | Richard Levitte <levitte@openssl.org> | 2020-11-20 22:13:11 +0100 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-11-28 15:28:46 +1000 |
commit | af2f14ace581d30b186429cb3f9f5d14c0b5b4ec (patch) | |
tree | 7b2fc7268982869c2505d331f96568c96d8d3113 /include | |
parent | b8fa02e8a4a4a9c274aafdb4fc834ba051301afb (diff) |
ERR: Drop or deprecate dangerous or overly confusing functions
ERR_get_error_line() is deprecated, and ERR_get_error_func() and
ERR_get_error_data() are removed in favor of ERR_get_error_all(),
since they pop the error record, leaving the caller with only partial
error record data and no way to get the rest if the wish.
If it's desirable to retrieve data piecemeal, the caller should
consider using the diverse ERR_peek functions and finish off with
ERR_get_error().
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13466)
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/err.h.in | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/include/openssl/err.h.in b/include/openssl/err.h.in index c36fe7d1ed..6fd749acd0 100644 --- a/include/openssl/err.h.in +++ b/include/openssl/err.h.in @@ -392,23 +392,16 @@ void ERR_vset_error(int lib, int reason, const char *fmt, va_list args); void ERR_set_error_data(char *data, int flags); unsigned long ERR_get_error(void); -/* - * TODO(3.0) consider if the following three functions should be deprecated. - * They all drop the error record from the error queue, so regardless of which - * one is used, the rest of the information is lost, making them not so useful. - * The recommendation should be to use the peek functions to extract all the - * additional data. - */ -unsigned long ERR_get_error_line(const char **file, int *line); -unsigned long ERR_get_error_func(const char **func); -unsigned long ERR_get_error_data(const char **data, int *flags); unsigned long ERR_get_error_all(const char **file, int *line, const char **func, const char **data, int *flags); -DEPRECATEDIN_3_0(unsigned long ERR_get_error_line_data(const char **file, - int *line, - const char **data, - int *flags)) +# ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +unsigned long ERR_get_error_line(const char **file, int *line); +OSSL_DEPRECATEDIN_3_0 +unsigned long ERR_get_error_line_data(const char **file, int *line, + const char **data, int *flags); +#endif unsigned long ERR_peek_error(void); unsigned long ERR_peek_error_line(const char **file, int *line); unsigned long ERR_peek_error_func(const char **func); @@ -416,10 +409,11 @@ unsigned long ERR_peek_error_data(const char **data, int *flags); unsigned long ERR_peek_error_all(const char **file, int *line, const char **func, const char **data, int *flags); -DEPRECATEDIN_3_0(unsigned long ERR_peek_error_line_data(const char **file, - int *line, - const char **data, - int *flags)) +# ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +unsigned long ERR_peek_error_line_data(const char **file, int *line, + const char **data, int *flags); +# endif unsigned long ERR_peek_last_error(void); unsigned long ERR_peek_last_error_line(const char **file, int *line); unsigned long ERR_peek_last_error_func(const char **func); @@ -427,10 +421,11 @@ unsigned long ERR_peek_last_error_data(const char **data, int *flags); unsigned long ERR_peek_last_error_all(const char **file, int *line, const char **func, const char **data, int *flags); -DEPRECATEDIN_3_0(unsigned long ERR_peek_last_error_line_data(const char **file, - int *line, - const char **data, - int *flags)) +# ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +unsigned long ERR_peek_last_error_line_data(const char **file, int *line, + const char **data, int *flags); +# endif void ERR_clear_error(void); |