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.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/lib/libcrypto/evp/e_null.c b/src/lib/libcrypto/evp/e_null.c
index 0a62c10aa9..e0702cf818 100644
--- a/src/lib/libcrypto/evp/e_null.c
+++ b/src/lib/libcrypto/evp/e_null.c
@@ -61,20 +61,22 @@
61#include <openssl/evp.h> 61#include <openssl/evp.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63 63
64static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 64static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
65 unsigned char *iv,int enc); 65 const unsigned char *iv,int enc);
66static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 66static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
67 unsigned char *in, unsigned int inl); 67 const unsigned char *in, unsigned int inl);
68static EVP_CIPHER n_cipher= 68static EVP_CIPHER n_cipher=
69 { 69 {
70 NID_undef, 70 NID_undef,
71 1,0,0, 71 1,0,0,
72 0,
72 null_init_key, 73 null_init_key,
73 null_cipher, 74 null_cipher,
74 NULL, 75 NULL,
75 0, 76 0,
76 NULL, 77 NULL,
77 NULL, 78 NULL,
79 NULL
78 }; 80 };
79 81
80EVP_CIPHER *EVP_enc_null(void) 82EVP_CIPHER *EVP_enc_null(void)
@@ -82,16 +84,18 @@ EVP_CIPHER *EVP_enc_null(void)
82 return(&n_cipher); 84 return(&n_cipher);
83 } 85 }
84 86
85static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 87static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
86 unsigned char *iv, int enc) 88 const unsigned char *iv, int enc)
87 { 89 {
88 memset(&(ctx->c),0,sizeof(ctx->c)); 90 memset(&(ctx->c),0,sizeof(ctx->c));
91 return 1;
89 } 92 }
90 93
91static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 94static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
92 unsigned char *in, unsigned int inl) 95 const unsigned char *in, unsigned int inl)
93 { 96 {
94 if (in != out) 97 if (in != out)
95 memcpy((char *)out,(char *)in,(int)inl); 98 memcpy((char *)out,(char *)in,(int)inl);
99 return 1;
96 } 100 }
97 101