Skip to content

Commit

Permalink
feat(suite, suite-common): allow disabling entropy check via message …
Browse files Browse the repository at this point in the history
…system
  • Loading branch information
komret committed Jan 29, 2025
1 parent f239945 commit bad609b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/suite/src/components/suite/Preloader/Preloader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
selectIsFirmwareAuthenticityCheckDismissed,
selectIsEntropyCheckFailed,
} from '@suite-common/wallet-core';
import { Feature, selectIsFeatureDisabled } from '@suite-common/message-system';

import { useDispatch, useSelector } from 'src/hooks/suite';
import { Onboarding } from 'src/views/onboarding';
Expand Down Expand Up @@ -69,6 +70,9 @@ export const Preloader = ({ children }: PropsWithChildren) => {
selectIsFirmwareAuthenticityCheckDismissed,
);
const isEntropyCheckEnabled = useSelector(selectIsEntropyCheckEnabled);
const isEntropyCheckDisabledByMessageSystem = useSelector(state =>
selectIsFeatureDisabled(state, Feature.entropyCheck),
);
const isEntropyCheckFailed = useSelector(selectIsEntropyCheckFailed);

// report firmware authenticity failures even when the UI is disabled
Expand Down Expand Up @@ -97,7 +101,8 @@ export const Preloader = ({ children }: PropsWithChildren) => {
return <InitialLoading timeout={90} />;
}

const isEntropyCheckEnabledAndFailed = isEntropyCheckEnabled && isEntropyCheckFailed;
const isEntropyCheckEnabledAndFailed =
isEntropyCheckEnabled && !isEntropyCheckDisabledByMessageSystem && isEntropyCheckFailed;

if (
(router.route?.app === undefined ||
Expand Down
3 changes: 2 additions & 1 deletion suite-common/message-system/src/messageSystemTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export const Feature = {
ethStake: 'eth.staking.stake',
ethUnstake: 'eth.staking.unstake',
ethClaim: 'eth.staking.claim',
firmwareRevisionCheck: 'security.firmware.check',
firmwareRevisionCheck: 'security.firmware.revisionCheck',
firmwareHashCheck: 'security.firmware.hashCheck',
entropyCheck: 'security.entropyCheck',
// FW update feature flag implemented only for mobile app
firmwareUpdate: 'device.firmware.update',
} as const;
Expand Down

0 comments on commit bad609b

Please sign in to comment.