#include <sys/errno.h>
#include <sys/time.h>
#include <sys/kernel.h>
+#include <sys/socketvar.h>
+
#include <machine/cpu.h>
+#include <machine/endian.h>
#include <net/if.h>
#include <net/route.h>
#include <net/netisr.h>
+#include <net/raw_cb.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip_var.h>
#include <netinet/ip_icmp.h>
-#include <sys/socketvar.h>
-#include <net/raw_cb.h>
#include <net/encap.h>
#include <netinet/ip_ipsp.h>
#include <sys/errno.h>
#include <sys/time.h>
#include <sys/kernel.h>
+#include <sys/socketvar.h>
+
#include <machine/cpu.h>
+#include <machine/endian.h>
#include <net/if.h>
#include <net/route.h>
#include <net/netisr.h>
+#include <net/raw_cb.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip_var.h>
#include <netinet/ip_icmp.h>
-#include <sys/socketvar.h>
-#include <net/raw_cb.h>
#include <net/encap.h>
#include <netinet/ip_ipsp.h>
#include <net/raw_cb.h>
#include <net/encap.h>
-#define IPSEC_IPSP_C
#include <netinet/ip_ipsp.h>
-#undef IPSEC_IPSP_C
#include <netinet/ip_ah.h>
#include <netinet/ip_esp.h>
#define IPSEC_ZEROES_SIZE 64
-#ifdef IPSEC_IPSP_C
#if BYTE_ORDER == LITTLE_ENDIAN
-inline u_int64_t
+static __inline u_int64_t
htonq(u_int64_t q)
{
register u_int32_t u, l;
#else
#error "Please fix <machine/endian.h>"
#endif
-#else
-u_int64_t htonq(u_int64_t);
-#define ntohq(_x) htonq(_x)
-extern unsigned char ipseczeroes[IPSEC_ZEROES_SIZE];
-#endif
+
+extern unsigned char ipseczeroes[];
#ifdef _KERNEL
#undef ENCDEBUG
*/
#include <sys/param.h>
+#include <sys/systm.h>
+
#include <netinet/ip_md5.h>
-#include <string.h>
#define HAVEBCOPY
#define S43 15
#define S44 21
+#define MD5Transform _MD5Transform
+
static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64]));
#if BYTE_ORDER == LITTLE_ENDIAN
#define SHA1HANDSOFF
#include <sys/param.h>
+#include <sys/systm.h>
+
#include <netinet/ip_sha1.h>
-#include <string.h>
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
#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
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);
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();
#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
#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
* 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);
}