Mercurial > audlegacy-plugins
diff src/scrobbler/scrobbler.c @ 2599:19fb7d7dcf4e
Use the md5 routines in libaudutil.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 21 May 2008 09:06:21 +0300 |
parents | bd3a24b39058 |
children | ff9b4776b938 |
line wrap: on
line diff
--- a/src/scrobbler/scrobbler.c Wed May 21 08:32:33 2008 +0300 +++ b/src/scrobbler/scrobbler.c Wed May 21 09:06:21 2008 +0300 @@ -6,13 +6,13 @@ #include <curl/curl.h> #include <stdio.h> #include "fmt.h" -#include "md5.h" #include "scrobbler.h" #include "config.h" #include "settings.h" #include <glib.h> #include <audacious/plugin.h> +#include <audacious/audutil.h> #define SCROBBLER_HS_URL "http://post.audioscrobbler.com" #define SCROBBLER_CLI_ID "aud" @@ -440,12 +440,12 @@ static unsigned char *md5_string(char *pass, int len) { - md5_state_t md5state; + aud_md5state_t md5state; static unsigned char md5pword[16]; - md5_init(&md5state); - md5_append(&md5state, (unsigned const char *)pass, len); - md5_finish(&md5state, md5pword); + aud_md5_init(&md5state); + aud_md5_append(&md5state, (unsigned const char *)pass, len); + aud_md5_finish(&md5state, md5pword); return md5pword; } @@ -517,17 +517,17 @@ } if (sc_challenge_hash != NULL) { - md5_state_t md5state; + aud_md5state_t md5state; unsigned char md5pword[16]; - md5_init(&md5state); + aud_md5_init(&md5state); /*pdebug(fmt_vastr("Pass Hash: %s", sc_password), DEBUG);*/ - md5_append(&md5state, (unsigned const char *)sc_password, + aud_md5_append(&md5state, (unsigned const char *)sc_password, strlen(sc_password)); /*pdebug(fmt_vastr("Challenge Hash: %s", sc_challenge_hash), DEBUG);*/ - md5_append(&md5state, (unsigned const char *)sc_challenge_hash, + aud_md5_append(&md5state, (unsigned const char *)sc_challenge_hash, strlen(sc_challenge_hash)); - md5_finish(&md5state, md5pword); + aud_md5_finish(&md5state, md5pword); hexify((char*)md5pword, sizeof(md5pword)); /*pdebug(fmt_vastr("Response Hash: %s", sc_response_hash), DEBUG);*/ }