Fix DH key generation.
authorBen Laurie <ben@openssl.org>
Thu, 7 Jan 1999 00:37:01 +0000 (00:37 +0000)
committerBen Laurie <ben@openssl.org>
Thu, 7 Jan 1999 00:37:01 +0000 (00:37 +0000)
Contributed by: Anonymous <nobody@replay.com>

CHANGES
ssl/s3_srvr.c

diff --git a/CHANGES b/CHANGES
index 2a8877ac3efaddd4aa5192f63957d07eb6de1f10..882b247ba6398ae2dd6891ab4c337bce2ad65899 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,10 @@
 
  Changes between 0.9.1c and 0.9.2
 
+  *) If a DH key is generated in s3_srvr.c, don't blow it by trying to use
+     NULL pointers.
+     [Anonymous <nobody@replay.com>]
+
   *) s_server should send the CAfile as acceptable CAs, not its own cert.
      [Bodo Moeller <3moeller@informatik.uni-hamburg.de>]
 
index 4e856b3ce86b727c23828b4bd924ec932c02d00f..09041b2fd9877b3d812715bcd5397bc326f6a154 100644 (file)
@@ -953,13 +953,16 @@ SSL *s;
                                }
 
                        s->s3->tmp.dh=dh;
-                       if (((dhp->pub_key == NULL) ||
-                            (dhp->priv_key == NULL) ||
-                            (s->options & SSL_OP_SINGLE_DH_USE)) &&
-                           (!DH_generate_key(dh)))
+                       if ((dhp->pub_key == NULL ||
+                            dhp->priv_key == NULL ||
+                            (s->options & SSL_OP_SINGLE_DH_USE)))
                                {
-                               SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,ERR_R_DH_LIB);
-                               goto err;
+                               if(!DH_generate_key(dh))
+                                   {
+                                   SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,
+                                          ERR_R_DH_LIB);
+                                   goto err;
+                                   }
                                }
                        else
                                {