mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-15 23:50:44 +00:00
34800a8067
Submitted by: Jim Bloom <bloom@acm.org>
82 lines
2.2 KiB
Plaintext
82 lines
2.2 KiB
Plaintext
--- tunip.c.orig Tue Sep 21 18:20:40 1999
|
|
+++ tunip.c Sun Feb 20 20:36:27 2000
|
|
@@ -54,12 +54,14 @@
|
|
#include <blowfish.h>
|
|
#include <cast.h>
|
|
#include <des.h>
|
|
+#ifndef NO_IDEA
|
|
#include <idea.h>
|
|
+#endif
|
|
|
|
#include "defs.h"
|
|
|
|
-#define _PATH_CONF "/etc/ipsec/pipsecd.conf"
|
|
-#define _PATH_STARTUP "/etc/ipsec/startup"
|
|
+#define _PATH_CONF FILE_PREFIX "/etc/ipsec/pipsecd.conf"
|
|
+#define _PATH_STARTUP FILE_PREFIX "/etc/ipsec/startup"
|
|
#define _PATH_DEV_RANDOM "/dev/random"
|
|
|
|
#ifdef USE_ETHERTAP
|
|
@@ -131,7 +133,9 @@
|
|
des_key_schedule k3;
|
|
} des3;
|
|
CAST_KEY cast;
|
|
+#ifndef NO_IDEA
|
|
IDEA_KEY_SCHEDULE idea;
|
|
+#endif
|
|
} crypt_key;
|
|
|
|
typedef struct crypt_method {
|
|
@@ -304,12 +308,14 @@
|
|
void cast_cbc_decrypt(unsigned char *iv, crypt_key *dk,
|
|
unsigned char *ct, unsigned int len);
|
|
int cast_setkey(unsigned char *b, unsigned int len, crypt_key *k);
|
|
+#ifndef NO_IDEA
|
|
void my_idea_cbc_encrypt(unsigned char *iv, crypt_key *ek,
|
|
unsigned char *t, unsigned int len);
|
|
void my_idea_cbc_decrypt(unsigned char *iv, crypt_key *dk,
|
|
unsigned char *ct, unsigned int len);
|
|
int my_idea_set_encrypt_key(unsigned char *b, unsigned int len, crypt_key *k);
|
|
int my_idea_set_decrypt_key(unsigned char *b, unsigned int len, crypt_key *k);
|
|
+#endif
|
|
void my_des_cbc_encrypt(unsigned char *iv, crypt_key *ek,
|
|
unsigned char *t, unsigned int len);
|
|
void my_des_cbc_decrypt(unsigned char *iv, crypt_key *dk,
|
|
@@ -379,14 +385,20 @@
|
|
|
|
hash_method_t *hash_list = &hash_ripemd160;
|
|
|
|
+#ifndef NO_IDEA
|
|
crypt_method_t crypt_idea = {
|
|
NULL,
|
|
"idea_cbc", 8, 8,
|
|
my_idea_cbc_encrypt, my_idea_cbc_decrypt,
|
|
my_idea_set_encrypt_key, my_idea_set_decrypt_key
|
|
};
|
|
+#endif
|
|
crypt_method_t crypt_cast = {
|
|
+#ifndef NO_IDEA
|
|
&crypt_idea,
|
|
+#else
|
|
+ NULL,
|
|
+#endif
|
|
"cast_cbc", 8, 8,
|
|
cast_cbc_encrypt, cast_cbc_decrypt,
|
|
cast_setkey, cast_setkey
|
|
@@ -1974,6 +1986,7 @@
|
|
return 0;
|
|
}
|
|
|
|
+#ifndef NO_IDEA
|
|
void my_idea_cbc_encrypt(unsigned char *iv, crypt_key *ek,
|
|
unsigned char *t, unsigned int len)
|
|
{
|
|
@@ -2002,6 +2015,7 @@
|
|
idea_set_decrypt_key(&k->idea, &k->idea);
|
|
return 0;
|
|
}
|
|
+#endif
|
|
|
|
void my_des_cbc_encrypt(unsigned char *iv, crypt_key *ek,
|
|
unsigned char *t, unsigned int len)
|