X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmd5.c;h=9d0b4421e7e90fb83092942a268de4d6474285a5;hb=3367e0fa984b3e5f61b2f75f07fc4e11f824bb73;hp=c0ba96afad0341f1e0c24828565888616f076b53;hpb=1f79d7b9a6f60f331ea0c90e9eb4ef7c40ee7aa5;p=citadel.git diff --git a/citadel/md5.c b/citadel/md5.c index c0ba96afa..9d0b4421e 100644 --- a/citadel/md5.c +++ b/citadel/md5.c @@ -150,7 +150,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx) MD5Transform(ctx->buf, (cit_uint32_t *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(struct MD5Context)); /* In case it's sensitive */ } #ifndef ASM_MD5 @@ -336,25 +336,22 @@ void MD5Transform(cit_uint32_t buf[4], cit_uint32_t const in[16]) * md5 string */ -char *make_apop_string(char *realpass, char *nonce, char *buffer) +char *make_apop_string(char *realpass, char *nonce, char *buffer, size_t n) { struct MD5Context ctx; u_char rawdigest[MD5_DIGEST_LEN]; int i; MD5Init(&ctx); -// printf("MD5@@: Adding nonce: %s\n", nonce); MD5Update(&ctx, (u_char*)nonce, strlen(nonce)); -// printf("MD5@@: Adding password %s\n", realpass); MD5Update(&ctx, (u_char*)realpass, strlen(realpass)); MD5Final(rawdigest, &ctx); for (i=0; i