@@ -23,7 +23,7 @@ using v8::FunctionCallbackInfo;
23
23
using v8::FunctionTemplate;
24
24
using v8::Int32;
25
25
using v8::Isolate;
26
- using v8::Just ;
26
+ using v8::JustVoid ;
27
27
using v8::Local;
28
28
using v8::Maybe;
29
29
using v8::MaybeLocal;
@@ -338,7 +338,7 @@ void Check(const FunctionCallbackInfo<Value>& args) {
338
338
// * Private type
339
339
// * Cipher
340
340
// * Passphrase
341
- Maybe<bool > DhKeyGenTraits::AdditionalConfig (
341
+ Maybe<void > DhKeyGenTraits::AdditionalConfig (
342
342
CryptoJobMode mode,
343
343
const FunctionCallbackInfo<Value>& args,
344
344
unsigned int * offset,
@@ -350,7 +350,7 @@ Maybe<bool> DhKeyGenTraits::AdditionalConfig(
350
350
auto group = DHPointer::FindGroup (group_name.ToStringView ());
351
351
if (!group) {
352
352
THROW_ERR_CRYPTO_UNKNOWN_DH_GROUP (env);
353
- return Nothing<bool >();
353
+ return Nothing<void >();
354
354
}
355
355
356
356
static constexpr int kStandardizedGenerator = 2 ;
@@ -363,14 +363,14 @@ Maybe<bool> DhKeyGenTraits::AdditionalConfig(
363
363
int size = args[*offset].As <Int32>()->Value ();
364
364
if (size < 0 ) {
365
365
THROW_ERR_OUT_OF_RANGE (env, " Invalid prime size" );
366
- return Nothing<bool >();
366
+ return Nothing<void >();
367
367
}
368
368
params->params .prime = size;
369
369
} else {
370
370
ArrayBufferOrViewContents<unsigned char > input (args[*offset]);
371
371
if (UNLIKELY (!input.CheckSizeInt32 ())) {
372
372
THROW_ERR_OUT_OF_RANGE (env, " prime is too big" );
373
- return Nothing<bool >();
373
+ return Nothing<void >();
374
374
}
375
375
params->params .prime = BignumPointer (input.data (), input.size ());
376
376
}
@@ -380,7 +380,7 @@ Maybe<bool> DhKeyGenTraits::AdditionalConfig(
380
380
*offset += 2 ;
381
381
}
382
382
383
- return Just ( true );
383
+ return JustVoid ( );
384
384
}
385
385
386
386
EVPKeyCtxPointer DhKeyGenTraits::Setup (DhKeyPairGenConfig* params) {
@@ -424,11 +424,11 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) {
424
424
return ctx;
425
425
}
426
426
427
- Maybe<bool > DHKeyExportTraits::AdditionalConfig (
427
+ Maybe<void > DHKeyExportTraits::AdditionalConfig (
428
428
const FunctionCallbackInfo<Value>& args,
429
429
unsigned int offset,
430
430
DHKeyExportConfig* params) {
431
- return Just ( true );
431
+ return JustVoid ( );
432
432
}
433
433
434
434
WebCryptoKeyExportStatus DHKeyExportTraits::DoExport (
@@ -487,7 +487,7 @@ void Stateless(const FunctionCallbackInfo<Value>& args) {
487
487
}
488
488
} // namespace
489
489
490
- Maybe<bool > DHBitsTraits::AdditionalConfig (
490
+ Maybe<void > DHBitsTraits::AdditionalConfig (
491
491
CryptoJobMode mode,
492
492
const FunctionCallbackInfo<Value>& args,
493
493
unsigned int offset,
@@ -500,28 +500,25 @@ Maybe<bool> DHBitsTraits::AdditionalConfig(
500
500
KeyObjectHandle* private_key;
501
501
KeyObjectHandle* public_key;
502
502
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 >());
505
505
506
506
if (private_key->Data ().GetKeyType () != kKeyTypePrivate ||
507
507
public_key->Data ().GetKeyType () != kKeyTypePublic ) {
508
508
THROW_ERR_CRYPTO_INVALID_KEYTYPE (env);
509
- return Nothing<bool >();
509
+ return Nothing<void >();
510
510
}
511
511
512
512
params->public_key = public_key->Data ().addRef ();
513
513
params->private_key = private_key->Data ().addRef ();
514
514
515
- return Just ( true );
515
+ return JustVoid ( );
516
516
}
517
517
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);
525
522
}
526
523
527
524
bool DHBitsTraits::DeriveBits (
@@ -533,11 +530,11 @@ bool DHBitsTraits::DeriveBits(
533
530
return true ;
534
531
}
535
532
536
- Maybe<bool > GetDhKeyDetail (Environment* env,
533
+ Maybe<void > GetDhKeyDetail (Environment* env,
537
534
const KeyObjectData& key,
538
535
Local<Object> target) {
539
536
CHECK_EQ (EVP_PKEY_id (key.GetAsymmetricKey ().get ()), EVP_PKEY_DH);
540
- return Just ( true );
537
+ return JustVoid ( );
541
538
}
542
539
543
540
void DiffieHellman::Initialize (Environment* env, Local<Object> target) {
0 commit comments