Return error if no cipher set for encrypted data type.
Update CHANGES.
This commit is contained in:
parent
d9f5f07e28
commit
fd47c36136
6
CHANGES
6
CHANGES
@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
*) Initial support for Cryptographic Message Syntax (aka CMS) based
|
*) Initial support for Cryptographic Message Syntax (aka CMS) based
|
||||||
on RFC3850, RFC3851 and RFC3852. New cms directory and cms utility,
|
on RFC3850, RFC3851 and RFC3852. New cms directory and cms utility,
|
||||||
support for data, signedData, compressedData types currently included,
|
support for data, signedData, compressedData, digestedData and
|
||||||
more to come. Scripts to check against RFC4134 examples draft and internal
|
encryptedData types currently included, more to come. Scripts to
|
||||||
consistency.
|
check against RFC4134 examples draft.
|
||||||
[Steve Henson]
|
[Steve Henson]
|
||||||
|
|
||||||
*) Zlib compression BIO. This is a filter BIO which compressed and
|
*) Zlib compression BIO. This is a filter BIO which compressed and
|
||||||
|
@ -273,6 +273,7 @@ void ERR_load_CMS_strings(void);
|
|||||||
#define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 148
|
#define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 148
|
||||||
#define CMS_F_CMS_ENCRYPTEDCONTENT_TO_BIO 138
|
#define CMS_F_CMS_ENCRYPTEDCONTENT_TO_BIO 138
|
||||||
#define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 140
|
#define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 140
|
||||||
|
#define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 149
|
||||||
#define CMS_F_CMS_ENCRYPTEDDATA_INIT_BIO 147
|
#define CMS_F_CMS_ENCRYPTEDDATA_INIT_BIO 147
|
||||||
#define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 141
|
#define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 141
|
||||||
#define CMS_F_CMS_ENCRYPTED_DATA_DECRYPT 139
|
#define CMS_F_CMS_ENCRYPTED_DATA_DECRYPT 139
|
||||||
@ -322,6 +323,7 @@ void ERR_load_CMS_strings(void);
|
|||||||
#define CMS_R_NOT_ENCRYPTED_DATA 143
|
#define CMS_R_NOT_ENCRYPTED_DATA 143
|
||||||
#define CMS_R_NOT_KEY_TRANSPORT 114
|
#define CMS_R_NOT_KEY_TRANSPORT 114
|
||||||
#define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 115
|
#define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 115
|
||||||
|
#define CMS_R_NO_CIPHER 144
|
||||||
#define CMS_R_NO_CONTENT 116
|
#define CMS_R_NO_CONTENT 116
|
||||||
#define CMS_R_NO_DEFAULT_DIGEST 117
|
#define CMS_R_NO_DEFAULT_DIGEST 117
|
||||||
#define CMS_R_NO_DIGEST_SET 118
|
#define CMS_R_NO_DIGEST_SET 118
|
||||||
|
@ -94,6 +94,7 @@ static ERR_STRING_DATA CMS_str_functs[]=
|
|||||||
{ERR_FUNC(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO), "CMS_ENCRYPTEDCONTENT_INIT_BIO"},
|
{ERR_FUNC(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO), "CMS_ENCRYPTEDCONTENT_INIT_BIO"},
|
||||||
{ERR_FUNC(CMS_F_CMS_ENCRYPTEDCONTENT_TO_BIO), "CMS_ENCRYPTEDCONTENT_TO_BIO"},
|
{ERR_FUNC(CMS_F_CMS_ENCRYPTEDCONTENT_TO_BIO), "CMS_ENCRYPTEDCONTENT_TO_BIO"},
|
||||||
{ERR_FUNC(CMS_F_CMS_ENCRYPTEDDATA_DECRYPT), "CMS_EncryptedData_decrypt"},
|
{ERR_FUNC(CMS_F_CMS_ENCRYPTEDDATA_DECRYPT), "CMS_EncryptedData_decrypt"},
|
||||||
|
{ERR_FUNC(CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT), "CMS_EncryptedData_encrypt"},
|
||||||
{ERR_FUNC(CMS_F_CMS_ENCRYPTEDDATA_INIT_BIO), "CMS_ENCRYPTEDDATA_INIT_BIO"},
|
{ERR_FUNC(CMS_F_CMS_ENCRYPTEDDATA_INIT_BIO), "CMS_ENCRYPTEDDATA_INIT_BIO"},
|
||||||
{ERR_FUNC(CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY), "CMS_EncryptedData_set1_key"},
|
{ERR_FUNC(CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY), "CMS_EncryptedData_set1_key"},
|
||||||
{ERR_FUNC(CMS_F_CMS_ENCRYPTED_DATA_DECRYPT), "CMS_ENCRYPTED_DATA_DECRYPT"},
|
{ERR_FUNC(CMS_F_CMS_ENCRYPTED_DATA_DECRYPT), "CMS_ENCRYPTED_DATA_DECRYPT"},
|
||||||
@ -146,6 +147,7 @@ static ERR_STRING_DATA CMS_str_reasons[]=
|
|||||||
{ERR_REASON(CMS_R_NOT_ENCRYPTED_DATA) ,"not encrypted data"},
|
{ERR_REASON(CMS_R_NOT_ENCRYPTED_DATA) ,"not encrypted data"},
|
||||||
{ERR_REASON(CMS_R_NOT_KEY_TRANSPORT) ,"not key transport"},
|
{ERR_REASON(CMS_R_NOT_KEY_TRANSPORT) ,"not key transport"},
|
||||||
{ERR_REASON(CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE),"not supported for this key type"},
|
{ERR_REASON(CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE),"not supported for this key type"},
|
||||||
|
{ERR_REASON(CMS_R_NO_CIPHER) ,"no cipher"},
|
||||||
{ERR_REASON(CMS_R_NO_CONTENT) ,"no content"},
|
{ERR_REASON(CMS_R_NO_CONTENT) ,"no content"},
|
||||||
{ERR_REASON(CMS_R_NO_DEFAULT_DIGEST) ,"no default digest"},
|
{ERR_REASON(CMS_R_NO_DEFAULT_DIGEST) ,"no default digest"},
|
||||||
{ERR_REASON(CMS_R_NO_DIGEST_SET) ,"no digest set"},
|
{ERR_REASON(CMS_R_NO_DIGEST_SET) ,"no digest set"},
|
||||||
|
@ -227,6 +227,11 @@ CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
CMS_ContentInfo *cms;
|
CMS_ContentInfo *cms;
|
||||||
|
if (!cipher)
|
||||||
|
{
|
||||||
|
CMSerr(CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT, CMS_R_NO_CIPHER);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
cms = CMS_ContentInfo_new();
|
cms = CMS_ContentInfo_new();
|
||||||
if (!cms)
|
if (!cms)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user