Skip to content

Commit 265f042

Browse files
committed
Fix signing test
Because the previous protocol check wasn’t doing the right thing, the key passed in was never being checked. Therefore the fact that a buffer wasn’t being passed in was not caught and the test passed even though it was passing in the wrong type.
1 parent 6c4668b commit 265f042

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/V2.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,11 @@ describe('Protocol V2', () => {
314314
const keypair = sodium.crypto_sign_keypair();
315315

316316
sk = new Paseto.PrivateKey.V2();
317-
sk.inject(keypair.privateKey, (err) => {
317+
sk.inject(Buffer.from(keypair.privateKey, 'binary'), (err) => {
318318
if (err) { return done(err); }
319319

320320
pk = new Paseto.PublicKey.V2();
321-
pk.inject(keypair.publicKey, done);
321+
pk.inject(Buffer.from(keypair.publicKey, 'binary'), done);
322322
});
323323
});
324324

0 commit comments

Comments
 (0)