summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/md4
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2001-03-15 04:42:37 +0000
committerKen Raeburn <raeburn@mit.edu>2001-03-15 04:42:37 +0000
commitb7438beb84c2b61618df722085f6b58c048ddb5a (patch)
tree30166e86021d44ec3bda4bfee0880f152479516e /src/lib/crypto/md4
parentfd0f0f1cd31ac2124bfff1f1a7af5a7175d1ae9c (diff)
downloadkrb5-b7438beb84c2b61618df722085f6b58c048ddb5a.tar.gz
krb5-b7438beb84c2b61618df722085f6b58c048ddb5a.tar.xz
krb5-b7438beb84c2b61618df722085f6b58c048ddb5a.zip
minor cleanup + audit issues
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13081 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/md4')
-rw-r--r--src/lib/crypto/md4/ChangeLog9
-rw-r--r--src/lib/crypto/md4/ISSUES3
-rw-r--r--src/lib/crypto/md4/md4.c22
-rw-r--r--src/lib/crypto/md4/rsa-md4.h6
4 files changed, 18 insertions, 22 deletions
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 <raeburn@mit.edu>
+
+ * 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 <raeburn@mit.edu>
* 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
/*
**********************************************************************