summaryrefslogtreecommitdiffstats
path: root/crypto/x509/x_pubkey.c
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/x509/x_pubkey.c
parent33847508d5605d8dbe868d7694a4eff79d785404 (diff)
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/x509/x_pubkey.c')
-rw-r--r--crypto/x509/x_pubkey.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c
index 126c2400f6..c8d76f882e 100644
--- a/crypto/x509/x_pubkey.c
+++ b/crypto/x509/x_pubkey.c
@@ -981,9 +981,7 @@ void X509_PUBKEY_set0_public_key(X509_PUBKEY *pub,
unsigned char *penc, int penclen)
{
ASN1_STRING_set0(pub->public_key, penc, penclen);
- /* Set number of unused bits to zero */
- pub->public_key->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07);
- pub->public_key->flags |= ASN1_STRING_FLAG_BITS_LEFT;
+ ossl_asn1_string_set_bits_left(pub->public_key, 0);
}
int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,