tree-wide: Beef up openssl logging

Let's translate openssl's errors to proper errnos 
where we can instead of returning EIO for everything.
Let's also make log_openssl_errors() public so we can
use it everywhere and migrate the rest of the codebase
to use it.
This commit is contained in:
Daan De Meyer
2026-06-22 11:40:57 +02:00
committed by Lennart Poettering
parent d5d3fbce10
commit 6b158b72f5
16 changed files with 394 additions and 352 deletions
+3 -1
View File
@@ -93,7 +93,9 @@ TEST(invalid) {
_cleanup_(EVP_PKEY_freep) EVP_PKEY *pkey = NULL;
DEFINE_HEX_PTR(key, "2d2d2d2d2d424547494e205055424c4943204b45592d2d2d2d2d0a4d466b7b");
assert_se(openssl_pubkey_from_pem(key, key_len, &pkey) == -EIO);
/* OpenSSL's decoder reports ERR_R_UNSUPPORTED for this garbage, which openssl_to_errno() maps
* to -EOPNOTSUPP. */
ASSERT_ERROR(openssl_pubkey_from_pem(key, key_len, &pkey), EOPNOTSUPP);
ASSERT_NULL(pkey);
}