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(
2807
2807
2808
2808
AllocatedBuffer out = env->AllocateManaged (olen);
2809
2809
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 ]);
2818
2814
2819
2815
if (SSL_export_keying_material (w->ssl_ .get (),
2820
2816
reinterpret_cast <unsigned char *>(out.data ()),
2821
2817
olen,
2822
2818
*label,
2823
2819
label.length (),
2824
2820
reinterpret_cast <const unsigned char *>(
2825
- key .get ()),
2826
- key .size (),
2827
- useContext ) != 1 ) {
2821
+ context .get ()),
2822
+ context .size (),
2823
+ use_context ) != 1 ) {
2828
2824
return ThrowCryptoError (env, ERR_get_error (), " SSL_export_keying_material" );
2829
2825
}
2830
2826
You can’t perform that action at this time.
0 commit comments