diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2023-02-21 16:13:56 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2023-02-22 07:58:52 +0100 |
| commit | cfa5e1e88bd121a809795d597caad8d63187442b (patch) | |
| tree | 07dacce218d3200403c447173411b0833eee3170 /gui | |
| parent | 4e392544fc29f36f2307935d54fabc771ee884e2 (diff) | |
| download | mullvadvpn-cfa5e1e88bd121a809795d597caad8d63187442b.tar.xz mullvadvpn-cfa5e1e88bd121a809795d597caad8d63187442b.zip | |
Add ui setting for quantum resistance setting
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/src/renderer/components/WireguardSettings.tsx | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/gui/src/renderer/components/WireguardSettings.tsx b/gui/src/renderer/components/WireguardSettings.tsx index 18c39a7396..edcc397e4a 100644 --- a/gui/src/renderer/components/WireguardSettings.tsx +++ b/gui/src/renderer/components/WireguardSettings.tsx @@ -107,6 +107,10 @@ export default function WireguardSettings() { </Cell.Group> <Cell.Group> + <QuantumResistantSetting /> + </Cell.Group> + + <Cell.Group> <MultihopSetting /> </Cell.Group> @@ -564,3 +568,64 @@ function MtuSetting() { </AriaInputGroup> ); } + +function QuantumResistantSetting() { + const { setWireguardQuantumResistant } = useAppContext(); + const quantumResistant = useSelector((state) => state.settings.wireguard.quantumResistant); + + const items: SelectorItem<boolean>[] = useMemo( + () => [ + { + label: messages.gettext('On'), + value: true, + }, + { + label: messages.gettext('Off'), + value: false, + }, + ], + [], + ); + + const selectQuantumResistant = useCallback( + async (quantumResistant: boolean | null) => { + await setWireguardQuantumResistant(quantumResistant ?? undefined); + }, + [setWireguardQuantumResistant], + ); + + return ( + <AriaInputGroup> + <StyledSelectorContainer> + <Selector + title={ + // TRANSLATORS: The title for the WireGuard quantum resistance selector. This setting + // TRANSLATORS: makes the cryptography resistant to the future abilities of quantum + // TRANSLATORS: computers. + messages.pgettext('wireguard-settings-view', 'Quantum-resistant tunnel') + } + details={ + <> + <ModalMessage> + {messages.pgettext( + 'wireguard-settings-view', + 'This feature makes the WireGuard tunnel resistant to potential attacks from quantum computers.', + )} + </ModalMessage> + <ModalMessage> + {messages.pgettext( + 'wireguard-settings-view', + 'It does this by performing an extra key exchange using a quantum safe algorithm and mixing the result into WireGuard’s regular encryption. This extra step uses approximately 500 kiB of traffic every time a new tunnel is established.', + )} + </ModalMessage> + </> + } + items={items} + value={quantumResistant ?? null} + onSelect={selectQuantumResistant} + automaticValue={null} + /> + </StyledSelectorContainer> + </AriaInputGroup> + ); +} |
