diff options
author | markus <> | 2002-09-05 12:51:50 +0000 |
---|---|---|
committer | markus <> | 2002-09-05 12:51:50 +0000 |
commit | 15b5d84f9da2ce4bfae8580e56e34a859f74ad71 (patch) | |
tree | bf939e82d7fd73cc8a01cf6959002209972091bc /src/lib/libcrypto/evp/e_null.c | |
parent | 027351f729b9e837200dae6e1520cda6577ab930 (diff) | |
download | openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.gz openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.bz2 openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.zip |
import openssl-0.9.7-beta1
Diffstat (limited to 'src/lib/libcrypto/evp/e_null.c')
-rw-r--r-- | src/lib/libcrypto/evp/e_null.c | 42 |
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 | 64 | static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
65 | static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | const unsigned char *iv,int enc); |
66 | unsigned char *iv,int enc); | 66 | static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
67 | static 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); | 68 | static const EVP_CIPHER n_cipher= |
69 | #else | ||
70 | static void null_init_key(); | ||
71 | static void null_cipher(); | ||
72 | #endif | ||
73 | |||
74 | static 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 | ||
86 | EVP_CIPHER *EVP_enc_null() | 82 | const EVP_CIPHER *EVP_enc_null(void) |
87 | { | 83 | { |
88 | return(&n_cipher); | 84 | return(&n_cipher); |
89 | } | 85 | } |
90 | 86 | ||
91 | static void null_init_key(ctx,key,iv,enc) | 87 | static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
92 | EVP_CIPHER_CTX *ctx; | 88 | const unsigned char *iv, int enc) |
93 | unsigned char *key; | ||
94 | unsigned char *iv; | ||
95 | int 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 | ||
100 | static void null_cipher(ctx,out,in,inl) | 94 | static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
101 | EVP_CIPHER_CTX *ctx; | 95 | const unsigned char *in, unsigned int inl) |
102 | unsigned char *out; | ||
103 | unsigned char *in; | ||
104 | unsigned 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 | ||