chiark / gitweb /
logging: provide vslilog as well as slilog
[secnet.git] / md5.c
diff --git a/md5.c b/md5.c
index ab00d26efb41028978569fefe86d0adae1022a23..0ce120004490026b46beb0d1966cf00e15632dd5 100644 (file)
--- a/md5.c
+++ b/md5.c
  * Still in the public domain.
  */
 
-#include <string.h>            /* for memcpy() */
-#include <sys/types.h>         /* for stupid systems */
-#include <netinet/in.h>                /* for ntohl() */
-
 #include "secnet.h"
-#include "config.h"
+#include <string.h>            /* for memcpy() */
 #include "md5.h"
 
 #ifdef WORDS_BIGENDIAN
@@ -271,19 +267,18 @@ struct md5 {
     struct hash_if ops;
 };
 
-init_module md5_module;
 void md5_module(dict_t *dict)
 {
     struct md5 *st;
     void *ctx;
-    string_t testinput="12345\n";
+    cstring_t testinput="12345\n";
     uint8_t expected[16]=
        {0xd5,0x77,0x27,0x3f,0xf8,0x85,0xc3,0xf8,
         0x4d,0xad,0xb8,0x57,0x8b,0xb4,0x13,0x99};
     uint8_t digest[16];
     int i;
 
-    st=safe_malloc(sizeof(*st),"netlink_module");
+    st=safe_malloc(sizeof(*st),"md5_module");
     st->cl.description="md5";
     st->cl.type=CL_HASH;
     st->cl.apply=NULL;
@@ -300,7 +295,7 @@ void md5_module(dict_t *dict)
     md5_final(ctx,digest);
     for (i=0; i<16; i++) {
        if (digest[i]!=expected[i]) {
-           fatal("md5 module failed self-test\n");
+           fatal("md5 module failed self-test");
        }
     }
 }