summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2021-10-31 16:51:16 +0000
committertb <>2021-10-31 16:51:16 +0000
commit125ed695394bdaa6554f2a49599600db43abe881 (patch)
tree0a0bb1eb5683c2a6bd66e9b08430197e4e00b64e
parent9088131a0bf4a9930c61b7096992aa4e3fec2959 (diff)
downloadopenbsd-125ed695394bdaa6554f2a49599600db43abe881.tar.gz
openbsd-125ed695394bdaa6554f2a49599600db43abe881.tar.bz2
openbsd-125ed695394bdaa6554f2a49599600db43abe881.zip
Hide struct internals under LIBRESSL_CRYPTO_INTERNAL so that other
parts of LibreSSL can no longer reach into them. discussed with beck, jsing
-rw-r--r--src/lib/libcrypto/Makefile4
-rw-r--r--src/lib/libcrypto/x509/x509.h24
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.h10
3 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/libcrypto/Makefile b/src/lib/libcrypto/Makefile
index 1caac51601..f626c16e91 100644
--- a/src/lib/libcrypto/Makefile
+++ b/src/lib/libcrypto/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.47 2021/10/23 09:13:51 beck Exp $ 1# $OpenBSD: Makefile,v 1.48 2021/10/31 16:51:16 tb Exp $
2 2
3LIB= crypto 3LIB= crypto
4LIBREBUILD=y 4LIBREBUILD=y
@@ -18,7 +18,7 @@ CFLAGS+= -Wall -Wundef
18.if ${COMPILER_VERSION:L} == "clang" 18.if ${COMPILER_VERSION:L} == "clang"
19CFLAGS+= -Werror 19CFLAGS+= -Werror
20.endif 20.endif
21CFLAGS+= -DLIBRESSL_INTERNAL 21CFLAGS+= -DLIBRESSL_INTERNAL -DLIBRESSL_CRYPTO_INTERNAL
22 22
23.if !defined(NOPIC) 23.if !defined(NOPIC)
24CFLAGS+= -DDSO_DLFCN -DHAVE_DLFCN_H -DHAVE_FUNOPEN 24CFLAGS+= -DDSO_DLFCN -DHAVE_DLFCN_H -DHAVE_FUNOPEN
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index 70e3f756c6..43b2307c8f 100644
--- a/src/lib/libcrypto/x509/x509.h
+++ b/src/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.h,v 1.84 2021/10/31 16:29:58 tb Exp $ */ 1/* $OpenBSD: x509.h,v 1.85 2021/10/31 16:51:16 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -139,7 +139,7 @@ typedef struct X509_val_st {
139 ASN1_TIME *notAfter; 139 ASN1_TIME *notAfter;
140} X509_VAL; 140} X509_VAL;
141 141
142#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 142#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
143struct X509_pubkey_st { 143struct X509_pubkey_st {
144 X509_ALGOR *algor; 144 X509_ALGOR *algor;
145 ASN1_BIT_STRING *public_key; 145 ASN1_BIT_STRING *public_key;
@@ -164,7 +164,7 @@ typedef struct X509_name_entry_st X509_NAME_ENTRY;
164 164
165DECLARE_STACK_OF(X509_NAME_ENTRY) 165DECLARE_STACK_OF(X509_NAME_ENTRY)
166 166
167#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 167#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
168/* we always keep X509_NAMEs in 2 forms. */ 168/* we always keep X509_NAMEs in 2 forms. */
169struct X509_name_st { 169struct X509_name_st {
170 STACK_OF(X509_NAME_ENTRY) *entries; 170 STACK_OF(X509_NAME_ENTRY) *entries;
@@ -184,7 +184,7 @@ DECLARE_STACK_OF(X509_NAME)
184 184
185#define X509_EX_V_NETSCAPE_HACK 0x8000 185#define X509_EX_V_NETSCAPE_HACK 0x8000
186#define X509_EX_V_INIT 0x0001 186#define X509_EX_V_INIT 0x0001
187#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 187#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
188typedef struct X509_extension_st { 188typedef struct X509_extension_st {
189 ASN1_OBJECT *object; 189 ASN1_OBJECT *object;
190 ASN1_BOOLEAN critical; 190 ASN1_BOOLEAN critical;
@@ -199,7 +199,7 @@ typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
199DECLARE_STACK_OF(X509_EXTENSION) 199DECLARE_STACK_OF(X509_EXTENSION)
200 200
201/* a sequence of these are used */ 201/* a sequence of these are used */
202#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 202#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
203typedef struct x509_attributes_st { 203typedef struct x509_attributes_st {
204 ASN1_OBJECT *object; 204 ASN1_OBJECT *object;
205 int single; /* 0 for a set, 1 for a single item (which is wrong) */ 205 int single; /* 0 for a set, 1 for a single item (which is wrong) */
@@ -216,7 +216,7 @@ typedef struct x509_attributes_st X509_ATTRIBUTE;
216DECLARE_STACK_OF(X509_ATTRIBUTE) 216DECLARE_STACK_OF(X509_ATTRIBUTE)
217 217
218 218
219#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 219#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
220typedef struct X509_req_info_st { 220typedef struct X509_req_info_st {
221 ASN1_ENCODING enc; 221 ASN1_ENCODING enc;
222 ASN1_INTEGER *version; 222 ASN1_INTEGER *version;
@@ -258,7 +258,7 @@ typedef struct x509_cinf_st X509_CINF;
258 * the end of the certificate itself 258 * the end of the certificate itself
259 */ 259 */
260 260
261#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 261#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
262typedef struct x509_cert_aux_st { 262typedef struct x509_cert_aux_st {
263 STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */ 263 STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */
264 STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */ 264 STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */
@@ -272,7 +272,7 @@ typedef struct x509_cert_aux_st X509_CERT_AUX;
272 272
273struct x509_st; 273struct x509_st;
274 274
275#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 275#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
276struct x509_st { 276struct x509_st {
277 X509_CINF *cert_info; 277 X509_CINF *cert_info;
278 X509_ALGOR *sig_alg; 278 X509_ALGOR *sig_alg;
@@ -422,7 +422,7 @@ DECLARE_STACK_OF(X509_TRUST)
422 XN_FLAG_FN_LN | \ 422 XN_FLAG_FN_LN | \
423 XN_FLAG_FN_ALIGN) 423 XN_FLAG_FN_ALIGN)
424 424
425#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 425#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
426struct x509_revoked_st { 426struct x509_revoked_st {
427 ASN1_INTEGER *serialNumber; 427 ASN1_INTEGER *serialNumber;
428 ASN1_TIME *revocationDate; 428 ASN1_TIME *revocationDate;
@@ -437,7 +437,7 @@ struct x509_revoked_st {
437 437
438DECLARE_STACK_OF(X509_REVOKED) 438DECLARE_STACK_OF(X509_REVOKED)
439 439
440#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 440#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
441typedef struct X509_crl_info_st { 441typedef struct X509_crl_info_st {
442 ASN1_INTEGER *version; 442 ASN1_INTEGER *version;
443 X509_ALGOR *sig_alg; 443 X509_ALGOR *sig_alg;
@@ -452,7 +452,7 @@ typedef struct X509_crl_info_st {
452typedef struct X509_crl_info_st X509_CRL_INFO; 452typedef struct X509_crl_info_st X509_CRL_INFO;
453#endif 453#endif
454 454
455#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 455#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
456struct X509_crl_st { 456struct X509_crl_st {
457 /* actual signature */ 457 /* actual signature */
458 X509_CRL_INFO *crl; 458 X509_CRL_INFO *crl;
@@ -564,7 +564,7 @@ typedef struct PBKDF2PARAM_st {
564 564
565/* PKCS#8 private key info structure */ 565/* PKCS#8 private key info structure */
566 566
567#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 567#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
568struct pkcs8_priv_key_info_st { 568struct pkcs8_priv_key_info_st {
569 ASN1_INTEGER *version; 569 ASN1_INTEGER *version;
570 X509_ALGOR *pkeyalg; 570 X509_ALGOR *pkeyalg;
diff --git a/src/lib/libcrypto/x509/x509_vfy.h b/src/lib/libcrypto/x509/x509_vfy.h
index d84df8a96e..676145cca7 100644
--- a/src/lib/libcrypto/x509/x509_vfy.h
+++ b/src/lib/libcrypto/x509/x509_vfy.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vfy.h,v 1.43 2021/10/31 16:26:08 tb Exp $ */ 1/* $OpenBSD: x509_vfy.h,v 1.44 2021/10/31 16:51:16 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -100,7 +100,7 @@ typedef enum {
100 X509_LU_CRL, 100 X509_LU_CRL,
101} X509_LOOKUP_TYPE; 101} X509_LOOKUP_TYPE;
102 102
103#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 103#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
104typedef struct x509_object_st { 104typedef struct x509_object_st {
105 /* one of the above types */ 105 /* one of the above types */
106 int type; 106 int type;
@@ -120,7 +120,7 @@ typedef struct x509_lookup_st X509_LOOKUP;
120DECLARE_STACK_OF(X509_LOOKUP) 120DECLARE_STACK_OF(X509_LOOKUP)
121DECLARE_STACK_OF(X509_OBJECT) 121DECLARE_STACK_OF(X509_OBJECT)
122 122
123#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 123#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
124/* This is a static that defines the function interface */ 124/* This is a static that defines the function interface */
125typedef struct x509_lookup_method_st { 125typedef struct x509_lookup_method_st {
126 const char *name; 126 const char *name;
@@ -165,7 +165,7 @@ typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM;
165 165
166DECLARE_STACK_OF(X509_VERIFY_PARAM) 166DECLARE_STACK_OF(X509_VERIFY_PARAM)
167 167
168#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 168#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
169/* 169/*
170 * This is used to hold everything. It is used for all certificate 170 * This is used to hold everything. It is used for all certificate
171 * validation. Once we have a certificate chain, the 'verify' 171 * validation. Once we have a certificate chain, the 'verify'
@@ -205,7 +205,7 @@ int X509_STORE_set_depth(X509_STORE *store, int depth);
205#define X509_STORE_set_verify_func(ctx,func) ((ctx)->verify=(func)) 205#define X509_STORE_set_verify_func(ctx,func) ((ctx)->verify=(func))
206#endif 206#endif
207 207
208#if defined(LIBRESSL_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) 208#if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509)
209/* This is the functions plus an instance of the local variables. */ 209/* This is the functions plus an instance of the local variables. */
210struct x509_lookup_st { 210struct x509_lookup_st {
211 int init; /* have we been started */ 211 int init; /* have we been started */