#include "imap_private.h"
#include "auth.h"
-#include "md5.h"
#define MD5_BLOCK_LEN 64
#define MD5_DIGEST_LEN 16
#include <lib-lib/macros.h>
+#include <lib-hash/hash.h>
#include "lib/debug.h"
/* forward declarations */
mutt_to_base64 ((unsigned char *) ibuf, (unsigned char *) obuf,
m_strlen(obuf), sizeof (ibuf) - 2);
- str_cat (ibuf, sizeof (ibuf), "\r\n");
+ m_strcat(ibuf, sizeof(ibuf), "\r\n");
mutt_socket_write (idata->conn, ibuf);
do
MD5Init (&ctx);
MD5Update (&ctx, (unsigned char *) password, secret_len);
MD5Final (hash_passwd, &ctx);
- strfcpy ((char *) secret, (char *) hash_passwd, MD5_DIGEST_LEN);
+ m_strcpy((char *)secret, MD5_DIGEST_LEN, (char *)hash_passwd);
secret_len = MD5_DIGEST_LEN;
}
else
- strfcpy ((char *) secret, password, sizeof (secret));
+ m_strcpy((char *)secret, sizeof(secret), password);
- 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);