summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/e_null.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/e_null.c')
-rw-r--r--src/lib/libcrypto/evp/e_null.c42
1 files changed, 17 insertions, 25 deletions
diff --git a/src/lib/libcrypto/evp/e_null.c b/src/lib/libcrypto/evp/e_null.c
index e4e7ca7606..2420d7e5af 100644
--- a/src/lib/libcrypto/evp/e_null.c
+++ b/src/lib/libcrypto/evp/e_null.c
@@ -58,52 +58,44 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include "evp.h" 61#include <openssl/evp.h>
62#include "objects.h" 62#include <openssl/objects.h>
63 63
64#ifndef NOPROTO 64static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
65static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65 const unsigned char *iv,int enc);
66 unsigned char *iv,int enc); 66static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
67static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 67 const unsigned char *in, unsigned int inl);
68 unsigned char *in, unsigned int inl); 68static const EVP_CIPHER n_cipher=
69#else
70static void null_init_key();
71static void null_cipher();
72#endif
73
74static EVP_CIPHER n_cipher=
75 { 69 {
76 NID_undef, 70 NID_undef,
77 1,0,0, 71 1,0,0,
72 0,
78 null_init_key, 73 null_init_key,
79 null_cipher, 74 null_cipher,
80 NULL, 75 NULL,
81 0, 76 0,
82 NULL, 77 NULL,
83 NULL, 78 NULL,
79 NULL
84 }; 80 };
85 81
86EVP_CIPHER *EVP_enc_null() 82const EVP_CIPHER *EVP_enc_null(void)
87 { 83 {
88 return(&n_cipher); 84 return(&n_cipher);
89 } 85 }
90 86
91static void null_init_key(ctx,key,iv,enc) 87static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
92EVP_CIPHER_CTX *ctx; 88 const unsigned char *iv, int enc)
93unsigned char *key;
94unsigned char *iv;
95int enc;
96 { 89 {
97 memset(&(ctx->c),0,sizeof(ctx->c)); 90 /* memset(&(ctx->c),0,sizeof(ctx->c));*/
91 return 1;
98 } 92 }
99 93
100static void null_cipher(ctx,out,in,inl) 94static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
101EVP_CIPHER_CTX *ctx; 95 const unsigned char *in, unsigned int inl)
102unsigned char *out;
103unsigned char *in;
104unsigned int inl;
105 { 96 {
106 if (in != out) 97 if (in != out)
107 memcpy((char *)out,(char *)in,(int)inl); 98 memcpy((char *)out,(char *)in,(int)inl);
99 return 1;
108 } 100 }
109 101