src: remove redundant CHECK

The function `SetAuthTag()` returns early (before reaching this line) if
`!cipher->IsAuthenticatedMode()`, which expands to the exact same
condition that is being `CHECK()`ed here.

PR-URL: https://github.com/nodejs/node/pull/61130
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
This commit is contained in:
Tobias Nießen
2025-12-22 00:53:06 +01:00
committed by GitHub
parent b8db64c18d
commit d7e4108bc1

View File

@@ -549,7 +549,6 @@ void CipherBase::SetAuthTag(const FunctionCallbackInfo<Value>& args) {
} else {
// At this point, the tag length is already known and must match the
// length of the given authentication tag.
CHECK(Cipher::FromCtx(cipher->ctx_).isSupportedAuthenticatedMode());
CHECK_NE(cipher->auth_tag_len_, kNoAuthTagLength);
is_valid = cipher->auth_tag_len_ == tag_len;
}