1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge pull request #1699 from profanity-im/1698-fixoxabrt

Fix SIGABRT when using wrong argument order for receiving ox key
This commit is contained in:
Michael Vetter 2022-04-27 16:51:39 +02:00 committed by GitHub
commit 196fdd9cb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -7503,11 +7503,6 @@ cmd_pgp(ProfWin* window, const char* const command, gchar** args)
#ifdef HAVE_LIBGPGME #ifdef HAVE_LIBGPGME
/*!
* \brief Command for XEP-0373: OpenPGP for XMPP
*
*/
gboolean gboolean
cmd_ox(ProfWin* window, const char* const command, gchar** args) cmd_ox(ProfWin* window, const char* const command, gchar** args)
{ {
@ -7700,7 +7695,7 @@ cmd_ox(ProfWin* window, const char* const command, gchar** args)
cons_show("JID and OpenPGP Key ID are required"); cons_show("JID and OpenPGP Key ID are required");
} }
} else { } else {
cons_show("OX not implemented"); cons_bad_cmd_usage(command);
} }
return TRUE; return TRUE;
} }

View File

@ -340,7 +340,11 @@ _ox_request_public_key(const char* const jid, const char* const fingerprint)
{ {
assert(jid); assert(jid);
assert(fingerprint); assert(fingerprint);
assert(strlen(fingerprint) == KEYID_LENGTH);
if (strlen(fingerprint) != KEYID_LENGTH) {
cons_show_error("Invalid fingerprint length for: %s", fingerprint);
}
cons_show("Requesting Public Key %s for %s", fingerprint, jid); cons_show("Requesting Public Key %s for %s", fingerprint, jid);
log_info("[OX] Request %s's public key %s.", jid, fingerprint); log_info("[OX] Request %s's public key %s.", jid, fingerprint);
// iq // iq