summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'sbin')
-rw-r--r--sbin/isakmpd/cookie.c8
-rw-r--r--sbin/isakmpd/dh.c25
-rw-r--r--sbin/isakmpd/hash.c7
-rw-r--r--sbin/isakmpd/math_group.h11
4 files changed, 29 insertions, 22 deletions
diff --git a/sbin/isakmpd/cookie.c b/sbin/isakmpd/cookie.c
index e66118b755a..f8eef8a03f3 100644
--- a/sbin/isakmpd/cookie.c
+++ b/sbin/isakmpd/cookie.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: cookie.c,v 1.4 1999/02/26 03:35:23 niklas Exp $ */
-/* $EOM: cookie.c,v 1.18 1999/02/25 11:38:49 niklas Exp $ */
+/* $OpenBSD: cookie.c,v 1.5 1999/04/19 20:00:24 niklas Exp $ */
+/* $EOM: cookie.c,v 1.20 1999/04/17 23:20:20 niklas Exp $ */
/*
- * Copyright (c) 1998 Niklas Hallqvist. All rights reserved.
+ * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -126,5 +126,5 @@ void
cookie_init (void)
{
/* Start responder cookie resets. */
- cookie_reset_event (NULL);
+ cookie_reset_event (0);
}
diff --git a/sbin/isakmpd/dh.c b/sbin/isakmpd/dh.c
index 1341bea6ecb..9f9fa44d8fe 100644
--- a/sbin/isakmpd/dh.c
+++ b/sbin/isakmpd/dh.c
@@ -1,8 +1,9 @@
-/* $OpenBSD: dh.c,v 1.4 1999/02/26 03:36:07 niklas Exp $ */
-/* $EOM: dh.c,v 1.3 1999/02/25 11:38:51 niklas Exp $ */
+/* $OpenBSD: dh.c,v 1.5 1999/04/19 20:00:24 niklas Exp $ */
+/* $EOM: dh.c,v 1.5 1999/04/17 23:20:22 niklas Exp $ */
/*
* Copyright (c) 1998 Niels Provos. All rights reserved.
+ * Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -58,13 +59,15 @@ dh_getlen (struct group *group)
* means the application has to save the exchange value itself,
* dh_create_exchange should only be called once.
*/
-
-void
+int
dh_create_exchange (struct group *group, u_int8_t *buf)
{
- group->setrandom (group, group->c);
- group->operation (group, group->a, group->gen, group->c);
+ if (group->setrandom (group, group->c))
+ return -1;
+ if (group->operation (group, group->a, group->gen, group->c))
+ return -1;
group->getraw (group, group->a, buf);
+ return 0;
}
/*
@@ -72,11 +75,13 @@ dh_create_exchange (struct group *group, u_int8_t *buf)
* is the exchange value offered by the other party. No length verification
* is done for the value, the application has to do that.
*/
-
-void
+int
dh_create_shared (struct group *group, u_int8_t *secret, u_int8_t *exchange)
{
- group->setraw (group, group->b, exchange, group->getlen(group));
- group->operation (group, group->a, group->b, group->c);
+ if (group->setraw (group, group->b, exchange, group->getlen(group)))
+ return -1;
+ if (group->operation (group, group->a, group->b, group->c))
+ return -1;
group->getraw (group, group->a, secret);
+ return 0;
}
diff --git a/sbin/isakmpd/hash.c b/sbin/isakmpd/hash.c
index cb0c7f966ee..0b2498a3f24 100644
--- a/sbin/isakmpd/hash.c
+++ b/sbin/isakmpd/hash.c
@@ -1,8 +1,9 @@
-/* $OpenBSD: hash.c,v 1.4 1999/02/26 03:40:25 niklas Exp $ */
-/* $EOM: hash.c,v 1.8 1999/02/25 11:38:59 niklas Exp $ */
+/* $OpenBSD: hash.c,v 1.5 1999/04/19 20:00:24 niklas Exp $ */
+/* $EOM: hash.c,v 1.10 1999/04/17 23:20:34 niklas Exp $ */
/*
* Copyright (c) 1998 Niels Provos. All rights reserved.
+ * Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -81,7 +82,7 @@ hash_get (enum hashes hashtype)
if (hashtype == hashes[i].type)
return &hashes[i];
- return NULL;
+ return 0;
}
/*
diff --git a/sbin/isakmpd/math_group.h b/sbin/isakmpd/math_group.h
index 6eab7764354..d85e625ba5d 100644
--- a/sbin/isakmpd/math_group.h
+++ b/sbin/isakmpd/math_group.h
@@ -1,8 +1,9 @@
-/* $OpenBSD: math_group.h,v 1.4 1999/03/24 14:59:52 niklas Exp $ */
-/* $EOM: math_group.h,v 1.5 1999/03/06 12:40:12 niklas Exp $ */
+/* $OpenBSD: math_group.h,v 1.5 1999/04/19 20:00:24 niklas Exp $ */
+/* $EOM: math_group.h,v 1.7 1999/04/17 23:20:40 niklas Exp $ */
/*
* Copyright (c) 1998 Niels Provos. All rights reserved.
+ * Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -56,9 +57,9 @@ struct group {
void *gen; /* Group Generator */
int (*getlen) (struct group *);
void (*getraw) (struct group *, void *, u_int8_t *);
- void (*setraw) (struct group *, void *, u_int8_t *, int);
- void (*setrandom) (struct group *, void *);
- void (*operation) (struct group *, void *, void *, void *);
+ int (*setraw) (struct group *, void *, u_int8_t *, int);
+ int (*setrandom) (struct group *, void *);
+ int (*operation) (struct group *, void *, void *, void *);
};
/* Description of an Elliptic Group over GF(2**n) for Boot-Strapping */