summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--dh.c10
2 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 8345586e8..ef1a945cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,13 @@
20 [ssh-agent.c] 20 [ssh-agent.c]
21 When adding a key that already exists, update the properties 21 When adding a key that already exists, update the properties
22 (time, confirm, comment) instead of discarding them. ok djm@ markus@ 22 (time, confirm, comment) instead of discarding them. ok djm@ markus@
23 - ray@cvs.openbsd.org 2007/09/27 00:15:57
24 [dh.c]
25 Don't return -1 on error in dh_pub_is_valid(), since it evaluates
26 to true.
27 Also fix a typo.
28 Initial diff from Matthew Dempsky, input from djm.
29 OK djm, markus.
23 30
2420070927 3120070927
25 - (dtucker) [configure.ac atomicio.c] Fall back to including <sys/poll.h> if 32 - (dtucker) [configure.ac atomicio.c] Fall back to including <sys/poll.h> if
@@ -3291,4 +3298,4 @@
3291 OpenServer 6 and add osr5bigcrypt support so when someone migrates 3298 OpenServer 6 and add osr5bigcrypt support so when someone migrates
3292 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 3299 passwords between UnixWare and OpenServer they will still work. OK dtucker@
3293 3300
3294$Id: ChangeLog,v 1.4764 2007/10/26 04:25:31 djm Exp $ 3301$Id: ChangeLog,v 1.4765 2007/10/26 04:25:55 djm Exp $
diff --git a/dh.c b/dh.c
index 78e230b9f..66858104c 100644
--- a/dh.c
+++ b/dh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh.c,v 1.44 2006/11/07 13:02:07 markus Exp $ */ 1/* $OpenBSD: dh.c,v 1.45 2007/09/27 00:15:57 ray Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Niels Provos. All rights reserved. 3 * Copyright (c) 2000 Niels Provos. All rights reserved.
4 * 4 *
@@ -185,7 +185,7 @@ dh_pub_is_valid(DH *dh, BIGNUM *dh_pub)
185 BIGNUM *tmp; 185 BIGNUM *tmp;
186 186
187 if (dh_pub->neg) { 187 if (dh_pub->neg) {
188 logit("invalid public DH value: negativ"); 188 logit("invalid public DH value: negative");
189 return 0; 189 return 0;
190 } 190 }
191 if (BN_cmp(dh_pub, BN_value_one()) != 1) { /* pub_exp <= 1 */ 191 if (BN_cmp(dh_pub, BN_value_one()) != 1) { /* pub_exp <= 1 */
@@ -193,8 +193,10 @@ dh_pub_is_valid(DH *dh, BIGNUM *dh_pub)
193 return 0; 193 return 0;
194 } 194 }
195 195
196 if ((tmp = BN_new()) == NULL) 196 if ((tmp = BN_new()) == NULL) {
197 return (-1); 197 error("%s: BN_new failed", __func__);
198 return 0;
199 }
198 if (!BN_sub(tmp, dh->p, BN_value_one()) || 200 if (!BN_sub(tmp, dh->p, BN_value_one()) ||
199 BN_cmp(dh_pub, tmp) != -1) { /* pub_exp > p-2 */ 201 BN_cmp(dh_pub, tmp) != -1) { /* pub_exp > p-2 */
200 BN_clear_free(tmp); 202 BN_clear_free(tmp);