X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fcms%2Fcms_pwri.c;h=a27828056379ffdbd0528c755a8fe730e8a8aee1;hp=cea1e404c036ff1c151a0d4b3b5d550847ef6ab2;hb=ad57a13bb86949a9e9adc7a2960e3f39e3e5b284;hpb=42423ac9611e0cbb02c93b3c5661328f324f9d08 diff --git a/crypto/cms/cms_pwri.c b/crypto/cms/cms_pwri.c index cea1e404c0..a278280563 100644 --- a/crypto/cms/cms_pwri.c +++ b/crypto/cms/cms_pwri.c @@ -15,8 +15,9 @@ #include #include #include -#include "cms_local.h" +#include "internal/sizes.h" #include "crypto/asn1.h" +#include "cms_local.h" int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, unsigned char *pass, ossl_ssize_t passlen) @@ -286,7 +287,7 @@ int ossl_cms_RecipientInfo_pwri_crypt(const CMS_ContentInfo *cms, int r = 0; X509_ALGOR *algtmp, *kekalg = NULL; EVP_CIPHER_CTX *kekctx = NULL; - const char *name; + char name[OSSL_MAX_NAME_SIZE]; EVP_CIPHER *kekcipher; unsigned char *key = NULL; size_t keylen; @@ -315,7 +316,7 @@ int ossl_cms_RecipientInfo_pwri_crypt(const CMS_ContentInfo *cms, return 0; } - name = OBJ_nid2sn(OBJ_obj2nid(kekalg->algorithm)); + OBJ_obj2txt(name, sizeof(name), kekalg->algorithm, 0); kekcipher = EVP_CIPHER_fetch(ossl_cms_ctx_get0_libctx(cms_ctx), name, ossl_cms_ctx_get0_propq(cms_ctx));