gcc 3.0 tells me that -m486 is deprecated. The gcc 2.95 manual tells
[openssl.git] / ssl / s2_enc.c
index 09835008a99d9fd7fbc53964bc4912d212f1e21e..1aacae1380acfea6df93b51bc1ddf34346432109 100644 (file)
@@ -56,8 +56,9 @@
  * [including the GNU Public Licence.]
  */
 
-#include <stdio.h>
 #include "ssl_locl.h"
+#ifndef OPENSSL_NO_SSL2
+#include <stdio.h>
 
 int ssl2_enc_init(SSL *s, int client)
        {
@@ -79,11 +80,11 @@ int ssl2_enc_init(SSL *s, int client)
 
        if ((s->enc_read_ctx == NULL) &&
                ((s->enc_read_ctx=(EVP_CIPHER_CTX *)
-               Malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
+               OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
                goto err;
        if ((s->enc_write_ctx == NULL) &&
                ((s->enc_write_ctx=(EVP_CIPHER_CTX *)
-               Malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
+               OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
                goto err;
 
        rs= s->enc_read_ctx;
@@ -168,6 +169,7 @@ void ssl2_mac(SSL *s, unsigned char *md, int send)
        l2n(seq,p);
 
        /* There has to be a MAC algorithm. */
+       EVP_MD_CTX_init(&c);
        EVP_DigestInit(&c,s->read_hash);
        EVP_DigestUpdate(&c,sec,
                EVP_CIPHER_CTX_key_length(s->enc_read_ctx));
@@ -175,6 +177,12 @@ void ssl2_mac(SSL *s, unsigned char *md, int send)
        /* the above line also does the pad data */
        EVP_DigestUpdate(&c,sequence,4); 
        EVP_DigestFinal(&c,md,NULL);
-       /* some would say I should zero the md context */
+       EVP_MD_CTX_cleanup(&c);
        }
+#else /* !OPENSSL_NO_SSL2 */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
 
+#endif