Skip to contentSkip to conversation

sign-file: remove open coding of ERR_clear_error()

PATCH James Bottomley 1 participant 1 message Jul 3, 2018 Keys/keyrings

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines · James Bottomley

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

Quoted 43 lines
Quoted 1 line

---
 scripts/sign-file.c | 14 ++------------

 1 file changed, 2 insertions(+), 12 deletions(-)
scripts/sign-file.c +0 -0
index 563419bc2837..49f1cf456254 100644
@@ -92,16 +92,6 @@ static void display_openssl_errors(const char *f,
 int l)
  	}
  }

scripts/sign-file.c +0 -10
-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); \

scripts/sign-file.c +0 -0
@@ -140,11 +130,11 @@ static EVP_PKEY *read_private_key(const char
 *private_key_name)
  		ENGINE *e;


  ENGINE_load_builtin_engines();

scripts/sign-file.c +1 -1
-		drain_openssl_errors();
+		ERR_clear_error();

  e = ENGINE_by_id("pkcs11");
  ERR(!e, "Load PKCS#11 ENGINE");
  if (ENGINE_init(e))

scripts/sign-file.c +1 -1
-			drain_openssl_errors();
+			ERR_clear_error();

  else
  ERR(1, "ENGINE_init");
  if (key_pass)