Skip to content

Commit

Permalink
[FIPS] Use compliant algorithms in Optimizer (elastic#190642)
Browse files Browse the repository at this point in the history
## Summary

Updates the Optimizer to user FIPS compliant algorithms, otherwise
Kibana will crash during startup in development mode. This was
originally part of elastic#188887.
  • Loading branch information
Ikuni17 authored Aug 15, 2024
1 parent e429b73 commit 9121cb4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/src/common/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ it('creates cache keys', () => {
},
"dllName": "manifest-name",
"dllRefs": Object {
"./some-foo.ts": "1:ku/53aRMuAA+4TmQeCWA/w:GtuPW9agF2yecW0xAIHtUQ",
"./some-foo.ts": "1:8ZZnQFMG7xLG5lQakybjWCNbihQ:6Yk7GIWDT9j4uCAeHPI2xJcHgrE",
},
"spec": Object {
"banner": undefined,
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/src/common/dll_manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface ParsedDllManifest {
}

const hash = (s: string) => {
return Crypto.createHash('md5').update(s).digest('base64').replace(/=+$/, '');
return Crypto.createHash('sha1').update(s).digest('base64').replace(/=+$/, '');
};

export function parseDllManifest(manifest: DllManifest): ParsedDllManifest {
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-optimizer/src/worker/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function getWebpackConfig(
profile: worker.profileWebpack,

output: {
hashFunction: 'sha1',
path: bundle.outputDir,
filename: `${bundle.id}.${bundle.type}.js`,
chunkFilename: `${bundle.id}.chunk.[id].js`,
Expand Down

0 comments on commit 9121cb4

Please sign in to comment.