]> git.ardis.lu - envpass/commitdiff
Move prf zeroing logic inside `finally`
authorArdis Lu <ardisglu@gmail.com>
Thu, 18 Jun 2026 06:05:03 +0000 (23:05 -0700)
committerArdis Lu <ardisglu@gmail.com>
Thu, 18 Jun 2026 06:05:03 +0000 (23:05 -0700)
This approach is more semantically aligned with what is meant to happen (wipe `prf` after it is broadcast, regardless of success or fail), and potentially better scheduling (previous approach allowed theoretical promises in the microtask queue injected after the `fetch` but before yielding to main thread?).

src/getPrf.html

index 9aac142bf1bad4779e0cca49e76f5a8249f0735c..2fba2ea8c4118a7653f5826ef3d974e0c00c1ef3 100644 (file)
@@ -98,8 +98,9 @@
           'Envpass-Challenge': challenge
         },
         body: prf
+      }).finally(() => {
+        prf.fill(0);
       });
-      prf.fill(0);
       if (response.status === 200) {
         p.textContent = 'Successfully sent passkey. You may close this window now.';
         clearTimeout(timeoutId);
This page took 0.032585 seconds and 4 git commands to generate.