1.1 --- a/epoc32/include/stdapis/openssl/pkcs7.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/stdapis/openssl/pkcs7.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,474 @@
1.4 -pkcs7.h
1.5 +/* crypto/pkcs7/pkcs7.h */
1.6 +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
1.7 + * All rights reserved.
1.8 + *
1.9 + * This package is an SSL implementation written
1.10 + * by Eric Young (eay@cryptsoft.com).
1.11 + * The implementation was written so as to conform with Netscapes SSL.
1.12 + *
1.13 + * This library is free for commercial and non-commercial use as long as
1.14 + * the following conditions are aheared to. The following conditions
1.15 + * apply to all code found in this distribution, be it the RC4, RSA,
1.16 + * lhash, DES, etc., code; not just the SSL code. The SSL documentation
1.17 + * included with this distribution is covered by the same copyright terms
1.18 + * except that the holder is Tim Hudson (tjh@cryptsoft.com).
1.19 + *
1.20 + * Copyright remains Eric Young's, and as such any Copyright notices in
1.21 + * the code are not to be removed.
1.22 + * If this package is used in a product, Eric Young should be given attribution
1.23 + * as the author of the parts of the library used.
1.24 + * This can be in the form of a textual message at program startup or
1.25 + * in documentation (online or textual) provided with the package.
1.26 + *
1.27 + * Redistribution and use in source and binary forms, with or without
1.28 + * modification, are permitted provided that the following conditions
1.29 + * are met:
1.30 + * 1. Redistributions of source code must retain the copyright
1.31 + * notice, this list of conditions and the following disclaimer.
1.32 + * 2. Redistributions in binary form must reproduce the above copyright
1.33 + * notice, this list of conditions and the following disclaimer in the
1.34 + * documentation and/or other materials provided with the distribution.
1.35 + * 3. All advertising materials mentioning features or use of this software
1.36 + * must display the following acknowledgement:
1.37 + * "This product includes cryptographic software written by
1.38 + * Eric Young (eay@cryptsoft.com)"
1.39 + * The word 'cryptographic' can be left out if the rouines from the library
1.40 + * being used are not cryptographic related :-).
1.41 + * 4. If you include any Windows specific code (or a derivative thereof) from
1.42 + * the apps directory (application code) you must include an acknowledgement:
1.43 + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
1.44 + *
1.45 + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
1.46 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.47 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1.48 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1.49 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1.50 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1.51 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1.52 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1.53 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1.54 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1.55 + * SUCH DAMAGE.
1.56 + *
1.57 + * The licence and distribution terms for any publically available version or
1.58 + * derivative of this code cannot be changed. i.e. this code cannot simply be
1.59 + * copied and put under another distribution licence
1.60 + * [including the GNU Public Licence.]
1.61 + */
1.62 +/*
1.63 + © Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
1.64 + */
1.65 +
1.66 +#ifndef HEADER_PKCS7_H
1.67 +#define HEADER_PKCS7_H
1.68 +
1.69 +#if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
1.70 +#define SYMBIAN
1.71 +#endif
1.72 +
1.73 +#ifdef SYMBIAN
1.74 +#include <e32def.h>
1.75 +#endif
1.76 +#include <openssl/asn1.h>
1.77 +#include <openssl/bio.h>
1.78 +#include <openssl/e_os2.h>
1.79 +
1.80 +#include <openssl/symhacks.h>
1.81 +#include <openssl/ossl_typ.h>
1.82 +
1.83 +#ifdef __cplusplus
1.84 +extern "C" {
1.85 +#endif
1.86 +
1.87 +#ifdef OPENSSL_SYS_WIN32
1.88 +/* Under Win32 thes are defined in wincrypt.h */
1.89 +#undef PKCS7_ISSUER_AND_SERIAL
1.90 +#undef PKCS7_SIGNER_INFO
1.91 +#endif
1.92 +
1.93 +/*
1.94 +Encryption_ID DES-CBC
1.95 +Digest_ID MD5
1.96 +Digest_Encryption_ID rsaEncryption
1.97 +Key_Encryption_ID rsaEncryption
1.98 +*/
1.99 +
1.100 +typedef struct pkcs7_issuer_and_serial_st
1.101 + {
1.102 + X509_NAME *issuer;
1.103 + ASN1_INTEGER *serial;
1.104 + } PKCS7_ISSUER_AND_SERIAL;
1.105 +
1.106 +typedef struct pkcs7_signer_info_st
1.107 + {
1.108 + ASN1_INTEGER *version; /* version 1 */
1.109 + PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
1.110 + X509_ALGOR *digest_alg;
1.111 + STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */
1.112 + X509_ALGOR *digest_enc_alg;
1.113 + ASN1_OCTET_STRING *enc_digest;
1.114 + STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */
1.115 +
1.116 + /* The private key to sign with */
1.117 + EVP_PKEY *pkey;
1.118 + } PKCS7_SIGNER_INFO;
1.119 +
1.120 +DECLARE_STACK_OF(PKCS7_SIGNER_INFO)
1.121 +DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO)
1.122 +
1.123 +typedef struct pkcs7_recip_info_st
1.124 + {
1.125 + ASN1_INTEGER *version; /* version 0 */
1.126 + PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
1.127 + X509_ALGOR *key_enc_algor;
1.128 + ASN1_OCTET_STRING *enc_key;
1.129 + X509 *cert; /* get the pub-key from this */
1.130 + } PKCS7_RECIP_INFO;
1.131 +
1.132 +DECLARE_STACK_OF(PKCS7_RECIP_INFO)
1.133 +DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO)
1.134 +
1.135 +typedef struct pkcs7_signed_st
1.136 + {
1.137 + ASN1_INTEGER *version; /* version 1 */
1.138 + STACK_OF(X509_ALGOR) *md_algs; /* md used */
1.139 + STACK_OF(X509) *cert; /* [ 0 ] */
1.140 + STACK_OF(X509_CRL) *crl; /* [ 1 ] */
1.141 + STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
1.142 +
1.143 + struct pkcs7_st *contents;
1.144 + } PKCS7_SIGNED;
1.145 +/* The above structure is very very similar to PKCS7_SIGN_ENVELOPE.
1.146 + * How about merging the two */
1.147 +
1.148 +typedef struct pkcs7_enc_content_st
1.149 + {
1.150 + ASN1_OBJECT *content_type;
1.151 + X509_ALGOR *algorithm;
1.152 + ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
1.153 + const EVP_CIPHER *cipher;
1.154 + } PKCS7_ENC_CONTENT;
1.155 +
1.156 +typedef struct pkcs7_enveloped_st
1.157 + {
1.158 + ASN1_INTEGER *version; /* version 0 */
1.159 + STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
1.160 + PKCS7_ENC_CONTENT *enc_data;
1.161 + } PKCS7_ENVELOPE;
1.162 +
1.163 +typedef struct pkcs7_signedandenveloped_st
1.164 + {
1.165 + ASN1_INTEGER *version; /* version 1 */
1.166 + STACK_OF(X509_ALGOR) *md_algs; /* md used */
1.167 + STACK_OF(X509) *cert; /* [ 0 ] */
1.168 + STACK_OF(X509_CRL) *crl; /* [ 1 ] */
1.169 + STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
1.170 +
1.171 + PKCS7_ENC_CONTENT *enc_data;
1.172 + STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
1.173 + } PKCS7_SIGN_ENVELOPE;
1.174 +
1.175 +typedef struct pkcs7_digest_st
1.176 + {
1.177 + ASN1_INTEGER *version; /* version 0 */
1.178 + X509_ALGOR *md; /* md used */
1.179 + struct pkcs7_st *contents;
1.180 + ASN1_OCTET_STRING *digest;
1.181 + } PKCS7_DIGEST;
1.182 +
1.183 +typedef struct pkcs7_encrypted_st
1.184 + {
1.185 + ASN1_INTEGER *version; /* version 0 */
1.186 + PKCS7_ENC_CONTENT *enc_data;
1.187 + } PKCS7_ENCRYPT;
1.188 +
1.189 +typedef struct pkcs7_st
1.190 + {
1.191 + /* The following is non NULL if it contains ASN1 encoding of
1.192 + * this structure */
1.193 + unsigned char *asn1;
1.194 + long length;
1.195 +
1.196 +#define PKCS7_S_HEADER 0
1.197 +#define PKCS7_S_BODY 1
1.198 +#define PKCS7_S_TAIL 2
1.199 + int state; /* used during processing */
1.200 +
1.201 + int detached;
1.202 +
1.203 + ASN1_OBJECT *type;
1.204 + /* content as defined by the type */
1.205 + /* all encryption/message digests are applied to the 'contents',
1.206 + * leaving out the 'type' field. */
1.207 + union {
1.208 + char *ptr;
1.209 +
1.210 + /* NID_pkcs7_data */
1.211 + ASN1_OCTET_STRING *data;
1.212 +
1.213 + /* NID_pkcs7_signed */
1.214 + PKCS7_SIGNED *sign;
1.215 +
1.216 + /* NID_pkcs7_enveloped */
1.217 + PKCS7_ENVELOPE *enveloped;
1.218 +
1.219 + /* NID_pkcs7_signedAndEnveloped */
1.220 + PKCS7_SIGN_ENVELOPE *signed_and_enveloped;
1.221 +
1.222 + /* NID_pkcs7_digest */
1.223 + PKCS7_DIGEST *digest;
1.224 +
1.225 + /* NID_pkcs7_encrypted */
1.226 + PKCS7_ENCRYPT *encrypted;
1.227 +
1.228 + /* Anything else */
1.229 + ASN1_TYPE *other;
1.230 + } d;
1.231 + } PKCS7;
1.232 +
1.233 +DECLARE_STACK_OF(PKCS7)
1.234 +DECLARE_ASN1_SET_OF(PKCS7)
1.235 +DECLARE_PKCS12_STACK_OF(PKCS7)
1.236 +
1.237 +#define PKCS7_OP_SET_DETACHED_SIGNATURE 1
1.238 +#define PKCS7_OP_GET_DETACHED_SIGNATURE 2
1.239 +
1.240 +#define PKCS7_get_signed_attributes(si) ((si)->auth_attr)
1.241 +#define PKCS7_get_attributes(si) ((si)->unauth_attr)
1.242 +
1.243 +#define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
1.244 +#define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
1.245 +#define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)
1.246 +#define PKCS7_type_is_signedAndEnveloped(a) \
1.247 + (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
1.248 +#define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
1.249 +
1.250 +#define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
1.251 +
1.252 +#define PKCS7_set_detached(p,v) \
1.253 + PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)
1.254 +#define PKCS7_get_detached(p) \
1.255 + PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL)
1.256 +
1.257 +#define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
1.258 +
1.259 +#ifdef SSLEAY_MACROS
1.260 +#ifndef PKCS7_ISSUER_AND_SERIAL_digest
1.261 +#define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \
1.262 + ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\
1.263 + (char *)data,md,len)
1.264 +#endif
1.265 +#endif
1.266 +
1.267 +/* S/MIME related flags */
1.268 +
1.269 +#define PKCS7_TEXT 0x1
1.270 +#define PKCS7_NOCERTS 0x2
1.271 +#define PKCS7_NOSIGS 0x4
1.272 +#define PKCS7_NOCHAIN 0x8
1.273 +#define PKCS7_NOINTERN 0x10
1.274 +#define PKCS7_NOVERIFY 0x20
1.275 +#define PKCS7_DETACHED 0x40
1.276 +#define PKCS7_BINARY 0x80
1.277 +#define PKCS7_NOATTR 0x100
1.278 +#define PKCS7_NOSMIMECAP 0x200
1.279 +#define PKCS7_NOOLDMIMETYPE 0x400
1.280 +#define PKCS7_CRLFEOL 0x800
1.281 +#define PKCS7_STREAM 0x1000
1.282 +#define PKCS7_NOCRL 0x2000
1.283 +
1.284 +/* Flags: for compatibility with older code */
1.285 +
1.286 +#define SMIME_TEXT PKCS7_TEXT
1.287 +#define SMIME_NOCERTS PKCS7_NOCERTS
1.288 +#define SMIME_NOSIGS PKCS7_NOSIGS
1.289 +#define SMIME_NOCHAIN PKCS7_NOCHAIN
1.290 +#define SMIME_NOINTERN PKCS7_NOINTERN
1.291 +#define SMIME_NOVERIFY PKCS7_NOVERIFY
1.292 +#define SMIME_DETACHED PKCS7_DETACHED
1.293 +#define SMIME_BINARY PKCS7_BINARY
1.294 +#define SMIME_NOATTR PKCS7_NOATTR
1.295 +
1.296 +DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
1.297 +
1.298 +#ifndef SSLEAY_MACROS
1.299 +IMPORT_C int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,const EVP_MD *type,
1.300 + unsigned char *md,unsigned int *len);
1.301 +#ifndef OPENSSL_NO_FP_API
1.302 +IMPORT_C PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7);
1.303 +IMPORT_C int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7);
1.304 +#endif
1.305 +IMPORT_C PKCS7 *PKCS7_dup(PKCS7 *p7);
1.306 +IMPORT_C PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7);
1.307 +IMPORT_C int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7);
1.308 +#endif
1.309 +
1.310 +DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)
1.311 +DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)
1.312 +DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED)
1.313 +DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)
1.314 +DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE)
1.315 +DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)
1.316 +DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)
1.317 +DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
1.318 +DECLARE_ASN1_FUNCTIONS(PKCS7)
1.319 +
1.320 +DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
1.321 +DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)
1.322 +
1.323 +DECLARE_ASN1_NDEF_FUNCTION(PKCS7)
1.324 +
1.325 +IMPORT_C long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
1.326 +
1.327 +IMPORT_C int PKCS7_set_type(PKCS7 *p7, int type);
1.328 +IMPORT_C int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
1.329 +IMPORT_C int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
1.330 +IMPORT_C int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
1.331 + const EVP_MD *dgst);
1.332 +IMPORT_C int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
1.333 +IMPORT_C int PKCS7_add_certificate(PKCS7 *p7, X509 *x509);
1.334 +IMPORT_C int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509);
1.335 +IMPORT_C int PKCS7_content_new(PKCS7 *p7, int nid);
1.336 +IMPORT_C int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
1.337 + BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
1.338 +IMPORT_C int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
1.339 + X509 *x509);
1.340 +
1.341 +IMPORT_C BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
1.342 +IMPORT_C int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
1.343 +IMPORT_C BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
1.344 +
1.345 +
1.346 +IMPORT_C PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
1.347 + EVP_PKEY *pkey, const EVP_MD *dgst);
1.348 +IMPORT_C X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
1.349 +IMPORT_C int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
1.350 +IMPORT_C STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
1.351 +
1.352 +IMPORT_C PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
1.353 +IMPORT_C int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
1.354 +IMPORT_C int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
1.355 +IMPORT_C int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
1.356 +
1.357 +IMPORT_C PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
1.358 +IMPORT_C ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
1.359 +IMPORT_C int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si,int nid,int type,
1.360 + void *data);
1.361 +IMPORT_C int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
1.362 + void *value);
1.363 +IMPORT_C ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid);
1.364 +IMPORT_C ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid);
1.365 +IMPORT_C int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
1.366 + STACK_OF(X509_ATTRIBUTE) *sk);
1.367 +IMPORT_C int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,STACK_OF(X509_ATTRIBUTE) *sk);
1.368 +
1.369 +
1.370 +IMPORT_C PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
1.371 + BIO *data, int flags);
1.372 +IMPORT_C int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
1.373 + BIO *indata, BIO *out, int flags);
1.374 +IMPORT_C STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags);
1.375 +IMPORT_C PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
1.376 + int flags);
1.377 +IMPORT_C int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags);
1.378 +
1.379 +IMPORT_C int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
1.380 + STACK_OF(X509_ALGOR) *cap);
1.381 +IMPORT_C STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
1.382 +IMPORT_C int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
1.383 +
1.384 +IMPORT_C int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
1.385 +IMPORT_C PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
1.386 +IMPORT_C int SMIME_crlf_copy(BIO *in, BIO *out, int flags);
1.387 +IMPORT_C int SMIME_text(BIO *in, BIO *out);
1.388 +
1.389 +/* BEGIN ERROR CODES */
1.390 +/* The following lines are auto generated by the script mkerr.pl. Any changes
1.391 + * made after this point may be overwritten when the script is next run.
1.392 + */
1.393 +IMPORT_C void ERR_load_PKCS7_strings(void);
1.394 +
1.395 +/* Error codes for the PKCS7 functions. */
1.396 +
1.397 +/* Function codes. */
1.398 +#define PKCS7_F_B64_READ_PKCS7 120
1.399 +#define PKCS7_F_B64_WRITE_PKCS7 121
1.400 +#define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118
1.401 +#define PKCS7_F_PKCS7_ADD_CERTIFICATE 100
1.402 +#define PKCS7_F_PKCS7_ADD_CRL 101
1.403 +#define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102
1.404 +#define PKCS7_F_PKCS7_ADD_SIGNER 103
1.405 +#define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125
1.406 +#define PKCS7_F_PKCS7_CTRL 104
1.407 +#define PKCS7_F_PKCS7_DATADECODE 112
1.408 +#define PKCS7_F_PKCS7_DATAFINAL 128
1.409 +#define PKCS7_F_PKCS7_DATAINIT 105
1.410 +#define PKCS7_F_PKCS7_DATASIGN 106
1.411 +#define PKCS7_F_PKCS7_DATAVERIFY 107
1.412 +#define PKCS7_F_PKCS7_DECRYPT 114
1.413 +#define PKCS7_F_PKCS7_ENCRYPT 115
1.414 +#define PKCS7_F_PKCS7_FIND_DIGEST 127
1.415 +#define PKCS7_F_PKCS7_GET0_SIGNERS 124
1.416 +#define PKCS7_F_PKCS7_SET_CIPHER 108
1.417 +#define PKCS7_F_PKCS7_SET_CONTENT 109
1.418 +#define PKCS7_F_PKCS7_SET_DIGEST 126
1.419 +#define PKCS7_F_PKCS7_SET_TYPE 110
1.420 +#define PKCS7_F_PKCS7_SIGN 116
1.421 +#define PKCS7_F_PKCS7_SIGNATUREVERIFY 113
1.422 +#define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119
1.423 +#define PKCS7_F_PKCS7_VERIFY 117
1.424 +#define PKCS7_F_SMIME_READ_PKCS7 122
1.425 +#define PKCS7_F_SMIME_TEXT 123
1.426 +
1.427 +/* Reason codes. */
1.428 +#define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117
1.429 +#define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144
1.430 +#define PKCS7_R_CIPHER_NOT_INITIALIZED 116
1.431 +#define PKCS7_R_CONTENT_AND_DATA_PRESENT 118
1.432 +#define PKCS7_R_DECODE_ERROR 130
1.433 +#define PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH 100
1.434 +#define PKCS7_R_DECRYPT_ERROR 119
1.435 +#define PKCS7_R_DIGEST_FAILURE 101
1.436 +#define PKCS7_R_ERROR_ADDING_RECIPIENT 120
1.437 +#define PKCS7_R_ERROR_SETTING_CIPHER 121
1.438 +#define PKCS7_R_INVALID_MIME_TYPE 131
1.439 +#define PKCS7_R_INVALID_NULL_POINTER 143
1.440 +#define PKCS7_R_MIME_NO_CONTENT_TYPE 132
1.441 +#define PKCS7_R_MIME_PARSE_ERROR 133
1.442 +#define PKCS7_R_MIME_SIG_PARSE_ERROR 134
1.443 +#define PKCS7_R_MISSING_CERIPEND_INFO 103
1.444 +#define PKCS7_R_NO_CONTENT 122
1.445 +#define PKCS7_R_NO_CONTENT_TYPE 135
1.446 +#define PKCS7_R_NO_MULTIPART_BODY_FAILURE 136
1.447 +#define PKCS7_R_NO_MULTIPART_BOUNDARY 137
1.448 +#define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115
1.449 +#define PKCS7_R_NO_RECIPIENT_MATCHES_KEY 146
1.450 +#define PKCS7_R_NO_SIGNATURES_ON_DATA 123
1.451 +#define PKCS7_R_NO_SIGNERS 142
1.452 +#define PKCS7_R_NO_SIG_CONTENT_TYPE 138
1.453 +#define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104
1.454 +#define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124
1.455 +#define PKCS7_R_PKCS7_DATAFINAL 126
1.456 +#define PKCS7_R_PKCS7_DATAFINAL_ERROR 125
1.457 +#define PKCS7_R_PKCS7_DATASIGN 145
1.458 +#define PKCS7_R_PKCS7_PARSE_ERROR 139
1.459 +#define PKCS7_R_PKCS7_SIG_PARSE_ERROR 140
1.460 +#define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127
1.461 +#define PKCS7_R_SIGNATURE_FAILURE 105
1.462 +#define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128
1.463 +#define PKCS7_R_SIG_INVALID_MIME_TYPE 141
1.464 +#define PKCS7_R_SMIME_TEXT_ERROR 129
1.465 +#define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106
1.466 +#define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107
1.467 +#define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108
1.468 +#define PKCS7_R_UNKNOWN_DIGEST_TYPE 109
1.469 +#define PKCS7_R_UNKNOWN_OPERATION 110
1.470 +#define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111
1.471 +#define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112
1.472 +#define PKCS7_R_WRONG_CONTENT_TYPE 113
1.473 +#define PKCS7_R_WRONG_PKCS7_TYPE 114
1.474 +
1.475 +#ifdef __cplusplus
1.476 +}
1.477 +#endif
1.478 +#endif