Switch md5 to sha256
For FIPS compliance Signed-off-by: Tomasz Szuba <tszuba@box.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
Use sha256 instead of md5 in build script cache key calculation
|
||||
|
||||
Makes it possible to build on FIPS nodejs.
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
'@backstage/backend-common': patch
|
||||
---
|
||||
|
||||
Use sha256 instead of md5 for hash key calculation in caches
|
||||
|
||||
This can have a side effect of invalidating caches (when cache key was >250 characters)
|
||||
This improves compliance with FIPS nodejs
|
||||
+1
-1
@@ -88,6 +88,6 @@ export class DefaultCacheClient implements CacheService {
|
||||
return wellFormedKey;
|
||||
}
|
||||
|
||||
return createHash('md5').update(candidateKey).digest('base64');
|
||||
return createHash('sha256').update(candidateKey).digest('base64');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ async function getProjectConfig(targetPath, extraConfig) {
|
||||
// If no explicit id was configured, generated one based on the configuration.
|
||||
if (!config.id) {
|
||||
const configHash = crypto
|
||||
.createHash('md5')
|
||||
.createHash('sha256')
|
||||
.update(version)
|
||||
.update(Buffer.alloc(1))
|
||||
.update(JSON.stringify(config.transform))
|
||||
|
||||
@@ -70,7 +70,7 @@ function createTransformer(config) {
|
||||
};
|
||||
|
||||
const getCacheKey = sourceText => {
|
||||
return createHash('md5')
|
||||
return createHash('sha256')
|
||||
.update(sourceText)
|
||||
.update(Buffer.alloc(1))
|
||||
.update(sucrasePkg.version)
|
||||
|
||||
@@ -25,7 +25,7 @@ function createTransformer(config) {
|
||||
|
||||
const getCacheKey = sourceText => {
|
||||
return crypto
|
||||
.createHash('md5')
|
||||
.createHash('sha256')
|
||||
.update(sourceText)
|
||||
.update(Buffer.alloc(1))
|
||||
.update(JSON.stringify(config))
|
||||
|
||||
Reference in New Issue
Block a user