Skip to content

Commit

Permalink
fix factor staging
Browse files Browse the repository at this point in the history
  • Loading branch information
VCNinc committed Jul 19, 2022
1 parent 246e2d1 commit 597cca7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function derive (factor, params, key) {
result.params = Promise.resolve(params)

const output = await result.output()
result.output = Promise.resolve(output)
result.output = () => Promise.resolve(output)
}

return () => Promise.resolve(result)
Expand Down
14 changes: 7 additions & 7 deletions test/features/stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ suite('stage', () => {
const json = JSON.parse(Buffer.from(decrypted).toString())
const code = json.code

const password = await mfkdf.stage.factor.derive(mfkdf.derive.factors.password('password'), setup.policy.factors[0].params)
const hmacsha1 = await mfkdf.stage.factor.derive(mfkdf.derive.factors.hmacsha1(response), setup.policy.factors[1].params)
const hotp = await mfkdf.stage.factor.derive(mfkdf.derive.factors.hotp(365287), setup.policy.factors[2].params)
const ooba = await mfkdf.stage.factor.derive(mfkdf.derive.factors.ooba(code), setup.policy.factors[3].params)
const question = await mfkdf.stage.factor.derive(mfkdf.derive.factors.question('fido'), setup.policy.factors[4].params)
const totp = await mfkdf.stage.factor.derive(mfkdf.derive.factors.totp(528258, { time: 1650430943604 }), setup.policy.factors[5].params)
const uuid = await mfkdf.stage.factor.derive(mfkdf.derive.factors.uuid('9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'), setup.policy.factors[6].params)
const password = await mfkdf.stage.factor.derive(mfkdf.derive.factors.password('password'), setup.policy.factors[0].params, setup.key)
const hmacsha1 = await mfkdf.stage.factor.derive(mfkdf.derive.factors.hmacsha1(response), setup.policy.factors[1].params, setup.key)
const hotp = await mfkdf.stage.factor.derive(mfkdf.derive.factors.hotp(365287), setup.policy.factors[2].params, setup.key)
const ooba = await mfkdf.stage.factor.derive(mfkdf.derive.factors.ooba(code), setup.policy.factors[3].params, setup.key)
const question = await mfkdf.stage.factor.derive(mfkdf.derive.factors.question('fido'), setup.policy.factors[4].params, setup.key)
const totp = await mfkdf.stage.factor.derive(mfkdf.derive.factors.totp(528258, { time: 1650430943604 }), setup.policy.factors[5].params, setup.key)
const uuid = await mfkdf.stage.factor.derive(mfkdf.derive.factors.uuid('9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'), setup.policy.factors[6].params, setup.key)

const derive = await mfkdf.derive.key(setup.policy, {
password, hmacsha1, hotp, ooba, question, totp, uuid
Expand Down

0 comments on commit 597cca7

Please sign in to comment.