des_old.h doesn't really need to include des.h, so don't. That will
[openssl.git] / ssl / s3_lib.c
index 6813595cbc2d1bb5deee1cde81456963fdb0f6ce..9a8cf1042d29cbf00eb229756c6704a5ecac3614 100644 (file)
@@ -56,7 +56,7 @@
  * [including the GNU Public Licence.]
  */
 /* ====================================================================
- * Copyright (c) 1998-2000 The OpenSSL Project.  All rights reserved.
+ * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #include <stdio.h>
 #include <openssl/objects.h>
 #include "ssl_locl.h"
+#include "kssl_lcl.h"
+#include <openssl/md5.h>
 
 const char *ssl3_version_str="SSLv3" OPENSSL_VERSION_PTEXT;
 
@@ -950,6 +952,8 @@ int ssl3_new(SSL *s)
 
        if ((s3=OPENSSL_malloc(sizeof *s3)) == NULL) goto err;
        memset(s3,0,sizeof *s3);
+       EVP_MD_CTX_init(&s3->finish_dgst1);
+       EVP_MD_CTX_init(&s3->finish_dgst2);
 
        s->s3=s3;
 
@@ -977,6 +981,8 @@ void ssl3_free(SSL *s)
 #endif
        if (s->s3->tmp.ca_names != NULL)
                sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free);
+       EVP_MD_CTX_cleanup(&s->s3->finish_dgst1);
+       EVP_MD_CTX_cleanup(&s->s3->finish_dgst2);
        memset(s->s3,0,sizeof *s->s3);
        OPENSSL_free(s->s3);
        s->s3=NULL;
@@ -1003,6 +1009,9 @@ void ssl3_clear(SSL *s)
        rp=s->s3->rbuf.buf;
        wp=s->s3->wbuf.buf;
 
+       EVP_MD_CTX_cleanup(&s->s3->finish_dgst1);
+       EVP_MD_CTX_cleanup(&s->s3->finish_dgst2);
+
        memset(s->s3,0,sizeof *s->s3);
        if (rp != NULL) s->s3->rbuf.buf=rp;
        if (wp != NULL) s->s3->wbuf.buf=wp;
@@ -1017,7 +1026,7 @@ void ssl3_clear(SSL *s)
        s->version=SSL3_VERSION;
        }
 
-long ssl3_ctrl(SSL *s, int cmd, long larg, char *parg)
+long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
        {
        int ret=0;
 
@@ -1180,7 +1189,7 @@ long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp)())
        return(ret);
        }
 
-long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg)
+long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
        {
        CERT *cert;