summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'sbin')
-rw-r--r--sbin/isakmpd/exchange.c6
-rw-r--r--sbin/isakmpd/ike_quick_mode.c9
-rw-r--r--sbin/isakmpd/ipsec.c4
-rw-r--r--sbin/isakmpd/key.c21
-rw-r--r--sbin/isakmpd/pf_key_v2.c4
5 files changed, 37 insertions, 7 deletions
diff --git a/sbin/isakmpd/exchange.c b/sbin/isakmpd/exchange.c
index bf698eb5e95..1c4ef1f18a0 100644
--- a/sbin/isakmpd/exchange.c
+++ b/sbin/isakmpd/exchange.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exchange.c,v 1.103 2004/08/23 11:53:24 ho Exp $ */
+/* $OpenBSD: exchange.c,v 1.104 2004/09/17 13:53:08 ho Exp $ */
/* $EOM: exchange.c,v 1.143 2000/12/04 00:02:25 angelos Exp $ */
/*
@@ -73,7 +73,9 @@
*/
#define MAX_BUCKET_BITS 16
+#ifdef USE_DEBUG
static void exchange_dump(char *, struct exchange *);
+#endif
static void exchange_free_aux(void *);
#if 0
static void exchange_resize(void);
@@ -1188,11 +1190,13 @@ exchange_dump_real(char *header, struct exchange *exchange, int class,
decode_32(exchange->message_id), buf));
}
+#ifdef USE_DEBUG
static void
exchange_dump(char *header, struct exchange *exchange)
{
exchange_dump_real(header, exchange, LOG_EXCHANGE, 10);
}
+#endif
void
exchange_report(void)
diff --git a/sbin/isakmpd/ike_quick_mode.c b/sbin/isakmpd/ike_quick_mode.c
index 363b8381a29..75bec874d5e 100644
--- a/sbin/isakmpd/ike_quick_mode.c
+++ b/sbin/isakmpd/ike_quick_mode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ike_quick_mode.c,v 1.86 2004/08/14 13:29:50 hshoexer Exp $ */
+/* $OpenBSD: ike_quick_mode.c,v 1.87 2004/09/17 13:53:08 ho Exp $ */
/* $EOM: ike_quick_mode.c,v 1.139 2001/01/26 10:43:17 niklas Exp $ */
/*
@@ -1739,8 +1739,11 @@ next_sa:
"strdup (\"%s\") failed", name);
goto cleanup;
}
- } else if (ignore_policy || strncmp("yes", conf_get_str("General",
- "Use-Keynote"), 3)) {
+ } else if (
+#ifdef USE_X509
+ ignore_policy ||
+#endif
+ strncmp("yes", conf_get_str("General", "Use-Keynote"), 3)) {
log_print("responder_recv_HASH_SA_NONCE: peer proposed "
"invalid phase 2 IDs: %s",
(exchange->doi->decode_ids("initiator id %s, responder"
diff --git a/sbin/isakmpd/ipsec.c b/sbin/isakmpd/ipsec.c
index 8a80719e3bd..1eda79a6f40 100644
--- a/sbin/isakmpd/ipsec.c
+++ b/sbin/isakmpd/ipsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec.c,v 1.103 2004/08/10 15:59:10 ho Exp $ */
+/* $OpenBSD: ipsec.c,v 1.104 2004/09/17 13:53:08 ho Exp $ */
/* $EOM: ipsec.c,v 1.143 2000/12/11 23:57:42 niklas Exp $ */
/*
@@ -73,7 +73,9 @@
#include "timer.h"
#include "transport.h"
#include "util.h"
+#ifdef USE_X509
#include "x509.h"
+#endif
extern int acquire_only;
diff --git a/sbin/isakmpd/key.c b/sbin/isakmpd/key.c
index a10fedd36b7..bc3c9fc4c15 100644
--- a/sbin/isakmpd/key.c
+++ b/sbin/isakmpd/key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.c,v 1.18 2004/06/14 09:55:41 ho Exp $ */
+/* $OpenBSD: key.c,v 1.19 2004/09/17 13:53:08 ho Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
@@ -21,6 +21,7 @@
*/
#include <string.h>
+#include <stdlib.h>
#include "sysdep.h"
@@ -28,7 +29,9 @@
#include "libcrypto.h"
#include "log.h"
#include "util.h"
+#ifdef USE_X509
#include "x509.h"
+#endif
void
key_free(int type, int private, void *key)
@@ -38,8 +41,10 @@ key_free(int type, int private, void *key)
free(key);
break;
case ISAKMP_KEY_RSA:
+#ifdef USE_X509
RSA_free(key);
break;
+#endif
case ISAKMP_KEY_NONE:
default:
log_error("key_free: unknown/unsupportedkey type %d", type);
@@ -52,8 +57,10 @@ void
key_serialize(int type, int private, void *key, u_int8_t **data,
size_t *datalenp)
{
+#ifdef USE_X509
u_int8_t *p;
size_t datalen;
+#endif
switch (type) {
case ISAKMP_KEY_PASSPHRASE:
@@ -61,6 +68,7 @@ key_serialize(int type, int private, void *key, u_int8_t **data,
*data = (u_int8_t *)strdup((char *)key);
break;
case ISAKMP_KEY_RSA:
+#ifdef USE_X509
switch (private) {
case ISAKMP_KEYTYPE_PUBLIC:
datalen = i2d_RSAPublicKey((RSA *)key, NULL);
@@ -84,6 +92,7 @@ key_serialize(int type, int private, void *key, u_int8_t **data,
*datalenp = i2d_RSAPrivateKey((RSA *)key, &p);
break;
}
+#endif
break;
default:
log_error("key_serialize: unknown/unsupported key type %d",
@@ -96,14 +105,17 @@ key_serialize(int type, int private, void *key, u_int8_t **data,
char *
key_printable(int type, int private, u_int8_t *data, int datalen)
{
+#ifdef USE_X509
char *s;
int i;
+#endif
switch (type) {
case ISAKMP_KEY_PASSPHRASE:
return strdup((char *)data);
case ISAKMP_KEY_RSA:
+#ifdef USE_X509
s = malloc(datalen * 2 + 1);
if (!s) {
log_error("key_printable: malloc (%d) failed",
@@ -114,6 +126,7 @@ key_printable(int type, int private, u_int8_t *data, int datalen)
snprintf(s + (2 * i), 2 * (datalen - i) + 1, "%02x",
data[i]);
return s;
+#endif
default:
log_error("key_printable: unknown/unsupported key type %d",
@@ -130,6 +143,7 @@ key_internalize(int type, int private, u_int8_t *data, int datalen)
case ISAKMP_KEY_PASSPHRASE:
return strdup((char *)data);
case ISAKMP_KEY_RSA:
+#ifdef USE_X509
switch (private) {
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
case ISAKMP_KEYTYPE_PUBLIC:
@@ -150,6 +164,7 @@ key_internalize(int type, int private, u_int8_t *data, int datalen)
return 0;
}
break;
+#endif /* USE_X509 */
default:
log_error("key_internalize: unknown/unsupported key type %d",
type);
@@ -164,7 +179,9 @@ void
key_from_printable(int type, int private, char *key, u_int8_t **data,
u_int32_t *datalenp)
{
+#ifdef USE_X509
u_int32_t datalen;
+#endif
switch (type) {
case ISAKMP_KEY_PASSPHRASE:
@@ -173,6 +190,7 @@ key_from_printable(int type, int private, char *key, u_int8_t **data,
break;
case ISAKMP_KEY_RSA:
+#ifdef USE_X509
datalen = (strlen(key) + 1) / 2; /* Round up, just in case */
*data = malloc(datalen);
if (!*data) {
@@ -183,6 +201,7 @@ key_from_printable(int type, int private, char *key, u_int8_t **data,
}
*datalenp = hex2raw(key, *data, datalen);
break;
+#endif
default:
log_error("key_from_printable: "
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c
index 854d0867bd5..24a17797a63 100644
--- a/sbin/isakmpd/pf_key_v2.c
+++ b/sbin/isakmpd/pf_key_v2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_key_v2.c,v 1.149 2004/08/12 11:08:54 ho Exp $ */
+/* $OpenBSD: pf_key_v2.c,v 1.150 2004/09/17 13:53:08 ho Exp $ */
/* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */
/*
@@ -2983,7 +2983,9 @@ pf_key_v2_expire(struct pf_key_v2_msg *pmsg)
struct sadb_lifetime *life, *lifecurrent;
struct sa *sa;
struct pf_key_v2_node *lifenode, *ext;
+#ifdef USE_DEBUG
char *dst_str;
+#endif
msg = (struct sadb_msg *)TAILQ_FIRST(pmsg)->seg;
ext = pf_key_v2_find_ext(pmsg, SADB_EXT_SA);