File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -2233,24 +2233,20 @@ void SSLWrap<Base>::ExportKeyingMaterial(
2233
2233
2234
2234
AllocatedBuffer out = env->AllocateManaged (olen);
2235
2235
2236
- ByteSource key;
2237
-
2238
- int useContext = 0 ;
2239
- if (!args[2 ]->IsNull () && Buffer::HasInstance (args[2 ])) {
2240
- key = ByteSource::FromBuffer (args[2 ]);
2241
-
2242
- useContext = 1 ;
2243
- }
2236
+ ByteSource context;
2237
+ bool use_context = !args[2 ]->IsUndefined ();
2238
+ if (use_context)
2239
+ context = ByteSource::FromBuffer (args[2 ]);
2244
2240
2245
2241
if (SSL_export_keying_material (w->ssl_ .get (),
2246
2242
reinterpret_cast <unsigned char *>(out.data ()),
2247
2243
olen,
2248
2244
*label,
2249
2245
label.length (),
2250
2246
reinterpret_cast <const unsigned char *>(
2251
- key .get ()),
2252
- key .size (),
2253
- useContext ) != 1 ) {
2247
+ context .get ()),
2248
+ context .size (),
2249
+ use_context ) != 1 ) {
2254
2250
return ThrowCryptoError (env, ERR_get_error (), " SSL_export_keying_material" );
2255
2251
}
2256
2252
You can’t perform that action at this time.
0 commit comments