@@ -511,10 +511,10 @@ bool CipherBase::InitAuthenticated(
511
511
if (mode == EVP_CIPH_GCM_MODE) {
512
512
if (auth_tag_len != kNoAuthTagLength ) {
513
513
if (!IsValidGCMTagLength (auth_tag_len)) {
514
- char msg[ 50 ];
515
- snprintf (msg, sizeof (msg ),
516
- " Invalid authentication tag length: %u" , auth_tag_len);
517
- THROW_ERR_CRYPTO_INVALID_AUTH_TAG ( env (), msg );
514
+ THROW_ERR_CRYPTO_INVALID_AUTH_TAG (
515
+ env ( ),
516
+ " Invalid authentication tag length: %u" ,
517
+ auth_tag_len );
518
518
return false ;
519
519
}
520
520
@@ -523,9 +523,8 @@ bool CipherBase::InitAuthenticated(
523
523
}
524
524
} else {
525
525
if (auth_tag_len == kNoAuthTagLength ) {
526
- char msg[128 ];
527
- snprintf (msg, sizeof (msg), " authTagLength required for %s" , cipher_type);
528
- THROW_ERR_CRYPTO_INVALID_AUTH_TAG (env (), msg);
526
+ THROW_ERR_CRYPTO_INVALID_AUTH_TAG (
527
+ env (), " authTagLength required for %s" , cipher_type);
529
528
return false ;
530
529
}
531
530
@@ -633,10 +632,8 @@ void CipherBase::SetAuthTag(const FunctionCallbackInfo<Value>& args) {
633
632
}
634
633
635
634
if (!is_valid) {
636
- char msg[50 ];
637
- snprintf (msg, sizeof (msg),
638
- " Invalid authentication tag length: %u" , tag_len);
639
- return THROW_ERR_CRYPTO_INVALID_AUTH_TAG (env, msg);
635
+ return THROW_ERR_CRYPTO_INVALID_AUTH_TAG (
636
+ env, " Invalid authentication tag length: %u" , tag_len);
640
637
}
641
638
642
639
cipher->auth_tag_len_ = tag_len;
0 commit comments