summaryrefslogtreecommitdiff
path: root/MirOTR/utils.cpp
diff options
context:
space:
mode:
authoradmin@progandy.co.cc <admin@progandy.co.cc@eced67a3-f377-a0ae-92ae-d6de1850b05a>2010-09-12 13:33:13 +0000
committeradmin@progandy.co.cc <admin@progandy.co.cc@eced67a3-f377-a0ae-92ae-d6de1850b05a>2010-09-12 13:33:13 +0000
commit8411617ad832612d074884ce7304516fe2459b48 (patch)
treea02d6d93c88418524972346284f6738420f9efc5 /MirOTR/utils.cpp
parent2ef110b55c664e80dddca099f1376c874f28fbc9 (diff)
- [ issue 2 ] implemented SMP
- fixed some memory leaks - ugly workaround for SMP in ICQ git-svn-id: http://mirotr.googlecode.com/svn/trunk@8 eced67a3-f377-a0ae-92ae-d6de1850b05a
Diffstat (limited to 'MirOTR/utils.cpp')
-rw-r--r--MirOTR/utils.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/MirOTR/utils.cpp b/MirOTR/utils.cpp
index 59dd5b2..6fe6dde 100644
--- a/MirOTR/utils.cpp
+++ b/MirOTR/utils.cpp
@@ -71,6 +71,23 @@ TrustLevel otr_context_get_trust(ConnContext *context)
return level;
}
+/* Set verification of fingerprint */
+void VerifyFingerprint(ConnContext *context, bool verify) {
+ lib_cs_lock();
+ otrl_context_set_trust(context->active_fingerprint, (verify)?"verified":NULL);
+ otrl_privkey_write_fingerprints(otr_user_state, g_fingerprint_store_filename);
+ lib_cs_unlock();
+ VerifyFingerprintMessage(context, verify);
+}
+
+void VerifyFingerprintMessage(ConnContext *context, bool verify) {
+ TCHAR msg[1024];
+ mir_sntprintf(msg, 1024, (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT((HANDLE)context->app_data));
+ msg[1023] = '\0';
+ ShowMessage((HANDLE)context->app_data, msg);
+ SetEncryptionStatus(context->app_data, otr_context_get_trust(context));
+}
+
/* Convert a 20-byte hash value to a 45-byte human-readable value */
void otrl_privkey_hash_to_humanT(TCHAR human[45], const unsigned char hash[20])
{