From 7015be7e487c936fda9b4981ba162c0cc1b837de Mon Sep 17 00:00:00 2001 From: jsing <> Date: Tue, 7 Feb 2017 15:52:33 +0000 Subject: Revert previous; the implementation is incorrect since it assumes that the provided error code matches the error that is currently on the top of the error stack. --- src/lib/libcrypto/err/err.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'src/lib/libcrypto/err/err.c') diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index dcf725fd64..1b235c1653 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err.c,v 1.43 2017/02/07 03:11:11 beck Exp $ */ +/* $OpenBSD: err.c,v 1.44 2017/02/07 15:52:33 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -862,9 +862,8 @@ void ERR_error_string_n(unsigned long e, char *buf, size_t len) { char lsbuf[30], fsbuf[30], rsbuf[30]; - const char *ls, *fs, *rs, *file, *data; - int l, f, r, ret, line, flags; - + const char *ls, *fs, *rs; + int l, f, r, ret; l = ERR_GET_LIB(e); f = ERR_GET_FUNC(e); @@ -887,19 +886,7 @@ ERR_error_string_n(unsigned long e, char *buf, size_t len) rs = rsbuf; } - if (ERR_get_error_line_data(&file, &line, &data, &flags) != 0) { - const char *filename; - - if ((filename = strrchr(file, '/')) != NULL) - filename++; - else - filename = file; - - ret = snprintf(buf, len, "error:%08lX:%s:%s:%s:%s:%d", e, ls, - fs, rs, filename, line); - } else - ret = snprintf(buf, len, "error:%08lX:%s:%s:%s", e, ls, fs, rs); - + ret = snprintf(buf, len, "error:%08lX:%s:%s:%s", e, ls, fs, rs); if (ret == -1) return; /* can't happen, and can't do better if it does */ if (ret >= len) { -- cgit v1.2.3-55-g6feb