|
@@ -1110,8 +1110,7 @@ WebIDL::ExceptionOr<GC::Ref<JS::Object>> RSAOAEP::export_key(Bindings::KeyFormat
|
|
// that represents the RSA public key represented by the [[handle]] internal slot of key
|
|
// that represents the RSA public key represented by the [[handle]] internal slot of key
|
|
auto maybe_data = handle.visit(
|
|
auto maybe_data = handle.visit(
|
|
[&](::Crypto::PK::RSAPublicKey<> const& public_key) -> ErrorOr<ByteBuffer> {
|
|
[&](::Crypto::PK::RSAPublicKey<> const& public_key) -> ErrorOr<ByteBuffer> {
|
|
- auto rsa_encryption_oid = Array<int, 7> { 1, 2, 840, 113549, 1, 1, 1 };
|
|
|
|
- return TRY(::Crypto::PK::wrap_in_subject_public_key_info(public_key, rsa_encryption_oid));
|
|
|
|
|
|
+ return TRY(::Crypto::PK::wrap_in_subject_public_key_info(public_key, Array { ::Crypto::Certificate::rsa_encryption_oid }));
|
|
},
|
|
},
|
|
[](auto) -> ErrorOr<ByteBuffer> {
|
|
[](auto) -> ErrorOr<ByteBuffer> {
|
|
VERIFY_NOT_REACHED();
|
|
VERIFY_NOT_REACHED();
|
|
@@ -1138,8 +1137,7 @@ WebIDL::ExceptionOr<GC::Ref<JS::Object>> RSAOAEP::export_key(Bindings::KeyFormat
|
|
// that represents the RSA private key represented by the [[handle]] internal slot of key
|
|
// that represents the RSA private key represented by the [[handle]] internal slot of key
|
|
auto maybe_data = handle.visit(
|
|
auto maybe_data = handle.visit(
|
|
[&](::Crypto::PK::RSAPrivateKey<> const& private_key) -> ErrorOr<ByteBuffer> {
|
|
[&](::Crypto::PK::RSAPrivateKey<> const& private_key) -> ErrorOr<ByteBuffer> {
|
|
- auto rsa_encryption_oid = Array<int, 7> { 1, 2, 840, 113549, 1, 1, 1 };
|
|
|
|
- return TRY(::Crypto::PK::wrap_in_private_key_info(private_key, rsa_encryption_oid));
|
|
|
|
|
|
+ return TRY(::Crypto::PK::wrap_in_private_key_info(private_key, Array { ::Crypto::Certificate::rsa_encryption_oid }));
|
|
},
|
|
},
|
|
[](auto) -> ErrorOr<ByteBuffer> {
|
|
[](auto) -> ErrorOr<ByteBuffer> {
|
|
VERIFY_NOT_REACHED();
|
|
VERIFY_NOT_REACHED();
|
|
@@ -3659,8 +3657,7 @@ WebIDL::ExceptionOr<GC::Ref<JS::Object>> X25519::export_key(Bindings::KeyFormat
|
|
// Set the algorithm object identifier to the id-X25519 OID defined in [RFC8410].
|
|
// Set the algorithm object identifier to the id-X25519 OID defined in [RFC8410].
|
|
// Set the subjectPublicKey field to keyData.
|
|
// Set the subjectPublicKey field to keyData.
|
|
auto public_key = handle.get<ByteBuffer>();
|
|
auto public_key = handle.get<ByteBuffer>();
|
|
- auto x25519_oid = Array<int, 7> { 1, 3, 101, 110 };
|
|
|
|
- auto data = TRY_OR_THROW_OOM(vm, ::Crypto::PK::wrap_in_subject_public_key_info(public_key, x25519_oid));
|
|
|
|
|
|
+ auto data = TRY_OR_THROW_OOM(vm, ::Crypto::PK::wrap_in_subject_public_key_info(public_key, Array { ::Crypto::Certificate::x25519_oid }));
|
|
|
|
|
|
// 3. Let result be a new ArrayBuffer associated with the relevant global object of this [HTML], and containing data.
|
|
// 3. Let result be a new ArrayBuffer associated with the relevant global object of this [HTML], and containing data.
|
|
result = JS::ArrayBuffer::create(m_realm, data);
|
|
result = JS::ArrayBuffer::create(m_realm, data);
|
|
@@ -3679,8 +3676,7 @@ WebIDL::ExceptionOr<GC::Ref<JS::Object>> X25519::export_key(Bindings::KeyFormat
|
|
// Set the privateKey field to the result of DER-encoding a CurvePrivateKey ASN.1 type, as defined in Section 7 of [RFC8410],
|
|
// Set the privateKey field to the result of DER-encoding a CurvePrivateKey ASN.1 type, as defined in Section 7 of [RFC8410],
|
|
// that represents the X25519 private key represented by the [[handle]] internal slot of key
|
|
// that represents the X25519 private key represented by the [[handle]] internal slot of key
|
|
auto private_key = handle.get<ByteBuffer>();
|
|
auto private_key = handle.get<ByteBuffer>();
|
|
- auto x25519_oid = Array<int, 7> { 1, 3, 101, 110 };
|
|
|
|
- auto data = TRY_OR_THROW_OOM(vm, ::Crypto::PK::wrap_in_private_key_info(private_key, x25519_oid));
|
|
|
|
|
|
+ auto data = TRY_OR_THROW_OOM(vm, ::Crypto::PK::wrap_in_private_key_info(private_key, Array { ::Crypto::Certificate::x25519_oid }));
|
|
|
|
|
|
// 3. Let result be a new ArrayBuffer associated with the relevant global object of this [HTML], and containing data.
|
|
// 3. Let result be a new ArrayBuffer associated with the relevant global object of this [HTML], and containing data.
|
|
result = JS::ArrayBuffer::create(m_realm, data);
|
|
result = JS::ArrayBuffer::create(m_realm, data);
|