gsasl-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS gsasl/lib/digest-md5


From: gsasl-commit
Subject: CVS gsasl/lib/digest-md5
Date: Sun, 19 Dec 2004 20:28:51 +0100

Update of /home/cvs/gsasl/lib/digest-md5
In directory dopio:/tmp/cvs-serv3098

Modified Files:
        session.c server.c client.c 
Log Message:
Fix uint32_t uses.


--- /home/cvs/gsasl/lib/digest-md5/session.c    2004/12/19 18:00:13     1.5
+++ /home/cvs/gsasl/lib/digest-md5/session.c    2004/12/19 19:28:51     1.6
@@ -33,8 +33,13 @@
 /* Get memcpy, strdup, strlen. */
 #include <string.h>
 
-/* Get htonl. */
-#include <netinet/in.h>
+/* Get htonl.  FIXME: use inline macro instead. */
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
 
 /* Get gc_hmac_md5. */
 #include <gc.h>
--- /home/cvs/gsasl/lib/digest-md5/server.c     2004/12/19 19:06:37     1.21
+++ /home/cvs/gsasl/lib/digest-md5/server.c     2004/12/19 19:28:51     1.22
@@ -42,9 +42,6 @@
 #include "digesthmac.h"
 #include "validate.h"
 
-/* Get uint32_t. */
-#include <netinet/in.h>
-
 #define NONCE_ENTROPY_BYTES 16
 
 struct _Gsasl_digest_md5_server_state
@@ -54,7 +51,7 @@
   digest_md5_response response;
   digest_md5_finish finish;
   char secret[DIGEST_MD5_LENGTH];
-  uint32_t readseqnum, sendseqnum;
+  unsigned long readseqnum, sendseqnum;
   char kic[DIGEST_MD5_LENGTH];
   char kcc[DIGEST_MD5_LENGTH];
   char kis[DIGEST_MD5_LENGTH];
@@ -274,7 +271,10 @@
   if (res)
     return res == -2 ? GSASL_NEEDS_MORE : GSASL_INTEGRITY_ERROR;
 
-  state->sendseqnum++;
+  if (state->sendseqnum == 4294967295)
+    state->sendseqnum = 0;
+  else
+    state->sendseqnum++;
 
   return GSASL_OK;
 }
@@ -294,7 +294,10 @@
   if (res)
     return res == -2 ? GSASL_NEEDS_MORE : GSASL_INTEGRITY_ERROR;
 
-  state->readseqnum++;
+  if (state->readseqnum == 4294967295)
+    state->readseqnum = 0;
+  else
+    state->readseqnum++;
 
   return GSASL_OK;
 }
--- /home/cvs/gsasl/lib/digest-md5/client.c     2004/12/19 19:06:37     1.21
+++ /home/cvs/gsasl/lib/digest-md5/client.c     2004/12/19 19:28:51     1.22
@@ -41,9 +41,6 @@
 #include "session.h"
 #include "digesthmac.h"
 
-/* Get uint32_t. */
-#include <netinet/in.h>
-
 #define CNONCE_ENTROPY_BYTES 16
 
 struct _Gsasl_digest_md5_client_state
@@ -53,7 +50,7 @@
   digest_md5_response response;
   digest_md5_finish finish;
   char secret[DIGEST_MD5_LENGTH];
-  uint32_t readseqnum, sendseqnum;
+  unsigned long readseqnum, sendseqnum;
   char kic[DIGEST_MD5_LENGTH];
   char kcc[DIGEST_MD5_LENGTH];
   char kis[DIGEST_MD5_LENGTH];
@@ -285,7 +282,10 @@
   if (res)
     return res == -2 ? GSASL_NEEDS_MORE : GSASL_INTEGRITY_ERROR;
 
-  state->sendseqnum++;
+  if (state->sendseqnum == 4294967295)
+    state->sendseqnum = 0;
+  else
+    state->sendseqnum++;
 
   return GSASL_OK;
 }
@@ -306,7 +306,10 @@
   if (res)
     return res == -2 ? GSASL_NEEDS_MORE : GSASL_INTEGRITY_ERROR;
 
-  state->readseqnum++;
+  if (state->readseqnum == 4294967295)
+    state->readseqnum = 0;
+  else
+    state->readseqnum++;
 
   return GSASL_OK;
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]