mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-27 12:46:06 +00:00
LibCrypto: Return PEM type when decoding and sanity check footer
Improve PEM decoding by parsing the header and returning it along the data. Also verify if the header is equal to the footer.
This commit is contained in:
parent
0280838944
commit
57ecd72256
Notes:
github-actions[bot]
2024-11-30 10:18:56 +00:00
Author: https://github.com/devgianlu
Commit: 57ecd72256
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2648
4 changed files with 75 additions and 20 deletions
|
@ -266,7 +266,7 @@ void RSA::import_private_key(ReadonlyBytes bytes, bool pem)
|
|||
{
|
||||
ByteBuffer buffer;
|
||||
if (pem) {
|
||||
buffer = decode_pem(bytes);
|
||||
buffer = decode_pem(bytes).data;
|
||||
bytes = buffer;
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,7 @@ void RSA::import_public_key(ReadonlyBytes bytes, bool pem)
|
|||
{
|
||||
ByteBuffer buffer;
|
||||
if (pem) {
|
||||
buffer = decode_pem(bytes);
|
||||
buffer = decode_pem(bytes).data;
|
||||
bytes = buffer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue