Fix warnings: printf format mismatches on 64 bit platforms.
[openssl.git] / crypto / evp / e_rc4.c
index 4064cc5fa0471b107ec5db089d9423bf77d7ebed..8b5175e0fdc8a3e79639cb615404c162cc614b86 100644 (file)
  * [including the GNU Public Licence.]
  */
 
-#ifndef OPENSSL_NO_RC4
-
 #include <stdio.h>
 #include "cryptlib.h"
+
+#ifndef OPENSSL_NO_RC4
+
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/rc4.h>
@@ -69,8 +70,6 @@
 
 typedef struct
     {
-    /* FIXME: what is the key for? */
-    unsigned char key[EVP_RC4_KEY_SIZE];
     RC4_KEY ks;        /* working key */
     } EVP_RC4_KEY;
 
@@ -79,7 +78,7 @@ typedef struct
 static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
                        const unsigned char *iv,int enc);
 static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-                     const unsigned char *in, unsigned int inl);
+                     const unsigned char *in, size_t inl);
 static const EVP_CIPHER r4_cipher=
        {
        NID_rc4,
@@ -91,6 +90,7 @@ static const EVP_CIPHER r4_cipher=
        sizeof(EVP_RC4_KEY),
        NULL,
        NULL,
+       NULL,
        NULL
        };
 
@@ -105,6 +105,7 @@ static const EVP_CIPHER r4_40_cipher=
        sizeof(EVP_RC4_KEY),
        NULL, 
        NULL,
+       NULL,
        NULL
        };
 
@@ -121,14 +122,13 @@ const EVP_CIPHER *EVP_rc4_40(void)
 static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
                        const unsigned char *iv, int enc)
        {
-       memcpy(&data(ctx)->key[0],key,EVP_CIPHER_CTX_key_length(ctx));
        RC4_set_key(&data(ctx)->ks,EVP_CIPHER_CTX_key_length(ctx),
-               data(ctx)->key);
+                   key);
        return 1;
        }
 
 static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-                     const unsigned char *in, unsigned int inl)
+                     const unsigned char *in, size_t inl)
        {
        RC4(&data(ctx)->ks,inl,in,out);
        return 1;