summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-03-02 10:41:46 +0000
committertb <>2024-03-02 10:41:46 +0000
commitb2a3fdcc5976cc3b2620d253495952a4e58f80ae (patch)
tree2c57c8e32636177c1d48188c8a9e0b0ff6c2421f /src
parent5a6928bc4b6854c45366b0767c4f86969e8f1e70 (diff)
downloadopenbsd-b2a3fdcc5976cc3b2620d253495952a4e58f80ae.tar.gz
openbsd-b2a3fdcc5976cc3b2620d253495952a4e58f80ae.tar.bz2
openbsd-b2a3fdcc5976cc3b2620d253495952a4e58f80ae.zip
Make X509_PURPOSE opaque
Code using details of X509_PURPOSE does so by using API. So we can make this struct opaque. ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x509/x509_purp.c12
-rw-r--r--src/lib/libcrypto/x509/x509v3.h12
2 files changed, 13 insertions, 11 deletions
diff --git a/src/lib/libcrypto/x509/x509_purp.c b/src/lib/libcrypto/x509/x509_purp.c
index 9d4ec3220c..d887d4c355 100644
--- a/src/lib/libcrypto/x509/x509_purp.c
+++ b/src/lib/libcrypto/x509/x509_purp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_purp.c,v 1.37 2024/03/02 10:40:05 tb Exp $ */ 1/* $OpenBSD: x509_purp.c,v 1.38 2024/03/02 10:41:46 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -68,6 +68,16 @@
68#include "x509_internal.h" 68#include "x509_internal.h"
69#include "x509_local.h" 69#include "x509_local.h"
70 70
71struct x509_purpose_st {
72 int purpose;
73 int trust; /* Default trust ID */
74 int flags;
75 int (*check_purpose)(const struct x509_purpose_st *, const X509 *, int);
76 char *name;
77 char *sname;
78 void *usr_data;
79} /* X509_PURPOSE */;
80
71#define V1_ROOT (EXFLAG_V1|EXFLAG_SS) 81#define V1_ROOT (EXFLAG_V1|EXFLAG_SS)
72#define ku_reject(x, usage) \ 82#define ku_reject(x, usage) \
73 (((x)->ex_flags & EXFLAG_KUSAGE) && !((x)->ex_kusage & (usage))) 83 (((x)->ex_flags & EXFLAG_KUSAGE) && !((x)->ex_kusage & (usage)))
diff --git a/src/lib/libcrypto/x509/x509v3.h b/src/lib/libcrypto/x509/x509v3.h
index 118a449e82..6b7dc80bf3 100644
--- a/src/lib/libcrypto/x509/x509v3.h
+++ b/src/lib/libcrypto/x509/x509v3.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509v3.h,v 1.27 2024/03/02 10:40:05 tb Exp $ */ 1/* $OpenBSD: x509v3.h,v 1.28 2024/03/02 10:41:46 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -422,15 +422,7 @@ struct ISSUING_DIST_POINT_st {
422#define X509_PURPOSE_DYNAMIC 0x1 422#define X509_PURPOSE_DYNAMIC 0x1
423#define X509_PURPOSE_DYNAMIC_NAME 0x2 423#define X509_PURPOSE_DYNAMIC_NAME 0x2
424 424
425typedef struct x509_purpose_st { 425typedef struct x509_purpose_st X509_PURPOSE;
426 int purpose;
427 int trust; /* Default trust ID */
428 int flags;
429 int (*check_purpose)(const struct x509_purpose_st *, const X509 *, int);
430 char *name;
431 char *sname;
432 void *usr_data;
433} X509_PURPOSE;
434 426
435#define X509_PURPOSE_SSL_CLIENT 1 427#define X509_PURPOSE_SSL_CLIENT 1
436#define X509_PURPOSE_SSL_SERVER 2 428#define X509_PURPOSE_SSL_SERVER 2