Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Bad encrypted message" if ending a session arrives too late #5119

Closed
2-4601 opened this issue Jan 23, 2016 · 1 comment
Closed

"Bad encrypted message" if ending a session arrives too late #5119

2-4601 opened this issue Jan 23, 2016 · 1 comment

Comments

@2-4601
Copy link
Contributor

2-4601 commented Jan 23, 2016

Android seems to get confused if it receives end secure session message later than the messages sent after it.

Steps

  1. In a conversation with an Android
  2. Android turns on airplaine mode
  3. I end the session
  4. I send three messages
  5. Android turns off airplaine mode
  6. Android receives two of my messages
  7. Android receives my end session message
  8. Android receives my third message and it is a Bad encrypted message...
  9. Android sees all subsequent messages from me as Bad encrypted message...
  10. If Android sends me a message everything works again

end session bad encrypted message

The screen shots and logs are from Desktop 0.1.9 and Android 3.9.1
But I'm able to reproduce this just between two Androids as well.

Desktop log: https://gist.github.com/anonymous/ca35e4cf3dee37325a7e
Android spammy log: https://gist.github.com/anonymous/72461983b75eca46950a

W/PushDecryptJob(10541): org.whispersystems.libaxolotl.InvalidKeyIdException: java.io.FileNotFoundException: /data/data/org.thoughtcrime.securesms/files/prekeys/9348061: open failed: ENOENT (No such file or directory)
W/PushDecryptJob(10541):    at org.thoughtcrime.securesms.crypto.storage.TextSecurePreKeyStore.loadPreKey(TextSecurePreKeyStore.java:57)
W/PushDecryptJob(10541):    at org.thoughtcrime.securesms.crypto.storage.TextSecureAxolotlStore.loadPreKey(TextSecureAxolotlStore.java:56)
W/PushDecryptJob(10541):    at org.whispersystems.libaxolotl.SessionBuilder.processV3(SessionBuilder.java:140)
W/PushDecryptJob(10541):    at org.whispersystems.libaxolotl.SessionBuilder.process(SessionBuilder.java:112)
W/PushDecryptJob(10541):    at org.whispersystems.libaxolotl.SessionCipher.decrypt(SessionCipher.java:183)
W/PushDecryptJob(10541):    at org.whispersystems.libaxolotl.SessionCipher.decrypt(SessionCipher.java:153)
W/PushDecryptJob(10541):    at org.whispersystems.textsecure.api.crypto.TextSecureCipher.decrypt(TextSecureCipher.java:148)
W/PushDecryptJob(10541):    at org.whispersystems.textsecure.api.crypto.TextSecureCipher.decrypt(TextSecureCipher.java:119)
W/PushDecryptJob(10541):    at org.thoughtcrime.securesms.jobs.PushDecryptJob.handleMessage(PushDecryptJob.java:135)
W/PushDecryptJob(10541):    at org.thoughtcrime.securesms.jobs.PushDecryptJob.onRun(PushDecryptJob.java:115)
W/PushDecryptJob(10541):    at org.whispersystems.jobqueue.JobConsumer.runJob(JobConsumer.java:76)
W/PushDecryptJob(10541):    at org.whispersystems.jobqueue.JobConsumer.run(JobConsumer.java:46)
W/PushDecryptJob(10541): Caused by: java.io.FileNotFoundException: /data/data/org.thoughtcrime.securesms/files/prekeys/9348061: open failed: ENOENT (No such file or directory)
W/PushDecryptJob(10541):    at libcore.io.IoBridge.open(IoBridge.java:406)
W/PushDecryptJob(10541):    at java.io.FileInputStream.<init>(FileInputStream.java:78)
W/PushDecryptJob(10541):    at org.thoughtcrime.securesms.crypto.storage.TextSecurePreKeyStore.loadSerializedRecord(TextSecurePreKeyStore.java:172)
W/PushDecryptJob(10541):    at org.thoughtcrime.securesms.crypto.storage.TextSecurePreKeyStore.loadPreKey(TextSecurePreKeyStore.java:54)
W/PushDecryptJob(10541):    ... 11 more
W/PushDecryptJob(10541): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
W/PushDecryptJob(10541):    at libcore.io.Posix.open(Native Method)
W/PushDecryptJob(10541):    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
W/PushDecryptJob(10541):    at libcore.io.IoBridge.open(IoBridge.java:390)
W/PushDecryptJob(10541):    ... 14 more
@2-4601
Copy link
Contributor Author

2-4601 commented Jan 28, 2016

I guess this is a stupid edge case and will be taken care of when the manual reset session option is not needed any more.
Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant