CMS support for key agreeement recipient info.
Add hooks to support key agreement recipient info type (KARI) using
algorithm specific code in the relevant public key ASN1 method.
(cherry picked from commit 17c2764d2e)
This commit is contained in:
@@ -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
|
||||
@@ -333,8 +337,32 @@ 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);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
@@ -391,6 +419,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 +438,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 +491,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
|
||||
|
||||
Reference in New Issue
Block a user