mirror of
https://github.com/oven-sh/bun
synced 2026-02-18 23:01:58 +00:00
Add a few passing tests for node:crypto (#17987)
This commit is contained in:
@@ -1010,8 +1010,11 @@ JSC::EncodedJSValue CRYPTO_INVALID_CURVE(JSC::ThrowScope& throwScope, JSC::JSGlo
|
||||
|
||||
JSC::EncodedJSValue CRYPTO_JWK_UNSUPPORTED_CURVE(JSC::ThrowScope& throwScope, JSC::JSGlobalObject* globalObject, const WTF::String& curve)
|
||||
{
|
||||
auto message = makeString("Unsupported JWK EC curve: "_s, curve);
|
||||
throwScope.throwException(globalObject, createError(globalObject, ErrorCode::ERR_CRYPTO_JWK_UNSUPPORTED_CURVE, message));
|
||||
WTF::StringBuilder builder;
|
||||
builder.append("Unsupported JWK EC curve: "_s);
|
||||
builder.append(curve);
|
||||
builder.append('.');
|
||||
throwScope.throwException(globalObject, createError(globalObject, ErrorCode::ERR_CRYPTO_JWK_UNSUPPORTED_CURVE, builder.toString()));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -1072,6 +1075,13 @@ JSC::EncodedJSValue CRYPTO_HASH_UPDATE_FAILED(JSC::ThrowScope& throwScope, JSC::
|
||||
return {};
|
||||
}
|
||||
|
||||
JSC::EncodedJSValue CRYPTO_TIMING_SAFE_EQUAL_LENGTH(JSC::ThrowScope& scope, JSC::JSGlobalObject* globalObject)
|
||||
{
|
||||
auto message = "Input buffers must have the same byte length"_s;
|
||||
scope.throwException(globalObject, createError(globalObject, ErrorCode::ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH, message));
|
||||
return {};
|
||||
}
|
||||
|
||||
JSC::EncodedJSValue MISSING_PASSPHRASE(JSC::ThrowScope& throwScope, JSC::JSGlobalObject* globalObject, WTF::ASCIILiteral message)
|
||||
{
|
||||
throwScope.throwException(globalObject, createError(globalObject, ErrorCode::ERR_MISSING_PASSPHRASE, message));
|
||||
|
||||
Reference in New Issue
Block a user