diff options
author | djm <> | 2010-10-01 22:59:01 +0000 |
---|---|---|
committer | djm <> | 2010-10-01 22:59:01 +0000 |
commit | fe047d8b632246cb2db3234a0a4f32e5c318857b (patch) | |
tree | 939b752540947d33507b3acc48d76a8bfb7c3dc3 /src/lib/libcrypto/evp/evp_lib.c | |
parent | 2ea67f4aa254b09ded62e6e14fc893bbe6381579 (diff) | |
download | openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.tar.gz openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.tar.bz2 openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.zip |
resolve conflicts, fix local changes
Diffstat (limited to 'src/lib/libcrypto/evp/evp_lib.c')
-rw-r--r-- | src/lib/libcrypto/evp/evp_lib.c | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/src/lib/libcrypto/evp/evp_lib.c b/src/lib/libcrypto/evp/evp_lib.c index 174cf6c594..40951a04f0 100644 --- a/src/lib/libcrypto/evp/evp_lib.c +++ b/src/lib/libcrypto/evp/evp_lib.c | |||
@@ -67,8 +67,6 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | |||
67 | 67 | ||
68 | if (c->cipher->set_asn1_parameters != NULL) | 68 | if (c->cipher->set_asn1_parameters != NULL) |
69 | ret=c->cipher->set_asn1_parameters(c,type); | 69 | ret=c->cipher->set_asn1_parameters(c,type); |
70 | else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) | ||
71 | ret=EVP_CIPHER_set_asn1_iv(c, type); | ||
72 | else | 70 | else |
73 | ret=-1; | 71 | ret=-1; |
74 | return(ret); | 72 | return(ret); |
@@ -80,8 +78,6 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | |||
80 | 78 | ||
81 | if (c->cipher->get_asn1_parameters != NULL) | 79 | if (c->cipher->get_asn1_parameters != NULL) |
82 | ret=c->cipher->get_asn1_parameters(c,type); | 80 | ret=c->cipher->get_asn1_parameters(c,type); |
83 | else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) | ||
84 | ret=EVP_CIPHER_get_asn1_iv(c, type); | ||
85 | else | 81 | else |
86 | ret=-1; | 82 | ret=-1; |
87 | return(ret); | 83 | return(ret); |
@@ -163,6 +159,12 @@ int EVP_CIPHER_type(const EVP_CIPHER *ctx) | |||
163 | 159 | ||
164 | return NID_des_cfb64; | 160 | return NID_des_cfb64; |
165 | 161 | ||
162 | case NID_des_ede3_cfb64: | ||
163 | case NID_des_ede3_cfb8: | ||
164 | case NID_des_ede3_cfb1: | ||
165 | |||
166 | return NID_des_cfb64; | ||
167 | |||
166 | default: | 168 | default: |
167 | /* Check it has an OID and it is valid */ | 169 | /* Check it has an OID and it is valid */ |
168 | otmp = OBJ_nid2obj(nid); | 170 | otmp = OBJ_nid2obj(nid); |
@@ -182,6 +184,11 @@ int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx) | |||
182 | return ctx->cipher->block_size; | 184 | return ctx->cipher->block_size; |
183 | } | 185 | } |
184 | 186 | ||
187 | int EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) | ||
188 | { | ||
189 | return ctx->cipher->do_cipher(ctx,out,in,inl); | ||
190 | } | ||
191 | |||
185 | const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx) | 192 | const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx) |
186 | { | 193 | { |
187 | return ctx->cipher; | 194 | return ctx->cipher; |
@@ -192,6 +199,11 @@ unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher) | |||
192 | return cipher->flags; | 199 | return cipher->flags; |
193 | } | 200 | } |
194 | 201 | ||
202 | unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx) | ||
203 | { | ||
204 | return ctx->cipher->flags; | ||
205 | } | ||
206 | |||
195 | void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx) | 207 | void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx) |
196 | { | 208 | { |
197 | return ctx->app_data; | 209 | return ctx->app_data; |
@@ -207,6 +219,11 @@ int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher) | |||
207 | return cipher->iv_len; | 219 | return cipher->iv_len; |
208 | } | 220 | } |
209 | 221 | ||
222 | int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) | ||
223 | { | ||
224 | return ctx->cipher->iv_len; | ||
225 | } | ||
226 | |||
210 | int EVP_CIPHER_key_length(const EVP_CIPHER *cipher) | 227 | int EVP_CIPHER_key_length(const EVP_CIPHER *cipher) |
211 | { | 228 | { |
212 | return cipher->key_len; | 229 | return cipher->key_len; |
@@ -217,6 +234,11 @@ int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx) | |||
217 | return ctx->key_len; | 234 | return ctx->key_len; |
218 | } | 235 | } |
219 | 236 | ||
237 | int EVP_CIPHER_nid(const EVP_CIPHER *cipher) | ||
238 | { | ||
239 | return cipher->nid; | ||
240 | } | ||
241 | |||
220 | int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx) | 242 | int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx) |
221 | { | 243 | { |
222 | return ctx->cipher->nid; | 244 | return ctx->cipher->nid; |
@@ -239,11 +261,23 @@ int EVP_MD_pkey_type(const EVP_MD *md) | |||
239 | 261 | ||
240 | int EVP_MD_size(const EVP_MD *md) | 262 | int EVP_MD_size(const EVP_MD *md) |
241 | { | 263 | { |
264 | if (!md) | ||
265 | { | ||
266 | EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL); | ||
267 | return -1; | ||
268 | } | ||
242 | return md->md_size; | 269 | return md->md_size; |
243 | } | 270 | } |
244 | 271 | ||
245 | const EVP_MD * EVP_MD_CTX_md(const EVP_MD_CTX *ctx) | 272 | unsigned long EVP_MD_flags(const EVP_MD *md) |
273 | { | ||
274 | return md->flags; | ||
275 | } | ||
276 | |||
277 | const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx) | ||
246 | { | 278 | { |
279 | if (!ctx) | ||
280 | return NULL; | ||
247 | return ctx->digest; | 281 | return ctx->digest; |
248 | } | 282 | } |
249 | 283 | ||