diff options
Diffstat (limited to 'modules/test/test-cryptogzip-guard.js')
| -rw-r--r-- | modules/test/test-cryptogzip-guard.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/test/test-cryptogzip-guard.js b/modules/test/test-cryptogzip-guard.js index 14f50d3..75d4ab8 100644 --- a/modules/test/test-cryptogzip-guard.js +++ b/modules/test/test-cryptogzip-guard.js @@ -103,13 +103,17 @@ function mkTerm(files) { !!gzErr && gzErr instanceof Error && !isDomException(gzErr) && /base64/.test(gzErr.message), gzErr ? gzErr.name + ': ' + gzErr.message : 'did not throw'); - // C8: `gunzip` command path prints its existing "gunzip error:" line instead of crashing + // C8: `gunzip` command path prints its existing "gunzip error:" line instead of crashing. + // Since the T3 follow-up (plan 2026-11-03_061900-newos4-cryptogzip-base64-guard.md) gunzip + // reads bytes and validates the gzip magic, so non-gzip input is reported as + // "not a gzip file" — it used to leak "not valid base64 input (…)" from the string path. const t8 = mkTerm({ 'notbase64.gz': 'hello world!' }); let cmdThrew = null; try { await t8.mod.commands['gunzip'](['notbase64.gz']); } catch (e) { cmdThrew = e; } const line = t8.printed.find(p => /^gunzip error: /.test(p.msg)); - ok('C8 gunzip prints "gunzip error: … not valid base64 …" and does not throw', - !cmdThrew && !!line && /base64/.test(line.msg) && t8.store['notbase64.gz'] === 'hello world!', + ok('C8 gunzip prints "gunzip error: not a gzip file" and does not throw', + !cmdThrew && !!line && line.msg === 'gunzip error: not a gzip file' + && t8.store['notbase64.gz'] === 'hello world!', cmdThrew ? 'threw ' + cmdThrew.message : JSON.stringify(t8.printed)); // C9: legacy path — a base64 .gz written by `gzip` still decompresses |