@@ -3369,7 +3369,7 @@ void CipherBase::Update(const FunctionCallbackInfo<Value>& args) {
33693369 // Only copy the data if we have to, because it's a string
33703370 if (args[0 ]->IsString ()) {
33713371 StringBytes::InlineDecoder decoder;
3372- if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], BINARY ))
3372+ if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8 ))
33733373 return ;
33743374 r = cipher->Update (decoder.out (), decoder.size (), &out, &out_len);
33753375 } else {
@@ -3548,7 +3548,7 @@ void Hmac::HmacUpdate(const FunctionCallbackInfo<Value>& args) {
35483548 bool r;
35493549 if (args[0 ]->IsString ()) {
35503550 StringBytes::InlineDecoder decoder;
3551- if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], BINARY ))
3551+ if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8 ))
35523552 return ;
35533553 r = hmac->HmacUpdate (decoder.out (), decoder.size ());
35543554 } else {
@@ -3666,7 +3666,7 @@ void Hash::HashUpdate(const FunctionCallbackInfo<Value>& args) {
36663666 bool r;
36673667 if (args[0 ]->IsString ()) {
36683668 StringBytes::InlineDecoder decoder;
3669- if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], BINARY ))
3669+ if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8 ))
36703670 return ;
36713671 r = hash->HashUpdate (decoder.out (), decoder.size ());
36723672 } else {
@@ -3818,7 +3818,7 @@ void Sign::SignUpdate(const FunctionCallbackInfo<Value>& args) {
38183818 Error err;
38193819 if (args[0 ]->IsString ()) {
38203820 StringBytes::InlineDecoder decoder;
3821- if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], BINARY ))
3821+ if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8 ))
38223822 return ;
38233823 err = sign->SignUpdate (decoder.out (), decoder.size ());
38243824 } else {
@@ -4020,7 +4020,7 @@ void Verify::VerifyUpdate(const FunctionCallbackInfo<Value>& args) {
40204020 Error err;
40214021 if (args[0 ]->IsString ()) {
40224022 StringBytes::InlineDecoder decoder;
4023- if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], BINARY ))
4023+ if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8 ))
40244024 return ;
40254025 err = verify->VerifyUpdate (decoder.out (), decoder.size ());
40264026 } else {
@@ -4119,12 +4119,11 @@ void Verify::VerifyFinal(const FunctionCallbackInfo<Value>& args) {
41194119
41204120 THROW_AND_RETURN_IF_NOT_STRING_OR_BUFFER (args[1 ]);
41214121
4122- // BINARY works for both buffers and binary strings.
4123- enum encoding encoding = BINARY;
4122+ enum encoding encoding = UTF8;
41244123 if (args.Length () >= 3 ) {
41254124 encoding = ParseEncoding (env->isolate (),
41264125 args[2 ]->ToString (env->isolate ()),
4127- BINARY );
4126+ UTF8 );
41284127 }
41294128
41304129 ssize_t hlen = StringBytes::Size (env->isolate (), args[1 ], encoding);
0 commit comments