X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fe_null.c;h=5205259f18ca2249a5cfaaef1140b6df8b4d2c4b;hp=e4e7ca76066fc7d502f44917a5f801f5e748f0f4;hb=ba30bad57bd0b02ebf952a550716a5a202b6004d;hpb=58964a492275ca9a59a0cd9c8155cb2491b4b909;ds=sidebyside diff --git a/crypto/evp/e_null.c b/crypto/evp/e_null.c index e4e7ca7606..5205259f18 100644 --- a/crypto/evp/e_null.c +++ b/crypto/evp/e_null.c @@ -58,52 +58,45 @@ #include #include "cryptlib.h" -#include "evp.h" -#include "objects.h" +#include +#include -#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; }