cms.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. /*
  2. * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the OpenSSL license (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef HEADER_CMS_H
  10. # define HEADER_CMS_H
  11. # include <openssl/opensslconf.h>
  12. # ifndef OPENSSL_NO_CMS
  13. # include <openssl/x509.h>
  14. # include <openssl/x509v3.h>
  15. # ifdef __cplusplus
  16. extern "C" {
  17. # endif
  18. typedef struct CMS_ContentInfo_st CMS_ContentInfo;
  19. typedef struct CMS_SignerInfo_st CMS_SignerInfo;
  20. typedef struct CMS_CertificateChoices CMS_CertificateChoices;
  21. typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
  22. typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
  23. typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
  24. typedef struct CMS_Receipt_st CMS_Receipt;
  25. typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
  26. typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
  27. DEFINE_STACK_OF(CMS_SignerInfo)
  28. DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
  29. DEFINE_STACK_OF(CMS_RecipientInfo)
  30. DEFINE_STACK_OF(CMS_RevocationInfoChoice)
  31. DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
  32. DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
  33. DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
  34. # define CMS_SIGNERINFO_ISSUER_SERIAL 0
  35. # define CMS_SIGNERINFO_KEYIDENTIFIER 1
  36. # define CMS_RECIPINFO_NONE -1
  37. # define CMS_RECIPINFO_TRANS 0
  38. # define CMS_RECIPINFO_AGREE 1
  39. # define CMS_RECIPINFO_KEK 2
  40. # define CMS_RECIPINFO_PASS 3
  41. # define CMS_RECIPINFO_OTHER 4
  42. /* S/MIME related flags */
  43. # define CMS_TEXT 0x1
  44. # define CMS_NOCERTS 0x2
  45. # define CMS_NO_CONTENT_VERIFY 0x4
  46. # define CMS_NO_ATTR_VERIFY 0x8
  47. # define CMS_NOSIGS \
  48. (CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)
  49. # define CMS_NOINTERN 0x10
  50. # define CMS_NO_SIGNER_CERT_VERIFY 0x20
  51. # define CMS_NOVERIFY 0x20
  52. # define CMS_DETACHED 0x40
  53. # define CMS_BINARY 0x80
  54. # define CMS_NOATTR 0x100
  55. # define CMS_NOSMIMECAP 0x200
  56. # define CMS_NOOLDMIMETYPE 0x400
  57. # define CMS_CRLFEOL 0x800
  58. # define CMS_STREAM 0x1000
  59. # define CMS_NOCRL 0x2000
  60. # define CMS_PARTIAL 0x4000
  61. # define CMS_REUSE_DIGEST 0x8000
  62. # define CMS_USE_KEYID 0x10000
  63. # define CMS_DEBUG_DECRYPT 0x20000
  64. # define CMS_KEY_PARAM 0x40000
  65. # define CMS_ASCIICRLF 0x80000
  66. const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms);
  67. BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
  68. int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
  69. ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
  70. int CMS_is_detached(CMS_ContentInfo *cms);
  71. int CMS_set_detached(CMS_ContentInfo *cms, int detached);
  72. # ifdef HEADER_PEM_H
  73. DECLARE_PEM_rw_const(CMS, CMS_ContentInfo)
  74. # endif
  75. int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
  76. CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
  77. int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
  78. BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
  79. int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
  80. int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
  81. int flags);
  82. CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
  83. int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
  84. int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont,
  85. unsigned int flags);
  86. CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
  87. STACK_OF(X509) *certs, BIO *data,
  88. unsigned int flags);
  89. CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
  90. X509 *signcert, EVP_PKEY *pkey,
  91. STACK_OF(X509) *certs, unsigned int flags);
  92. int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
  93. CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
  94. int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
  95. unsigned int flags);
  96. CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
  97. unsigned int flags);
  98. int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
  99. const unsigned char *key, size_t keylen,
  100. BIO *dcont, BIO *out, unsigned int flags);
  101. CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
  102. const unsigned char *key,
  103. size_t keylen, unsigned int flags);
  104. int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
  105. const unsigned char *key, size_t keylen);
  106. int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
  107. X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
  108. int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
  109. STACK_OF(X509) *certs,
  110. X509_STORE *store, unsigned int flags);
  111. STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
  112. CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
  113. const EVP_CIPHER *cipher, unsigned int flags);
  114. int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
  115. BIO *dcont, BIO *out, unsigned int flags);
  116. int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
  117. int CMS_decrypt_set1_key(CMS_ContentInfo *cms,
  118. unsigned char *key, size_t keylen,
  119. const unsigned char *id, size_t idlen);
  120. int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
  121. unsigned char *pass, ossl_ssize_t passlen);
  122. STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
  123. int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
  124. EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
  125. CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
  126. CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
  127. X509 *recip, unsigned int flags);
  128. int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
  129. int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
  130. int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
  131. EVP_PKEY **pk, X509 **recip,
  132. X509_ALGOR **palg);
  133. int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
  134. ASN1_OCTET_STRING **keyid,
  135. X509_NAME **issuer,
  136. ASN1_INTEGER **sno);
  137. CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
  138. unsigned char *key, size_t keylen,
  139. unsigned char *id, size_t idlen,
  140. ASN1_GENERALIZEDTIME *date,
  141. ASN1_OBJECT *otherTypeId,
  142. ASN1_TYPE *otherType);
  143. int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,
  144. X509_ALGOR **palg,
  145. ASN1_OCTET_STRING **pid,
  146. ASN1_GENERALIZEDTIME **pdate,
  147. ASN1_OBJECT **potherid,
  148. ASN1_TYPE **pothertype);
  149. int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri,
  150. unsigned char *key, size_t keylen);
  151. int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
  152. const unsigned char *id, size_t idlen);
  153. int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
  154. unsigned char *pass,
  155. ossl_ssize_t passlen);
  156. CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
  157. int iter, int wrap_nid,
  158. int pbe_nid,
  159. unsigned char *pass,
  160. ossl_ssize_t passlen,
  161. const EVP_CIPHER *kekciph);
  162. int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
  163. int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
  164. int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
  165. unsigned int flags);
  166. CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
  167. int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
  168. const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);
  169. CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms);
  170. int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
  171. int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
  172. STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
  173. CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms);
  174. int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
  175. int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
  176. STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
  177. int CMS_SignedData_init(CMS_ContentInfo *cms);
  178. CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
  179. X509 *signer, EVP_PKEY *pk, const EVP_MD *md,
  180. unsigned int flags);
  181. EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);
  182. EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);
  183. STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
  184. void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
  185. int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
  186. ASN1_OCTET_STRING **keyid,
  187. X509_NAME **issuer, ASN1_INTEGER **sno);
  188. int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
  189. int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
  190. unsigned int flags);
  191. void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,
  192. X509 **signer, X509_ALGOR **pdig,
  193. X509_ALGOR **psig);
  194. ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
  195. int CMS_SignerInfo_sign(CMS_SignerInfo *si);
  196. int CMS_SignerInfo_verify(CMS_SignerInfo *si);
  197. int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
  198. int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
  199. int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
  200. int algnid, int keysize);
  201. int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
  202. int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
  203. int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
  204. int lastpos);
  205. int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, const ASN1_OBJECT *obj,
  206. int lastpos);
  207. X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);
  208. X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);
  209. int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
  210. int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si,
  211. const ASN1_OBJECT *obj, int type,
  212. const void *bytes, int len);
  213. int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,
  214. int nid, int type,
  215. const void *bytes, int len);
  216. int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
  217. const char *attrname, int type,
  218. const void *bytes, int len);
  219. void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, const ASN1_OBJECT *oid,
  220. int lastpos, int type);
  221. int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
  222. int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
  223. int lastpos);
  224. int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si,
  225. const ASN1_OBJECT *obj, int lastpos);
  226. X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);
  227. X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
  228. int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
  229. int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si,
  230. const ASN1_OBJECT *obj, int type,
  231. const void *bytes, int len);
  232. int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,
  233. int nid, int type,
  234. const void *bytes, int len);
  235. int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
  236. const char *attrname, int type,
  237. const void *bytes, int len);
  238. void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
  239. int lastpos, int type);
  240. # ifdef HEADER_X509V3_H
  241. int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
  242. CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,
  243. int allorfirst,
  244. STACK_OF(GENERAL_NAMES)
  245. *receiptList, STACK_OF(GENERAL_NAMES)
  246. *receiptsTo);
  247. int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
  248. void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
  249. ASN1_STRING **pcid,
  250. int *pallorfirst,
  251. STACK_OF(GENERAL_NAMES) **plist,
  252. STACK_OF(GENERAL_NAMES) **prto);
  253. # endif
  254. int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
  255. X509_ALGOR **palg,
  256. ASN1_OCTET_STRING **pukm);
  257. STACK_OF(CMS_RecipientEncryptedKey)
  258. *CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
  259. int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
  260. X509_ALGOR **pubalg,
  261. ASN1_BIT_STRING **pubkey,
  262. ASN1_OCTET_STRING **keyid,
  263. X509_NAME **issuer,
  264. ASN1_INTEGER **sno);
  265. int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
  266. int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
  267. ASN1_OCTET_STRING **keyid,
  268. ASN1_GENERALIZEDTIME **tm,
  269. CMS_OtherKeyAttribute **other,
  270. X509_NAME **issuer, ASN1_INTEGER **sno);
  271. int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
  272. X509 *cert);
  273. int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
  274. EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
  275. int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
  276. CMS_RecipientInfo *ri,
  277. CMS_RecipientEncryptedKey *rek);
  278. int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
  279. ASN1_OCTET_STRING *ukm, int keylen);
  280. /* BEGIN ERROR CODES */
  281. /*
  282. * The following lines are auto generated by the script mkerr.pl. Any changes
  283. * made after this point may be overwritten when the script is next run.
  284. */
  285. int ERR_load_CMS_strings(void);
  286. /* Error codes for the CMS functions. */
  287. /* Function codes. */
  288. # define CMS_F_CHECK_CONTENT 99
  289. # define CMS_F_CMS_ADD0_CERT 164
  290. # define CMS_F_CMS_ADD0_RECIPIENT_KEY 100
  291. # define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 165
  292. # define CMS_F_CMS_ADD1_RECEIPTREQUEST 158
  293. # define CMS_F_CMS_ADD1_RECIPIENT_CERT 101
  294. # define CMS_F_CMS_ADD1_SIGNER 102
  295. # define CMS_F_CMS_ADD1_SIGNINGTIME 103
  296. # define CMS_F_CMS_COMPRESS 104
  297. # define CMS_F_CMS_COMPRESSEDDATA_CREATE 105
  298. # define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO 106
  299. # define CMS_F_CMS_COPY_CONTENT 107
  300. # define CMS_F_CMS_COPY_MESSAGEDIGEST 108
  301. # define CMS_F_CMS_DATA 109
  302. # define CMS_F_CMS_DATAFINAL 110
  303. # define CMS_F_CMS_DATAINIT 111
  304. # define CMS_F_CMS_DECRYPT 112
  305. # define CMS_F_CMS_DECRYPT_SET1_KEY 113
  306. # define CMS_F_CMS_DECRYPT_SET1_PASSWORD 166
  307. # define CMS_F_CMS_DECRYPT_SET1_PKEY 114
  308. # define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 115
  309. # define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 116
  310. # define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 117
  311. # define CMS_F_CMS_DIGEST_VERIFY 118
  312. # define CMS_F_CMS_ENCODE_RECEIPT 161
  313. # define CMS_F_CMS_ENCRYPT 119
  314. # define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 120
  315. # define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 121
  316. # define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 122
  317. # define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 123
  318. # define CMS_F_CMS_ENVELOPEDDATA_CREATE 124
  319. # define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 125
  320. # define CMS_F_CMS_ENVELOPED_DATA_INIT 126
  321. # define CMS_F_CMS_ENV_ASN1_CTRL 171
  322. # define CMS_F_CMS_FINAL 127
  323. # define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 128
  324. # define CMS_F_CMS_GET0_CONTENT 129
  325. # define CMS_F_CMS_GET0_ECONTENT_TYPE 130
  326. # define CMS_F_CMS_GET0_ENVELOPED 131
  327. # define CMS_F_CMS_GET0_REVOCATION_CHOICES 132
  328. # define CMS_F_CMS_GET0_SIGNED 133
  329. # define CMS_F_CMS_MSGSIGDIGEST_ADD1 162
  330. # define CMS_F_CMS_RECEIPTREQUEST_CREATE0 159
  331. # define CMS_F_CMS_RECEIPT_VERIFY 160
  332. # define CMS_F_CMS_RECIPIENTINFO_DECRYPT 134
  333. # define CMS_F_CMS_RECIPIENTINFO_ENCRYPT 169
  334. # define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT 178
  335. # define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG 175
  336. # define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID 173
  337. # define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS 172
  338. # define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP 174
  339. # define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 135
  340. # define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 136
  341. # define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 137
  342. # define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP 138
  343. # define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP 139
  344. # define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT 140
  345. # define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 141
  346. # define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 142
  347. # define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 143
  348. # define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT 167
  349. # define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 144
  350. # define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 168
  351. # define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 145
  352. # define CMS_F_CMS_SD_ASN1_CTRL 170
  353. # define CMS_F_CMS_SET1_IAS 176
  354. # define CMS_F_CMS_SET1_KEYID 177
  355. # define CMS_F_CMS_SET1_SIGNERIDENTIFIER 146
  356. # define CMS_F_CMS_SET_DETACHED 147
  357. # define CMS_F_CMS_SIGN 148
  358. # define CMS_F_CMS_SIGNED_DATA_INIT 149
  359. # define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN 150
  360. # define CMS_F_CMS_SIGNERINFO_SIGN 151
  361. # define CMS_F_CMS_SIGNERINFO_VERIFY 152
  362. # define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 153
  363. # define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 154
  364. # define CMS_F_CMS_SIGN_RECEIPT 163
  365. # define CMS_F_CMS_STREAM 155
  366. # define CMS_F_CMS_UNCOMPRESS 156
  367. # define CMS_F_CMS_VERIFY 157
  368. /* Reason codes. */
  369. # define CMS_R_ADD_SIGNER_ERROR 99
  370. # define CMS_R_CERTIFICATE_ALREADY_PRESENT 175
  371. # define CMS_R_CERTIFICATE_HAS_NO_KEYID 160
  372. # define CMS_R_CERTIFICATE_VERIFY_ERROR 100
  373. # define CMS_R_CIPHER_INITIALISATION_ERROR 101
  374. # define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102
  375. # define CMS_R_CMS_DATAFINAL_ERROR 103
  376. # define CMS_R_CMS_LIB 104
  377. # define CMS_R_CONTENTIDENTIFIER_MISMATCH 170
  378. # define CMS_R_CONTENT_NOT_FOUND 105
  379. # define CMS_R_CONTENT_TYPE_MISMATCH 171
  380. # define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106
  381. # define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107
  382. # define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108
  383. # define CMS_R_CONTENT_VERIFY_ERROR 109
  384. # define CMS_R_CTRL_ERROR 110
  385. # define CMS_R_CTRL_FAILURE 111
  386. # define CMS_R_DECRYPT_ERROR 112
  387. # define CMS_R_ERROR_GETTING_PUBLIC_KEY 113
  388. # define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114
  389. # define CMS_R_ERROR_SETTING_KEY 115
  390. # define CMS_R_ERROR_SETTING_RECIPIENTINFO 116
  391. # define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117
  392. # define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176
  393. # define CMS_R_INVALID_KEY_LENGTH 118
  394. # define CMS_R_MD_BIO_INIT_ERROR 119
  395. # define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120
  396. # define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121
  397. # define CMS_R_MSGSIGDIGEST_ERROR 172
  398. # define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162
  399. # define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163
  400. # define CMS_R_NEED_ONE_SIGNER 164
  401. # define CMS_R_NOT_A_SIGNED_RECEIPT 165
  402. # define CMS_R_NOT_ENCRYPTED_DATA 122
  403. # define CMS_R_NOT_KEK 123
  404. # define CMS_R_NOT_KEY_AGREEMENT 181
  405. # define CMS_R_NOT_KEY_TRANSPORT 124
  406. # define CMS_R_NOT_PWRI 177
  407. # define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125
  408. # define CMS_R_NO_CIPHER 126
  409. # define CMS_R_NO_CONTENT 127
  410. # define CMS_R_NO_CONTENT_TYPE 173
  411. # define CMS_R_NO_DEFAULT_DIGEST 128
  412. # define CMS_R_NO_DIGEST_SET 129
  413. # define CMS_R_NO_KEY 130
  414. # define CMS_R_NO_KEY_OR_CERT 174
  415. # define CMS_R_NO_MATCHING_DIGEST 131
  416. # define CMS_R_NO_MATCHING_RECIPIENT 132
  417. # define CMS_R_NO_MATCHING_SIGNATURE 166
  418. # define CMS_R_NO_MSGSIGDIGEST 167
  419. # define CMS_R_NO_PASSWORD 178
  420. # define CMS_R_NO_PRIVATE_KEY 133
  421. # define CMS_R_NO_PUBLIC_KEY 134
  422. # define CMS_R_NO_RECEIPT_REQUEST 168
  423. # define CMS_R_NO_SIGNERS 135
  424. # define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136
  425. # define CMS_R_RECEIPT_DECODE_ERROR 169
  426. # define CMS_R_RECIPIENT_ERROR 137
  427. # define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138
  428. # define CMS_R_SIGNFINAL_ERROR 139
  429. # define CMS_R_SMIME_TEXT_ERROR 140
  430. # define CMS_R_STORE_INIT_ERROR 141
  431. # define CMS_R_TYPE_NOT_COMPRESSED_DATA 142
  432. # define CMS_R_TYPE_NOT_DATA 143
  433. # define CMS_R_TYPE_NOT_DIGESTED_DATA 144
  434. # define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145
  435. # define CMS_R_TYPE_NOT_ENVELOPED_DATA 146
  436. # define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147
  437. # define CMS_R_UNKNOWN_CIPHER 148
  438. # define CMS_R_UNKNOWN_DIGEST_ALGORIHM 149
  439. # define CMS_R_UNKNOWN_ID 150
  440. # define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151
  441. # define CMS_R_UNSUPPORTED_CONTENT_TYPE 152
  442. # define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153
  443. # define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179
  444. # define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154
  445. # define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE 155
  446. # define CMS_R_UNSUPPORTED_TYPE 156
  447. # define CMS_R_UNWRAP_ERROR 157
  448. # define CMS_R_UNWRAP_FAILURE 180
  449. # define CMS_R_VERIFICATION_FAILURE 158
  450. # define CMS_R_WRAP_ERROR 159
  451. # ifdef __cplusplus
  452. }
  453. # endif
  454. # endif
  455. #endif