Skip to content

Commit

Permalink
Update to new fingerprint function
Browse files Browse the repository at this point in the history
  • Loading branch information
claucece committed Aug 9, 2019
1 parent dd9dfc3 commit 0145537
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions gtk-dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,10 @@ static char *create_verify_fingerprint_label_v3(
}

static char *create_verify_fingerprint_label_v4(
const otrng_known_fingerprint_s *other_fprint, const char *protocol,
const otrng_known_fingerprint_s *their_fprint, const char *protocol,
const char *account) {
char our_human_fprint[OTRNG_FPRINT_HUMAN_LEN];
char other_human_fprint[OTRNG_FPRINT_HUMAN_LEN];
char their_human_fprint[OTRNG_FPRINT_HUMAN_LEN];
PurplePlugin *p;
char *proto_name;
char *label_text;
Expand All @@ -720,24 +720,24 @@ static char *create_verify_fingerprint_label_v4(
p = purple_find_prpl(protocol);
proto_name = (p && p->info->name) ? p->info->name : _("Unknown");

otrng_fingerprint_hash_to_human(other_human_fprint, other_fprint->fp);
otrng_fingerprint_hash_to_human(their_human_fprint, their_fprint->fp, sizeof(their_fprint->fp));

label_text = g_strdup_printf(_("Fingerprint for you, %s (%s):\n%s\n\n"
"Purported fingerprint for %s:\n%s\n"),
account, proto_name, our_human_fprint,
other_fprint->username, other_human_fprint);
their_fprint->username, their_human_fprint);

return label_text;
}

static char *
create_verify_fingerprint_label(const otrng_plugin_fingerprint_s *other_fprint,
create_verify_fingerprint_label(const otrng_plugin_fingerprint_s *their_fprint,
const char *protocol, const char *account) {
if (other_fprint->version == 3) {
return create_verify_fingerprint_label_v3(other_fprint->v3, protocol,
if (their_fprint->version == 3) {
return create_verify_fingerprint_label_v3(their_fprint->v3, protocol,
account);
}
return create_verify_fingerprint_label_v4(other_fprint->v4, protocol,
return create_verify_fingerprint_label_v4(their_fprint->v4, protocol,
account);
}

Expand Down
2 changes: 1 addition & 1 deletion gtk-ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static void keylist_all_do_v4(const otrng_client_s *client,
if (!fphuman) {
return;
}
otrng_fingerprint_hash_to_human(fphuman, fp->fp);
otrng_fingerprint_hash_to_human(fphuman, fp->fp, sizeof(fp->fp));
titles[4] = fphuman;
titles[5] = g_strdup_printf("%s (%s)", client->client_id.account,
client->client_id.protocol);
Expand Down
2 changes: 1 addition & 1 deletion otrng-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ char *otrv4_client_adapter_privkey_fingerprint(const otrng_client_s *client) {
return NULL;
}

otrng_fingerprint_hash_to_human(ret, our_fp);
otrng_fingerprint_hash_to_human(ret, our_fp, sizeof(our_fp));
return ret;
}

0 comments on commit 0145537

Please sign in to comment.