diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2014-05-09 17:49:52 -0400 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2014-05-09 17:49:52 -0400 |
commit | ef0a5007445c997707f9cea44635172e72b3c297 (patch) | |
tree | 4d4129c8977d185d2b73ae6d2d60b3f29b685f1b | |
parent | 52cad9f41fd1a7ebd89c238f6e0def69885601e1 (diff) |
OTR: add a #define for the fingerprint length
20 is hardcoded into libotr's API.
-rw-r--r-- | src/im-channel-otr.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/im-channel-otr.c b/src/im-channel-otr.c index d3de3f09c..d6901bd63 100644 --- a/src/im-channel-otr.c +++ b/src/im-channel-otr.c @@ -33,6 +33,7 @@ #include "presence-cache.h" #include "util.h" +#define FINGERPRINT_LEN 20 #define OTR_PRIV_KEY "otr-priv" #define GET_PRIV(self) g_object_get_data (G_OBJECT (self), OTR_PRIV_KEY) @@ -176,8 +177,8 @@ fp_raw_to_variant (guchar *fp_raw) otrl_privkey_hash_to_human (display_fp, fp_raw); return g_variant_new ("(s@ay)", display_fp, - g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, fp_raw, 20, - sizeof (guchar))); + g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, fp_raw, + FINGERPRINT_LEN, sizeof (guchar))); } return g_variant_new ("(say)", "", NULL); @@ -196,7 +197,7 @@ update_properties (GabbleIMChannel *self) ConnContext *context; TrustLevel level = TRUST_LEVEL_NOT_PRIVATE; Fingerprint *their_fp = NULL; - guchar our_fp_raw[20]; + guchar our_fp_raw[FINGERPRINT_LEN]; context = otrl_context_find (userstate, get_target_id (self), get_self_id (self), "xmpp", priv->instag, 0, NULL, NULL, NULL); @@ -295,7 +296,7 @@ otr_new_fingerprint (void *opdata, const gchar *accountname, const gchar *protocol, const gchar *username, - guchar fingerprint[20]) + guchar fingerprint[FINGERPRINT_LEN]) { update_properties (opdata); } |