summaryrefslogtreecommitdiff
path: root/sys/netinet/libdeslite
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/libdeslite')
-rw-r--r--sys/netinet/libdeslite/des.h20
-rw-r--r--sys/netinet/libdeslite/des_locl.h31
-rw-r--r--sys/netinet/libdeslite/set_key.c2
3 files changed, 18 insertions, 35 deletions
diff --git a/sys/netinet/libdeslite/des.h b/sys/netinet/libdeslite/des.h
index 32a30616756..c49eeb0f408 100644
--- a/sys/netinet/libdeslite/des.h
+++ b/sys/netinet/libdeslite/des.h
@@ -48,7 +48,9 @@
#ifndef HEADER_DES_H
#define HEADER_DES_H
+#ifndef _KERNEL
#include <stdio.h>
+#endif
typedef unsigned char des_cblock[8];
typedef struct des_ks_struct
@@ -183,11 +185,12 @@ void des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
void des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
des_key_schedule schedule, des_cblock *ivec, int *num);
-/* Extra functions from Mark Murray <mark@grondar.za> */
-void des_cblock_print_file(des_cblock *cb, FILE *fp);
-/* The following functions are not in the normal unix build or the
+/*
+ * Extra functions from Mark Murray <mark@grondar.za>
+ * The following functions are not in the normal unix build or the
* SSLeay build. When using the SSLeay build, use RAND_seed()
- * and RAND_bytes() instead. */
+ * and RAND_bytes() instead.
+ */
int des_new_random_key(des_cblock *key);
void des_init_random_number_generator(des_cblock *key);
void des_set_random_generator_seed(des_cblock *key);
@@ -232,11 +235,12 @@ void des_string_to_2keys();
void des_cfb64_encrypt();
void des_ofb64_encrypt();
-/* Extra functions from Mark Murray <mark@grondar.za> */
-void des_cblock_print_file();
-/* The following functions are not in the normal unix build or the
+/*
+ * Extra functions from Mark Murray <mark@grondar.za>
+ * The following functions are not in the normal unix build or the
* SSLeay build. When using the SSLeay build, use RAND_seed()
- * and RAND_bytes() instead. */
+ * and RAND_bytes() instead.
+ */
int des_new_random_key();
void des_init_random_number_generator();
void des_set_random_generator_seed();
diff --git a/sys/netinet/libdeslite/des_locl.h b/sys/netinet/libdeslite/des_locl.h
index acd1ea79313..ce0cabb927b 100644
--- a/sys/netinet/libdeslite/des_locl.h
+++ b/sys/netinet/libdeslite/des_locl.h
@@ -47,11 +47,11 @@
#ifndef HEADER_DES_LOCL_H
#define HEADER_DES_LOCL_H
-#include <stdio.h>
-#include <stdlib.h>
-#ifndef MSDOS
-#include <unistd.h>
-#endif
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/systm.h>
+
#include "des.h"
/* the following is tweaked from a config script, that is why it is a
@@ -60,31 +60,10 @@
#undef DES_USE_PTR
#endif
-#ifdef MSDOS /* Visual C++ 2.1 (Windows NT/95) */
-#include <stdlib.h>
-#include <time.h>
-#include <io.h>
-#define RAND
-#undef PROTO
-#define PROTO
-#endif
-
-#if defined(__STDC__) || defined(VMS) || defined(M_XENIX) || defined(MSDOS)
-#include <string.h>
-#endif
-
#ifndef RAND
#define RAND
#endif
-#ifdef MSDOS
-#define getpid() 2
-extern int errno;
-#define RAND
-#undef PROTO
-#define PROTO
-#endif
-
#if defined(NOCONST)
#define const
#endif
diff --git a/sys/netinet/libdeslite/set_key.c b/sys/netinet/libdeslite/set_key.c
index e4df27e0572..a97542cf2c1 100644
--- a/sys/netinet/libdeslite/set_key.c
+++ b/sys/netinet/libdeslite/set_key.c
@@ -126,7 +126,7 @@ des_cblock (*key);
* this section very often :-(, thanks to
* engineering@MorningStar.Com for the fix
* eay 93/06/29 */
- if (memcmp(weak_keys[i],key,sizeof(key)) == 0) return(1);
+ if (bcmp(weak_keys[i],key,sizeof(key)) == 0) return(1);
return(0);
}