pidgin/pidgin

Merge in the public updates
release-2.x.y
2017-03-06, Gary Kramlich
7d13c981b14f
Merge in the public updates
--- a/ChangeLog.API Tue Feb 28 22:48:04 2017 -0600
+++ b/ChangeLog.API Mon Mar 06 20:44:31 2017 -0600
@@ -1,5 +1,14 @@
Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
+version 2.12.0:
+ libpurple:
+ Added:
+ * PURPLE_MESSAGE_REMOTE_SEND in PurpleMessageFlags, to specify
+ messages like _SEND that were sent from another location.
+ * purple_certificate_get_fingerprint_sha256
+ * PurpleCertificateScheme.get_fingerprint_sha256
+ * PURPLE_CERTIFICATE_SCHEME_HAS_FUNC
+
version 2.11.0:
libpurple:
Added:
--- a/finch/finch.c Tue Feb 28 22:48:04 2017 -0600
+++ b/finch/finch.c Mon Mar 06 20:44:31 2017 -0600
@@ -70,16 +70,11 @@
g_hash_table_insert(ui_info, "client_type", "console");
/*
- * This is the client key for "Finch." It is owned by the AIM
- * account "markdoliner." Please don't use this key for other
- * applications. You can either not specify a client key, in
- * which case the default "libpurple" key will be used, or you
- * can try to register your own at the AIM or ICQ web sites
- * (although this functionality was removed at some point, it's
- * possible it has been re-added). AOL's old key management
- * page is http://developer.aim.com/manageKeys.jsp
+ * This is the client key for "Finch." Please don't use this
+ * key for other applications. You can not specify a client
+ * key, in which case the default "libpurple" key will be used
*/
- g_hash_table_insert(ui_info, "prpl-aim-clientkey", "ma19sqWV9ymU6UYc");
+ g_hash_table_insert(ui_info, "prpl-aim-clientkey", "ma18nmEklXMR7Cj_");
/*
* This is the client key for "Pidgin." It is owned by the AIM
@@ -102,7 +97,7 @@
* don't use this for other applications. You can just not
* specify a distid and libpurple will use a default.
*/
- g_hash_table_insert(ui_info, "prpl-aim-distid", GINT_TO_POINTER(1552));
+ g_hash_table_insert(ui_info, "prpl-aim-distid", GINT_TO_POINTER(1718));
g_hash_table_insert(ui_info, "prpl-icq-distid", GINT_TO_POINTER(1552));
}
--- a/finch/libgnt/gntkeys.c Tue Feb 28 22:48:04 2017 -0600
+++ b/finch/libgnt/gntkeys.c Mon Mar 06 20:44:31 2017 -0600
@@ -211,7 +211,7 @@
*/
#define SIZE 256
-#define IS_END 1 << 0
+#define IS_END (1 << 0)
struct _node
{
struct _node *next[SIZE];
--- a/libpurple/buddyicon.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/buddyicon.c Mon Mar 06 20:44:31 2017 -0600
@@ -1264,8 +1264,8 @@
g_free, NULL);
pointer_icon_cache = g_hash_table_new(g_direct_hash, g_direct_equal);
- if (!cache_dir)
- cache_dir = g_build_filename(purple_user_dir(), "icons", NULL);
+ if (!cache_dir)
+ cache_dir = g_build_filename(purple_user_dir(), "icons", NULL);
purple_signal_connect(purple_imgstore_get_handle(), "image-deleting",
purple_buddy_icons_get_handle(),
--- a/libpurple/certificate.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/certificate.c Mon Mar 06 20:44:31 2017 -0600
@@ -84,6 +84,29 @@
}
}
+static void
+get_ascii_fingerprints (PurpleCertificate *crt, gchar **sha1, gchar **sha256)
+{
+ GByteArray *sha_bin;
+
+ if (sha1 != NULL) {
+ sha_bin = purple_certificate_get_fingerprint_sha1(crt);
+
+ *sha1 = purple_base16_encode_chunked(sha_bin->data, sha_bin->len);
+
+ g_byte_array_free(sha_bin, TRUE);
+ }
+
+ if (sha256 != NULL) {
+ sha_bin = purple_certificate_get_fingerprint_sha256(crt, FALSE);
+
+ *sha256 = (sha_bin == NULL) ? g_strdup("(null)") :
+ purple_base16_encode_chunked(sha_bin->data, sha_bin->len);
+
+ g_byte_array_free(sha_bin, TRUE);
+ }
+}
+
void
purple_certificate_verify (PurpleCertificateVerifier *verifier,
const gchar *subject_name, GList *cert_chain,
@@ -388,6 +411,30 @@
return fpr;
}
+GByteArray *
+purple_certificate_get_fingerprint_sha256(PurpleCertificate *crt, gboolean sha1_fallback)
+{
+ PurpleCertificateScheme *scheme;
+ GByteArray *fpr = NULL;
+
+ g_return_val_if_fail(crt, NULL);
+ g_return_val_if_fail(crt->scheme, NULL);
+
+ scheme = crt->scheme;
+
+ if (!PURPLE_CERTIFICATE_SCHEME_HAS_FUNC(scheme, get_fingerprint_sha256)) {
+ /* outdated ssl module? fallback to sha1 and print a warning */
+ if (sha1_fallback) {
+ fpr = purple_certificate_get_fingerprint_sha1(crt);
+ }
+ g_return_val_if_reached(fpr);
+ }
+
+ fpr = (scheme->get_fingerprint_sha256)(crt);
+
+ return fpr;
+}
+
gchar *
purple_certificate_get_unique_id(PurpleCertificate *crt)
{
@@ -630,18 +677,13 @@
static void
x509_singleuse_start_verify (PurpleCertificateVerificationRequest *vrq)
{
- gchar *sha_asc;
- GByteArray *sha_bin;
+ gchar *sha1_asc, *sha256_asc;
gchar *cn;
const gchar *cn_match;
- gchar *primary, *secondary;
+ gchar *primary, *secondary, *secondary_extra;
PurpleCertificate *crt = (PurpleCertificate *) vrq->cert_chain->data;
- /* Pull out the SHA1 checksum */
- sha_bin = purple_certificate_get_fingerprint_sha1(crt);
- /* Now decode it for display */
- sha_asc = purple_base16_encode_chunked(sha_bin->data,
- sha_bin->len);
+ get_ascii_fingerprints(crt, &sha1_asc, &sha256_asc);
/* Get the cert Common Name */
cn = purple_certificate_get_subject_name(crt);
@@ -655,14 +697,17 @@
/* Make messages */
primary = g_strdup_printf(_("%s has presented the following certificate for just-this-once use:"), vrq->subject_name);
- secondary = g_strdup_printf(_("Common name: %s %s\nFingerprint (SHA1): %s"), cn, cn_match, sha_asc);
+ secondary = g_strdup_printf(_("Common name: %s %s\nFingerprint (SHA1): %s"), cn, cn_match, sha1_asc);
+
+ /* TODO: make this part of the translatable string above */
+ secondary_extra = g_strdup_printf("%s\nSHA256: %s", secondary, sha256_asc);
/* Make a semi-pretty display */
purple_request_accept_cancel(
vrq->cb_data, /* TODO: Find what the handle ought to be */
_("Single-use Certificate Verification"),
primary,
- secondary,
+ secondary_extra,
0, /* Accept by default */
NULL, /* No account */
NULL, /* No other user */
@@ -675,8 +720,9 @@
g_free(cn);
g_free(primary);
g_free(secondary);
- g_free(sha_asc);
- g_byte_array_free(sha_bin, TRUE);
+ g_free(secondary_extra);
+ g_free(sha1_asc);
+ g_free(sha256_asc);
}
static void
@@ -1506,10 +1552,10 @@
return;
}
- /* Now get SHA1 sums for both and compare them */
+ /* Now get SHA256 sums for both and compare them */
/* TODO: This is not an elegant way to compare certs */
- peer_fpr = purple_certificate_get_fingerprint_sha1(peer_crt);
- cached_fpr = purple_certificate_get_fingerprint_sha1(cached_crt);
+ peer_fpr = purple_certificate_get_fingerprint_sha256(peer_crt, TRUE);
+ cached_fpr = purple_certificate_get_fingerprint_sha256(cached_crt, TRUE);
if (!memcmp(peer_fpr->data, cached_fpr->data, peer_fpr->len)) {
purple_debug_info("certificate/x509/tls_cached",
"Peer cert matched cached\n");
@@ -1616,8 +1662,8 @@
if (ca_crt != NULL) {
GByteArray *failing_fpr;
GByteArray *ca_fpr;
- failing_fpr = purple_certificate_get_fingerprint_sha1(failing_crt);
- ca_fpr = purple_certificate_get_fingerprint_sha1(ca_crt);
+ failing_fpr = purple_certificate_get_fingerprint_sha256(failing_crt, TRUE);
+ ca_fpr = purple_certificate_get_fingerprint_sha256(ca_crt, TRUE);
if (byte_arrays_equal(failing_fpr, ca_fpr)) {
purple_debug_info("certificate/x509/tls_cached",
"Full chain verification failed (probably a bad "
@@ -1699,10 +1745,10 @@
* If the fingerprints don't match, we'll fall back to checking the
* signature.
*/
- last_fpr = purple_certificate_get_fingerprint_sha1(end_crt);
+ last_fpr = purple_certificate_get_fingerprint_sha256(end_crt, TRUE);
for (cur = ca_crts; cur; cur = cur->next) {
ca_crt = cur->data;
- ca_fpr = purple_certificate_get_fingerprint_sha1(ca_crt);
+ ca_fpr = purple_certificate_get_fingerprint_sha256(ca_crt, TRUE);
if ( byte_arrays_equal(last_fpr, ca_fpr) ||
purple_certificate_signed_by(end_crt, ca_crt) )
@@ -2152,19 +2198,14 @@
void
purple_certificate_display_x509(PurpleCertificate *crt)
{
- gchar *sha_asc;
- GByteArray *sha_bin;
+ gchar *sha1_asc, *sha256_asc;
gchar *cn, *issuer_id;
time_t activation, expiration;
gchar *activ_str, *expir_str;
- gchar *secondary;
+ gchar *secondary, *secondary_extra;
gboolean self_signed;
- /* Pull out the SHA1 checksum */
- sha_bin = purple_certificate_get_fingerprint_sha1(crt);
- /* Now decode it for display */
- sha_asc = purple_base16_encode_chunked(sha_bin->data,
- sha_bin->len);
+ get_ascii_fingerprints(crt, &sha1_asc, &sha256_asc);
/* Get the cert Common Name */
/* TODO: Will break on CA certs */
@@ -2193,20 +2234,23 @@
"Expiration date: %s\n"),
cn ? cn : "(null)",
self_signed ? _("(self-signed)") : (issuer_id ? issuer_id : "(null)"),
- sha_asc ? sha_asc : "(null)",
+ sha1_asc ? sha1_asc : "(null)",
activ_str ? activ_str : "(null)",
expir_str ? expir_str : "(null)");
+ /* TODO: make this part of the translatable string above */
+ secondary_extra = g_strdup_printf("%sSHA256: %s", secondary, sha256_asc);
+
/* Make a semi-pretty display */
if (self_signed) {
purple_notify_info(NULL, /* TODO: Find what the handle ought to be */
_("Certificate Information"),
"",
- secondary);
+ secondary_extra);
} else {
purple_request_action(NULL, /* TODO: Find what the handle ought to be */
_("Certificate Information"), _("Certificate Information"),
- secondary, 2, NULL, NULL, NULL,
+ secondary_extra, 2, NULL, NULL, NULL,
issuer_id, 2,
_("View Issuer Certificate"), PURPLE_CALLBACK(display_x509_issuer),
_("Close"), PURPLE_CALLBACK(g_free));
@@ -2219,10 +2263,11 @@
g_free(cn);
g_free(issuer_id);
g_free(secondary);
- g_free(sha_asc);
+ g_free(secondary_extra);
+ g_free(sha1_asc);
+ g_free(sha256_asc);
g_free(activ_str);
g_free(expir_str);
- g_byte_array_free(sha_bin, TRUE);
}
void purple_certificate_add_ca_search_path(const char *path)
--- a/libpurple/certificate.h Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/certificate.h Mon Mar 06 20:44:31 2017 -0600
@@ -315,9 +315,31 @@
*/
void (* verify_cert)(PurpleCertificateVerificationRequest *vrq, PurpleCertificateInvalidityFlags *flags);
- void (*_purple_reserved3)(void);
+ /**
+ * The size of the PurpleCertificateScheme. This should always be sizeof(PurpleCertificateScheme).
+ * This allows adding more functions to this struct without requiring a major version bump.
+ *
+ * PURPLE_CERTIFICATE_SCHEME_HAS_FUNC() should be used for functions after this point.
+ */
+ unsigned long struct_size;
+
+ /**
+ * Retrieves the certificate public key fingerprint using SHA256
+ *
+ * @param crt Certificate instance
+ * @return Binary representation of SHA256 hash - must be freed using
+ * g_byte_array_free()
+ * @since 2.12.0
+ */
+ GByteArray * (* get_fingerprint_sha256)(PurpleCertificate *crt);
};
+#define PURPLE_CERTIFICATE_SCHEME_HAS_FUNC(obj, member) \
+ (((G_STRUCT_OFFSET(PurpleCertificateScheme, member) < G_STRUCT_OFFSET(PurpleCertificateScheme, struct_size)) \
+ || (G_STRUCT_OFFSET(PurpleCertificateScheme, member) < obj->struct_size)) && \
+ obj->member != NULL)
+
+
/** A set of operations used to provide logic for verifying a Certificate's
* authenticity.
*
@@ -578,12 +600,26 @@
* Retrieves the certificate public key fingerprint using SHA1.
*
* @param crt Certificate instance
- * @return Binary representation of the hash. You are responsible for free()ing
- * this.
+ * @return Binary representation of the hash. You are responsible for freeing
+ * this with g_byte_array_free().
+ * @see purple_base16_encode_chunked()
+ * @see purple_certificate_get_fingerprint_sha256()
+ */
+GByteArray *
+purple_certificate_get_fingerprint_sha1(PurpleCertificate *crt);
+
+/**
+ * Retrieves the certificate public key fingerprint using SHA256.
+ *
+ * @param crt Certificate instance
+ * @param sha1_fallback If true, return SHA1 if the SSL module doesn't
+ * implement SHA256. Otherwise, return NULL.
+ * @return Binary representation of the hash. You are responsible for freeing
+ * this with g_byte_array_free().
* @see purple_base16_encode_chunked()
*/
GByteArray *
-purple_certificate_get_fingerprint_sha1(PurpleCertificate *crt);
+purple_certificate_get_fingerprint_sha256(PurpleCertificate *crt, gboolean sha1_fallback);
/**
* Get a unique identifier for the certificate
--- a/libpurple/conversation.h Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/conversation.h Mon Mar 06 20:44:31 2017 -0600
@@ -126,7 +126,10 @@
PURPLE_MESSAGE_NOTIFY = 0x2000, /**< Message is a notification */
PURPLE_MESSAGE_NO_LINKIFY = 0x4000, /**< Message should not be auto-
linkified @since 2.1.0 */
- PURPLE_MESSAGE_INVISIBLE = 0x8000 /**< Message should not be displayed */
+ PURPLE_MESSAGE_INVISIBLE = 0x8000, /**< Message should not be displayed */
+ PURPLE_MESSAGE_REMOTE_SEND = 0x10000 /**< Message sent from another location,
+ not an echo of a local one
+ @since 2.12.0 */
} PurpleMessageFlags;
/**
--- a/libpurple/dbus-server.h Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/dbus-server.h Mon Mar 06 20:44:31 2017 -0600
@@ -199,7 +199,9 @@
*/
+#ifndef DBUS_EXPORT
#define DBUS_EXPORT
+#endif
/*
Here we include the list of #PURPLE_DBUS_DECLARE_TYPE statements for
--- a/libpurple/plugins/perl/common/Certificate.xs Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/plugins/perl/common/Certificate.xs Mon Mar 06 20:44:31 2017 -0600
@@ -219,6 +219,19 @@
OUTPUT:
RETVAL
+SV*
+purple_certificate_get_fingerprint_sha256(crt, sha1_fallback)
+ Purple::Certificate crt
+ gboolean sha1_fallback
+ PREINIT:
+ GByteArray *gba = NULL;
+ CODE:
+ gba = purple_certificate_get_fingerprint_sha256(crt, sha1_fallback);
+ RETVAL = newSVpv((gchar *)gba->data, gba->len);
+ g_byte_array_free(gba, TRUE);
+ OUTPUT:
+ RETVAL
+
void
purple_certificate_verify(verifier, subject_name, cert_chain, cb, cb_data)
Purple::Certificate::Verifier verifier
--- a/libpurple/plugins/ssl/ssl-gnutls.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/plugins/ssl/ssl-gnutls.c Mon Mar 06 20:44:31 2017 -0600
@@ -1037,9 +1037,9 @@
}
static GByteArray *
-x509_sha1sum(PurpleCertificate *crt)
+x509_shasum(PurpleCertificate *crt, gnutls_digest_algorithm_t algo)
{
- size_t hashlen = 20; /* SHA1 hashes are 20 bytes */
+ size_t hashlen = (algo == GNUTLS_DIG_SHA1) ? 20 : 32;
size_t tmpsz = hashlen; /* Throw-away variable for GnuTLS to stomp on*/
gnutls_x509_crt_t crt_dat;
GByteArray *hash; /**< Final hash container */
@@ -1051,7 +1051,7 @@
/* Extract the fingerprint */
g_return_val_if_fail(
- 0 == gnutls_x509_crt_get_fingerprint(crt_dat, GNUTLS_DIG_SHA,
+ 0 == gnutls_x509_crt_get_fingerprint(crt_dat, algo,
hashbuf, &tmpsz),
NULL);
@@ -1065,6 +1065,18 @@
return hash;
}
+static GByteArray *
+x509_sha1sum(PurpleCertificate *crt)
+{
+ return x509_shasum(crt, GNUTLS_DIG_SHA1);
+}
+
+static GByteArray *
+x509_sha256sum(PurpleCertificate *crt)
+{
+ return x509_shasum(crt, GNUTLS_DIG_SHA256);
+}
+
static gchar *
x509_cert_dn (PurpleCertificate *crt)
{
@@ -1239,8 +1251,8 @@
NULL,
NULL,
- NULL
-
+ sizeof(PurpleCertificateScheme), /* struct_size */
+ x509_sha256sum, /* SHA256 fingerprint */
};
static PurpleSslOps ssl_ops =
--- a/libpurple/plugins/ssl/ssl-nss.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/plugins/ssl/ssl-nss.c Mon Mar 06 20:44:31 2017 -0600
@@ -881,11 +881,11 @@
}
static GByteArray *
-x509_sha1sum(PurpleCertificate *crt)
+x509_shasum(PurpleCertificate *crt, SECOidTag algo)
{
CERTCertificate *crt_dat;
- size_t hashlen = 20; /* Size of an sha1sum */
- GByteArray *sha1sum;
+ size_t hashlen = (algo == SEC_OID_SHA1) ? 20 : 32;
+ GByteArray *hash;
SECItem *derCert; /* DER representation of the cert */
SECStatus st;
@@ -899,22 +899,34 @@
derCert = &(crt_dat->derCert);
/* Make a hash! */
- sha1sum = g_byte_array_sized_new(hashlen);
+ hash = g_byte_array_sized_new(hashlen);
/* glib leaves the size as 0 by default */
- sha1sum->len = hashlen;
+ hash->len = hashlen;
- st = PK11_HashBuf(SEC_OID_SHA1, sha1sum->data,
+ st = PK11_HashBuf(algo, hash->data,
derCert->data, derCert->len);
/* Check for errors */
if (st != SECSuccess) {
- g_byte_array_free(sha1sum, TRUE);
+ g_byte_array_free(hash, TRUE);
purple_debug_error("nss/x509",
"Error: hashing failed!\n");
return NULL;
}
- return sha1sum;
+ return hash;
+}
+
+static GByteArray *
+x509_sha1sum(PurpleCertificate *crt)
+{
+ return x509_shasum(crt, SEC_OID_SHA1);
+}
+
+static GByteArray *
+x509_sha256sum(PurpleCertificate *crt)
+{
+ return x509_shasum(crt, SEC_OID_SHA256);
}
static gchar *
@@ -1211,7 +1223,8 @@
x509_importcerts_from_file, /* Multiple certificate import function */
x509_register_trusted_tls_cert, /* Register a certificate as trusted for TLS */
x509_verify_cert, /* Verify that the specified cert chain is trusted */
- NULL
+ sizeof(PurpleCertificateScheme), /* struct_size */
+ x509_sha256sum, /* SHA256 fingerprint */
};
static PurpleSslOps ssl_ops =
--- a/libpurple/protocols/bonjour/jabber.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/protocols/bonjour/jabber.c Mon Mar 06 20:44:31 2017 -0600
@@ -1320,8 +1320,8 @@
if(check_if_blocked(pb))
return;
- account = purple_buddy_get_account(pb);
- gc = purple_account_get_connection(account);
+ account = purple_buddy_get_account(pb);
+ gc = purple_account_get_connection(account);
if (xmlnode_get_child(packet, "si") != NULL || xmlnode_get_child(packet, "error") != NULL)
xep_si_parse(gc, packet, pb);
--- a/libpurple/protocols/irc/msgs.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/protocols/irc/msgs.c Mon Mar 06 20:44:31 2017 -0600
@@ -1574,6 +1574,8 @@
int id = 0;
PurpleConnection *gc = purple_account_get_connection(irc->account);
const char *mech_list = NULL;
+ char *pos;
+ size_t index;
if (strncmp(args[2], "sasl ", 6))
return;
@@ -1637,6 +1639,15 @@
}
irc->sasl_mechs = g_string_new(mech_list);
+ /* Drop EXTERNAL mechanism since we don't support it */
+ if ((pos = strstr(irc->sasl_mechs->str, "EXTERNAL"))) {
+ index = pos - irc->sasl_mechs->str;
+ g_string_erase(irc->sasl_mechs, index, strlen("EXTERNAL"));
+ /* Remove space which separated this mech from the next */
+ if ((irc->sasl_mechs->str)[index] == ' ') {
+ g_string_erase(irc->sasl_mechs, index, 1);
+ }
+ }
irc_auth_start_cyrus(irc);
}
--- a/libpurple/protocols/novell/nmrtf.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/protocols/novell/nmrtf.c Mon Mar 06 20:44:31 2017 -0600
@@ -474,23 +474,23 @@
static int
rtf_pop_state(NMRtfContext *ctx)
{
- NMRtfStateSave *save_old;
+ NMRtfStateSave *save_old;
GSList *link_old;
- if (ctx->saved == NULL)
- return NMRTF_STACK_UNDERFLOW;
+ if (ctx->saved == NULL)
+ return NMRTF_STACK_UNDERFLOW;
save_old = ctx->saved->data;
- ctx->chp = save_old->chp;
- ctx->rds = save_old->rds;
- ctx->ris = save_old->ris;
- (ctx->depth)--;
+ ctx->chp = save_old->chp;
+ ctx->rds = save_old->rds;
+ ctx->ris = save_old->ris;
+ (ctx->depth)--;
- g_free(save_old);
+ g_free(save_old);
link_old = ctx->saved;
ctx->saved = g_slist_remove_link(ctx->saved, link_old);
g_slist_free_1(link_old);
- return NMRTF_OK;
+ return NMRTF_OK;
}
/*
@@ -671,13 +671,13 @@
static int
rtf_apply_property(NMRtfContext *ctx, NMRtfProperty prop, int val)
{
- if (ctx->rds == NMRTF_STATE_SKIP) /* If we're skipping text, */
- return NMRTF_OK; /* don't do anything. */
+ if (ctx->rds == NMRTF_STATE_SKIP) /* If we're skipping text, */
+ return NMRTF_OK; /* don't do anything. */
/* Need to flush any temporary data before a property change*/
rtf_flush_data(ctx);
- switch (prop) {
+ switch (prop) {
case NMRTF_PROP_FONT_IDX:
ctx->chp.font_idx = val;
break;
@@ -686,9 +686,9 @@
break;
default:
return NMRTF_BAD_TABLE;
- }
+ }
- return NMRTF_OK;
+ return NMRTF_OK;
}
/*
--- a/libpurple/protocols/oscar/clientlogin.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/protocols/oscar/clientlogin.c Mon Mar 06 20:44:31 2017 -0600
@@ -73,21 +73,11 @@
return start_oscar_session_urls[od->icq ? 1 : 0];
}
-/*
- * Using clientLogin requires a developer ID. This key is for libpurple.
- * It is the default key for all libpurple-based clients. AOL encourages
- * UIs (especially ones with lots of users) to override this with their
- * own key. This key is owned by the AIM account "markdoliner"
- *
- * Keys can be managed at http://developer.aim.com/manageKeys.jsp
- */
-#define DEFAULT_CLIENT_KEY "ma15d7JTxbmVG-RP"
-
static const char *get_client_key(OscarData *od)
{
return oscar_get_ui_info_string(
od->icq ? "prpl-icq-clientkey" : "prpl-aim-clientkey",
- DEFAULT_CLIENT_KEY);
+ od->icq ? ICQ_DEFAULT_CLIENT_KEY : AIM_DEFAULT_CLIENT_KEY);
}
static gchar *generate_error_message(xmlnode *resp, const char *url)
@@ -362,8 +352,7 @@
const gchar *encryption_type = purple_account_get_string(account, "encryption", OSCAR_DEFAULT_ENCRYPTION);
/*
- * Construct the GET parameters. 0x00000611 is the distid given to
- * us by AOL for use as the default libpurple distid.
+ * Construct the GET parameters.
*/
query_string = g_strdup_printf("a=%s"
"&distId=%d"
@@ -372,7 +361,8 @@
"&ts=%" PURPLE_TIME_T_MODIFIER
"&useTLS=%d",
purple_url_encode(token),
- oscar_get_ui_info_int(od->icq ? "prpl-icq-distid" : "prpl-aim-distid", 0x00000611),
+ oscar_get_ui_info_int(od->icq ? "prpl-icq-distid" : "prpl-aim-distid",
+ od->icq ? ICQ_DEFAULT_DIST_ID : AIM_DEFAULT_DIST_ID),
get_client_key(od),
hosttime,
strcmp(encryption_type, OSCAR_NO_ENCRYPTION) != 0 ? 1 : 0);
--- a/libpurple/protocols/oscar/kerberos.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/protocols/oscar/kerberos.c Mon Mar 06 20:44:31 2017 -0600
@@ -98,21 +98,11 @@
return url;
}
-/*
- * Using kerberos auth requires a developer ID. This key is for libpurple.
- * It is the default key for all libpurple-based clients. AOL encourages
- * UIs (especially ones with lots of users) to override this with their
- * own key. This key is owned by the AIM account "markdoliner"
- *
- * Keys can be managed at http://developer.aim.com/manageKeys.jsp
- */
-#define DEFAULT_CLIENT_KEY "ma15d7JTxbmVG-RP"
-
static const char *get_client_key(OscarData *od)
{
return oscar_get_ui_info_string(
od->icq ? "prpl-icq-clientkey" : "prpl-aim-clientkey",
- DEFAULT_CLIENT_KEY);
+ od->icq ? ICQ_DEFAULT_CLIENT_KEY : AIM_DEFAULT_CLIENT_KEY);
}
static void
--- a/libpurple/protocols/oscar/oscarcommon.h Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/protocols/oscar/oscarcommon.h Mon Mar 06 20:44:31 2017 -0600
@@ -41,6 +41,17 @@
#define AIM_DEFAULT_KDC_SERVER "kdc.uas.aol.com"
#define AIM_DEFAULT_KDC_PORT 443
+/*
+ * Using clientLogin requires a developer ID. This key is for libpurple.
+ * It is the default key for all libpurple-based clients. AOL encourages
+ * UIs (especially ones with lots of users) to override this with their
+ * own key.
+ */
+#define ICQ_DEFAULT_DIST_ID 1553
+#define ICQ_DEFAULT_CLIENT_KEY "ma15d7JTxbmVG-RP"
+#define AIM_DEFAULT_DIST_ID 1717
+#define AIM_DEFAULT_CLIENT_KEY "ma19CwYN9i9Mw5nY"
+
#define OSCAR_DEFAULT_LOGIN_PORT 5190
#define OSCAR_OPPORTUNISTIC_ENCRYPTION "opportunistic_encryption"
--- a/libpurple/protocols/zephyr/Zinternal.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/protocols/zephyr/Zinternal.c Mon Mar 06 20:44:31 2017 -0600
@@ -259,7 +259,7 @@
if (!packet_len)
return (ZERR_EOF);
- packet[packet_len] = '\0';
+ packet[packet_len] = '\0';
/* Ignore obviously non-Zephyr packets. */
zvlen = sizeof(ZVERSIONHDR) - 1;
--- a/libpurple/sslconn.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/sslconn.c Mon Mar 06 20:44:31 2017 -0600
@@ -190,7 +190,7 @@
PurpleSslErrorFunction error_func,
void *data)
{
- return purple_ssl_connect_with_host_fd(account, fd, func, error_func, NULL, data);
+ return purple_ssl_connect_with_host_fd(account, fd, func, error_func, NULL, data);
}
PurpleSslConnection *
@@ -219,8 +219,9 @@
gsc->connect_cb = func;
gsc->error_cb = error_func;
gsc->fd = fd;
- if(host)
- gsc->host = g_strdup(host);
+ if (host) {
+ gsc->host = g_strdup(host);
+ }
/* TODO: Move this elsewhere */
gsc->verifier = purple_certificate_find_verifier("x509","tls_cached");
--- a/libpurple/util.c Tue Feb 28 22:48:04 2017 -0600
+++ b/libpurple/util.c Mon Mar 06 20:44:31 2017 -0600
@@ -219,10 +219,6 @@
/**************************************************************************
* Base64 Functions
**************************************************************************/
-static const char alphabet[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
- "0123456789+/";
-
static const char xdigits[] =
"0123456789abcdef";