summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-03-02 10:41:47 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-03-02 10:41:47 +0000
commiteff7f4a0e6962efc2d764a926c17ffe59ee629c3 (patch)
treeaf506a8610fe1aa0fdfa79b7156c514eeeb145da
parent4010b02d81b36968cd0f68ea7e76efb3987bb155 (diff)
Make X509_PURPOSE opaque
Code using details of X509_PURPOSE does so by using API. So we can make this struct opaque. ok jsing
-rw-r--r--lib/libcrypto/x509/x509_purp.c12
-rw-r--r--lib/libcrypto/x509/x509v3.h12
2 files changed, 13 insertions, 11 deletions
diff --git a/lib/libcrypto/x509/x509_purp.c b/lib/libcrypto/x509/x509_purp.c
index 9d4ec3220ce..d887d4c355a 100644
--- a/lib/libcrypto/x509/x509_purp.c
+++ b/lib/libcrypto/x509/x509_purp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_purp.c,v 1.37 2024/03/02 10:40:05 tb Exp $ */
+/* $OpenBSD: x509_purp.c,v 1.38 2024/03/02 10:41:46 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2001.
*/
@@ -68,6 +68,16 @@
#include "x509_internal.h"
#include "x509_local.h"
+struct x509_purpose_st {
+ int purpose;
+ int trust; /* Default trust ID */
+ int flags;
+ int (*check_purpose)(const struct x509_purpose_st *, const X509 *, int);
+ char *name;
+ char *sname;
+ void *usr_data;
+} /* X509_PURPOSE */;
+
#define V1_ROOT (EXFLAG_V1|EXFLAG_SS)
#define ku_reject(x, usage) \
(((x)->ex_flags & EXFLAG_KUSAGE) && !((x)->ex_kusage & (usage)))
diff --git a/lib/libcrypto/x509/x509v3.h b/lib/libcrypto/x509/x509v3.h
index 118a449e822..6b7dc80bf3f 100644
--- a/lib/libcrypto/x509/x509v3.h
+++ b/lib/libcrypto/x509/x509v3.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509v3.h,v 1.27 2024/03/02 10:40:05 tb Exp $ */
+/* $OpenBSD: x509v3.h,v 1.28 2024/03/02 10:41:46 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
@@ -422,15 +422,7 @@ struct ISSUING_DIST_POINT_st {
#define X509_PURPOSE_DYNAMIC 0x1
#define X509_PURPOSE_DYNAMIC_NAME 0x2
-typedef struct x509_purpose_st {
- int purpose;
- int trust; /* Default trust ID */
- int flags;
- int (*check_purpose)(const struct x509_purpose_st *, const X509 *, int);
- char *name;
- char *sname;
- void *usr_data;
-} X509_PURPOSE;
+typedef struct x509_purpose_st X509_PURPOSE;
#define X509_PURPOSE_SSL_CLIENT 1
#define X509_PURPOSE_SSL_SERVER 2