Changeset 1bdc669 for lib/misc.c
- Timestamp:
- 2023-02-23T23:48:10Z (2 years 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
-
lib/misc.c
r7342cae r1bdc669 34 34 #include "nogaim.h" 35 35 #include "base64.h" 36 #include "md5.h"37 36 #include <stdio.h> 38 37 #include <stdlib.h> … … 47 46 #endif 48 47 49 #include "md5.h"50 48 #include "ssl_client.h" 51 49 … … 576 574 int md5_verify_password(char *password, char *hash) 577 575 { 578 md5_byte_t *pass_dec = NULL; 579 md5_byte_t pass_md5[16]; 580 md5_state_t md5_state; 576 guint8 *pass_dec = NULL; 577 guint8 pass_md5[16]; 578 GChecksum *md5_state; 579 gsize digest_len = MD5_HASH_SIZE; 581 580 int ret = -1, i; 582 581 583 582 if (base64_decode(hash, &pass_dec) == 21) { 584 md5_init(&md5_state); 585 md5_append(&md5_state, (md5_byte_t *) password, strlen(password)); 586 md5_append(&md5_state, (md5_byte_t *) pass_dec + 16, 5); /* Hmmm, salt! */ 587 md5_finish(&md5_state, pass_md5); 583 md5_state = g_checksum_new(G_CHECKSUM_MD5); 584 g_checksum_update(md5_state, (guint8 *) password, strlen(password)); 585 g_checksum_update(md5_state, (guint8 *) pass_dec + 16, 5); /* Hmmm, salt! */ 586 g_checksum_get_digest(md5_state, pass_md5, &digest_len); 587 g_checksum_free(md5_state); 588 588 589 589 for (i = 0; i < 16; i++) {
Note: See TracChangeset
for help on using the changeset viewer.