From cea4eee18aa4525b9ce6977c69aba91d7772ae87 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Mon, 8 Jan 2024 17:03:22 +0100 Subject: [PATCH] Use sha256 (resolves CodeQL warning) (#201978) * Use sha256 (resolves CodeQL warning) * check in JS file too --- build/azure-pipelines/common/computeNodeModulesCacheKey.js | 2 +- build/azure-pipelines/common/computeNodeModulesCacheKey.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines/common/computeNodeModulesCacheKey.js b/build/azure-pipelines/common/computeNodeModulesCacheKey.js index 535cb7efd98..fe84d03e1d7 100644 --- a/build/azure-pipelines/common/computeNodeModulesCacheKey.js +++ b/build/azure-pipelines/common/computeNodeModulesCacheKey.js @@ -9,7 +9,7 @@ const path = require("path"); const crypto = require("crypto"); const { dirs } = require('../../npm/dirs'); const ROOT = path.join(__dirname, '../../../'); -const shasum = crypto.createHash('sha1'); +const shasum = crypto.createHash('sha256'); shasum.update(fs.readFileSync(path.join(ROOT, 'build/.cachesalt'))); shasum.update(fs.readFileSync(path.join(ROOT, '.yarnrc'))); shasum.update(fs.readFileSync(path.join(ROOT, 'remote/.yarnrc'))); diff --git a/build/azure-pipelines/common/computeNodeModulesCacheKey.ts b/build/azure-pipelines/common/computeNodeModulesCacheKey.ts index f9d70503685..16bf76796f9 100644 --- a/build/azure-pipelines/common/computeNodeModulesCacheKey.ts +++ b/build/azure-pipelines/common/computeNodeModulesCacheKey.ts @@ -10,7 +10,7 @@ const { dirs } = require('../../npm/dirs'); const ROOT = path.join(__dirname, '../../../'); -const shasum = crypto.createHash('sha1'); +const shasum = crypto.createHash('sha256'); shasum.update(fs.readFileSync(path.join(ROOT, 'build/.cachesalt'))); shasum.update(fs.readFileSync(path.join(ROOT, '.yarnrc')));