password-scheme-cram-md5.c revision 6c07b8ddc5e894feead4d422075b079451721241
/* Copyright (C) 2003 Timo Sirainen / Joshua Goodall */
#include "lib.h"
#include "md5.h"
#include "hex-binary.h"
#include "password-scheme.h"
const char *password_generate_cram_md5(const char *plaintext)
{
int i;
/* Hash excessively long passwords */
if (len > 64) {
} else {
}
for (i = 0; i < 64; i++) {
ipad[i] ^= 0x36;
opad[i] ^= 0x5c;
}
/* Make HMAC-MD5 hex digest */
#define CDPUT(p, c) STMT_START { \
*(p)++ = (c) & 0xff; \
*(p)++ = (c) >> 8 & 0xff; \
*(p)++ = (c) >> 16 & 0xff; \
*(p)++ = (c) >> 24 & 0xff; \
} STMT_END
}