summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2023-02-07 23:56:44 +0100
committerLinus Groh <mail@linusgroh.de>2023-02-08 18:50:53 +0000
commita6bcad551dfe5b4ace8592104b69accac5de6bc2 (patch)
treeae64c663dccb9a47176a0fa0c9a82d4fae5a584f
parentf5fb1396e82b64ffb97835d46c63d2496aca695c (diff)
downloadserenity-a6bcad551dfe5b4ace8592104b69accac5de6bc2.zip
LibCrypto: Use `AK::Stream` for pretty printing DER
-rw-r--r--Userland/Libraries/LibCrypto/ASN1/DER.cpp8
-rw-r--r--Userland/Libraries/LibCrypto/ASN1/DER.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibCrypto/ASN1/DER.cpp b/Userland/Libraries/LibCrypto/ASN1/DER.cpp
index 51683b6f29..c3d661fa8c 100644
--- a/Userland/Libraries/LibCrypto/ASN1/DER.cpp
+++ b/Userland/Libraries/LibCrypto/ASN1/DER.cpp
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
-#include <AK/DeprecatedStream.h>
+#include <AK/Stream.h>
#include <AK/Try.h>
#include <AK/Utf8View.h>
#include <LibCrypto/ASN1/DER.h>
@@ -224,7 +224,7 @@ ErrorOr<void> Decoder::leave()
return {};
}
-ErrorOr<void> pretty_print(Decoder& decoder, DeprecatedOutputStream& stream, int indent)
+ErrorOr<void> pretty_print(Decoder& decoder, AK::Stream& stream, int indent)
{
while (!decoder.eof()) {
auto tag = TRY(decoder.peek());
@@ -238,7 +238,7 @@ ErrorOr<void> pretty_print(Decoder& decoder, DeprecatedOutputStream& stream, int
TRY(decoder.enter());
builder.append('\n');
- stream.write(builder.string_view().bytes());
+ TRY(stream.write_entire_buffer(builder.string_view().bytes()));
TRY(pretty_print(decoder, stream, indent + 2));
@@ -314,7 +314,7 @@ ErrorOr<void> pretty_print(Decoder& decoder, DeprecatedOutputStream& stream, int
}
builder.append('\n');
- stream.write(builder.string_view().bytes());
+ TRY(stream.write_entire_buffer(builder.string_view().bytes()));
}
return {};
diff --git a/Userland/Libraries/LibCrypto/ASN1/DER.h b/Userland/Libraries/LibCrypto/ASN1/DER.h
index ee25bae929..e899c34237 100644
--- a/Userland/Libraries/LibCrypto/ASN1/DER.h
+++ b/Userland/Libraries/LibCrypto/ASN1/DER.h
@@ -214,6 +214,6 @@ private:
Optional<Tag> m_current_tag;
};
-ErrorOr<void> pretty_print(Decoder&, DeprecatedOutputStream&, int indent = 0);
+ErrorOr<void> pretty_print(Decoder&, AK::Stream&, int indent = 0);
}