Fix (most) WIN32 warnings and errors.
[openssl.git] / crypto / evp / e_null.c
index c30e2736f257de80dcae9c242390756b7c6ef0e0..5205259f18ca2249a5cfaaef1140b6df8b4d2c4b 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/evp/e_null.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "evp.h"
-#include "objects.h"
+#include <openssl/evp.h>
+#include <openssl/objects.h>
 
-#ifndef NOPROTO
-static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
-       unsigned char *iv,int enc);
-static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-       unsigned char *in, unsigned int inl);
-#else
-static void null_init_key();
-static void null_cipher();
-#endif
-
-static EVP_CIPHER n_cipher=
+static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
+       const unsigned char *iv,int enc);
+static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+       const unsigned char *in, unsigned int inl);
+static const EVP_CIPHER n_cipher=
        {
        NID_undef,
        1,0,0,
+       0,
        null_init_key,
        null_cipher,
+       NULL,
+       0,
+       NULL,
+       NULL,
+       NULL,
+       NULL
        };
 
-EVP_CIPHER *EVP_enc_null()
+const EVP_CIPHER *EVP_enc_null(void)
        {
        return(&n_cipher);
        }
 
-static void null_init_key(ctx,key,iv,enc)
-EVP_CIPHER_CTX *ctx;
-unsigned char *key;
-unsigned char *iv;
-int enc;
+static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
+            const unsigned char *iv, int enc)
        {
-       memset(&(ctx->c),0,sizeof(ctx->c));
+       /*      memset(&(ctx->c),0,sizeof(ctx->c));*/
+       return 1;
        }
 
-static void null_cipher(ctx,out,in,inl)
-EVP_CIPHER_CTX *ctx;
-unsigned char *out;
-unsigned char *in;
-unsigned int inl;
+static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+            const unsigned char *in, unsigned int inl)
        {
        if (in != out)
-               memcpy((char *)out,(char *)in,(int)inl);
+               memcpy((char *)out,(const char *)in,(size_t)inl);
+       return 1;
        }