All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: keyrings@vger.kernel.org
Subject: [PATCH v2 2/4] sign-file: remove open coding of ERR_clear_error()
Date: Mon, 22 Oct 2018 10:45:52 +0000	[thread overview]
Message-ID: <1540205152.2815.9.camel@HansenPartnership.com> (raw)

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.16.4

             reply	other threads:[~2018-10-22 10:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22 10:45 James Bottomley [this message]
2018-10-22 11:34 ` [PATCH v2 2/4] sign-file: remove open coding of ERR_clear_error() David Woodhouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1540205152.2815.9.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=keyrings@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.