mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 01:26:22 +00:00
LibWeb+LibCrypto: Remove OID constants scattered around
Now that `Certificate` has been moved, the OID constants are easily reachable in `LibCrypto`.
This commit is contained in:
parent
49c388b891
commit
506e490793
Notes:
github-actions[bot]
2024-11-25 13:12:06 +00:00
Author: https://github.com/devgianlu
Commit: 506e490793
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2563
Reviewed-by: https://github.com/alimpfard ✅
2 changed files with 6 additions and 11 deletions
|
@ -10,12 +10,11 @@
|
|||
#include <LibCrypto/ASN1/ASN1.h>
|
||||
#include <LibCrypto/ASN1/DER.h>
|
||||
#include <LibCrypto/ASN1/PEM.h>
|
||||
#include <LibCrypto/Certificate/Certificate.h>
|
||||
#include <LibCrypto/PK/RSA.h>
|
||||
|
||||
namespace Crypto::PK {
|
||||
|
||||
static constexpr Array<int, 7> pkcs8_rsa_key_oid { 1, 2, 840, 113549, 1, 1, 1 };
|
||||
|
||||
RSA::KeyPairType RSA::parse_rsa_key(ReadonlyBytes der)
|
||||
{
|
||||
// we are going to assign to at least one of these
|
||||
|
@ -96,7 +95,7 @@ RSA::KeyPairType RSA::parse_rsa_key(ReadonlyBytes der)
|
|||
|
||||
auto oid = oid_result.release_value();
|
||||
// Now let's check that the OID matches "RSA key"
|
||||
if (oid != pkcs8_rsa_key_oid) {
|
||||
if (oid != Crypto::Certificate::rsa_encryption_oid) {
|
||||
// Oh well. not an RSA key at all.
|
||||
dbgln_if(RSA_PARSE_DEBUG, "RSA PKCS#8 public key parse failed: Not an RSA key");
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue