Commit 06cff36e64 for openssl.org
commit 06cff36e641c39f1859f78adcf20d0d977ea0088
Author: Milan Broz <gmazyland@gmail.com>
Date: Thu Feb 19 13:05:21 2026 +0100
Constify X509_REQ_get1_email, X509_get1_email and X509_get1_ocsp.
Functions seem not documented, but exported.
Signed-off-by: Milan Broz <gmazyland@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Fri Feb 20 17:07:41 2026
(Merged from https://github.com/openssl/openssl/pull/30082)
diff --git a/crypto/x509/v3_utl.c b/crypto/x509/v3_utl.c
index e7abe6150a..ecb9e872d2 100644
--- a/crypto/x509/v3_utl.c
+++ b/crypto/x509/v3_utl.c
@@ -446,7 +446,7 @@ static int sk_strcmp(const char *const *a, const char *const *b)
return strcmp(*a, *b);
}
-STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x)
+STACK_OF(OPENSSL_STRING) *X509_get1_email(const X509 *x)
{
GENERAL_NAMES *gens;
STACK_OF(OPENSSL_STRING) *ret;
@@ -457,7 +457,7 @@ STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x)
return ret;
}
-STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x)
+STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(const X509 *x)
{
AUTHORITY_INFO_ACCESS *info;
STACK_OF(OPENSSL_STRING) *ret = NULL;
@@ -479,7 +479,7 @@ STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x)
return ret;
}
-STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x)
+STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(const X509_REQ *x)
{
GENERAL_NAMES *gens;
STACK_OF(X509_EXTENSION) *exts;
diff --git a/include/openssl/x509v3.h.in b/include/openssl/x509v3.h.in
index 76671367b8..de75440060 100644
--- a/include/openssl/x509v3.h.in
+++ b/include/openssl/x509v3.h.in
@@ -777,10 +777,10 @@ char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp);
int X509_PURPOSE_get_trust(const X509_PURPOSE *xp);
int X509_PURPOSE_set(int *p, int purpose);
-STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x);
-STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x);
+STACK_OF(OPENSSL_STRING) *X509_get1_email(const X509 *x);
+STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(const X509_REQ *x);
void X509_email_free(STACK_OF(OPENSSL_STRING) *sk);
-STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);
+STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(const X509 *x);
/* Flags for X509_check_* functions */