mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:48:11 +00:00
LibCrypto: Change the signature of decode_pem to use Span.
This commit is contained in:
parent
0d782e1dfb
commit
3de4e08b46
2 changed files with 5 additions and 4 deletions
|
@ -166,7 +166,7 @@ void RSA::verify(const ByteBuffer& in, ByteBuffer& out)
|
|||
void RSA::import_private_key(const ByteBuffer& buffer, bool pem)
|
||||
{
|
||||
// so gods help me, I hate DER
|
||||
auto decoded_buffer = pem ? decode_pem(buffer) : buffer;
|
||||
auto decoded_buffer = pem ? decode_pem(buffer.span()) : buffer;
|
||||
auto key = parse_rsa_key(decoded_buffer.span());
|
||||
if (!key.private_key.length()) {
|
||||
dbg() << "We expected to see a private key, but we found none";
|
||||
|
@ -178,7 +178,7 @@ void RSA::import_private_key(const ByteBuffer& buffer, bool pem)
|
|||
void RSA::import_public_key(const ByteBuffer& buffer, bool pem)
|
||||
{
|
||||
// so gods help me, I hate DER
|
||||
auto decoded_buffer = pem ? decode_pem(buffer) : buffer;
|
||||
auto decoded_buffer = pem ? decode_pem(buffer.span()) : buffer;
|
||||
auto key = parse_rsa_key(decoded_buffer.span());
|
||||
if (!key.public_key.length()) {
|
||||
dbg() << "We expected to see a public key, but we found none";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue