From: Ken Raeburn Date: Thu, 15 Mar 2001 04:42:37 +0000 (+0000) Subject: minor cleanup + audit issues X-Git-Tag: krb5-1.3-alpha1~1618 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b7438beb84c2b61618df722085f6b58c048ddb5a;p=krb5.git minor cleanup + audit issues git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13081 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/md4/ChangeLog b/src/lib/crypto/md4/ChangeLog index 764c8d7d9..6cef77085 100644 --- a/src/lib/crypto/md4/ChangeLog +++ b/src/lib/crypto/md4/ChangeLog @@ -1,3 +1,12 @@ +2001-03-14 Ken Raeburn + + * md4.c (GG, HH, krb5_MD4Init): Use UL suffix on numbers, don't + bother with UL macro. + (UL): Macro deleted. + (Transform): Always declare with prototype. + + * rsa-md4.h: Always use prototypes. + 2000-01-21 Ken Raeburn * md4.c (PADDING): Now const. diff --git a/src/lib/crypto/md4/ISSUES b/src/lib/crypto/md4/ISSUES new file mode 100644 index 000000000..1103bd87b --- /dev/null +++ b/src/lib/crypto/md4/ISSUES @@ -0,0 +1,3 @@ +Issues to be addressed for src/lib/crypto/md4: -*- text -*- + +Assumes int is >= 32 bits. diff --git a/src/lib/crypto/md4/md4.c b/src/lib/crypto/md4/md4.c index bedd84bcb..4eb6a577c 100644 --- a/src/lib/crypto/md4/md4.c +++ b/src/lib/crypto/md4/md4.c @@ -38,18 +38,8 @@ #include "k5-int.h" #include "rsa-md4.h" -#if defined(__STDC__) || defined(_MSDOS) || defined(_WIN32) -#define UL(x) x##UL -#else -#define UL(x) ((krb5_ui_4) x) -#endif - /* forward declaration */ -#if (defined(__STDC__) || defined(_MSDOS) || defined(_WIN32)) && !defined(KRB5_NO_PROTOTYPES) static void Transform (krb5_ui_4 FAR *, krb5_ui_4 FAR *); -#else -static void Transform (); -#endif static const unsigned char PADDING[64] = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -77,11 +67,11 @@ static const unsigned char PADDING[64] = { (a) &= 0xffffffff; \ (a) = ROTATE_LEFT ((a), (s));} #define GG(a, b, c, d, x, s) \ - {(a) += G ((b), (c), (d)) + (x) + UL(013240474631); \ + {(a) += G ((b), (c), (d)) + (x) + 013240474631UL; \ (a) &= 0xffffffff; \ (a) = ROTATE_LEFT ((a), (s));} #define HH(a, b, c, d, x, s) \ - {(a) += H ((b), (c), (d)) + (x) + UL(015666365641); \ + {(a) += H ((b), (c), (d)) + (x) + 015666365641UL; \ (a) &= 0xffffffff; \ (a) = ROTATE_LEFT ((a), (s));} @@ -93,10 +83,10 @@ krb5_MD4_CTX FAR *mdContext; /* Load magic initialization constants. */ - mdContext->buf[0] = UL(0x67452301); - mdContext->buf[1] = UL(0xefcdab89); - mdContext->buf[2] = UL(0x98badcfe); - mdContext->buf[3] = UL(0x10325476); + mdContext->buf[0] = 0x67452301UL; + mdContext->buf[1] = 0xefcdab89UL; + mdContext->buf[2] = 0x98badcfeUL; + mdContext->buf[3] = 0x10325476UL; } void diff --git a/src/lib/crypto/md4/rsa-md4.h b/src/lib/crypto/md4/rsa-md4.h index 5b331e8f4..7141d0a96 100644 --- a/src/lib/crypto/md4/rsa-md4.h +++ b/src/lib/crypto/md4/rsa-md4.h @@ -86,15 +86,9 @@ typedef struct { unsigned char digest[16]; /* actual digest after MD4Final call */ } krb5_MD4_CTX; -#if defined(__STDC__) || defined(_MSDOS) || defined(_WIN32) extern void krb5_MD4Init(krb5_MD4_CTX FAR *); extern void krb5_MD4Update(krb5_MD4_CTX FAR *, const unsigned char FAR *, unsigned int); extern void krb5_MD4Final(krb5_MD4_CTX FAR *); -#else -void krb5_MD4Init (); -void krb5_MD4Update (); -void krb5_MD4Final (); -#endif /* **********************************************************************