diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/err/err.c | 19 | ||||
| -rw-r--r-- | src/lib/libcrypto/err/err.h | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/ERR_asprintf_error_data.3 | 55 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/ERR_put_error.3 | 14 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 |
5 files changed, 81 insertions, 14 deletions
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index 1b235c1653..ffe25bf465 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: err.c,v 1.44 2017/02/07 15:52:33 jsing Exp $ */ | 1 | /* $OpenBSD: err.c,v 1.45 2017/02/20 23:21:19 beck Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -1092,14 +1092,6 @@ ERR_asprintf_error_data(char * format, ...) { | |||
| 1092 | else | 1092 | else |
| 1093 | ERR_set_error_data(errbuf, ERR_TXT_MALLOCED|ERR_TXT_STRING); | 1093 | ERR_set_error_data(errbuf, ERR_TXT_MALLOCED|ERR_TXT_STRING); |
| 1094 | } | 1094 | } |
| 1095 | void | ||
| 1096 | ERR_add_error_data(int num, ...) | ||
| 1097 | { | ||
| 1098 | va_list args; | ||
| 1099 | va_start(args, num); | ||
| 1100 | ERR_add_error_vdata(num, args); | ||
| 1101 | va_end(args); | ||
| 1102 | } | ||
| 1103 | 1095 | ||
| 1104 | void | 1096 | void |
| 1105 | ERR_add_error_vdata(int num, va_list args) | 1097 | ERR_add_error_vdata(int num, va_list args) |
| @@ -1121,6 +1113,15 @@ ERR_add_error_vdata(int num, va_list args) | |||
| 1121 | ERR_set_error_data(errbuf, ERR_TXT_MALLOCED|ERR_TXT_STRING); | 1113 | ERR_set_error_data(errbuf, ERR_TXT_MALLOCED|ERR_TXT_STRING); |
| 1122 | } | 1114 | } |
| 1123 | 1115 | ||
| 1116 | void | ||
| 1117 | ERR_add_error_data(int num, ...) | ||
| 1118 | { | ||
| 1119 | va_list args; | ||
| 1120 | va_start(args, num); | ||
| 1121 | ERR_add_error_vdata(num, args); | ||
| 1122 | va_end(args); | ||
| 1123 | } | ||
| 1124 | |||
| 1124 | int | 1125 | int |
| 1125 | ERR_set_mark(void) | 1126 | ERR_set_mark(void) |
| 1126 | { | 1127 | { |
diff --git a/src/lib/libcrypto/err/err.h b/src/lib/libcrypto/err/err.h index 672dead06b..22cdb2987f 100644 --- a/src/lib/libcrypto/err/err.h +++ b/src/lib/libcrypto/err/err.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: err.h,v 1.24 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: err.h,v 1.25 2017/02/20 23:21:19 beck Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -378,8 +378,10 @@ void ERR_print_errors_fp(FILE *fp); | |||
| 378 | void ERR_print_errors(BIO *bp); | 378 | void ERR_print_errors(BIO *bp); |
| 379 | #endif | 379 | #endif |
| 380 | void ERR_asprintf_error_data(char * format, ...); | 380 | void ERR_asprintf_error_data(char * format, ...); |
| 381 | #ifndef LIBRESSL_INTERNAL | ||
| 381 | void ERR_add_error_data(int num, ...); | 382 | void ERR_add_error_data(int num, ...); |
| 382 | void ERR_add_error_vdata(int num, va_list args); | 383 | void ERR_add_error_vdata(int num, va_list args); |
| 384 | #endif | ||
| 383 | void ERR_load_strings(int lib, ERR_STRING_DATA str[]); | 385 | void ERR_load_strings(int lib, ERR_STRING_DATA str[]); |
| 384 | void ERR_unload_strings(int lib, ERR_STRING_DATA str[]); | 386 | void ERR_unload_strings(int lib, ERR_STRING_DATA str[]); |
| 385 | void ERR_load_ERR_strings(void); | 387 | void ERR_load_ERR_strings(void); |
diff --git a/src/lib/libcrypto/man/ERR_asprintf_error_data.3 b/src/lib/libcrypto/man/ERR_asprintf_error_data.3 new file mode 100644 index 0000000000..6481da4750 --- /dev/null +++ b/src/lib/libcrypto/man/ERR_asprintf_error_data.3 | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | .\" $OpenBSD: ERR_asprintf_error_data.3,v 1.1 2017/02/20 23:21:19 beck Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 2017 Bob Beck <beck@openbsd.org> | ||
| 4 | .\" | ||
| 5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 7 | .\" copyright notice and this permission notice appear in all copies. | ||
| 8 | .\" | ||
| 9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | .Dd $Mdocdate: February 20 2017 $ | ||
| 17 | .Dt ERR_ASPRINTF_ERROR_DATA 3 | ||
| 18 | .Os | ||
| 19 | .Sh NAME | ||
| 20 | .Nm ERR_asprintf_error_data | ||
| 21 | .Nd record a LibreSSL error using a formatted string. | ||
| 22 | .Sh SYNOPSIS | ||
| 23 | .In openssl/err.h | ||
| 24 | .Ft void | ||
| 25 | .Fo ERR_asprintf_error_data | ||
| 26 | .Fa "char * format" | ||
| 27 | .Fa ... | ||
| 28 | .Fc | ||
| 29 | .Sh DESCRIPTION | ||
| 30 | .Nm | ||
| 31 | builds a string using | ||
| 32 | .Xr asprintf 3 | ||
| 33 | called with the provided | ||
| 34 | .Ar format | ||
| 35 | and arguments. | ||
| 36 | The resulting string is then associated with the error code that was most | ||
| 37 | recently added. | ||
| 38 | If | ||
| 39 | .Xr asprintf 3 | ||
| 40 | fails, the string "malloc failed" is associated instead. | ||
| 41 | .Pp | ||
| 42 | .Nm | ||
| 43 | is intended to be used instead of the OpenSSL functions | ||
| 44 | .Xr ERR_add_error_data 3 | ||
| 45 | and | ||
| 46 | .Xr ERR_add_error_vdata 3 . | ||
| 47 | .Sh SEE ALSO | ||
| 48 | .Xr ERR 3 , | ||
| 49 | .Xr ERR_put_error 3 , | ||
| 50 | .Xr printf 3 | ||
| 51 | .Sh HISTORY | ||
| 52 | .Nm | ||
| 53 | appeared in | ||
| 54 | .Ox 5.6 | ||
| 55 | and is available in all versions of LibreSSL. | ||
diff --git a/src/lib/libcrypto/man/ERR_put_error.3 b/src/lib/libcrypto/man/ERR_put_error.3 index 2b41bedea3..3011e16df4 100644 --- a/src/lib/libcrypto/man/ERR_put_error.3 +++ b/src/lib/libcrypto/man/ERR_put_error.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: ERR_put_error.3,v 1.4 2016/11/23 17:54:15 schwarze Exp $ | 1 | .\" $OpenBSD: ERR_put_error.3,v 1.5 2017/02/20 23:21:19 beck Exp $ |
| 2 | .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 | 2 | .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org>. | 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org>. |
| @@ -48,12 +48,13 @@ | |||
| 48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 50 | .\" | 50 | .\" |
| 51 | .Dd $Mdocdate: November 23 2016 $ | 51 | .Dd $Mdocdate: February 20 2017 $ |
| 52 | .Dt ERR_PUT_ERROR 3 | 52 | .Dt ERR_PUT_ERROR 3 |
| 53 | .Os | 53 | .Os |
| 54 | .Sh NAME | 54 | .Sh NAME |
| 55 | .Nm ERR_put_error , | 55 | .Nm ERR_put_error , |
| 56 | .Nm ERR_add_error_data | 56 | .Nm ERR_add_error_data , |
| 57 | .Nm ERR_add_error_vdata | ||
| 57 | .Nd record an OpenSSL error | 58 | .Nd record an OpenSSL error |
| 58 | .Sh SYNOPSIS | 59 | .Sh SYNOPSIS |
| 59 | .In openssl/err.h | 60 | .In openssl/err.h |
| @@ -97,6 +98,12 @@ string arguments with the error code added last. | |||
| 97 | .Fn ERR_add_error_vdata | 98 | .Fn ERR_add_error_vdata |
| 98 | is similar except the argument is a | 99 | is similar except the argument is a |
| 99 | .Vt va_list . | 100 | .Vt va_list . |
| 101 | Use of | ||
| 102 | .Fn ERR_add_error_data | ||
| 103 | and | ||
| 104 | .Fn ERR_add_error_vdata | ||
| 105 | is deprecated inside of LibreSSL in favour of | ||
| 106 | .Xr ERR_asprintf_error_data 3 . | ||
| 100 | .Pp | 107 | .Pp |
| 101 | .Xr ERR_load_strings 3 | 108 | .Xr ERR_load_strings 3 |
| 102 | can be used to register error strings so that the application can | 109 | can be used to register error strings so that the application can |
| @@ -136,6 +143,7 @@ which must use the | |||
| 136 | macro. | 143 | macro. |
| 137 | .Sh SEE ALSO | 144 | .Sh SEE ALSO |
| 138 | .Xr ERR 3 , | 145 | .Xr ERR 3 , |
| 146 | .Xr ERR_asprintf_error_data 3 , | ||
| 139 | .Xr ERR_load_strings 3 | 147 | .Xr ERR_load_strings 3 |
| 140 | .Sh HISTORY | 148 | .Sh HISTORY |
| 141 | .Fn ERR_put_error | 149 | .Fn ERR_put_error |
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 9a64837d31..75239dc387 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.114 2017/01/31 05:40:26 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.115 2017/02/20 23:21:19 beck Exp $ |
| 2 | 2 | ||
| 3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
| 4 | 4 | ||
| @@ -92,6 +92,7 @@ MAN= \ | |||
| 92 | EC_POINT_new.3 \ | 92 | EC_POINT_new.3 \ |
| 93 | ERR.3 \ | 93 | ERR.3 \ |
| 94 | ERR_GET_LIB.3 \ | 94 | ERR_GET_LIB.3 \ |
| 95 | ERR_asprintf_error_data.3 \ | ||
| 95 | ERR_clear_error.3 \ | 96 | ERR_clear_error.3 \ |
| 96 | ERR_error_string.3 \ | 97 | ERR_error_string.3 \ |
| 97 | ERR_get_error.3 \ | 98 | ERR_get_error.3 \ |
