-/* $OpenBSD: x509_purp.c,v 1.38 2024/03/02 10:41:46 tb Exp $ */
+/* $OpenBSD: x509_purp.c,v 1.39 2024/03/02 10:43:52 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2001.
*/
static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca);
static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca);
-static X509_PURPOSE xstandard[] = {
+static const X509_PURPOSE xstandard[] = {
{
.purpose = X509_PURPOSE_SSL_CLIENT,
.trust = X509_TRUST_SSL_CLIENT,
}
LCRYPTO_ALIAS(X509_PURPOSE_get_count);
-X509_PURPOSE *
+const X509_PURPOSE *
X509_PURPOSE_get0(int idx)
{
if (idx < 0 || (size_t)idx >= X509_PURPOSE_COUNT)
X509_PURPOSE_get_by_sname(const char *sname)
{
int i;
- X509_PURPOSE *xptmp;
+ const X509_PURPOSE *xptmp;
for (i = 0; i < X509_PURPOSE_get_count(); i++) {
xptmp = X509_PURPOSE_get0(i);
}
LCRYPTO_ALIAS(X509_PURPOSE_get_id);
-char *
+const char *
X509_PURPOSE_get0_name(const X509_PURPOSE *xp)
{
return xp->name;
}
LCRYPTO_ALIAS(X509_PURPOSE_get0_name);
-char *
+const char *
X509_PURPOSE_get0_sname(const X509_PURPOSE *xp)
{
return xp->sname;
-/* $OpenBSD: x509v3.h,v 1.28 2024/03/02 10:41:46 tb Exp $ */
+/* $OpenBSD: x509v3.h,v 1.29 2024/03/02 10:43:52 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
int X509_supported_extension(X509_EXTENSION *ex);
int X509_check_issued(X509 *issuer, X509 *subject);
int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid);
+
int X509_PURPOSE_get_count(void);
-X509_PURPOSE *X509_PURPOSE_get0(int idx);
+const X509_PURPOSE *X509_PURPOSE_get0(int idx);
int X509_PURPOSE_get_by_sname(const char *sname);
-char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp);
-char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp);
+const char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp);
+const char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp);
int X509_PURPOSE_get_id(const X509_PURPOSE *);
uint32_t X509_get_extension_flags(X509 *x);
uint32_t X509_get_key_usage(X509 *x);