mobilecoinofficial / auxin

Developer friendly wrapper around the Signal Messenger protocol.
GNU Affero General Public License v3.0
8 stars 7 forks source link

Expose protocol encryption/decryption errors as JSON RPC messages #60

Open itdaniher opened 2 years ago

itdaniher commented 2 years ago

In the event of a user reregistering their phone number, the following is printed to the error log, and no indication is provided to the application code.

2022-03-30T21:16:25Z app[98871698] iad [info]INFO core:276: {'jsonrpc': '2.0', 'id': 'PONG', 'method': 'PONG'}
2022-03-30T21:16:35Z app[98871698] iad [info]INFO core:276: {'jsonrpc': '2.0', 'id': 'PONG', 'method': 'PONG'}
2022-03-30T21:16:44Z app[98871698] iad [info][2022-03-30T21:16:44Z ERROR libsignal_protocol::session_cipher] Message from 2cee7a48-ba17-4ec5-a234-08de726c95cb.1 failed to decrypt; sender ratchet public key 37612e3459b990a461ee0d2c9a56e15053a4104940ca4c39bf4b074e23427d17 message counter 6
2022-03-30T21:16:44Z app[98871698] iad [info]    Candidate session 0 failed with 'untrusted identity for address 2cee7a48-ba17-4ec5-a234-08de726c95cb.1', had 5 receiver chains
2022-03-30T21:16:44Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 0531d753259ee58440be88179fc890ef6f87212ce8a6a300d710b4c0c898f3220c chain key index 1
2022-03-30T21:16:44Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 05a31e8069f582f30d6d5ffbb6daee2ed69b5505faab8ae69ab98b0b266f9b590a chain key index 1
2022-03-30T21:16:44Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 05c0eb87c09bb883cb0687868e90c96e9f0a34199de4e28add0b3b90c56b7cb949 chain key index 1
2022-03-30T21:16:44Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 0540af63e6e21fd24661e47aa723fdcaa6a21669b799ab24952b949518da11e317 chain key index 2
2022-03-30T21:16:44Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 052cc0dc76fd28b3887338013b044e716b557f4f9cfbfbfe97f89b7dbf29508f1a chain key index 2
2022-03-30T21:16:44Z app[98871698] iad [info]    Candidate session 1 had 1 receiver chains
2022-03-30T21:16:44Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 0572081d4f85e6837be2ac9cbfa6bf8ee68d118d66b111e942d33a440665c9e613 chain key index 0
2022-03-30T21:16:44Z app[98871698] iad [info][2022-03-30T21:16:44Z WARN  auxin] Message from address Some(AuxinDeviceAddress { address: Both("+19713260950", 2cee7a48-ba17-4ec5-a234-08de726c95cb), device_id: 1 }) failed to decrypt - ignoring error and continuing to receive messages to clear out prior bad state. Error was: UntrustedIdentity(ProtocolAddress { name: "2cee7a48-ba17-4ec5-a234-08de726c95cb", device_id: 1 })
2022-03-30T21:16:44Z app[98871698] iad [info][2022-03-30T21:16:44Z WARN  auxin_cli] Recoverable error ignored in websocket message type: REQUEST request {verb: "PUT" path: "/api/v1/message" body: "\010\003\022\014+19713260950(\247\302\300\345\375/8\001B\251\0023\010\327\246\262\007\022!\005  Nw\225\342\0071zr\230\361\242\231\341f5u\330\213\000\252\327\331s5\361\256\211\346\331C\032!\005\305\321\245\2506/\323g\215&g\357\320X\332C\241\250:S\023@\014.\236\271\274]X\006\353\177\"\323\0013\n!\0057a.4Y\271\220\244a\356\r,\232V\341PS\244\020I@\312L9\277K\007N#B}\027\020\006\030\000\"\240\001!\346=Y\007\312\304\210\345\220T\247\346:Bt>})P\323\272$\376\362\251\276N\356\264yk\303A_c\016f\007\272\332\320m\345\225nQ\256\001\004\225\006\235\317dx{\233<f0m\306\016\0066\305\201\267\311\311\201V\374\361\244\304\307\240\034\267\312\346#\321]\350_K{\264\362B\027\310C\001\360\032\273\244\016i\036\224\307D\003\364\031\365\020\320\0076\330\017\3110\223\351\206\357.uKJ\357e\304-B\004u\260\356\241\352\255IX\213\340Z\013\264\312^\260\001\02314\320\2160\354\213h\233\212\263g\273\226\325=)(\205}0\230\230HJ$584ec9ad-cf9a-4c64-99aa-f3ac8d14c841P\361\302\300\345\375/Z$2cee7a48-ba17-4ec5-a234-08de726c95cbj$16bb02e9-a2a9-4ce6-8443-7e91f9bc844f" headers: "X-Signal-Key: false" headers: "X-Signal-Timestamp:1648675004787" id: 7079973557141212260}
2022-03-30T21:16:45Z app[98871698] iad [info]INFO core:276: {'jsonrpc': '2.0', 'id': 'PONG', 'method': 'PONG'}
2022-03-30T21:16:46Z app[98871698] iad [info][2022-03-30T21:16:46Z ERROR libsignal_protocol::session_cipher] Message from 2cee7a48-ba17-4ec5-a234-08de726c95cb.1 failed to decrypt; sender ratchet public key 37612e3459b990a461ee0d2c9a56e15053a4104940ca4c39bf4b074e23427d17 message counter 7
2022-03-30T21:16:46Z app[98871698] iad [info]    Candidate session 0 failed with 'untrusted identity for address 2cee7a48-ba17-4ec5-a234-08de726c95cb.1', had 5 receiver chains
2022-03-30T21:16:46Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 0531d753259ee58440be88179fc890ef6f87212ce8a6a300d710b4c0c898f3220c chain key index 1
2022-03-30T21:16:46Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 05a31e8069f582f30d6d5ffbb6daee2ed69b5505faab8ae69ab98b0b266f9b590a chain key index 1
2022-03-30T21:16:46Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 05c0eb87c09bb883cb0687868e90c96e9f0a34199de4e28add0b3b90c56b7cb949 chain key index 1
2022-03-30T21:16:46Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 0540af63e6e21fd24661e47aa723fdcaa6a21669b799ab24952b949518da11e317 chain key index 2
2022-03-30T21:16:46Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 052cc0dc76fd28b3887338013b044e716b557f4f9cfbfbfe97f89b7dbf29508f1a chain key index 2
2022-03-30T21:16:46Z app[98871698] iad [info]    Candidate session 1 had 1 receiver chains
2022-03-30T21:16:46Z app[98871698] iad [info]    Receiver chain with sender ratchet public key 0572081d4f85e6837be2ac9cbfa6bf8ee68d118d66b111e942d33a440665c9e613 chain key index 0
2022-03-30T21:16:46Z app[98871698] iad [info][2022-03-30T21:16:46Z WARN  auxin] Message from address Some(AuxinDeviceAddress { address: Both("+19713260950", 2cee7a48-ba17-4ec5-a234-08de726c95cb), device_id: 1 }) failed to decrypt - ignoring error and continuing to receive messages to clear out prior bad state. Error was: UntrustedIdentity(ProtocolAddress { name: "2cee7a48-ba17-4ec5-a234-08de726c95cb", device_id: 1 })
2022-03-30T21:16:46Z app[98871698] iad [info][2022-03-30T21:16:46Z WARN  auxin_cli] Recoverable error ignored in websocket message type: REQUEST request {verb: "PUT" path: "/api/v1/message" body: "\010\003\022\014+19713260950(\236\320\300\345\375/8\001B\251\0023\010\327\246\262\007\022!\005  Nw\225\342\0071zr\230\361\242\231\341f5u\330\213\000\252\327\331s5\361\256\211\346\331C\032!\005\305\321\245\2506/\323g\215&g\357\320X\332C\241\250:S\023@\014.\236\271\274]X\006\353\177\"\323\0013\n!\0057a.4Y\271\220\244a\356\r,\232V\341PS\244\020I@\312L9\277K\007N#B}\027\020\007\030\000\"\240\001`Yd\353\003\331\347\357\207`\225\243\266_\302\221\314\321O\r\243\320\270\305\254 >\\ \335\311\331\233cv\"\366Y]\303\357\320\367\320\0216 \221>]\370\331li\344\021\3661\265_\316\352\360\362\006\031\030\320\374p\312\313)\225\307\347\312_\317F\323\340x\027\227\007&$\307\215\024C6\301P(\353\027\322\245Uw`q\364\272\240\024\327\3630\302!y\320\337\202\327\265!P\226\002\240\n5\355\202F9)\010\026\312\367\314g\276~\364\241\037\203\014\004Z\'\t\032\351vNA\264\2204\201`\353\233\346\251\377:\340(\354\001(\205}0\230\230HJ$ffecb9a1-d428-4e2e-8599-5befc82c99dcP\365\320\300\345\375/Z$2cee7a48-ba17-4ec5-a234-08de726c95cbj$16bb02e9-a2a9-4ce6-8443-7e91f9bc844f" headers: "X-Signal-Key: false" headers: "X-Signal-Timestamp:1648675006583" id: 1139654359859136538}