Const-correct X509_get0_extensions.

In upstream, this returns a const pointer, so we should match.

Update-Note: Callers may need to update their calls of
X509_get0_extensions, but I believe everything affected has been fixed.

Change-Id: Ic92660e18868cc681399ba4fc3f47ea1796fb164
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/42884
Reviewed-by: Adam Langley <agl@google.com>
chromium-5359
David Benjamin 5 years ago committed by Adam Langley
parent 3743aafdac
commit cefbf9ceaa
  1. 2
      crypto/x509/x509_set.c
  2. 5
      include/openssl/x509.h

@ -221,7 +221,7 @@ int X509_set_pubkey(X509 *x, EVP_PKEY *pkey)
return (X509_PUBKEY_set(&(x->cert_info->key), pkey));
}
STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x)
const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x)
{
return x->cert_info->extensions;
}

@ -968,9 +968,8 @@ OPENSSL_EXPORT X509_NAME *X509_get_subject_name(const X509 *a);
OPENSSL_EXPORT int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
OPENSSL_EXPORT EVP_PKEY *X509_get_pubkey(X509 *x);
OPENSSL_EXPORT ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);
// TODO(davidben): |X509_get0_extensions| should return a const pointer to
// match upstream.
OPENSSL_EXPORT STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x);
OPENSSL_EXPORT const STACK_OF(X509_EXTENSION) *
X509_get0_extensions(const X509 *x);
OPENSSL_EXPORT const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x);
OPENSSL_EXPORT int X509_REQ_set_version(X509_REQ *x, long version);

Loading…
Cancel
Save