projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move signal.c into lib/sys
[apps/madmutt.git]
/
imap
/
auth_cram.c
diff --git
a/imap/auth_cram.c
b/imap/auth_cram.c
index
3f3d8ff
..
0438a82
100644
(file)
--- a/
imap/auth_cram.c
+++ b/
imap/auth_cram.c
@@
-17,12
+17,12
@@
#include "imap_private.h"
#include "auth.h"
#include "imap_private.h"
#include "auth.h"
-#include "md5.h"
#define MD5_BLOCK_LEN 64
#define MD5_DIGEST_LEN 16
#define MD5_BLOCK_LEN 64
#define MD5_DIGEST_LEN 16
-#include "lib/intl.h"
-#include "lib/debug.h"
+#include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
+#include <lib-hash/hash.h>
/* forward declarations */
static void hmac_md5 (const char *password, char *challenge,
/* forward declarations */
static void hmac_md5 (const char *password, char *challenge,
@@
-42,7
+42,7
@@
imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA * idata, const char *method)
mutt_message _("Authenticating (CRAM-MD5)...");
/* get auth info */
mutt_message _("Authenticating (CRAM-MD5)...");
/* get auth info */
- if (mutt_account_get
user
(&idata->conn->account))
+ if (mutt_account_get
login
(&idata->conn->account))
return IMAP_AUTH_FAILURE;
if (mutt_account_getpass (&idata->conn->account))
return IMAP_AUTH_FAILURE;
return IMAP_AUTH_FAILURE;
if (mutt_account_getpass (&idata->conn->account))
return IMAP_AUTH_FAILURE;
@@
-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,
*/
mutt_to_base64 ((unsigned char *) ibuf, (unsigned char *) obuf,
- m
utt_strlen
(obuf), sizeof (ibuf) - 2);
-
safe_strcat (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
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;
unsigned int secret_len, chal_len;
int i;
- secret_len = m
utt_strlen
(password);
- chal_len = m
utt_strlen
(challenge);
+ secret_len = m
_strlen
(password);
+ chal_len = m
_strlen
(challenge);
/* passwords longer than MD5_BLOCK_LEN bytes are substituted with their MD5
* digests */
/* passwords longer than MD5_BLOCK_LEN bytes are substituted with their MD5
* digests */
@@
-143,14
+143,14
@@
static void hmac_md5 (const char *password, char *challenge,
MD5Init (&ctx);
MD5Update (&ctx, (unsigned char *) password, secret_len);
MD5Final (hash_passwd, &ctx);
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
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);
memcpy (ipad, secret, secret_len);
memcpy (opad, secret, secret_len);