summaryrefslogtreecommitdiff
path: root/crypto/cms
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2022-06-28 07:53:59 +0200
committerDr. David von Oheimb <dev@ddvo.net>2022-07-19 08:44:19 +0200
commit7c310e872e72977432b3520c5d27641e13815548 (patch)
tree6a280ea938354730e9421c1b375ab689f9fa3224 /crypto/cms
parent33847508d5605d8dbe868d7694a4eff79d785404 (diff)
downloadopenssl-new-7c310e872e72977432b3520c5d27641e13815548.tar.gz
libcrypto refactoring: introduce and use ossl_asn1_string_set_bits_left()
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/18668)
Diffstat (limited to 'crypto/cms')
-rw-r--r--crypto/cms/cms_dh.c4
-rw-r--r--crypto/cms/cms_ec.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/crypto/cms/cms_dh.c b/crypto/cms/cms_dh.c
index 31082894eb..ea8b24528f 100644
--- a/crypto/cms/cms_dh.c
+++ b/crypto/cms/cms_dh.c
@@ -13,6 +13,7 @@
#include <openssl/err.h>
#include <openssl/core_names.h>
#include "internal/sizes.h"
+#include "crypto/asn1.h"
#include "crypto/evp.h"
#include "cms_local.h"
@@ -234,8 +235,7 @@ static int dh_cms_encrypt(CMS_RecipientInfo *ri)
if (penclen <= 0)
goto err;
ASN1_STRING_set0(pubkey, penc, penclen);
- pubkey->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07);
- pubkey->flags |= ASN1_STRING_FLAG_BITS_LEFT;
+ ossl_asn1_string_set_bits_left(pubkey, 0);
penc = NULL;
(void)X509_ALGOR_set0(talg, OBJ_nid2obj(NID_dhpublicnumber),
diff --git a/crypto/cms/cms_ec.c b/crypto/cms/cms_ec.c
index e82115934e..808b3bf1ae 100644
--- a/crypto/cms/cms_ec.c
+++ b/crypto/cms/cms_ec.c
@@ -12,6 +12,7 @@
#include <openssl/err.h>
#include <openssl/decoder.h>
#include "internal/sizes.h"
+#include "crypto/asn1.h"
#include "crypto/evp.h"
#include "cms_local.h"
@@ -277,8 +278,7 @@ static int ecdh_cms_encrypt(CMS_RecipientInfo *ri)
penclen = EVP_PKEY_get1_encoded_public_key(pkey, &penc);
ASN1_STRING_set0(pubkey, penc, penclen);
- pubkey->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07);
- pubkey->flags |= ASN1_STRING_FLAG_BITS_LEFT;
+ ossl_asn1_string_set_bits_left(pubkey, 0);
penc = NULL;
(void)X509_ALGOR_set0(talg, OBJ_nid2obj(NID_X9_62_id_ecPublicKey),