Skip to content

Commit e3caf97

Browse files
christianaurichzmaduh95
authored andcommitted
test: deflake test-fs-stat-cancel-inflight under FIPS
The pbkdf2() call that keeps the only threadpool worker busy used a 6-byte password and a 4-byte salt. OpenSSL 4 FIPS rejects those, so the derivation failed at once and freed the worker. The queued stat could then start before req.cancel() ran, and it completed without ECANCELED. Use inputs that meet the FIPS minimums and check that the derivation succeeds. Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com> PR-URL: #67449 Refs: #67248 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 9fda062 commit e3caf97

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎test/parallel/test-fs-stat-cancel-inflight.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ assert.strictEqual(process.env.UV_THREADPOOL_SIZE, '1');
2727
const { internalBinding } = require('internal/test/binding');
2828
const binding = internalBinding('fs');
2929

30-
// Occupy the only worker thread so the stat below cannot start.
31-
crypto.pbkdf2('secret', 'salt', 500_000, 32, 'sha512', common.mustCall());
30+
// Occupy the only worker thread so the stat below cannot start. Inputs below
31+
// the FIPS minimums would fail at once and free the worker.
32+
crypto.pbkdf2('password', '0123456789abcdef', 500_000, 32, 'sha512',
33+
common.mustSucceed());
3234

3335
const req = new binding.FSReqCallback(false);
3436
req.oncomplete = common.mustCall((err) => {

0 commit comments

Comments
 (0)