diff options
Diffstat (limited to 'src/lib/libcrypto/evp/evp.h')
-rw-r--r-- | src/lib/libcrypto/evp/evp.h | 502 |
1 files changed, 240 insertions, 262 deletions
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index fd43127092..915fe62341 100644 --- a/src/lib/libcrypto/evp/evp.h +++ b/src/lib/libcrypto/evp/evp.h | |||
@@ -67,74 +67,30 @@ | |||
67 | # undef OPENSSL_ALGORITHM_DEFINES | 67 | # undef OPENSSL_ALGORITHM_DEFINES |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | #ifndef NO_BIO | 70 | #include <openssl/ossl_typ.h> |
71 | |||
72 | #include <openssl/symhacks.h> | ||
73 | |||
74 | #ifndef OPENSSL_NO_BIO | ||
71 | #include <openssl/bio.h> | 75 | #include <openssl/bio.h> |
72 | #endif | 76 | #endif |
73 | #ifndef NO_MD2 | ||
74 | #include <openssl/md2.h> | ||
75 | #endif | ||
76 | #ifndef NO_MD4 | ||
77 | #include <openssl/md4.h> | ||
78 | #endif | ||
79 | #ifndef NO_MD5 | ||
80 | #include <openssl/md5.h> | ||
81 | #endif | ||
82 | #ifndef NO_SHA | ||
83 | #include <openssl/sha.h> | ||
84 | #endif | ||
85 | #ifndef NO_RIPEMD | ||
86 | #include <openssl/ripemd.h> | ||
87 | #endif | ||
88 | #ifndef NO_DES | ||
89 | #include <openssl/des.h> | ||
90 | #endif | ||
91 | #ifndef NO_RC4 | ||
92 | #include <openssl/rc4.h> | ||
93 | #endif | ||
94 | #ifndef NO_RC2 | ||
95 | #include <openssl/rc2.h> | ||
96 | #endif | ||
97 | #ifndef NO_RC5 | ||
98 | #include <openssl/rc5.h> | ||
99 | #endif | ||
100 | #ifndef NO_BF | ||
101 | #include <openssl/blowfish.h> | ||
102 | #endif | ||
103 | #ifndef NO_CAST | ||
104 | #include <openssl/cast.h> | ||
105 | #endif | ||
106 | #ifndef NO_IDEA | ||
107 | #include <openssl/idea.h> | ||
108 | #endif | ||
109 | #ifndef NO_MDC2 | ||
110 | #include <openssl/mdc2.h> | ||
111 | #endif | ||
112 | 77 | ||
78 | /* | ||
113 | #define EVP_RC2_KEY_SIZE 16 | 79 | #define EVP_RC2_KEY_SIZE 16 |
114 | #define EVP_RC4_KEY_SIZE 16 | 80 | #define EVP_RC4_KEY_SIZE 16 |
115 | #define EVP_BLOWFISH_KEY_SIZE 16 | 81 | #define EVP_BLOWFISH_KEY_SIZE 16 |
116 | #define EVP_CAST5_KEY_SIZE 16 | 82 | #define EVP_CAST5_KEY_SIZE 16 |
117 | #define EVP_RC5_32_12_16_KEY_SIZE 16 | 83 | #define EVP_RC5_32_12_16_KEY_SIZE 16 |
84 | */ | ||
118 | #define EVP_MAX_MD_SIZE (16+20) /* The SSLv3 md5+sha1 type */ | 85 | #define EVP_MAX_MD_SIZE (16+20) /* The SSLv3 md5+sha1 type */ |
119 | #define EVP_MAX_KEY_LENGTH 24 | 86 | #define EVP_MAX_KEY_LENGTH 32 |
120 | #define EVP_MAX_IV_LENGTH 8 | 87 | #define EVP_MAX_IV_LENGTH 16 |
88 | #define EVP_MAX_BLOCK_LENGTH 32 | ||
121 | 89 | ||
122 | #define PKCS5_SALT_LEN 8 | 90 | #define PKCS5_SALT_LEN 8 |
123 | /* Default PKCS#5 iteration count */ | 91 | /* Default PKCS#5 iteration count */ |
124 | #define PKCS5_DEFAULT_ITER 2048 | 92 | #define PKCS5_DEFAULT_ITER 2048 |
125 | 93 | ||
126 | #ifndef NO_RSA | ||
127 | #include <openssl/rsa.h> | ||
128 | #endif | ||
129 | |||
130 | #ifndef NO_DSA | ||
131 | #include <openssl/dsa.h> | ||
132 | #endif | ||
133 | |||
134 | #ifndef NO_DH | ||
135 | #include <openssl/dh.h> | ||
136 | #endif | ||
137 | |||
138 | #include <openssl/objects.h> | 94 | #include <openssl/objects.h> |
139 | 95 | ||
140 | #define EVP_PK_RSA 0x0001 | 96 | #define EVP_PK_RSA 0x0001 |
@@ -164,26 +120,26 @@ extern "C" { | |||
164 | /* Type needs to be a bit field | 120 | /* Type needs to be a bit field |
165 | * Sub-type needs to be for variations on the method, as in, can it do | 121 | * Sub-type needs to be for variations on the method, as in, can it do |
166 | * arbitrary encryption.... */ | 122 | * arbitrary encryption.... */ |
167 | typedef struct evp_pkey_st | 123 | struct evp_pkey_st |
168 | { | 124 | { |
169 | int type; | 125 | int type; |
170 | int save_type; | 126 | int save_type; |
171 | int references; | 127 | int references; |
172 | union { | 128 | union { |
173 | char *ptr; | 129 | char *ptr; |
174 | #ifndef NO_RSA | 130 | #ifndef OPENSSL_NO_RSA |
175 | struct rsa_st *rsa; /* RSA */ | 131 | struct rsa_st *rsa; /* RSA */ |
176 | #endif | 132 | #endif |
177 | #ifndef NO_DSA | 133 | #ifndef OPENSSL_NO_DSA |
178 | struct dsa_st *dsa; /* DSA */ | 134 | struct dsa_st *dsa; /* DSA */ |
179 | #endif | 135 | #endif |
180 | #ifndef NO_DH | 136 | #ifndef OPENSSL_NO_DH |
181 | struct dh_st *dh; /* DH */ | 137 | struct dh_st *dh; /* DH */ |
182 | #endif | 138 | #endif |
183 | } pkey; | 139 | } pkey; |
184 | int save_parameters; | 140 | int save_parameters; |
185 | STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ | 141 | STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ |
186 | } EVP_PKEY; | 142 | } /* EVP_PKEY */; |
187 | 143 | ||
188 | #define EVP_PKEY_MO_SIGN 0x0001 | 144 | #define EVP_PKEY_MO_SIGN 0x0001 |
189 | #define EVP_PKEY_MO_VERIFY 0x0002 | 145 | #define EVP_PKEY_MO_VERIFY 0x0002 |
@@ -258,27 +214,32 @@ typedef struct evp_pkey_method_st | |||
258 | #endif | 214 | #endif |
259 | 215 | ||
260 | #ifndef EVP_MD | 216 | #ifndef EVP_MD |
261 | typedef struct env_md_st | 217 | struct env_md_st |
262 | { | 218 | { |
263 | int type; | 219 | int type; |
264 | int pkey_type; | 220 | int pkey_type; |
265 | int md_size; | 221 | int md_size; |
266 | void (*init)(); | 222 | unsigned long flags; |
267 | void (*update)(); | 223 | int (*init)(EVP_MD_CTX *ctx); |
268 | void (*final)(); | 224 | int (*update)(EVP_MD_CTX *ctx,const void *data,unsigned long count); |
269 | 225 | int (*final)(EVP_MD_CTX *ctx,unsigned char *md); | |
226 | int (*copy)(EVP_MD_CTX *to,const EVP_MD_CTX *from); | ||
227 | int (*cleanup)(EVP_MD_CTX *ctx); | ||
228 | |||
229 | /* FIXME: prototype these some day */ | ||
270 | int (*sign)(); | 230 | int (*sign)(); |
271 | int (*verify)(); | 231 | int (*verify)(); |
272 | int required_pkey_type[5]; /*EVP_PKEY_xxx */ | 232 | int required_pkey_type[5]; /*EVP_PKEY_xxx */ |
273 | int block_size; | 233 | int block_size; |
274 | int ctx_size; /* how big does the ctx need to be */ | 234 | int ctx_size; /* how big does the ctx->md_data need to be */ |
275 | } EVP_MD; | 235 | } /* EVP_MD */; |
276 | |||
277 | 236 | ||
237 | #define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single | ||
238 | * block */ | ||
278 | 239 | ||
279 | #define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} | 240 | #define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} |
280 | 241 | ||
281 | #ifndef NO_DSA | 242 | #ifndef OPENSSL_NO_DSA |
282 | #define EVP_PKEY_DSA_method DSA_sign,DSA_verify, \ | 243 | #define EVP_PKEY_DSA_method DSA_sign,DSA_verify, \ |
283 | {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \ | 244 | {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \ |
284 | EVP_PKEY_DSA4,0} | 245 | EVP_PKEY_DSA4,0} |
@@ -286,7 +247,7 @@ typedef struct env_md_st | |||
286 | #define EVP_PKEY_DSA_method EVP_PKEY_NULL_method | 247 | #define EVP_PKEY_DSA_method EVP_PKEY_NULL_method |
287 | #endif | 248 | #endif |
288 | 249 | ||
289 | #ifndef NO_RSA | 250 | #ifndef OPENSSL_NO_RSA |
290 | #define EVP_PKEY_RSA_method RSA_sign,RSA_verify, \ | 251 | #define EVP_PKEY_RSA_method RSA_sign,RSA_verify, \ |
291 | {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} | 252 | {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} |
292 | #define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \ | 253 | #define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \ |
@@ -300,34 +261,20 @@ typedef struct env_md_st | |||
300 | 261 | ||
301 | #endif /* !EVP_MD */ | 262 | #endif /* !EVP_MD */ |
302 | 263 | ||
303 | typedef struct env_md_ctx_st | 264 | struct env_md_ctx_st |
304 | { | 265 | { |
305 | const EVP_MD *digest; | 266 | const EVP_MD *digest; |
306 | union { | 267 | ENGINE *engine; /* functional reference if 'digest' is ENGINE-provided */ |
307 | unsigned char base[4]; | 268 | unsigned long flags; |
308 | #ifndef NO_MD2 | 269 | void *md_data; |
309 | MD2_CTX md2; | 270 | } /* EVP_MD_CTX */; |
310 | #endif | 271 | |
311 | #ifndef NO_MD5 | 272 | /* values for EVP_MD_CTX flags */ |
312 | MD5_CTX md5; | ||
313 | #endif | ||
314 | #ifndef NO_MD4 | ||
315 | MD4_CTX md4; | ||
316 | #endif | ||
317 | #ifndef NO_RIPEMD | ||
318 | RIPEMD160_CTX ripemd160; | ||
319 | #endif | ||
320 | #ifndef NO_SHA | ||
321 | SHA_CTX sha; | ||
322 | #endif | ||
323 | #ifndef NO_MDC2 | ||
324 | MDC2_CTX mdc2; | ||
325 | #endif | ||
326 | } md; | ||
327 | } EVP_MD_CTX; | ||
328 | 273 | ||
329 | typedef struct evp_cipher_st EVP_CIPHER; | 274 | #define EVP_MD_CTX_FLAG_ONESHOT 0x0001 /* digest update will be called |
330 | typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; | 275 | * once only */ |
276 | #define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been | ||
277 | * cleaned */ | ||
331 | 278 | ||
332 | struct evp_cipher_st | 279 | struct evp_cipher_st |
333 | { | 280 | { |
@@ -341,12 +288,12 @@ struct evp_cipher_st | |||
341 | int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out, | 288 | int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out, |
342 | const unsigned char *in, unsigned int inl);/* encrypt/decrypt data */ | 289 | const unsigned char *in, unsigned int inl);/* encrypt/decrypt data */ |
343 | int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */ | 290 | int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */ |
344 | int ctx_size; /* how big the ctx needs to be */ | 291 | int ctx_size; /* how big ctx->cipher_data needs to be */ |
345 | int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */ | 292 | int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */ |
346 | int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */ | 293 | int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */ |
347 | int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */ | 294 | int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */ |
348 | void *app_data; /* Application data */ | 295 | void *app_data; /* Application data */ |
349 | }; | 296 | } /* EVP_CIPHER */; |
350 | 297 | ||
351 | /* Values for cipher flags */ | 298 | /* Values for cipher flags */ |
352 | 299 | ||
@@ -368,6 +315,8 @@ struct evp_cipher_st | |||
368 | #define EVP_CIPH_CTRL_INIT 0x40 | 315 | #define EVP_CIPH_CTRL_INIT 0x40 |
369 | /* Don't use standard key length function */ | 316 | /* Don't use standard key length function */ |
370 | #define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 | 317 | #define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 |
318 | /* Don't use standard block padding */ | ||
319 | #define EVP_CIPH_NO_PADDING 0x100 | ||
371 | 320 | ||
372 | /* ctrl() values */ | 321 | /* ctrl() values */ |
373 | 322 | ||
@@ -387,62 +336,23 @@ typedef struct evp_cipher_info_st | |||
387 | struct evp_cipher_ctx_st | 336 | struct evp_cipher_ctx_st |
388 | { | 337 | { |
389 | const EVP_CIPHER *cipher; | 338 | const EVP_CIPHER *cipher; |
339 | ENGINE *engine; /* functional reference if 'cipher' is ENGINE-provided */ | ||
390 | int encrypt; /* encrypt or decrypt */ | 340 | int encrypt; /* encrypt or decrypt */ |
391 | int buf_len; /* number we have left */ | 341 | int buf_len; /* number we have left */ |
392 | 342 | ||
393 | unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ | 343 | unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ |
394 | unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ | 344 | unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ |
395 | unsigned char buf[EVP_MAX_IV_LENGTH]; /* saved partial block */ | 345 | unsigned char buf[EVP_MAX_BLOCK_LENGTH];/* saved partial block */ |
396 | int num; /* used by cfb/ofb mode */ | 346 | int num; /* used by cfb/ofb mode */ |
397 | 347 | ||
398 | void *app_data; /* application stuff */ | 348 | void *app_data; /* application stuff */ |
399 | int key_len; /* May change for variable length cipher */ | 349 | int key_len; /* May change for variable length cipher */ |
400 | union { | 350 | unsigned long flags; /* Various flags */ |
401 | #ifndef NO_RC4 | 351 | void *cipher_data; /* per EVP data */ |
402 | struct | 352 | int final_used; |
403 | { | 353 | int block_mask; |
404 | unsigned char key[EVP_RC4_KEY_SIZE]; | 354 | unsigned char final[EVP_MAX_BLOCK_LENGTH];/* possible final block */ |
405 | RC4_KEY ks; /* working key */ | 355 | } /* EVP_CIPHER_CTX */; |
406 | } rc4; | ||
407 | #endif | ||
408 | #ifndef NO_DES | ||
409 | des_key_schedule des_ks;/* key schedule */ | ||
410 | struct | ||
411 | { | ||
412 | des_key_schedule ks;/* key schedule */ | ||
413 | des_cblock inw; | ||
414 | des_cblock outw; | ||
415 | } desx_cbc; | ||
416 | struct | ||
417 | { | ||
418 | des_key_schedule ks1;/* key schedule */ | ||
419 | des_key_schedule ks2;/* key schedule (for ede) */ | ||
420 | des_key_schedule ks3;/* key schedule (for ede3) */ | ||
421 | } des_ede; | ||
422 | #endif | ||
423 | #ifndef NO_IDEA | ||
424 | IDEA_KEY_SCHEDULE idea_ks;/* key schedule */ | ||
425 | #endif | ||
426 | #ifndef NO_RC2 | ||
427 | struct { | ||
428 | int key_bits; /* effective key bits */ | ||
429 | RC2_KEY ks;/* key schedule */ | ||
430 | } rc2; | ||
431 | #endif | ||
432 | #ifndef NO_RC5 | ||
433 | struct { | ||
434 | int rounds; /* number of rounds */ | ||
435 | RC5_32_KEY ks;/* key schedule */ | ||
436 | } rc5; | ||
437 | #endif | ||
438 | #ifndef NO_BF | ||
439 | BF_KEY bf_ks;/* key schedule */ | ||
440 | #endif | ||
441 | #ifndef NO_CAST | ||
442 | CAST_KEY cast_ks;/* key schedule */ | ||
443 | #endif | ||
444 | } c; | ||
445 | }; | ||
446 | 356 | ||
447 | typedef struct evp_Encode_Ctx_st | 357 | typedef struct evp_Encode_Ctx_st |
448 | { | 358 | { |
@@ -459,20 +369,20 @@ typedef struct evp_Encode_Ctx_st | |||
459 | 369 | ||
460 | /* Password based encryption function */ | 370 | /* Password based encryption function */ |
461 | typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | 371 | typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
462 | ASN1_TYPE *param, EVP_CIPHER *cipher, | 372 | ASN1_TYPE *param, const EVP_CIPHER *cipher, |
463 | EVP_MD *md, int en_de); | 373 | const EVP_MD *md, int en_de); |
464 | 374 | ||
465 | #ifndef NO_RSA | 375 | #ifndef OPENSSL_NO_RSA |
466 | #define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ | 376 | #define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ |
467 | (char *)(rsa)) | 377 | (char *)(rsa)) |
468 | #endif | 378 | #endif |
469 | 379 | ||
470 | #ifndef NO_DSA | 380 | #ifndef OPENSSL_NO_DSA |
471 | #define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ | 381 | #define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ |
472 | (char *)(dsa)) | 382 | (char *)(dsa)) |
473 | #endif | 383 | #endif |
474 | 384 | ||
475 | #ifndef NO_DH | 385 | #ifndef OPENSSL_NO_DH |
476 | #define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\ | 386 | #define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\ |
477 | (char *)(dh)) | 387 | (char *)(dh)) |
478 | #endif | 388 | #endif |
@@ -484,6 +394,8 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
484 | #define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) | 394 | #define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) |
485 | 395 | ||
486 | #define EVP_MD_type(e) ((e)->type) | 396 | #define EVP_MD_type(e) ((e)->type) |
397 | #define EVP_MD_nid(e) EVP_MD_type(e) | ||
398 | #define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) | ||
487 | #define EVP_MD_pkey_type(e) ((e)->pkey_type) | 399 | #define EVP_MD_pkey_type(e) ((e)->pkey_type) |
488 | #define EVP_MD_size(e) ((e)->md_size) | 400 | #define EVP_MD_size(e) ((e)->md_size) |
489 | #define EVP_MD_block_size(e) ((e)->block_size) | 401 | #define EVP_MD_block_size(e) ((e)->block_size) |
@@ -494,11 +406,12 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
494 | #define EVP_MD_CTX_type(e) EVP_MD_type((e)->digest) | 406 | #define EVP_MD_CTX_type(e) EVP_MD_type((e)->digest) |
495 | 407 | ||
496 | #define EVP_CIPHER_nid(e) ((e)->nid) | 408 | #define EVP_CIPHER_nid(e) ((e)->nid) |
409 | #define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) | ||
497 | #define EVP_CIPHER_block_size(e) ((e)->block_size) | 410 | #define EVP_CIPHER_block_size(e) ((e)->block_size) |
498 | #define EVP_CIPHER_key_length(e) ((e)->key_len) | 411 | #define EVP_CIPHER_key_length(e) ((e)->key_len) |
499 | #define EVP_CIPHER_iv_length(e) ((e)->iv_len) | 412 | #define EVP_CIPHER_iv_length(e) ((e)->iv_len) |
500 | #define EVP_CIPHER_flags(e) ((e)->flags) | 413 | #define EVP_CIPHER_flags(e) ((e)->flags) |
501 | #define EVP_CIPHER_mode(e) ((e)->flags) & EVP_CIPH_MODE) | 414 | #define EVP_CIPHER_mode(e) (((e)->flags) & EVP_CIPH_MODE) |
502 | 415 | ||
503 | #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher) | 416 | #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher) |
504 | #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid) | 417 | #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid) |
@@ -514,8 +427,10 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
514 | #define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) | 427 | #define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) |
515 | #define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) | 428 | #define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) |
516 | 429 | ||
430 | #define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) | ||
517 | #define EVP_SignInit(a,b) EVP_DigestInit(a,b) | 431 | #define EVP_SignInit(a,b) EVP_DigestInit(a,b) |
518 | #define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) | 432 | #define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) |
433 | #define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) | ||
519 | #define EVP_VerifyInit(a,b) EVP_DigestInit(a,b) | 434 | #define EVP_VerifyInit(a,b) EVP_DigestInit(a,b) |
520 | #define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) | 435 | #define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) |
521 | #define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) | 436 | #define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) |
@@ -542,38 +457,61 @@ void BIO_set_md(BIO *,const EVP_MD *md); | |||
542 | #define EVP_delete_digest_alias(alias) \ | 457 | #define EVP_delete_digest_alias(alias) \ |
543 | OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); | 458 | OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); |
544 | 459 | ||
545 | 460 | void EVP_MD_CTX_init(EVP_MD_CTX *ctx); | |
546 | int EVP_MD_CTX_copy(EVP_MD_CTX *out,EVP_MD_CTX *in); | 461 | int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); |
547 | void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); | 462 | EVP_MD_CTX *EVP_MD_CTX_create(void); |
548 | void EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d, | 463 | void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); |
464 | int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out,const EVP_MD_CTX *in); | ||
465 | #define EVP_MD_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs)) | ||
466 | #define EVP_MD_CTX_clear_flags(ctx,flgs) ((ctx)->flags&=~(flgs)) | ||
467 | #define EVP_MD_CTX_test_flags(ctx,flgs) ((ctx)->flags&(flgs)) | ||
468 | int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); | ||
469 | int EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d, | ||
549 | unsigned int cnt); | 470 | unsigned int cnt); |
550 | void EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); | 471 | int EVP_DigestFinal_ex(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); |
472 | int EVP_Digest(void *data, unsigned int count, | ||
473 | unsigned char *md, unsigned int *size, const EVP_MD *type, ENGINE *impl); | ||
474 | |||
475 | int EVP_MD_CTX_copy(EVP_MD_CTX *out,const EVP_MD_CTX *in); | ||
476 | int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); | ||
477 | int EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); | ||
551 | 478 | ||
552 | int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify); | 479 | int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify); |
553 | void EVP_set_pw_prompt(char *prompt); | 480 | void EVP_set_pw_prompt(char *prompt); |
554 | char * EVP_get_pw_prompt(void); | 481 | char * EVP_get_pw_prompt(void); |
555 | 482 | ||
556 | int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, | 483 | int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md, |
557 | const unsigned char *salt, const unsigned char *data, int datal, | 484 | const unsigned char *salt, const unsigned char *data, |
558 | int count, unsigned char *key, unsigned char *iv); | 485 | int datal, int count, unsigned char *key,unsigned char *iv); |
559 | 486 | ||
560 | int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, | 487 | int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, |
561 | unsigned char *key, unsigned char *iv); | 488 | const unsigned char *key, const unsigned char *iv); |
489 | int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, | ||
490 | const unsigned char *key, const unsigned char *iv); | ||
562 | int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | 491 | int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
563 | int *outl, unsigned char *in, int inl); | 492 | int *outl, const unsigned char *in, int inl); |
493 | int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); | ||
564 | int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); | 494 | int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); |
565 | 495 | ||
566 | int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, | 496 | int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, |
567 | unsigned char *key, unsigned char *iv); | 497 | const unsigned char *key, const unsigned char *iv); |
498 | int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, | ||
499 | const unsigned char *key, const unsigned char *iv); | ||
568 | int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | 500 | int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
569 | int *outl, unsigned char *in, int inl); | 501 | int *outl, const unsigned char *in, int inl); |
570 | int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | 502 | int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); |
571 | 503 | int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | |
572 | int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, | 504 | |
573 | unsigned char *key,unsigned char *iv,int enc); | 505 | int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, |
506 | const unsigned char *key,const unsigned char *iv, | ||
507 | int enc); | ||
508 | int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, | ||
509 | const unsigned char *key,const unsigned char *iv, | ||
510 | int enc); | ||
574 | int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | 511 | int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
575 | int *outl, unsigned char *in, int inl); | 512 | int *outl, const unsigned char *in, int inl); |
576 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | 513 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); |
514 | int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | ||
577 | 515 | ||
578 | int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s, | 516 | int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s, |
579 | EVP_PKEY *pkey); | 517 | EVP_PKEY *pkey); |
@@ -581,11 +519,11 @@ int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s, | |||
581 | int EVP_VerifyFinal(EVP_MD_CTX *ctx,unsigned char *sigbuf, | 519 | int EVP_VerifyFinal(EVP_MD_CTX *ctx,unsigned char *sigbuf, |
582 | unsigned int siglen,EVP_PKEY *pkey); | 520 | unsigned int siglen,EVP_PKEY *pkey); |
583 | 521 | ||
584 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek, | 522 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,unsigned char *ek, |
585 | int ekl,unsigned char *iv,EVP_PKEY *priv); | 523 | int ekl,unsigned char *iv,EVP_PKEY *priv); |
586 | int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); | 524 | int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); |
587 | 525 | ||
588 | int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek, | 526 | int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, |
589 | int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk); | 527 | int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk); |
590 | void EVP_SealFinal(EVP_CIPHER_CTX *ctx,unsigned char *out,int *outl); | 528 | void EVP_SealFinal(EVP_CIPHER_CTX *ctx,unsigned char *out,int *outl); |
591 | 529 | ||
@@ -602,14 +540,13 @@ int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned | |||
602 | char *out, int *outl); | 540 | char *out, int *outl); |
603 | int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); | 541 | int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); |
604 | 542 | ||
605 | void ERR_load_EVP_strings(void ); | ||
606 | |||
607 | void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); | 543 | void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); |
608 | int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); | 544 | int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); |
609 | int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); | 545 | int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); |
546 | int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); | ||
610 | int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); | 547 | int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); |
611 | 548 | ||
612 | #ifndef NO_BIO | 549 | #ifndef OPENSSL_NO_BIO |
613 | BIO_METHOD *BIO_f_md(void); | 550 | BIO_METHOD *BIO_f_md(void); |
614 | BIO_METHOD *BIO_f_base64(void); | 551 | BIO_METHOD *BIO_f_base64(void); |
615 | BIO_METHOD *BIO_f_cipher(void); | 552 | BIO_METHOD *BIO_f_cipher(void); |
@@ -618,89 +555,117 @@ void BIO_set_cipher(BIO *b,const EVP_CIPHER *c,unsigned char *k, | |||
618 | unsigned char *i, int enc); | 555 | unsigned char *i, int enc); |
619 | #endif | 556 | #endif |
620 | 557 | ||
621 | EVP_MD *EVP_md_null(void); | 558 | const EVP_MD *EVP_md_null(void); |
622 | #ifndef NO_MD2 | 559 | #ifndef OPENSSL_NO_MD2 |
623 | EVP_MD *EVP_md2(void); | 560 | const EVP_MD *EVP_md2(void); |
624 | #endif | 561 | #endif |
625 | #ifndef NO_MD4 | 562 | #ifndef OPENSSL_NO_MD4 |
626 | EVP_MD *EVP_md4(void); | 563 | const EVP_MD *EVP_md4(void); |
627 | #endif | 564 | #endif |
628 | #ifndef NO_MD5 | 565 | #ifndef OPENSSL_NO_MD5 |
629 | EVP_MD *EVP_md5(void); | 566 | const EVP_MD *EVP_md5(void); |
630 | #endif | 567 | #endif |
631 | #ifndef NO_SHA | 568 | #ifndef OPENSSL_NO_SHA |
632 | EVP_MD *EVP_sha(void); | 569 | const EVP_MD *EVP_sha(void); |
633 | EVP_MD *EVP_sha1(void); | 570 | const EVP_MD *EVP_sha1(void); |
634 | EVP_MD *EVP_dss(void); | 571 | const EVP_MD *EVP_dss(void); |
635 | EVP_MD *EVP_dss1(void); | 572 | const EVP_MD *EVP_dss1(void); |
636 | #endif | 573 | #endif |
637 | #ifndef NO_MDC2 | 574 | #ifndef OPENSSL_NO_MDC2 |
638 | EVP_MD *EVP_mdc2(void); | 575 | const EVP_MD *EVP_mdc2(void); |
639 | #endif | 576 | #endif |
640 | #ifndef NO_RIPEMD | 577 | #ifndef OPENSSL_NO_RIPEMD |
641 | EVP_MD *EVP_ripemd160(void); | 578 | const EVP_MD *EVP_ripemd160(void); |
642 | #endif | 579 | #endif |
643 | EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ | 580 | const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ |
644 | #ifndef NO_DES | 581 | #ifndef OPENSSL_NO_DES |
645 | EVP_CIPHER *EVP_des_ecb(void); | 582 | const EVP_CIPHER *EVP_des_ecb(void); |
646 | EVP_CIPHER *EVP_des_ede(void); | 583 | const EVP_CIPHER *EVP_des_ede(void); |
647 | EVP_CIPHER *EVP_des_ede3(void); | 584 | const EVP_CIPHER *EVP_des_ede3(void); |
648 | EVP_CIPHER *EVP_des_cfb(void); | 585 | const EVP_CIPHER *EVP_des_cfb(void); |
649 | EVP_CIPHER *EVP_des_ede_cfb(void); | 586 | const EVP_CIPHER *EVP_des_ede_cfb(void); |
650 | EVP_CIPHER *EVP_des_ede3_cfb(void); | 587 | const EVP_CIPHER *EVP_des_ede3_cfb(void); |
651 | EVP_CIPHER *EVP_des_ofb(void); | 588 | const EVP_CIPHER *EVP_des_ofb(void); |
652 | EVP_CIPHER *EVP_des_ede_ofb(void); | 589 | const EVP_CIPHER *EVP_des_ede_ofb(void); |
653 | EVP_CIPHER *EVP_des_ede3_ofb(void); | 590 | const EVP_CIPHER *EVP_des_ede3_ofb(void); |
654 | EVP_CIPHER *EVP_des_cbc(void); | 591 | const EVP_CIPHER *EVP_des_cbc(void); |
655 | EVP_CIPHER *EVP_des_ede_cbc(void); | 592 | const EVP_CIPHER *EVP_des_ede_cbc(void); |
656 | EVP_CIPHER *EVP_des_ede3_cbc(void); | 593 | const EVP_CIPHER *EVP_des_ede3_cbc(void); |
657 | EVP_CIPHER *EVP_desx_cbc(void); | 594 | const EVP_CIPHER *EVP_desx_cbc(void); |
658 | #endif | 595 | /* This should now be supported through the dev_crypto ENGINE. But also, why are |
659 | #ifndef NO_RC4 | 596 | * rc4 and md5 declarations made here inside a "NO_DES" precompiler branch? */ |
660 | EVP_CIPHER *EVP_rc4(void); | 597 | #if 0 |
661 | EVP_CIPHER *EVP_rc4_40(void); | 598 | # ifdef OPENSSL_OPENBSD_DEV_CRYPTO |
662 | #endif | 599 | const EVP_CIPHER *EVP_dev_crypto_des_ede3_cbc(void); |
663 | #ifndef NO_IDEA | 600 | const EVP_CIPHER *EVP_dev_crypto_rc4(void); |
664 | EVP_CIPHER *EVP_idea_ecb(void); | 601 | const EVP_MD *EVP_dev_crypto_md5(void); |
665 | EVP_CIPHER *EVP_idea_cfb(void); | 602 | # endif |
666 | EVP_CIPHER *EVP_idea_ofb(void); | 603 | #endif |
667 | EVP_CIPHER *EVP_idea_cbc(void); | 604 | #endif |
668 | #endif | 605 | #ifndef OPENSSL_NO_RC4 |
669 | #ifndef NO_RC2 | 606 | const EVP_CIPHER *EVP_rc4(void); |
670 | EVP_CIPHER *EVP_rc2_ecb(void); | 607 | const EVP_CIPHER *EVP_rc4_40(void); |
671 | EVP_CIPHER *EVP_rc2_cbc(void); | 608 | #endif |
672 | EVP_CIPHER *EVP_rc2_40_cbc(void); | 609 | #ifndef OPENSSL_NO_IDEA |
673 | EVP_CIPHER *EVP_rc2_64_cbc(void); | 610 | const EVP_CIPHER *EVP_idea_ecb(void); |
674 | EVP_CIPHER *EVP_rc2_cfb(void); | 611 | const EVP_CIPHER *EVP_idea_cfb(void); |
675 | EVP_CIPHER *EVP_rc2_ofb(void); | 612 | const EVP_CIPHER *EVP_idea_ofb(void); |
676 | #endif | 613 | const EVP_CIPHER *EVP_idea_cbc(void); |
677 | #ifndef NO_BF | 614 | #endif |
678 | EVP_CIPHER *EVP_bf_ecb(void); | 615 | #ifndef OPENSSL_NO_RC2 |
679 | EVP_CIPHER *EVP_bf_cbc(void); | 616 | const EVP_CIPHER *EVP_rc2_ecb(void); |
680 | EVP_CIPHER *EVP_bf_cfb(void); | 617 | const EVP_CIPHER *EVP_rc2_cbc(void); |
681 | EVP_CIPHER *EVP_bf_ofb(void); | 618 | const EVP_CIPHER *EVP_rc2_40_cbc(void); |
682 | #endif | 619 | const EVP_CIPHER *EVP_rc2_64_cbc(void); |
683 | #ifndef NO_CAST | 620 | const EVP_CIPHER *EVP_rc2_cfb(void); |
684 | EVP_CIPHER *EVP_cast5_ecb(void); | 621 | const EVP_CIPHER *EVP_rc2_ofb(void); |
685 | EVP_CIPHER *EVP_cast5_cbc(void); | 622 | #endif |
686 | EVP_CIPHER *EVP_cast5_cfb(void); | 623 | #ifndef OPENSSL_NO_BF |
687 | EVP_CIPHER *EVP_cast5_ofb(void); | 624 | const EVP_CIPHER *EVP_bf_ecb(void); |
688 | #endif | 625 | const EVP_CIPHER *EVP_bf_cbc(void); |
689 | #ifndef NO_RC5 | 626 | const EVP_CIPHER *EVP_bf_cfb(void); |
690 | EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); | 627 | const EVP_CIPHER *EVP_bf_ofb(void); |
691 | EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); | 628 | #endif |
692 | EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); | 629 | #ifndef OPENSSL_NO_CAST |
693 | EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); | 630 | const EVP_CIPHER *EVP_cast5_ecb(void); |
694 | #endif | 631 | const EVP_CIPHER *EVP_cast5_cbc(void); |
695 | void OpenSSL_add_all_algorithms(void); | 632 | const EVP_CIPHER *EVP_cast5_cfb(void); |
633 | const EVP_CIPHER *EVP_cast5_ofb(void); | ||
634 | #endif | ||
635 | #ifndef OPENSSL_NO_RC5 | ||
636 | const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); | ||
637 | const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); | ||
638 | const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); | ||
639 | const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); | ||
640 | #endif | ||
641 | #ifndef OPENSSL_NO_AES | ||
642 | const EVP_CIPHER *EVP_aes_128_ecb(void); | ||
643 | const EVP_CIPHER *EVP_aes_128_cbc(void); | ||
644 | const EVP_CIPHER *EVP_aes_192_ecb(void); | ||
645 | const EVP_CIPHER *EVP_aes_192_cbc(void); | ||
646 | const EVP_CIPHER *EVP_aes_256_ecb(void); | ||
647 | const EVP_CIPHER *EVP_aes_256_cbc(void); | ||
648 | #endif | ||
649 | |||
650 | void OPENSSL_add_all_algorithms_noconf(void); | ||
651 | void OPENSSL_add_all_algorithms_conf(void); | ||
652 | |||
653 | #ifdef OPENSSL_LOAD_CONF | ||
654 | #define OpenSSL_add_all_algorithms() \ | ||
655 | OPENSSL_add_all_algorithms_conf() | ||
656 | #else | ||
657 | #define OpenSSL_add_all_algorithms() \ | ||
658 | OPENSSL_add_all_algorithms_noconf() | ||
659 | #endif | ||
660 | |||
696 | void OpenSSL_add_all_ciphers(void); | 661 | void OpenSSL_add_all_ciphers(void); |
697 | void OpenSSL_add_all_digests(void); | 662 | void OpenSSL_add_all_digests(void); |
698 | #define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() | 663 | #define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() |
699 | #define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() | 664 | #define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() |
700 | #define SSLeay_add_all_digests() OpenSSL_add_all_digests() | 665 | #define SSLeay_add_all_digests() OpenSSL_add_all_digests() |
701 | 666 | ||
702 | int EVP_add_cipher(EVP_CIPHER *cipher); | 667 | int EVP_add_cipher(const EVP_CIPHER *cipher); |
703 | int EVP_add_digest(EVP_MD *digest); | 668 | int EVP_add_digest(const EVP_MD *digest); |
704 | 669 | ||
705 | const EVP_CIPHER *EVP_get_cipherbyname(const char *name); | 670 | const EVP_CIPHER *EVP_get_cipherbyname(const char *name); |
706 | const EVP_MD *EVP_get_digestbyname(const char *name); | 671 | const EVP_MD *EVP_get_digestbyname(const char *name); |
@@ -714,18 +679,24 @@ int EVP_PKEY_type(int type); | |||
714 | int EVP_PKEY_bits(EVP_PKEY *pkey); | 679 | int EVP_PKEY_bits(EVP_PKEY *pkey); |
715 | int EVP_PKEY_size(EVP_PKEY *pkey); | 680 | int EVP_PKEY_size(EVP_PKEY *pkey); |
716 | int EVP_PKEY_assign(EVP_PKEY *pkey,int type,char *key); | 681 | int EVP_PKEY_assign(EVP_PKEY *pkey,int type,char *key); |
717 | #ifndef NO_RSA | 682 | |
718 | int EVP_PKEY_set1_RSA(EVP_PKEY *pkey,RSA *key); | 683 | #ifndef OPENSSL_NO_RSA |
719 | RSA * EVP_PKEY_get1_RSA(EVP_PKEY *pkey); | 684 | struct rsa_st; |
685 | int EVP_PKEY_set1_RSA(EVP_PKEY *pkey,struct rsa_st *key); | ||
686 | struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); | ||
720 | #endif | 687 | #endif |
721 | #ifndef NO_DSA | 688 | #ifndef OPENSSL_NO_DSA |
722 | int EVP_PKEY_set1_DSA(EVP_PKEY *pkey,DSA *key); | 689 | struct dsa_st; |
723 | DSA * EVP_PKEY_get1_DSA(EVP_PKEY *pkey); | 690 | int EVP_PKEY_set1_DSA(EVP_PKEY *pkey,struct dsa_st *key); |
691 | struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); | ||
724 | #endif | 692 | #endif |
725 | #ifndef NO_DH | 693 | #ifndef OPENSSL_NO_DH |
726 | int EVP_PKEY_set1_DH(EVP_PKEY *pkey,DH *key); | 694 | struct dh_st; |
727 | DH * EVP_PKEY_get1_DH(EVP_PKEY *pkey); | 695 | int EVP_PKEY_set1_DH(EVP_PKEY *pkey,struct dh_st *key); |
696 | struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey); | ||
728 | #endif | 697 | #endif |
698 | |||
699 | |||
729 | EVP_PKEY * EVP_PKEY_new(void); | 700 | EVP_PKEY * EVP_PKEY_new(void); |
730 | void EVP_PKEY_free(EVP_PKEY *pkey); | 701 | void EVP_PKEY_free(EVP_PKEY *pkey); |
731 | EVP_PKEY * d2i_PublicKey(int type,EVP_PKEY **a, unsigned char **pp, | 702 | EVP_PKEY * d2i_PublicKey(int type,EVP_PKEY **a, unsigned char **pp, |
@@ -755,20 +726,20 @@ int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); | |||
755 | 726 | ||
756 | /* PKCS5 password based encryption */ | 727 | /* PKCS5 password based encryption */ |
757 | int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | 728 | int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
758 | ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md, | 729 | ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, |
759 | int en_de); | 730 | int en_de); |
760 | int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, | 731 | int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, |
761 | unsigned char *salt, int saltlen, int iter, | 732 | unsigned char *salt, int saltlen, int iter, |
762 | int keylen, unsigned char *out); | 733 | int keylen, unsigned char *out); |
763 | int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | 734 | int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
764 | ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md, | 735 | ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, |
765 | int en_de); | 736 | int en_de); |
766 | 737 | ||
767 | void PKCS5_PBE_add(void); | 738 | void PKCS5_PBE_add(void); |
768 | 739 | ||
769 | int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen, | 740 | int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen, |
770 | ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); | 741 | ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); |
771 | int EVP_PBE_alg_add(int nid, EVP_CIPHER *cipher, EVP_MD *md, | 742 | int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, |
772 | EVP_PBE_KEYGEN *keygen); | 743 | EVP_PBE_KEYGEN *keygen); |
773 | void EVP_PBE_cleanup(void); | 744 | void EVP_PBE_cleanup(void); |
774 | 745 | ||
@@ -776,6 +747,7 @@ void EVP_PBE_cleanup(void); | |||
776 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 747 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
777 | * made after this point may be overwritten when the script is next run. | 748 | * made after this point may be overwritten when the script is next run. |
778 | */ | 749 | */ |
750 | void ERR_load_EVP_strings(void); | ||
779 | 751 | ||
780 | /* Error codes for the EVP functions. */ | 752 | /* Error codes for the EVP functions. */ |
781 | 753 | ||
@@ -785,6 +757,8 @@ void EVP_PBE_cleanup(void); | |||
785 | #define EVP_F_EVP_CIPHER_CTX_CTRL 124 | 757 | #define EVP_F_EVP_CIPHER_CTX_CTRL 124 |
786 | #define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 | 758 | #define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 |
787 | #define EVP_F_EVP_DECRYPTFINAL 101 | 759 | #define EVP_F_EVP_DECRYPTFINAL 101 |
760 | #define EVP_F_EVP_DIGESTINIT 128 | ||
761 | #define EVP_F_EVP_ENCRYPTFINAL 127 | ||
788 | #define EVP_F_EVP_MD_CTX_COPY 110 | 762 | #define EVP_F_EVP_MD_CTX_COPY 110 |
789 | #define EVP_F_EVP_OPENINIT 102 | 763 | #define EVP_F_EVP_OPENINIT 102 |
790 | #define EVP_F_EVP_PBE_ALG_ADD 115 | 764 | #define EVP_F_EVP_PBE_ALG_ADD 115 |
@@ -799,6 +773,7 @@ void EVP_PBE_cleanup(void); | |||
799 | #define EVP_F_EVP_PKEY_GET1_DSA 120 | 773 | #define EVP_F_EVP_PKEY_GET1_DSA 120 |
800 | #define EVP_F_EVP_PKEY_GET1_RSA 121 | 774 | #define EVP_F_EVP_PKEY_GET1_RSA 121 |
801 | #define EVP_F_EVP_PKEY_NEW 106 | 775 | #define EVP_F_EVP_PKEY_NEW 106 |
776 | #define EVP_F_EVP_RIJNDAEL 126 | ||
802 | #define EVP_F_EVP_SIGNFINAL 107 | 777 | #define EVP_F_EVP_SIGNFINAL 107 |
803 | #define EVP_F_EVP_VERIFYFINAL 108 | 778 | #define EVP_F_EVP_VERIFYFINAL 108 |
804 | #define EVP_F_PKCS5_PBE_KEYIVGEN 117 | 779 | #define EVP_F_PKCS5_PBE_KEYIVGEN 117 |
@@ -807,12 +782,15 @@ void EVP_PBE_cleanup(void); | |||
807 | #define EVP_F_RC5_CTRL 125 | 782 | #define EVP_F_RC5_CTRL 125 |
808 | 783 | ||
809 | /* Reason codes. */ | 784 | /* Reason codes. */ |
785 | #define EVP_R_BAD_BLOCK_LENGTH 136 | ||
810 | #define EVP_R_BAD_DECRYPT 100 | 786 | #define EVP_R_BAD_DECRYPT 100 |
787 | #define EVP_R_BAD_KEY_LENGTH 137 | ||
811 | #define EVP_R_BN_DECODE_ERROR 112 | 788 | #define EVP_R_BN_DECODE_ERROR 112 |
812 | #define EVP_R_BN_PUBKEY_ERROR 113 | 789 | #define EVP_R_BN_PUBKEY_ERROR 113 |
813 | #define EVP_R_CIPHER_PARAMETER_ERROR 122 | 790 | #define EVP_R_CIPHER_PARAMETER_ERROR 122 |
814 | #define EVP_R_CTRL_NOT_IMPLEMENTED 132 | 791 | #define EVP_R_CTRL_NOT_IMPLEMENTED 132 |
815 | #define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133 | 792 | #define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133 |
793 | #define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138 | ||
816 | #define EVP_R_DECODE_ERROR 114 | 794 | #define EVP_R_DECODE_ERROR 114 |
817 | #define EVP_R_DIFFERENT_KEY_TYPES 101 | 795 | #define EVP_R_DIFFERENT_KEY_TYPES 101 |
818 | #define EVP_R_ENCODE_ERROR 115 | 796 | #define EVP_R_ENCODE_ERROR 115 |
@@ -827,6 +805,7 @@ void EVP_PBE_cleanup(void); | |||
827 | #define EVP_R_KEYGEN_FAILURE 120 | 805 | #define EVP_R_KEYGEN_FAILURE 120 |
828 | #define EVP_R_MISSING_PARAMETERS 103 | 806 | #define EVP_R_MISSING_PARAMETERS 103 |
829 | #define EVP_R_NO_CIPHER_SET 131 | 807 | #define EVP_R_NO_CIPHER_SET 131 |
808 | #define EVP_R_NO_DIGEST_SET 139 | ||
830 | #define EVP_R_NO_DSA_PARAMETERS 116 | 809 | #define EVP_R_NO_DSA_PARAMETERS 116 |
831 | #define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 | 810 | #define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 |
832 | #define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 | 811 | #define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 |
@@ -848,4 +827,3 @@ void EVP_PBE_cleanup(void); | |||
848 | } | 827 | } |
849 | #endif | 828 | #endif |
850 | #endif | 829 | #endif |
851 | |||