* [PATCH] sign-file: remove open coding of ERR_clear_error()
@ 2018-02-12 16:27 James Bottomley
0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2018-02-12 16:27 UTC (permalink / raw)
To: keyrings
drain_openssl_errors() is nothing more than an open coding of
ERR_clear_error(). Use the correct API everywhere.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
scripts/sign-file.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/scripts/sign-file.c b/scripts/sign-file.c
index 563419bc2837..49f1cf456254 100644
--- a/scripts/sign-file.c
+++ b/scripts/sign-file.c
@@ -92,16 +92,6 @@ static void display_openssl_errors(const char *f, int l)
}
}
-static void drain_openssl_errors(void)
-{
- const char *file;
- int line;
-
- if (ERR_peek_error() = 0)
- return;
- while (ERR_get_error_line(&file, &line)) {}
-}
-
#define ERR(cond, fmt, ...) \
do { \
bool __cond = (cond); \
@@ -140,11 +130,11 @@ static EVP_PKEY *read_private_key(const char *private_key_name)
ENGINE *e;
ENGINE_load_builtin_engines();
- drain_openssl_errors();
+ ERR_clear_error();
e = ENGINE_by_id("pkcs11");
ERR(!e, "Load PKCS#11 ENGINE");
if (ENGINE_init(e))
- drain_openssl_errors();
+ ERR_clear_error();
else
ERR(1, "ENGINE_init");
if (key_pass)
--
2.12.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] sign-file: remove open coding of ERR_clear_error()
@ 2018-07-03 16:12 James Bottomley
0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2018-07-03 16:12 UTC (permalink / raw)
To: keyrings
On Mon, 2018-02-12 at 08:27 -0800, James Bottomley wrote:
> drain_openssl_errors() is nothing more than an open coding of
> ERR_clear_error(). Use the correct API everywhere.
Ping on this ... it's a simple clean up and it's been four months.
James
> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com
> >
> ---
> scripts/sign-file.c | 14 ++------------
> 1 file changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/scripts/sign-file.c b/scripts/sign-file.c
> index 563419bc2837..49f1cf456254 100644
> --- a/scripts/sign-file.c
> +++ b/scripts/sign-file.c
> @@ -92,16 +92,6 @@ static void display_openssl_errors(const char *f,
> int l)
> }
> }
>
> -static void drain_openssl_errors(void)
> -{
> - const char *file;
> - int line;
> -
> - if (ERR_peek_error() = 0)
> - return;
> - while (ERR_get_error_line(&file, &line)) {}
> -}
> -
> #define ERR(cond, fmt, ...) \
> do { \
> bool __cond = (cond); \
> @@ -140,11 +130,11 @@ static EVP_PKEY *read_private_key(const char
> *private_key_name)
> ENGINE *e;
>
> ENGINE_load_builtin_engines();
> - drain_openssl_errors();
> + ERR_clear_error();
> e = ENGINE_by_id("pkcs11");
> ERR(!e, "Load PKCS#11 ENGINE");
> if (ENGINE_init(e))
> - drain_openssl_errors();
> + ERR_clear_error();
> else
> ERR(1, "ENGINE_init");
> if (key_pass)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-03 16:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-12 16:27 [PATCH] sign-file: remove open coding of ERR_clear_error() James Bottomley
-- strict thread matches above, loose matches on Subject: below --
2018-07-03 16:12 James Bottomley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.