Include "constant_time_locl.h" rather than "../constant_time_locl.h".
[oweals/openssl.git] / crypto / cms / cms.h
index 1624b79ebc367ff0614d2c5191ad4c85d19330eb..4b36a69c4f2981a690535b737f60d8758774dce5 100644 (file)
@@ -73,9 +73,12 @@ typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
 typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
 typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
 typedef struct CMS_Receipt_st CMS_Receipt;
+typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
+typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
 
 DECLARE_STACK_OF(CMS_SignerInfo)
 DECLARE_STACK_OF(GENERAL_NAMES)
+DECLARE_STACK_OF(CMS_RecipientEncryptedKey)
 DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
 DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
 DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
@@ -83,6 +86,7 @@ DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
 #define CMS_SIGNERINFO_ISSUER_SERIAL   0
 #define CMS_SIGNERINFO_KEYIDENTIFIER   1
 
+#define CMS_RECIPINFO_NONE             -1
 #define CMS_RECIPINFO_TRANS            0
 #define CMS_RECIPINFO_AGREE            1
 #define CMS_RECIPINFO_KEK              2
@@ -271,6 +275,7 @@ int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
                                        unsigned int flags);
 void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, X509 **signer,
                                        X509_ALGOR **pdig, X509_ALGOR **psig);
+ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
 int CMS_SignerInfo_sign(CMS_SignerInfo *si);
 int CMS_SignerInfo_verify(CMS_SignerInfo *si);
 int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
@@ -333,8 +338,35 @@ void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
                                        int *pallorfirst,
                                        STACK_OF(GENERAL_NAMES) **plist,
                                        STACK_OF(GENERAL_NAMES) **prto);
-
 #endif
+int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
+                                       X509_ALGOR **palg,
+                                       ASN1_OCTET_STRING **pukm);
+STACK_OF(CMS_RecipientEncryptedKey) *
+       CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
+
+int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
+                                       X509_ALGOR **pubalg,
+                                       ASN1_BIT_STRING **pubkey,
+                                       ASN1_OCTET_STRING **keyid,
+                                       X509_NAME **issuer, ASN1_INTEGER **sno);
+
+int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
+       
+int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
+                                       ASN1_OCTET_STRING **keyid,
+                                       ASN1_GENERALIZEDTIME **tm,
+                                       CMS_OtherKeyAttribute **other,
+                                       X509_NAME **issuer, ASN1_INTEGER **sno);
+int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
+                                               X509 *cert);
+int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
+EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
+int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri,
+                                       CMS_RecipientEncryptedKey *rek);
+
+int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg, 
+                       ASN1_OCTET_STRING *ukm, int keylen);
 
 /* BEGIN ERROR CODES */
 /* The following lines are auto generated by the script mkerr.pl. Any changes
@@ -391,6 +423,11 @@ void ERR_load_CMS_strings(void);
 #define CMS_F_CMS_RECEIPT_VERIFY                        160
 #define CMS_F_CMS_RECIPIENTINFO_DECRYPT                         134
 #define CMS_F_CMS_RECIPIENTINFO_ENCRYPT                         169
+#define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT            178
+#define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG           175
+#define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID       173
+#define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS          172
+#define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP        174
 #define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT           135
 #define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT           136
 #define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID           137
@@ -405,6 +442,8 @@ void ERR_load_CMS_strings(void);
 #define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD           168
 #define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY               145
 #define CMS_F_CMS_SD_ASN1_CTRL                          170
+#define CMS_F_CMS_SET1_IAS                              176
+#define CMS_F_CMS_SET1_KEYID                            177
 #define CMS_F_CMS_SET1_SIGNERIDENTIFIER                         146
 #define CMS_F_CMS_SET_DETACHED                          147
 #define CMS_F_CMS_SIGN                                  148
@@ -456,6 +495,7 @@ void ERR_load_CMS_strings(void);
 #define CMS_R_NOT_A_SIGNED_RECEIPT                      165
 #define CMS_R_NOT_ENCRYPTED_DATA                        122
 #define CMS_R_NOT_KEK                                   123
+#define CMS_R_NOT_KEY_AGREEMENT                                 181
 #define CMS_R_NOT_KEY_TRANSPORT                                 124
 #define CMS_R_NOT_PWRI                                  177
 #define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE           125