Source code cleanups: Use void * rather than char * in lhash,
[openssl.git] / ssl / s3_enc.c
index 3ef8676c34cee8cd5e0bb37ec95a3e7753e48fa0..4caf70878d01f9aefaa8f29b282aa48745feac5e 100644 (file)
@@ -78,12 +78,8 @@ static unsigned char ssl3_pad_2[48]={
        0x5c,0x5c,0x5c,0x5c,0x5c,0x5c,0x5c,0x5c,
        0x5c,0x5c,0x5c,0x5c,0x5c,0x5c,0x5c,0x5c };
 
-#ifndef NO_PROTO
 static int ssl3_handshake_mac(SSL *s, EVP_MD_CTX *in_ctx,
-       unsigned char *sender, int len, unsigned char *p);
-#else
-static int ssl3_handshake_mac();
-#endif
+       const char *sender, int len, unsigned char *p);
 
 static void ssl3_generate_key_block(SSL *s, unsigned char *km, int num)
        {
@@ -93,6 +89,9 @@ static void ssl3_generate_key_block(SSL *s, unsigned char *km, int num)
        unsigned char c='A';
        int i,j,k;
 
+#ifdef CHARSET_EBCDIC
+       c = os_toascii[c]; /*'A' in ASCII */
+#endif
        k=0;
        for (i=0; i<num; i+=MD5_DIGEST_LENGTH)
                {
@@ -413,7 +412,7 @@ int ssl3_cert_verify_mac(SSL *s, EVP_MD_CTX *ctx, unsigned char *p)
        }
 
 int ssl3_final_finish_mac(SSL *s, EVP_MD_CTX *ctx1, EVP_MD_CTX *ctx2,
-            unsigned char *sender, int len, unsigned char *p)
+            const char *sender, int len, unsigned char *p)
        {
        int ret;
 
@@ -424,7 +423,7 @@ int ssl3_final_finish_mac(SSL *s, EVP_MD_CTX *ctx1, EVP_MD_CTX *ctx2,
        }
 
 static int ssl3_handshake_mac(SSL *s, EVP_MD_CTX *in_ctx,
-            unsigned char *sender, int len, unsigned char *p)
+            const char *sender, int len, unsigned char *p)
        {
        unsigned int ret;
        int npad,n;
@@ -514,9 +513,15 @@ int ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
             int len)
        {
        static const unsigned char *salt[3]={
+#ifndef CHARSET_EBCDIC
                (const unsigned char *)"A",
                (const unsigned char *)"BB",
                (const unsigned char *)"CCC",
+#else
+               (const unsigned char *)"\x41",
+               (const unsigned char *)"\x42\x42",
+               (const unsigned char *)"\x43\x43\x43",
+#endif
                };
        unsigned char buf[EVP_MAX_MD_SIZE];
        EVP_MD_CTX ctx;