Add support for 'other' PKCS#7 content types.
[openssl.git] / crypto / pkcs7 / pkcs7.h
index 19f66c6e1e387348ada806f6f32e7b69eb166bd1..ac46c8dd1560c6a37331332d27d602db65fed985 100644 (file)
 #ifndef HEADER_PKCS7_H
 #define HEADER_PKCS7_H
 
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
 #include <openssl/bio.h>
 #include <openssl/x509.h>
 
@@ -70,6 +66,10 @@ extern "C" {
 #include <openssl/vms_idhacks.h>
 #endif
 
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
 #ifdef WIN32
 /* Under Win32 thes are defined in wincrypt.h */
 #undef PKCS7_ISSUER_AND_SERIAL
@@ -210,9 +210,16 @@ typedef struct pkcs7_st
 
                /* NID_pkcs7_encrypted */
                PKCS7_ENCRYPT *encrypted;
+
+               /* Anything else */
+               ASN1_TYPE *other;
                } d;
        } PKCS7;
 
+DECLARE_STACK_OF(PKCS7)
+DECLARE_ASN1_SET_OF(PKCS7)
+DECLARE_PKCS12_STACK_OF(PKCS7)
+
 #define PKCS7_OP_SET_DETACHED_SIGNATURE        1
 #define PKCS7_OP_GET_DETACHED_SIGNATURE        2
 
@@ -250,7 +257,7 @@ typedef struct pkcs7_st
 #define PKCS7_BINARY   0x80
 #define PKCS7_NOATTR   0x100
 
-/* Flags: for compatability with older code */
+/* Flags: for compatibility with older code */
 
 #define SMIME_TEXT     PKCS7_TEXT
 #define SMIME_NOCERTS  PKCS7_NOCERTS
@@ -397,14 +404,15 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
                                                        BIO *data, int flags);
 int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
                                        BIO *indata, BIO *out, int flags);
-STACK_OF(X509) *PKCS7_iget_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags);
+STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags);
 PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, EVP_CIPHER *cipher,
                                                                int flags);
 int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags);
 
-int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, STACK *cap);
-STACK *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
-int PKCS7_simple_smimecap(STACK *sk, int nid, int arg);
+int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
+                             STACK_OF(X509_ALGOR) *cap);
+STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
+int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
 
 int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
 PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
@@ -433,7 +441,7 @@ int SMIME_text(BIO *in, BIO *out);
 #define PKCS7_F_PKCS7_DATAVERIFY                        107
 #define PKCS7_F_PKCS7_DECRYPT                           114
 #define PKCS7_F_PKCS7_ENCRYPT                           115
-#define PKCS7_F_PKCS7_IGET_SIGNERS                      124
+#define PKCS7_F_PKCS7_GET0_SIGNERS                      124
 #define PKCS7_F_PKCS7_SET_CIPHER                        108
 #define PKCS7_F_PKCS7_SET_CONTENT                       109
 #define PKCS7_F_PKCS7_SET_TYPE                          110