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 @@ -2807,24 +2807,20 @@ void SSLWrap<Base>::ExportKeyingMaterial(
28072807
28082808 AllocatedBuffer out = env->AllocateManaged (olen);
28092809
2810- ByteSource key;
2811-
2812- int useContext = 0 ;
2813- if (!args[2 ]->IsNull () && Buffer::HasInstance (args[2 ])) {
2814- key = ByteSource::FromBuffer (args[2 ]);
2815-
2816- useContext = 1 ;
2817- }
2810+ ByteSource context;
2811+ bool use_context = !args[2 ]->IsUndefined ();
2812+ if (use_context)
2813+ context = ByteSource::FromBuffer (args[2 ]);
28182814
28192815 if (SSL_export_keying_material (w->ssl_ .get (),
28202816 reinterpret_cast <unsigned char *>(out.data ()),
28212817 olen,
28222818 *label,
28232819 label.length (),
28242820 reinterpret_cast <const unsigned char *>(
2825- key .get ()),
2826- key .size (),
2827- useContext ) != 1 ) {
2821+ context .get ()),
2822+ context .size (),
2823+ use_context ) != 1 ) {
28282824 return ThrowCryptoError (env, ERR_get_error (), " SSL_export_keying_material" );
28292825 }
28302826
You can’t perform that action at this time.
0 commit comments