Closed adriacidre closed 3 years ago
@adriacidre yep, that's a mistake, well spotted. It should be bobAccount
Cool @purehyperbole, in that case that test will expose the problem we're facing on encryption with SDK implementation.
Running this test you'll get:
var sessionWithAlice = crypto.create_inbound_session(aliceAccount, ciphertextForBob)
^
Error: BAD_MESSAGE_KEY_ID
at Test.<anonymous> (/Users/adriancidrejugo/go/src/github.com/joinself/self-crypto-node/tests/omemo.js:32:33)
at Test.bound [as _cb] (/Users/adriancidrejugo/go/src/github.com/joinself/self-crypto-node/node_modules/tape/lib/test.js:90:32)
at Test.run (/Users/adriancidrejugo/go/src/github.com/joinself/self-crypto-node/node_modules/tape/lib/test.js:107:31)
at Test.bound [as run] (/Users/adriancidrejugo/go/src/github.com/joinself/self-crypto-node/node_modules/tape/lib/test.js:90:32)
at Immediate.next (/Users/adriancidrejugo/go/src/github.com/joinself/self-crypto-node/node_modules/tape/lib/results.js:89:19)
at processImmediate (internal/timers.js:456:21) {
code: 'ERROR'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Which is the error we're getting on the sdk implementation.
@adriacidre my mistake, it was correct before. It should be based on no account. You are creating an inbound session from a message sent for Alice intended for Bob. So we need to use bobs account
@purehyperbole can you check this change? comparing this encrypt/decrypt test with with the sdk implementation I think
should be based on alice's account instead of bob's. Am I missing something?