<html><head></head><body>It's a preexisting issue, but I'd remove the bogus p_ prefix<br><br><div class="gmail_quote">Le 15 avril 2020 14:35:20 GMT+03:00, Marvin Scholz <epirat07@gmail.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail"><hr> modules/misc/audioscrobbler.c | 38 +++++++++++------------------------<br> 1 file changed, 12 insertions(+), 26 deletions(-)<br><br>diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c<br>index 312c271fd0..107427f16e 100644<br>--- a/modules/misc/audioscrobbler.c<br>+++ b/modules/misc/audioscrobbler.c<br>@@ -44,7 +44,8 @@<br> #include <vlc_input_item.h><br> #include <vlc_dialog.h><br> #include <vlc_meta.h><br>-#include <vlc_md5.h><br>+#include <vlc_strings.h><br>+#include <vlc_hash.h><br> #include <vlc_memstream.h><br> #include <vlc_stream.h><br> #include <vlc_url.h><br>@@ -466,7 +467,7 @@ static int Handshake(intf_thread_t *p_this)<br> time_t timestamp;<br> char psz_timestamp[21];<br> <br>- struct md5_s p_struct_md5;<br>+ vlc_hash_md5_t p_struct_md5;<br> <br> stream_t *p_stream;<br> char *psz_handshake_url;<br>@@ -493,18 +494,12 @@ static int Handshake(intf_thread_t *p_this)<br> time(×tamp);<br> <br> /* generates a md5 hash of the password */<br>- InitMD5(&p_struct_md5);<br>- AddMD5(&p_struct_md5, (uint8_t*) psz_password, strlen(psz_password));<br>- EndMD5(&p_struct_md5);<br>-<br>+ vlc_hash_md5_Init(&p_struct_md5);<br>+ vlc_hash_md5_Update(&p_struct_md5, psz_password, strlen(psz_password));<br> free(psz_password);<br> <br>- char *psz_password_md5 = psz_md5_hash(&p_struct_md5);<br>- if (!psz_password_md5)<br>- {<br>- free(psz_username);<br>- return VLC_ENOMEM;<br>- }<br>+ char psz_password_md5[VLC_HASH_MD5_DIGEST_HEX_SIZE];<br>+ vlc_hash_FinishHex(&p_struct_md5, psz_password_md5);<br> <br> snprintf(psz_timestamp, sizeof(psz_timestamp), "%"PRIu64,<br> (uint64_t)timestamp);<br>@@ -513,23 +508,15 @@ static int Handshake(intf_thread_t *p_this)<br> * - md5 hash of the password, plus<br> * - timestamp in clear text<br> */<br>- InitMD5(&p_struct_md5);<br>- AddMD5(&p_struct_md5, (uint8_t*) psz_password_md5, 32);<br>- AddMD5(&p_struct_md5, (uint8_t*) psz_timestamp, strlen(psz_timestamp));<br>- EndMD5(&p_struct_md5);<br>- free(psz_password_md5);<br>-<br>- char *psz_auth_token = psz_md5_hash(&p_struct_md5);<br>- if (!psz_auth_token)<br>- {<br>- free(psz_username);<br>- return VLC_ENOMEM;<br>- }<br>+ vlc_hash_md5_Init(&p_struct_md5);<br>+ vlc_hash_md5_Update(&p_struct_md5, psz_password_md5, sizeof(psz_password_md5) - 1);<br>+ vlc_hash_md5_Update(&p_struct_md5, psz_timestamp, strlen(psz_timestamp));<br>+ char psz_auth_token[VLC_HASH_MD5_DIGEST_HEX_SIZE];<br>+ vlc_hash_FinishHex(&p_struct_md5, psz_auth_token);<br> <br> psz_scrobbler_url = var_InheritString(p_this, "scrobbler-url");<br> if (!psz_scrobbler_url)<br> {<br>- free(psz_auth_token);<br> free(psz_username);<br> return VLC_ENOMEM;<br> }<br>@@ -538,7 +525,6 @@ static int Handshake(intf_thread_t *p_this)<br> "http://%s/?hs=true&p=1.2&c="CLIENT_NAME"&v="CLIENT_VERSION"&u=%s&t=%s&a=%s"<br> , psz_scrobbler_url, psz_username, psz_timestamp, psz_auth_token);<br> <br>- free(psz_auth_token);<br> free(psz_scrobbler_url);<br> free(psz_username);<br> if (i_ret == -1)</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>