X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fauth_cram.c;h=ba2f42ec5db91b8536a71ca8524ec427daa2c543;hp=4a54f48ec8ad1089075df315c8743843706aeda5;hb=c98480f8568e6c1bc927c6c5f2b5e80b4aa6548c;hpb=a8477ebaa09990b3688164cbe5cf661c4189541d diff --git a/imap/auth_cram.c b/imap/auth_cram.c index 4a54f48..ba2f42e 100644 --- a/imap/auth_cram.c +++ b/imap/auth_cram.c @@ -17,11 +17,11 @@ #include "imap_private.h" #include "auth.h" -#include "md5.h" #define MD5_BLOCK_LEN 64 #define MD5_DIGEST_LEN 16 -#include "lib/intl.h" +#include +#include #include "lib/debug.h" /* forward declarations */ @@ -101,8 +101,8 @@ imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA * idata, const char *method) */ mutt_to_base64 ((unsigned char *) ibuf, (unsigned char *) obuf, - str_len (obuf), sizeof (ibuf) - 2); - str_cat (ibuf, sizeof (ibuf), "\r\n"); + m_strlen(obuf), sizeof (ibuf) - 2); + m_strcat(ibuf, sizeof(ibuf), "\r\n"); mutt_socket_write (idata->conn, ibuf); do @@ -134,8 +134,8 @@ static void hmac_md5 (const char *password, char *challenge, unsigned int secret_len, chal_len; int i; - secret_len = str_len (password); - chal_len = str_len (challenge); + secret_len = m_strlen(password); + chal_len = m_strlen(challenge); /* passwords longer than MD5_BLOCK_LEN bytes are substituted with their MD5 * digests */ @@ -149,8 +149,8 @@ static void hmac_md5 (const char *password, char *challenge, else strfcpy ((char *) secret, password, sizeof (secret)); - memset (ipad, 0, sizeof (ipad)); - memset (opad, 0, sizeof (opad)); + p_clear(ipad, 1); + p_clear(opad, 1); memcpy (ipad, secret, secret_len); memcpy (opad, secret, secret_len);