Ignore:
Timestamp:
2023-02-23T23:48:10Z (14 months ago)
Author:
GitHub <noreply@…>
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)
Message:

Migrate internal users of md5.h to using GChecksum directly (#169)

  • Use GChecksum directly rather than md5 wrapper
  • Mark md5 functions as deprecated.
  • Migrate more users of md5.h to GChecksum
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber_util.c

    r7342cae r1bdc669  
    2323
    2424#include "jabber.h"
    25 #include "md5.h"
    2625#include "base64.h"
    2726
     
    141140        struct jabber_data *jd = ic->proto_data;
    142141        struct jabber_cache_entry *entry = g_new0(struct jabber_cache_entry, 1);
    143         md5_state_t id_hash;
    144         md5_byte_t id_sum[16];
     142        GChecksum *id_hash;
     143        gsize digest_len = MD5_HASH_SIZE;
     144        guint8 id_sum[MD5_HASH_SIZE];
    145145        char *id, *asc_hash;
    146146
     
    148148
    149149        id_hash = jd->cached_id_prefix;
    150         md5_append(&id_hash, (md5_byte_t *) &next_id, sizeof(next_id));
    151         md5_digest_keep(&id_hash, id_sum);
     150        g_checksum_update(id_hash, (guint8 *) &next_id, sizeof(next_id));
     151        g_checksum_get_digest(id_hash, id_sum, &digest_len);
     152        g_checksum_free(id_hash);
     153
    152154        asc_hash = base64_encode(id_sum, 12);
    153155
Note: See TracChangeset for help on using the changeset viewer.