Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jun 19, 2022
1 parent 1b9396c commit b228a0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ should('OTP url parser', () => {
);
assert.deepStrictEqual(
otp.buildURL(otp.parse('ZYTYYE5FOAGW5ML7LRWUL4WTZLNJAMZS')),
'optauth://totp/?secret=ZYTYYE5FOAGW5ML7LRWUL4WTZLNJAMZS&interval=30&digits=6&algorithm=SHA1'
'otpauth://totp/?secret=ZYTYYE5FOAGW5ML7LRWUL4WTZLNJAMZS&interval=30&digits=6&algorithm=SHA1'
);
assert.deepStrictEqual(
otp.buildURL(
otp.parse(
'otpauth://totp/ACME%20Co:[email protected]?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA1&digits=6&period=30'
)
),
'optauth://totp/?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&interval=30&digits=6&algorithm=SHA1'
'otpauth://totp/?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&interval=30&digits=6&algorithm=SHA1'
);
});
should('OTP', () => {
Expand Down Expand Up @@ -79,9 +79,9 @@ should('OTP', () => {
assert.deepStrictEqual(otp.hotp(optsRfc, 8), '399871');
assert.deepStrictEqual(otp.hotp(optsRfc, 9), '520489');
// https://datatracker.ietf.org/doc/html/rfc6238#appendix-B
/*
/*
There is something strange:
- Spec says vector should be "12345678901234567890" as hex (won't work for sha256/sha512),
- Spec says vector should be "12345678901234567890" as hex (won't work for sha256/sha512),
hovewer later in example code they use different keys for sha256/sha512 (with padding)
- 1password doesn't pad (10 bytes secret with sha1 works as is, without padding)
- https://github.com/pyauth/pyotp doesn't pad
Expand Down

0 comments on commit b228a0d

Please sign in to comment.