Skip to content

Commit

Permalink
fix(suite-native): handle device authenticity check for expired configs
Browse files Browse the repository at this point in the history
  • Loading branch information
yanascz committed Feb 12, 2025
1 parent c4fca3d commit 2663144
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion suite-native/analytics/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ export type AnalyticsSendFlowStep =
| 'outputs_review'
| 'destination_tag_review';

export type DeviceAuthenticityCheckResult = 'successful' | 'compromised' | 'cancelled' | 'failed';
export type DeviceAuthenticityCheckResult =
| 'successful'
| 'compromised'
| 'configExpired'
| 'cancelled'
| 'failed';

export type FirmwareUpdatePayload = {
model: DeviceModelInternal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ export const DeviceAuthenticityCard = () => {
const { success, payload } = result.payload;
if (success) {
const checkResult = payload.valid ? 'successful' : 'compromised';
navigation.navigate(DeviceAuthenticityStackRoutes.AuthenticitySummary, { checkResult });
reportCheckResult(checkResult);
const configExpired = payload.error === 'CA_PUBKEY_NOT_FOUND' && payload.configExpired;
navigation.navigate(DeviceAuthenticityStackRoutes.AuthenticitySummary, {
checkResult: configExpired ? 'successful' : checkResult,
});
reportCheckResult(configExpired ? 'configExpired' : checkResult);
} else {
const errorCode = payload.code;
if (errorCode === 'Failure_ActionCancelled' || errorCode === 'Failure_PinCancelled') {
Expand Down

0 comments on commit 2663144

Please sign in to comment.