1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 23:58:11 +00:00

LibCrypto: Change the signature of decode_pem to use Span.

This commit is contained in:
asynts 2020-07-27 15:20:27 +02:00 committed by Andreas Kling
parent 0d782e1dfb
commit 3de4e08b46
2 changed files with 5 additions and 4 deletions

View file

@ -26,12 +26,13 @@
#pragma once
#include <AK/Span.h>
#include <LibCrypto/ASN1/ASN1.h>
#include <LibCrypto/ASN1/DER.h>
namespace Crypto {
static ByteBuffer decode_pem(const ByteBuffer& data_in, size_t cert_index = 0)
static ByteBuffer decode_pem(ReadonlyBytes data_in, size_t cert_index = 0)
{
size_t i { 0 };
size_t start_at { 0 };
@ -61,7 +62,7 @@ static ByteBuffer decode_pem(const ByteBuffer& data_in, size_t cert_index = 0)
cert_index--;
start_at = 0;
} else {
idx = decode_b64(data_in.offset_pointer(start_at), end_idx - start_at, output);
idx = decode_b64(data_in.offset(start_at), end_idx - start_at, output);
break;
}
} else