Constify the return value of X509_get0_pubkey_bitstr()

Part of #28654
Fixes: https://github.com/openssl/project/issues/1772

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/29434)
This commit is contained in:
Bob Beck
2025-09-29 15:32:39 -06:00
committed by Neil Horman
parent 077e94f6e5
commit f18816261e
7 changed files with 7 additions and 7 deletions

View File

@@ -24,7 +24,7 @@ OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject,
{
const X509_NAME *iname;
const ASN1_INTEGER *serial;
ASN1_BIT_STRING *ikey;
const ASN1_BIT_STRING *ikey;
if (!dgst)
dgst = EVP_sha1();

View File

@@ -204,7 +204,7 @@ int X509_ocspid_print(BIO *bp, const X509 *x)
int derlen;
int i;
unsigned char SHA1md[SHA_DIGEST_LENGTH];
ASN1_BIT_STRING *keybstr;
const ASN1_BIT_STRING *keybstr;
const X509_NAME *subj;
EVP_MD *md = NULL;

View File

@@ -488,7 +488,7 @@ int i2d_ECPrivateKey_bio(BIO *bp, const EC_KEY *eckey)
int X509_pubkey_digest(const X509 *data, const EVP_MD *type,
unsigned char *md, unsigned int *len)
{
ASN1_BIT_STRING *key = X509_get0_pubkey_bitstr(data);
const ASN1_BIT_STRING *key = X509_get0_pubkey_bitstr(data);
if (key == NULL)
return 0;

View File

@@ -1028,7 +1028,7 @@ int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
return 1;
}
ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)
const ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)
{
if (x == NULL)
return NULL;