summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCrypto
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-01-20 17:18:17 +0000
committerAndreas Kling <kling@serenityos.org>2022-01-24 22:36:09 +0100
commitc388a879d73633b6ebe8353fd2a0407b908fe26f (patch)
tree3a09d39c87751105ace98936c8c210c57eee2fe8 /Userland/Libraries/LibCrypto
parentf590cd1850027399ab7f0193ba97fa76b3a9cbab (diff)
downloadserenity-c388a879d73633b6ebe8353fd2a0407b908fe26f.zip
AK+Userland: Make AK::decode_base64 return ErrorOr
Diffstat (limited to 'Userland/Libraries/LibCrypto')
-rw-r--r--Userland/Libraries/LibCrypto/ASN1/PEM.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibCrypto/ASN1/PEM.cpp b/Userland/Libraries/LibCrypto/ASN1/PEM.cpp
index 90f957cfc9..a23bed08bf 100644
--- a/Userland/Libraries/LibCrypto/ASN1/PEM.cpp
+++ b/Userland/Libraries/LibCrypto/ASN1/PEM.cpp
@@ -35,8 +35,8 @@ ByteBuffer decode_pem(ReadonlyBytes data)
break;
}
auto b64decoded = decode_base64(lexer.consume_line().trim_whitespace(TrimMode::Right));
- if (!b64decoded.has_value()) {
- dbgln("Failed to decode PEM, likely bad Base64");
+ if (b64decoded.is_error()) {
+ dbgln("Failed to decode PEM: {}", b64decoded.error().string_literal());
return {};
}
if (decoded.try_append(b64decoded.value().data(), b64decoded.value().size()).is_error()) {