Changeset 1bdc669 for storage_xml.c
- Timestamp:
- 2023-02-23T23:48:10Z (14 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
-
storage_xml.c
r7342cae r1bdc669 28 28 #include "base64.h" 29 29 #include "arc.h" 30 #include "md5.h"31 30 #include "xmltree.h" 32 31 … … 323 322 char *pass_buf = NULL; 324 323 account_t *acc; 325 md5_byte_tpass_md5[21];326 md5_state_tmd5_state;324 guint8 pass_md5[21]; 325 GChecksum *md5_state; 327 326 GSList *l; 328 327 struct xt_node *root, *cur; 328 gsize digest_len = MD5_HASH_SIZE; 329 329 330 330 root = cur = xt_new_node("user", NULL, NULL); … … 336 336 byte password hash, more convenient for base64 encoding. */ 337 337 random_bytes(pass_md5 + 16, 5); 338 md5_init(&md5_state); 339 md5_append(&md5_state, (md5_byte_t *) irc->password, strlen(irc->password)); 340 md5_append(&md5_state, pass_md5 + 16, 5); /* Add the salt. */ 341 md5_finish(&md5_state, pass_md5); 338 md5_state = g_checksum_new(G_CHECKSUM_MD5); 339 g_checksum_update(md5_state, (guint8 *) irc->password, strlen(irc->password)); 340 g_checksum_update(md5_state, pass_md5 + 16, 5); /* Add the salt. */ 341 g_checksum_get_digest(md5_state, pass_md5, &digest_len); 342 g_checksum_free(md5_state); 342 343 /* Save the hash in base64-encoded form. */ 343 344 pass_buf = base64_encode(pass_md5, 21);
Note: See TracChangeset
for help on using the changeset viewer.