Changeset View
Changeset View
Standalone View
Standalone View
src/client/actions/encryption.cpp
| Show First 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | Event decryptEvent(ClientModel &m, Event e) | ||||
| maybePlainText.reason(), | maybePlainText.reason(), | ||||
| "MOE.KAZV.MXC_DECRYPT_ERROR", | "MOE.KAZV.MXC_DECRYPT_ERROR", | ||||
| json(nullptr) | json(nullptr) | ||||
| ), | ), | ||||
| Event::NotDecrypted); | Event::NotDecrypted); | ||||
| } else { | } else { | ||||
| try { | try { | ||||
| auto plainJson = json::parse(maybePlainText.value()); | auto plainJson = json::parse(maybePlainText.value()); | ||||
| kzo.client.dbg() << "plain:" << plainJson << std::endl; | |||||
| auto error = verifyEvent(m, e, plainJson); | auto error = verifyEvent(m, e, plainJson); | ||||
| auto valid = !error.has_value(); | auto valid = !error.has_value(); | ||||
| if (valid) { | if (valid) { | ||||
| kzo.client.dbg() << "The decrypted event is valid." << std::endl; | kzo.client.dbg() << "The decrypted event is valid." << std::endl; | ||||
| } | } | ||||
| return valid | return valid | ||||
| ? e.setDecryptedJson(plainJson, Event::Decrypted) | ? e.setDecryptedJson(plainJson, Event::Decrypted) | ||||
| : e.setDecryptedJson( | : e.setDecryptedJson( | ||||
| ▲ Show 20 Lines • Show All 529 Lines • Show Last 20 Lines | |||||