Skip to content

Commit 1cb4aad

Browse files
committed
fixup! src,crypto: add NativeCryptoKey
Signed-off-by: Filip Skokan <[email protected]>
1 parent 4a0dbab commit 1cb4aad

2 files changed

Lines changed: 1 addition & 19 deletions

File tree

src/crypto/crypto_keys.cc

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,18 +1793,13 @@ void NativeCryptoKey::Initialize(Environment* env, Local<Object> target) {
17931793
target,
17941794
"createCryptoKeyClass",
17951795
NativeCryptoKey::CreateCryptoKeyClass);
1796-
SetMethod(env->context(),
1797-
target,
1798-
"getCryptoKeyHandle",
1799-
NativeCryptoKey::GetKeyHandle);
18001796
SetMethod(
18011797
env->context(), target, "getCryptoKeySlots", NativeCryptoKey::GetSlots);
18021798
}
18031799

18041800
void NativeCryptoKey::RegisterExternalReferences(
18051801
ExternalReferenceRegistry* registry) {
18061802
registry->Register(NativeCryptoKey::CreateCryptoKeyClass);
1807-
registry->Register(NativeCryptoKey::GetKeyHandle);
18081803
registry->Register(NativeCryptoKey::GetSlots);
18091804
registry->Register(NativeCryptoKey::New);
18101805
}
@@ -1900,18 +1895,6 @@ void NativeCryptoKey::CreateCryptoKeyClass(
19001895
args.GetReturnValue().Set(ret);
19011896
}
19021897

1903-
void NativeCryptoKey::GetKeyHandle(const FunctionCallbackInfo<Value>& args) {
1904-
Environment* env = Environment::GetCurrent(args);
1905-
CHECK_EQ(args.Length(), 1);
1906-
CHECK(HasInstance(args[0]));
1907-
NativeCryptoKey* native = Unwrap<NativeCryptoKey>(args[0].As<Object>());
1908-
Local<Object> handle;
1909-
if (!KeyObjectHandle::Create(env, native->handle_data_).ToLocal(&handle)) {
1910-
return;
1911-
}
1912-
args.GetReturnValue().Set(handle);
1913-
}
1914-
19151898
// Returns all of the key's internal slot values as a single Array:
19161899
// [type, extractable, algorithm, usages, handle]. JS-side helpers
19171900
// call this once per key to prime a per-instance cache, so subsequent

src/crypto/crypto_keys.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,9 @@ class NativeCryptoKey : public BaseObject {
258258

259259
// True if `value` is a real NativeCryptoKey instance. Checks the
260260
// kClassTagField internal field.
261-
// Used by `GetSlots` / `GetKeyHandle` to validate their receiver.
261+
// Used by `GetSlots` to validate its receiver.
262262
static bool HasInstance(v8::Local<v8::Value> value);
263263

264-
static void GetKeyHandle(const v8::FunctionCallbackInfo<v8::Value>& args);
265264
// Returns [type, extractable, algorithm, usages, handle] in one call
266265
// so JS can prime a per-instance cache on first access.
267266
static void GetSlots(const v8::FunctionCallbackInfo<v8::Value>& args);

0 commit comments

Comments
 (0)