Ignore:
Timestamp:
2023-04-01T20:09:39Z (18 months ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
552da22
Parents:
59c9fa4d
git-author:
Jelmer Vernooij <jelmer@…> (01-04-23 20:09:39)
git-committer:
GitHub <noreply@…> (01-04-23 20:09:39)
Message:

Deprecate sha1_* functions (#172)

  • Migrate sha1 calls to direct use of GChecksum
  • Mark sha1.h functions as deprecated
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    r59c9fa4d ra4ac9c4  
    2323
    2424#include "jabber.h"
    25 #include "sha1.h"
    2625
    2726static xt_status jabber_parse_roster(struct im_connection *ic, struct xt_node *node, struct xt_node *orig);
     
    245244                /* We can do digest authentication, it seems, and of
    246245                   course we prefer that. */
    247                 sha1_state_t sha;
     246                GChecksum *sha;
    248247                char hash_hex[41];
    249248                unsigned char hash[20];
    250249                int i;
    251 
    252                 sha1_init(&sha);
    253                 sha1_append(&sha, (unsigned char *) s, strlen(s));
    254                 sha1_append(&sha, (unsigned char *) ic->acc->pass, strlen(ic->acc->pass));
    255                 sha1_finish(&sha, hash);
     250                gsize digest_len = 20;
     251
     252                sha = g_checksum_new(G_CHECKSUM_SHA1);
     253                g_checksum_update(sha, (unsigned char *) s, strlen(s));
     254                g_checksum_update(sha, (unsigned char *) ic->acc->pass, strlen(ic->acc->pass));
     255                g_checksum_get_digest(sha, hash, &digest_len);
     256                g_checksum_free(sha);
    256257
    257258                for (i = 0; i < 20; i++) {
Note: See TracChangeset for help on using the changeset viewer.