Really add the EVP and all of the DES changes.
[openssl.git] / ssl / s3_srvr.c
index bc0d1cc9b6f3e7bc5ef799d4f81154abd885ba6c..112c823a0fe8eef3fb9b6bc649e8f845d468e341 100644 (file)
 #include <openssl/x509.h>
 #include <openssl/krb5_asn.h>
 #include "ssl_locl.h"
-
 #ifndef OPENSSL_NO_KRB5
 #include "kssl_lcl.h"
 #endif /* OPENSSL_NO_KRB5 */
+#include <openssl/md5.h>
 
 static SSL_METHOD *ssl3_get_server_method(int ver);
 static int ssl3_get_client_hello(SSL *s);
@@ -953,6 +953,7 @@ static int ssl3_send_server_key_exchange(SSL *s)
        BUF_MEM *buf;
        EVP_MD_CTX md_ctx;
 
+       EVP_MD_CTX_init(&md_ctx);
        if (s->state == SSL3_ST_SW_KEY_EXCH_A)
                {
                type=s->s3->tmp.new_cipher->algorithms & SSL_MKEY_MASK;
@@ -1161,10 +1162,12 @@ static int ssl3_send_server_key_exchange(SSL *s)
                }
 
        s->state = SSL3_ST_SW_KEY_EXCH_B;
+       EVP_MD_CTX_cleanup(&md_ctx);
        return(ssl3_do_write(s,SSL3_RT_HANDSHAKE));
 f_err:
        ssl3_send_alert(s,SSL3_AL_FATAL,al);
 err:
+       EVP_MD_CTX_cleanup(&md_ctx);
        return(-1);
        }