Skip to content

Commit 0b2c6ed

Browse files
committed
Check preKeyId isn't null in createSessionFromPreKeyWhisperMessage
Checking for falsey wouldn't catch the case where preKeyId is 0.
1 parent 060e52a commit 0b2c6ed

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "axolotl",
33
"main": "dist/axolotl.js",
4-
"version": "1.2.1",
4+
"version": "1.2.2",
55
"authors": [
66
"Joe Bandenburg <joe@bandenburg.com>"
77
],

dist/axolotl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,7 @@
17091709
$ctx.state = 12;
17101710
break;
17111711
case 12:
1712-
$ctx.state = message.preKeyId ? 13 : 16;
1712+
$ctx.state = message.preKeyId !== null ? 13 : 16;
17131713
break;
17141714
case 13:
17151715
$ctx.state = 14;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "axolotl",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "An indepedent JavaScript implementation of Axolotl. Axolotl is a ratcheting forward secrecy protocol.",
55
"main": "dist/axolotl.js",
66
"directories": {

src/SessionFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function SessionFactory(crypto, store) {
113113
var ourSignedPreKeyPair = yield store.getLocalSignedPreKeyPair(message.signedPreKeyId);
114114

115115
var preKeyPair;
116-
if (message.preKeyId) {
116+
if (message.preKeyId !== null) {
117117
preKeyPair = yield store.getLocalPreKeyPair(message.preKeyId);
118118
}
119119

0 commit comments

Comments
 (0)