diff --git a/src/crypto/crypto_ec.cc b/src/crypto/crypto_ec.cc index d9e29a01d297e4..4a80f843336a3d 100644 --- a/src/crypto/crypto_ec.cc +++ b/src/crypto/crypto_ec.cc @@ -828,12 +828,7 @@ Maybe ExportJWKEcKey( if (key->GetKeyType() == kKeyTypePrivate) { const BIGNUM* pvt = EC_KEY_get0_private_key(ec); - return SetEncodedValue( - env, - target, - env->jwk_d_string(), - pvt, - degree_bytes).IsJust() ? JustVoid() : Nothing(); + return SetEncodedValue(env, target, env->jwk_d_string(), pvt, degree_bytes); } return JustVoid(); diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc index 501177f15cbdb0..4660be3cea1449 100644 --- a/src/crypto/crypto_util.cc +++ b/src/crypto/crypto_util.cc @@ -604,12 +604,11 @@ MaybeLocal EncodeBignum( error); } -Maybe SetEncodedValue( - Environment* env, - Local target, - Local name, - const BIGNUM* bn, - int size) { +Maybe SetEncodedValue(Environment* env, + Local target, + Local name, + const BIGNUM* bn, + int size) { Local value; Local error; CHECK_NOT_NULL(bn); @@ -617,9 +616,10 @@ Maybe SetEncodedValue( if (!EncodeBignum(env, bn, size, &error).ToLocal(&value)) { if (!error.IsEmpty()) env->isolate()->ThrowException(error); - return Nothing(); + return Nothing(); } - return target->Set(env->context(), name, value); + return target->Set(env->context(), name, value).IsJust() ? JustVoid() + : Nothing(); } bool SetRsaOaepLabel(const EVPKeyCtxPointer& ctx, const ByteSource& label) { diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h index 680c30f42ab727..8756008d4ce3d2 100644 --- a/src/crypto/crypto_util.h +++ b/src/crypto/crypto_util.h @@ -713,12 +713,11 @@ v8::MaybeLocal EncodeBignum( int size, v8::Local* error); -v8::Maybe SetEncodedValue( - Environment* env, - v8::Local target, - v8::Local name, - const BIGNUM* bn, - int size = 0); +v8::Maybe SetEncodedValue(Environment* env, + v8::Local target, + v8::Local name, + const BIGNUM* bn, + int size = 0); bool SetRsaOaepLabel(const EVPKeyCtxPointer& rsa, const ByteSource& label);