Changeset 1bdc669 for protocols/jabber/jabber.c
- Timestamp:
- 2023-02-23T23:48:10Z (21 months ago)
- Branches:
- master
- Children:
- 93d4d8f
- Parents:
- 7342cae
- git-author:
- Jelmer Vernooij <jelmer@…> (23-02-23 23:48:10)
- git-committer:
- GitHub <noreply@…> (23-02-23 23:48:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
r7342cae r1bdc669 33 33 #include "jabber.h" 34 34 #include "oauth.h" 35 #include "md5.h"36 35 37 36 GSList *jabber_connections; … … 301 300 } 302 301 303 /* This generates an unfinished md5_state_tvariable. Every time we generate302 /* This generates an unfinished g_checksum variable. Every time we generate 304 303 an ID, we finish the state by adding a sequence number and take the hash. */ 305 304 static void jabber_generate_id_hash(struct jabber_data *jd) 306 305 { 307 md5_byte_tbinbuf[4];306 guint8 binbuf[4]; 308 307 char *s; 309 308 310 md5_init(&jd->cached_id_prefix);311 md5_append(&jd->cached_id_prefix, (unsigned char *)jd->username, strlen(jd->username));312 md5_append(&jd->cached_id_prefix, (unsigned char *)jd->server, strlen(jd->server));309 jd->cached_id_prefix = g_checksum_new(G_CHECKSUM_MD5); 310 g_checksum_update(jd->cached_id_prefix, jd->username, strlen(jd->username)); 311 g_checksum_update(jd->cached_id_prefix, jd->server, strlen(jd->server)); 313 312 s = set_getstr(&jd->ic->acc->set, "resource"); 314 md5_append(&jd->cached_id_prefix, (unsigned char *)s, strlen(s));313 g_checksum_update(jd->cached_id_prefix, s, strlen(s)); 315 314 random_bytes(binbuf, 4); 316 md5_append(&jd->cached_id_prefix, binbuf, 4);315 g_checksum_update(jd->cached_id_prefix, binbuf, 4); 317 316 } 318 317 … … 371 370 xt_free(jd->xt); 372 371 373 md5_free(&jd->cached_id_prefix);372 g_checksum_free(jd->cached_id_prefix); 374 373 375 374 g_free(jd->oauth2_access_token);
Note: See TracChangeset
for help on using the changeset viewer.