From 0fb7c18f10b0a88e762a141e1fb94158ea12d569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mustafa=20Ate=C5=9F=20UZUN?= Date: Sun, 12 May 2024 22:17:14 +0300 Subject: [PATCH] crypto: fix duplicated switch-case return values PR-URL: https://github.com/nodejs/node/pull/49030 Reviewed-By: Filip Skokan Reviewed-By: Luigi Pinca --- lib/internal/crypto/util.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/internal/crypto/util.js b/lib/internal/crypto/util.js index e429cbc1e744e6..284b23c9ae618b 100644 --- a/lib/internal/crypto/util.js +++ b/lib/internal/crypto/util.js @@ -510,10 +510,14 @@ function getUsagesUnion(usageSet, ...usages) { function getBlockSize(name) { switch (name) { - case 'SHA-1': return 512; - case 'SHA-256': return 512; - case 'SHA-384': return 1024; - case 'SHA-512': return 1024; + case 'SHA-1': + // Fall through + case 'SHA-256': + return 512; + case 'SHA-384': + // Fall through + case 'SHA-512': + return 1024; } }