From d1842bc81aa5c77f8ce16ab090f92b937f8f4bb1 Mon Sep 17 00:00:00 2001 From: Viola Date: Wed, 10 Jul 2024 00:21:45 +0800 Subject: [PATCH] Add else clause in case of openssl sign failure #549 In some distro (like RHELs), SHA-1 has been disabled by default. To avoid that a NULL is returned and nothing happens, this else clause is added to log the error. --- application/controllers/Lotw.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index d43e4e5da..a18cd7110 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -1001,6 +1001,9 @@ class Lotw extends CI_Controller { } $signature_b64 = base64_encode($signature); return $signature_b64."\n"; + } else { + // in case of deprecation of SHA-1 in some distro + log_message('error', openssl_error_string()); } } else { log_message('error', 'Error signing LoTW log.');