]> andersk Git - gssapi-openssh.git/blobdiff - openssh/dh.c
Import of OpenSSH 4.9p1
[gssapi-openssh.git] / openssh / dh.c
index f6ef05cf66ab90adf998fbedc08dbfaee0c6a0ac..66858104cb9383916fc4a76409ed94042c446261 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh.c,v 1.42 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: dh.c,v 1.45 2007/09/27 00:15:57 ray Exp $ */
 /*
  * Copyright (c) 2000 Niels Provos.  All rights reserved.
  *
@@ -185,7 +185,7 @@ dh_pub_is_valid(DH *dh, BIGNUM *dh_pub)
        BIGNUM *tmp;
 
        if (dh_pub->neg) {
-               logit("invalid public DH value: negativ");
+               logit("invalid public DH value: negative");
                return 0;
        }
        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)
                return 0;
        }
 
-       if ((tmp = BN_new()) == NULL)
-               return (-1);
+       if ((tmp = BN_new()) == NULL) {
+               error("%s: BN_new failed", __func__);
+               return 0;
+       }
        if (!BN_sub(tmp, dh->p, BN_value_one()) ||
            BN_cmp(dh_pub, tmp) != -1) {                /* pub_exp > p-2 */
                BN_clear_free(tmp);
This page took 0.588576 seconds and 4 git commands to generate.