diff options
Diffstat (limited to 'src/lib/libcrypto/pkcs7/pkcs7.h')
-rw-r--r-- | src/lib/libcrypto/pkcs7/pkcs7.h | 104 |
1 files changed, 24 insertions, 80 deletions
diff --git a/src/lib/libcrypto/pkcs7/pkcs7.h b/src/lib/libcrypto/pkcs7/pkcs7.h index 1b817e605d..5819700a85 100644 --- a/src/lib/libcrypto/pkcs7/pkcs7.h +++ b/src/lib/libcrypto/pkcs7/pkcs7.h | |||
@@ -59,16 +59,18 @@ | |||
59 | #ifndef HEADER_PKCS7_H | 59 | #ifndef HEADER_PKCS7_H |
60 | #define HEADER_PKCS7_H | 60 | #define HEADER_PKCS7_H |
61 | 61 | ||
62 | #include <openssl/asn1.h> | ||
62 | #include <openssl/bio.h> | 63 | #include <openssl/bio.h> |
63 | #include <openssl/x509.h> | 64 | #include <openssl/e_os2.h> |
64 | 65 | ||
65 | #include <openssl/symhacks.h> | 66 | #include <openssl/symhacks.h> |
67 | #include <openssl/ossl_typ.h> | ||
66 | 68 | ||
67 | #ifdef __cplusplus | 69 | #ifdef __cplusplus |
68 | extern "C" { | 70 | extern "C" { |
69 | #endif | 71 | #endif |
70 | 72 | ||
71 | #ifdef WIN32 | 73 | #ifdef OPENSSL_SYS_WIN32 |
72 | /* Under Win32 thes are defined in wincrypt.h */ | 74 | /* Under Win32 thes are defined in wincrypt.h */ |
73 | #undef PKCS7_ISSUER_AND_SERIAL | 75 | #undef PKCS7_ISSUER_AND_SERIAL |
74 | #undef PKCS7_SIGNER_INFO | 76 | #undef PKCS7_SIGNER_INFO |
@@ -225,6 +227,7 @@ DECLARE_PKCS12_STACK_OF(PKCS7) | |||
225 | #define PKCS7_get_attributes(si) ((si)->unauth_attr) | 227 | #define PKCS7_get_attributes(si) ((si)->unauth_attr) |
226 | 228 | ||
227 | #define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed) | 229 | #define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed) |
230 | #define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted) | ||
228 | #define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped) | 231 | #define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped) |
229 | #define PKCS7_type_is_signedAndEnveloped(a) \ | 232 | #define PKCS7_type_is_signedAndEnveloped(a) \ |
230 | (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped) | 233 | (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped) |
@@ -235,6 +238,8 @@ DECLARE_PKCS12_STACK_OF(PKCS7) | |||
235 | #define PKCS7_get_detached(p) \ | 238 | #define PKCS7_get_detached(p) \ |
236 | PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL) | 239 | PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL) |
237 | 240 | ||
241 | #define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7)) | ||
242 | |||
238 | #ifdef SSLEAY_MACROS | 243 | #ifdef SSLEAY_MACROS |
239 | #ifndef PKCS7_ISSUER_AND_SERIAL_digest | 244 | #ifndef PKCS7_ISSUER_AND_SERIAL_digest |
240 | #define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \ | 245 | #define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \ |
@@ -268,19 +273,12 @@ DECLARE_PKCS12_STACK_OF(PKCS7) | |||
268 | #define SMIME_BINARY PKCS7_BINARY | 273 | #define SMIME_BINARY PKCS7_BINARY |
269 | #define SMIME_NOATTR PKCS7_NOATTR | 274 | #define SMIME_NOATTR PKCS7_NOATTR |
270 | 275 | ||
271 | PKCS7_ISSUER_AND_SERIAL *PKCS7_ISSUER_AND_SERIAL_new(void ); | 276 | DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) |
272 | void PKCS7_ISSUER_AND_SERIAL_free( | ||
273 | PKCS7_ISSUER_AND_SERIAL *a); | ||
274 | int i2d_PKCS7_ISSUER_AND_SERIAL( | ||
275 | PKCS7_ISSUER_AND_SERIAL *a,unsigned char **pp); | ||
276 | PKCS7_ISSUER_AND_SERIAL *d2i_PKCS7_ISSUER_AND_SERIAL( | ||
277 | PKCS7_ISSUER_AND_SERIAL **a, | ||
278 | unsigned char **pp, long length); | ||
279 | 277 | ||
280 | #ifndef SSLEAY_MACROS | 278 | #ifndef SSLEAY_MACROS |
281 | int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,const EVP_MD *type, | 279 | int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,const EVP_MD *type, |
282 | unsigned char *md,unsigned int *len); | 280 | unsigned char *md,unsigned int *len); |
283 | #ifndef NO_FP_API | 281 | #ifndef OPENSSL_NO_FP_API |
284 | PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7); | 282 | PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7); |
285 | int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7); | 283 | int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7); |
286 | #endif | 284 | #endif |
@@ -289,71 +287,18 @@ PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7); | |||
289 | int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7); | 287 | int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7); |
290 | #endif | 288 | #endif |
291 | 289 | ||
292 | PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new(void); | 290 | DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO) |
293 | void PKCS7_SIGNER_INFO_free(PKCS7_SIGNER_INFO *a); | 291 | DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO) |
294 | int i2d_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO *a, | 292 | DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED) |
295 | unsigned char **pp); | 293 | DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT) |
296 | PKCS7_SIGNER_INFO *d2i_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO **a, | 294 | DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE) |
297 | unsigned char **pp,long length); | 295 | DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE) |
298 | 296 | DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST) | |
299 | PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new(void); | 297 | DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT) |
300 | void PKCS7_RECIP_INFO_free(PKCS7_RECIP_INFO *a); | 298 | DECLARE_ASN1_FUNCTIONS(PKCS7) |
301 | int i2d_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO *a, | ||
302 | unsigned char **pp); | ||
303 | PKCS7_RECIP_INFO *d2i_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO **a, | ||
304 | unsigned char **pp,long length); | ||
305 | |||
306 | PKCS7_SIGNED *PKCS7_SIGNED_new(void); | ||
307 | void PKCS7_SIGNED_free(PKCS7_SIGNED *a); | ||
308 | int i2d_PKCS7_SIGNED(PKCS7_SIGNED *a, | ||
309 | unsigned char **pp); | ||
310 | PKCS7_SIGNED *d2i_PKCS7_SIGNED(PKCS7_SIGNED **a, | ||
311 | unsigned char **pp,long length); | ||
312 | |||
313 | PKCS7_ENC_CONTENT *PKCS7_ENC_CONTENT_new(void); | ||
314 | void PKCS7_ENC_CONTENT_free(PKCS7_ENC_CONTENT *a); | ||
315 | int i2d_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT *a, | ||
316 | unsigned char **pp); | ||
317 | PKCS7_ENC_CONTENT *d2i_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT **a, | ||
318 | unsigned char **pp,long length); | ||
319 | |||
320 | PKCS7_ENVELOPE *PKCS7_ENVELOPE_new(void); | ||
321 | void PKCS7_ENVELOPE_free(PKCS7_ENVELOPE *a); | ||
322 | int i2d_PKCS7_ENVELOPE(PKCS7_ENVELOPE *a, | ||
323 | unsigned char **pp); | ||
324 | PKCS7_ENVELOPE *d2i_PKCS7_ENVELOPE(PKCS7_ENVELOPE **a, | ||
325 | unsigned char **pp,long length); | ||
326 | |||
327 | PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new(void); | ||
328 | void PKCS7_SIGN_ENVELOPE_free(PKCS7_SIGN_ENVELOPE *a); | ||
329 | int i2d_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE *a, | ||
330 | unsigned char **pp); | ||
331 | PKCS7_SIGN_ENVELOPE *d2i_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE **a, | ||
332 | unsigned char **pp,long length); | ||
333 | |||
334 | PKCS7_DIGEST *PKCS7_DIGEST_new(void); | ||
335 | void PKCS7_DIGEST_free(PKCS7_DIGEST *a); | ||
336 | int i2d_PKCS7_DIGEST(PKCS7_DIGEST *a, | ||
337 | unsigned char **pp); | ||
338 | PKCS7_DIGEST *d2i_PKCS7_DIGEST(PKCS7_DIGEST **a, | ||
339 | unsigned char **pp,long length); | ||
340 | |||
341 | PKCS7_ENCRYPT *PKCS7_ENCRYPT_new(void); | ||
342 | void PKCS7_ENCRYPT_free(PKCS7_ENCRYPT *a); | ||
343 | int i2d_PKCS7_ENCRYPT(PKCS7_ENCRYPT *a, | ||
344 | unsigned char **pp); | ||
345 | PKCS7_ENCRYPT *d2i_PKCS7_ENCRYPT(PKCS7_ENCRYPT **a, | ||
346 | unsigned char **pp,long length); | ||
347 | |||
348 | PKCS7 *PKCS7_new(void); | ||
349 | void PKCS7_free(PKCS7 *a); | ||
350 | void PKCS7_content_free(PKCS7 *a); | ||
351 | int i2d_PKCS7(PKCS7 *a, | ||
352 | unsigned char **pp); | ||
353 | PKCS7 *d2i_PKCS7(PKCS7 **a, | ||
354 | unsigned char **pp,long length); | ||
355 | 299 | ||
356 | void ERR_load_PKCS7_strings(void); | 300 | DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN) |
301 | DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY) | ||
357 | 302 | ||
358 | 303 | ||
359 | long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg); | 304 | long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg); |
@@ -361,7 +306,7 @@ long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg); | |||
361 | int PKCS7_set_type(PKCS7 *p7, int type); | 306 | int PKCS7_set_type(PKCS7 *p7, int type); |
362 | int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); | 307 | int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); |
363 | int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, | 308 | int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, |
364 | EVP_MD *dgst); | 309 | const EVP_MD *dgst); |
365 | int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); | 310 | int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); |
366 | int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); | 311 | int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); |
367 | int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); | 312 | int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); |
@@ -377,7 +322,7 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert); | |||
377 | 322 | ||
378 | 323 | ||
379 | PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, | 324 | PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, |
380 | EVP_PKEY *pkey, EVP_MD *dgst); | 325 | EVP_PKEY *pkey, const EVP_MD *dgst); |
381 | X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); | 326 | X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); |
382 | STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); | 327 | STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); |
383 | 328 | ||
@@ -404,7 +349,7 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, | |||
404 | int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, | 349 | int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, |
405 | BIO *indata, BIO *out, int flags); | 350 | BIO *indata, BIO *out, int flags); |
406 | STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); | 351 | STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); |
407 | PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, EVP_CIPHER *cipher, | 352 | PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, |
408 | int flags); | 353 | int flags); |
409 | int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); | 354 | int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); |
410 | 355 | ||
@@ -422,6 +367,7 @@ int SMIME_text(BIO *in, BIO *out); | |||
422 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 367 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
423 | * made after this point may be overwritten when the script is next run. | 368 | * made after this point may be overwritten when the script is next run. |
424 | */ | 369 | */ |
370 | void ERR_load_PKCS7_strings(void); | ||
425 | 371 | ||
426 | /* Error codes for the PKCS7 functions. */ | 372 | /* Error codes for the PKCS7 functions. */ |
427 | 373 | ||
@@ -462,7 +408,6 @@ int SMIME_text(BIO *in, BIO *out); | |||
462 | #define PKCS7_R_DIGEST_FAILURE 101 | 408 | #define PKCS7_R_DIGEST_FAILURE 101 |
463 | #define PKCS7_R_ERROR_ADDING_RECIPIENT 120 | 409 | #define PKCS7_R_ERROR_ADDING_RECIPIENT 120 |
464 | #define PKCS7_R_ERROR_SETTING_CIPHER 121 | 410 | #define PKCS7_R_ERROR_SETTING_CIPHER 121 |
465 | #define PKCS7_R_INTERNAL_ERROR 102 | ||
466 | #define PKCS7_R_INVALID_MIME_TYPE 131 | 411 | #define PKCS7_R_INVALID_MIME_TYPE 131 |
467 | #define PKCS7_R_INVALID_NULL_POINTER 143 | 412 | #define PKCS7_R_INVALID_NULL_POINTER 143 |
468 | #define PKCS7_R_MIME_NO_CONTENT_TYPE 132 | 413 | #define PKCS7_R_MIME_NO_CONTENT_TYPE 132 |
@@ -502,4 +447,3 @@ int SMIME_text(BIO *in, BIO *out); | |||
502 | } | 447 | } |
503 | #endif | 448 | #endif |
504 | #endif | 449 | #endif |
505 | |||