From: Ardis Lu Date: Thu, 18 Jun 2026 06:15:43 +0000 (-0700) Subject: Clear `prf` on invalid chunk X-Git-Tag: v0.1.3~5 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=ab4b9171fb35fb45db05ec007e2fc4fb66f393ad;p=envpass Clear `prf` on invalid chunk Seems safer to just wipe it in case there is a scenario where a partial `prf` is sent. --- diff --git a/src/getPrf.js b/src/getPrf.js index 767629d..caa5257 100644 --- a/src/getPrf.js +++ b/src/getPrf.js @@ -143,6 +143,7 @@ export async function getPrf(options = {}) { request.on('data', chunk => { try { prf.set(chunk, offset); } catch { // Invalid chunk or too many bytes, stop processing immediately. + prf.fill(0); response.writeHead(400).end(); request.destroy(); return;