From df578aa01314acd072038b703ac3ec002208da03 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Fri, 19 May 2017 00:16:30 +0000 Subject: [PATCH] Fix spelling errors in CMS. Unfortunately it affects error code macros in public cms.h header, for which reason misspelled names are preserved for backward compatibility. Reviewed-by: Andy Polyakov Reviewed-by: Kurt Roeckx (Merged from https://github.com/openssl/openssl/pull/3463) --- crypto/cms/cms_env.c | 2 +- crypto/cms/cms_err.c | 6 +++--- crypto/cms/cms_lib.c | 2 +- doc/man3/CMS_decrypt.pod | 2 +- doc/man3/CMS_get0_RecipientInfos.pod | 4 ++-- include/openssl/cms.h | 9 +++++++-- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/crypto/cms/cms_env.c b/crypto/cms/cms_env.c index 8d45943530..6ca3be71ad 100644 --- a/crypto/cms/cms_env.c +++ b/crypto/cms/cms_env.c @@ -749,7 +749,7 @@ int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri) default: CMSerr(CMS_F_CMS_RECIPIENTINFO_DECRYPT, - CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE); + CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE); return 0; } } diff --git a/crypto/cms/cms_err.c b/crypto/cms/cms_err.c index c6df1b5afe..59afbbb58d 100644 --- a/crypto/cms/cms_err.c +++ b/crypto/cms/cms_err.c @@ -222,7 +222,7 @@ static ERR_STRING_DATA CMS_str_reasons[] = { {ERR_REASON(CMS_R_UNABLE_TO_FINALIZE_CONTEXT), "unable to finalize context"}, {ERR_REASON(CMS_R_UNKNOWN_CIPHER), "unknown cipher"}, - {ERR_REASON(CMS_R_UNKNOWN_DIGEST_ALGORIHM), "unknown digest algorihm"}, + {ERR_REASON(CMS_R_UNKNOWN_DIGEST_ALGORITHM), "unknown digest algorithm"}, {ERR_REASON(CMS_R_UNKNOWN_ID), "unknown id"}, {ERR_REASON(CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM), "unsupported compression algorithm"}, @@ -233,8 +233,8 @@ static ERR_STRING_DATA CMS_str_reasons[] = { "unsupported key encryption algorithm"}, {ERR_REASON(CMS_R_UNSUPPORTED_RECIPIENT_TYPE), "unsupported recipient type"}, - {ERR_REASON(CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE), - "unsupported recpientinfo type"}, + {ERR_REASON(CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE), + "unsupported recipientinfo type"}, {ERR_REASON(CMS_R_UNSUPPORTED_TYPE), "unsupported type"}, {ERR_REASON(CMS_R_UNWRAP_ERROR), "unwrap error"}, {ERR_REASON(CMS_R_UNWRAP_FAILURE), "unwrap failure"}, diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c index 7395684b61..c2cac26010 100644 --- a/crypto/cms/cms_lib.c +++ b/crypto/cms/cms_lib.c @@ -292,7 +292,7 @@ BIO *cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm) digest = EVP_get_digestbyobj(digestoid); if (!digest) { CMSerr(CMS_F_CMS_DIGESTALGORITHM_INIT_BIO, - CMS_R_UNKNOWN_DIGEST_ALGORIHM); + CMS_R_UNKNOWN_DIGEST_ALGORITHM); goto err; } mdbio = BIO_new(BIO_f_md()); diff --git a/doc/man3/CMS_decrypt.pod b/doc/man3/CMS_decrypt.pod index b3b196c390..1174734022 100644 --- a/doc/man3/CMS_decrypt.pod +++ b/doc/man3/CMS_decrypt.pod @@ -46,7 +46,7 @@ in advance using the CMS utility functions such as CMS_set1_pkey(). In this case both B and B should be set to NULL. To process KEKRecipientInfo types CMS_set1_key() or CMS_RecipientInfo_set0_key() -and CMS_ReceipientInfo_decrypt() should be called before CMS_decrypt() and +and CMS_RecipientInfo_decrypt() should be called before CMS_decrypt() and B and B set to NULL. The following flags can be passed in the B parameter. diff --git a/doc/man3/CMS_get0_RecipientInfos.pod b/doc/man3/CMS_get0_RecipientInfos.pod index 6c33c224e9..80370d6736 100644 --- a/doc/man3/CMS_get0_RecipientInfos.pod +++ b/doc/man3/CMS_get0_RecipientInfos.pod @@ -85,11 +85,11 @@ of CMS_decrypt() is not appropriate. In typical usage and application will retrieve all CMS_RecipientInfo structures using CMS_get0_RecipientInfos() and check the type of each using -CMS_RecpientInfo_type(). Depending on the type the CMS_RecipientInfo structure +CMS_RecipientInfo_type(). Depending on the type the CMS_RecipientInfo structure can be ignored or its key identifier data retrieved using an appropriate function. Then if the corresponding secret or private key can be obtained by any appropriate means it can then associated with the structure and -CMS_RecpientInfo_decrypt() called. If successful CMS_decrypt() can be called +CMS_RecipientInfo_decrypt() called. If successful CMS_decrypt() can be called with a NULL key to decrypt the enveloped content. The CMS_RecipientInfo_encrypt() can be used to add a new recipient to an diff --git a/include/openssl/cms.h b/include/openssl/cms.h index 7e534e0dd6..a042069770 100644 --- a/include/openssl/cms.h +++ b/include/openssl/cms.h @@ -329,6 +329,11 @@ int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms, int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg, ASN1_OCTET_STRING *ukm, int keylen); +/* Compat for: CMS_R_UNKNOWN_DIGEST_ALGORITHM */ +# define CMS_R_UNKNOWN_DIGEST_ALGORITM 149 +/* Compat for: CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE */ +# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE 155 + /* BEGIN ERROR CODES */ /* * The following lines are auto generated by the script mkerr.pl. Any changes @@ -491,14 +496,14 @@ int ERR_load_CMS_strings(void); # define CMS_R_TYPE_NOT_ENVELOPED_DATA 146 # define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147 # define CMS_R_UNKNOWN_CIPHER 148 -# define CMS_R_UNKNOWN_DIGEST_ALGORIHM 149 +# define CMS_R_UNKNOWN_DIGEST_ALGORITHM 149 # define CMS_R_UNKNOWN_ID 150 # define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151 # define CMS_R_UNSUPPORTED_CONTENT_TYPE 152 # define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153 # define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179 # define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154 -# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE 155 +# define CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE 155 # define CMS_R_UNSUPPORTED_TYPE 156 # define CMS_R_UNWRAP_ERROR 157 # define CMS_R_UNWRAP_FAILURE 180 -- 2.25.1