@@ -23,7 +23,7 @@ using v8::FunctionCallbackInfo;
2323using v8::FunctionTemplate;
2424using v8::Int32;
2525using v8::Isolate;
26- using v8::Just ;
26+ using v8::JustVoid ;
2727using v8::Local;
2828using v8::Maybe;
2929using v8::MaybeLocal;
@@ -338,7 +338,7 @@ void Check(const FunctionCallbackInfo<Value>& args) {
338338// * Private type
339339// * Cipher
340340// * Passphrase
341- Maybe<bool > DhKeyGenTraits::AdditionalConfig (
341+ Maybe<void > DhKeyGenTraits::AdditionalConfig (
342342 CryptoJobMode mode,
343343 const FunctionCallbackInfo<Value>& args,
344344 unsigned int * offset,
@@ -350,7 +350,7 @@ Maybe<bool> DhKeyGenTraits::AdditionalConfig(
350350 auto group = DHPointer::FindGroup (group_name.ToStringView ());
351351 if (!group) {
352352 THROW_ERR_CRYPTO_UNKNOWN_DH_GROUP (env);
353- return Nothing<bool >();
353+ return Nothing<void >();
354354 }
355355
356356 static constexpr int kStandardizedGenerator = 2 ;
@@ -363,14 +363,14 @@ Maybe<bool> DhKeyGenTraits::AdditionalConfig(
363363 int size = args[*offset].As <Int32>()->Value ();
364364 if (size < 0 ) {
365365 THROW_ERR_OUT_OF_RANGE (env, " Invalid prime size" );
366- return Nothing<bool >();
366+ return Nothing<void >();
367367 }
368368 params->params .prime = size;
369369 } else {
370370 ArrayBufferOrViewContents<unsigned char > input (args[*offset]);
371371 if (UNLIKELY (!input.CheckSizeInt32 ())) {
372372 THROW_ERR_OUT_OF_RANGE (env, " prime is too big" );
373- return Nothing<bool >();
373+ return Nothing<void >();
374374 }
375375 params->params .prime = BignumPointer (input.data (), input.size ());
376376 }
@@ -380,7 +380,7 @@ Maybe<bool> DhKeyGenTraits::AdditionalConfig(
380380 *offset += 2 ;
381381 }
382382
383- return Just ( true );
383+ return JustVoid ( );
384384}
385385
386386EVPKeyCtxPointer DhKeyGenTraits::Setup (DhKeyPairGenConfig* params) {
@@ -424,11 +424,11 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) {
424424 return ctx;
425425}
426426
427- Maybe<bool > DHKeyExportTraits::AdditionalConfig (
427+ Maybe<void > DHKeyExportTraits::AdditionalConfig (
428428 const FunctionCallbackInfo<Value>& args,
429429 unsigned int offset,
430430 DHKeyExportConfig* params) {
431- return Just ( true );
431+ return JustVoid ( );
432432}
433433
434434WebCryptoKeyExportStatus DHKeyExportTraits::DoExport (
@@ -487,7 +487,7 @@ void Stateless(const FunctionCallbackInfo<Value>& args) {
487487}
488488} // namespace
489489
490- Maybe<bool > DHBitsTraits::AdditionalConfig (
490+ Maybe<void > DHBitsTraits::AdditionalConfig (
491491 CryptoJobMode mode,
492492 const FunctionCallbackInfo<Value>& args,
493493 unsigned int offset,
@@ -500,28 +500,25 @@ Maybe<bool> DHBitsTraits::AdditionalConfig(
500500 KeyObjectHandle* private_key;
501501 KeyObjectHandle* public_key;
502502
503- ASSIGN_OR_RETURN_UNWRAP (&public_key, args[offset], Nothing<bool >());
504- ASSIGN_OR_RETURN_UNWRAP (&private_key, args[offset + 1 ], Nothing<bool >());
503+ ASSIGN_OR_RETURN_UNWRAP (&public_key, args[offset], Nothing<void >());
504+ ASSIGN_OR_RETURN_UNWRAP (&private_key, args[offset + 1 ], Nothing<void >());
505505
506506 if (private_key->Data ().GetKeyType () != kKeyTypePrivate ||
507507 public_key->Data ().GetKeyType () != kKeyTypePublic ) {
508508 THROW_ERR_CRYPTO_INVALID_KEYTYPE (env);
509- return Nothing<bool >();
509+ return Nothing<void >();
510510 }
511511
512512 params->public_key = public_key->Data ().addRef ();
513513 params->private_key = private_key->Data ().addRef ();
514514
515- return Just ( true );
515+ return JustVoid ( );
516516}
517517
518- Maybe<bool > DHBitsTraits::EncodeOutput (
519- Environment* env,
520- const DHBitsConfig& params,
521- ByteSource* out,
522- v8::Local<v8::Value>* result) {
523- *result = out->ToArrayBuffer (env);
524- return Just (!result->IsEmpty ());
518+ MaybeLocal<Value> DHBitsTraits::EncodeOutput (Environment* env,
519+ const DHBitsConfig& params,
520+ ByteSource* out) {
521+ return out->ToArrayBuffer (env);
525522}
526523
527524bool DHBitsTraits::DeriveBits (
@@ -533,11 +530,11 @@ bool DHBitsTraits::DeriveBits(
533530 return true ;
534531}
535532
536- Maybe<bool > GetDhKeyDetail (Environment* env,
533+ Maybe<void > GetDhKeyDetail (Environment* env,
537534 const KeyObjectData& key,
538535 Local<Object> target) {
539536 CHECK_EQ (EVP_PKEY_id (key.GetAsymmetricKey ().get ()), EVP_PKEY_DH);
540- return Just ( true );
537+ return JustVoid ( );
541538}
542539
543540void DiffieHellman::Initialize (Environment* env, Local<Object> target) {
0 commit comments