make update
[openssl.git] / ssl / s2_enc.c
index af12dc472f26e7fc35e3f58f9700e69c3390cf86..c05ce5ddc0921b6cd7a4ef6d7f6f81037d0583c1 100644 (file)
  * [including the GNU Public Licence.]
  */
 
-#include <stdio.h>
 #include "ssl_locl.h"
+#ifndef OPENSSL_NO_SSL2
+#include <stdio.h>
 
-int ssl2_enc_init(s, client)
-SSL *s;
-int client;
+int ssl2_enc_init(SSL *s, int client)
        {
        /* Max number of bytes needed */
        EVP_CIPHER_CTX *rs,*ws;
@@ -81,11 +80,11 @@ 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;
@@ -114,9 +113,7 @@ err:
 /* read/writes from s->s2->mac_data using length for encrypt and 
  * decrypt.  It sets the s->s2->padding, s->[rw]length and
  * s->s2->pad_data ptr if we are encrypting */
-void ssl2_enc(s,send)
-SSL *s;
-int send;
+void ssl2_enc(SSL *s, int send)
        {
        EVP_CIPHER_CTX *ds;
        unsigned long l;
@@ -146,10 +143,7 @@ int send;
        EVP_Cipher(ds,s->s2->mac_data,s->s2->mac_data,l);
        }
 
-void ssl2_mac(s, md,send)
-SSL *s;
-unsigned char *md;
-int send;
+void ssl2_mac(SSL *s, unsigned char *md, int send)
        {
        EVP_MD_CTX c;
        unsigned char sequence[4],*p,*sec,*act;
@@ -184,4 +178,10 @@ int send;
        EVP_DigestFinal(&c,md,NULL);
        /* some would say I should zero the md context */
        }
+#else /* !OPENSSL_NO_SSL2 */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
 
+#endif