X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Finclude%2Fmd4.h;h=348d7bb4e999e8f96fc66b24111efd586a811468;hb=e2eaf9194b16fdd15ebf274aafd05edc9fefb4bb;hp=0223023995f008cf78e5ea0f4041c82484100355;hpb=ead2df5a7a288fde62552da2e05014c7acedd84e;p=freeradius.git diff --git a/src/include/md4.h b/src/include/md4.h index 0223023..348d7bb 100644 --- a/src/include/md4.h +++ b/src/include/md4.h @@ -6,8 +6,11 @@ * */ -#ifndef _LRAD_MD4_H -#define _LRAD_MD4_H +#ifndef _FR_MD4_H +#define _FR_MD4_H + +#include +RCSIDH(md4_h, "$Id$") #ifdef HAVE_INTTYPES_H #include @@ -23,17 +26,17 @@ #include -/* - * FreeRADIUS defines to ensure globally unique MD4 function names, - * so that we don't pick up other MD4 libraries. - */ -#define MD4_CTX librad_MD4_CTX -#define MD4Init librad_MD4Init -#define MD4Update librad_MD4Update -#define MD4Final librad_MD4Final +#ifdef WITH_OPENSSL_MD4 +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif -void md4_calc (unsigned char *, const unsigned char *, unsigned int); +void fr_md4_calc (unsigned char *, const unsigned char *, unsigned int); +#ifndef WITH_OPENSSL_MD4 /* The below was retrieved from * http://www.openbsd.org/cgi-bin/cvsweb/src/include/md4.h?rev=1.12 * With the following changes: uint64_t => uint32_t[2] @@ -65,30 +68,33 @@ void md4_calc (unsigned char *, const unsigned char *, unsigned int); #define MD4_DIGEST_LENGTH 16 #define MD4_DIGEST_STRING_LENGTH (MD4_DIGEST_LENGTH * 2 + 1) -typedef struct MD4Context { +typedef struct FR_MD4Context { uint32_t state[4]; /* state */ uint32_t count[2]; /* number of bits, mod 2^64 */ uint8_t buffer[MD4_BLOCK_LENGTH]; /* input buffer */ -} MD4_CTX; - -/*#include */ +} FR_MD4_CTX; /*__BEGIN_DECLS*/ -void MD4Init(MD4_CTX *); -void MD4Update(MD4_CTX *, const uint8_t *, size_t) +void fr_MD4Init(FR_MD4_CTX *); +void fr_MD4Update(FR_MD4_CTX *, const uint8_t *, size_t) /* __attribute__((__bounded__(__string__,2,3)))*/; -void MD4Final(uint8_t [MD4_DIGEST_LENGTH], MD4_CTX *) +void fr_MD4Final(uint8_t [MD4_DIGEST_LENGTH], FR_MD4_CTX *) /* __attribute__((__bounded__(__minbytes__,1,MD4_DIGEST_LENGTH)))*/; -void MD4Transform(uint32_t [4], const uint8_t [MD4_BLOCK_LENGTH]) +void fr_MD4Transform(uint32_t [4], const uint8_t [MD4_BLOCK_LENGTH]) /* __attribute__((__bounded__(__minbytes__,1,4))) __attribute__((__bounded__(__minbytes__,2,MD4_BLOCK_LENGTH)))*/; -/*char *MD4End(MD4_CTX *, char [MD4_DIGEST_STRING_LENGTH]) - __attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH))); -char *MD4File(char *, char [MD4_DIGEST_STRING_LENGTH]) - __attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH))); -char *MD4Data(const uint8_t *, size_t, char [MD4_DIGEST_STRING_LENGTH]) - __attribute__((__bounded__(__string__,1,2))) - __attribute__((__bounded__(__minbytes__,3,MD4_DIGEST_STRING_LENGTH)));*/ /*__END_DECLS*/ +#else /* WITH_OPENSSL_MD4 */ + +#define FR_MD4_CTX MD4_CTX +#define fr_MD4Init MD4_Init +#define fr_MD4Update MD4_Update +#define fr_MD4Final MD4_Final +#define fr_MD4Transform MD4_Transform +#endif + +#ifdef __cplusplus +} +#endif -#endif /* _LRAD_MD4_H */ +#endif /* _FR_MD4_H */