summaryrefslogtreecommitdiff
path: root/debian/patches/prototypes
blob: 7191e10200366d818565d40ed52f325ea554ea6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
Description: Include missing prototypes, and disable use of BIO_new_file
 Pull in missing prototypes for functions that are not yet upstream in
 gnu-efi, and #ifdef out references to BIO_new_file(), BIO_new_fp(), and
 X509_load_{cert,crl}_file since the prototypes are themselves #ifdef'ed
 out.
 .
 Without these prototypes, we get implicit conversions on amd64, which
 are sensibly treated as a build failure by Launchpad.
Author: Steve Langasek <steve.langasek@ubuntu.com>

Index: shim/Cryptlib/Library/BaseMemoryLib.h
===================================================================
--- /dev/null
+++ shim/Cryptlib/Library/BaseMemoryLib.h
@@ -0,0 +1,41 @@
+#ifndef __BASE_MEMORY_LIB__
+#define __BASE_MEMORY_LIB__
+
+CHAR8 *
+ScanMem8 (
+    IN CHAR8          *Buffer,
+    IN UINTN           Size,
+    IN CHAR8           Value
+    );
+
+UINT32
+WriteUnaligned32(
+    UINT32            *Buffer,
+    UINT32             Value
+    );
+
+CHAR8 *
+AsciiStrCat(
+    CHAR8             *Destination,
+    CHAR8             *Source
+    );
+
+CHAR8 *
+AsciiStrCpy(
+    CHAR8             *Destination,
+    CHAR8             *Source
+    );
+
+CHAR8 *
+AsciiStrnCpy(
+    CHAR8             *Destination,
+    CHAR8             *Source,
+    UINTN              count
+    );
+
+UINTN
+AsciiStrSize(
+    CHAR8             *string
+    );
+
+#endif
Index: shim/Cryptlib/OpenSSL/crypto/x509v3/v3_pci.c
===================================================================
--- shim.orig/Cryptlib/OpenSSL/crypto/x509v3/v3_pci.c
+++ shim/Cryptlib/OpenSSL/crypto/x509v3/v3_pci.c
@@ -157,6 +157,7 @@
 				}
 			OPENSSL_free(tmp_data2);
 			}
+#ifndef OPENSSL_NO_STDIO
 		else if (strncmp(val->value, "file:", 5) == 0)
 			{
 			unsigned char buf[2048];
@@ -194,6 +195,7 @@
 				goto err;
 				}
 			}
+#endif
 		else if (strncmp(val->value, "text:", 5) == 0)
 			{
 			val_len = strlen(val->value + 5);
Index: shim/Cryptlib/OpenSSL/crypto/conf/conf_def.c
===================================================================
--- shim.orig/Cryptlib/OpenSSL/crypto/conf/conf_def.c
+++ shim/Cryptlib/OpenSSL/crypto/conf/conf_def.c
@@ -186,11 +186,13 @@
 	int ret;
 	BIO *in=NULL;
 
+#ifndef OPENSSL_NO_STDIO
 #ifdef OPENSSL_SYS_VMS
 	in=BIO_new_file(name, "r");
 #else
 	in=BIO_new_file(name, "rb");
 #endif
+#endif
 	if (in == NULL)
 		{
 		if (ERR_GET_REASON(ERR_peek_last_error()) == BIO_R_NO_SUCH_FILE)
Index: shim/Cryptlib/OpenSSL/crypto/conf/conf_lib.c
===================================================================
--- shim.orig/Cryptlib/OpenSSL/crypto/conf/conf_lib.c
+++ shim/Cryptlib/OpenSSL/crypto/conf/conf_lib.c
@@ -92,11 +92,13 @@
 	LHASH *ltmp;
 	BIO *in=NULL;
 
+#ifndef OPENSSL_NO_STDIO
 #ifdef OPENSSL_SYS_VMS
 	in=BIO_new_file(file, "r");
 #else
 	in=BIO_new_file(file, "rb");
 #endif
+#endif
 	if (in == NULL)
 		{
 		CONFerr(CONF_F_CONF_LOAD,ERR_R_SYS_LIB);
Index: shim/Cryptlib/OpenSSL/crypto/conf/conf_sap.c
===================================================================
--- shim.orig/Cryptlib/OpenSSL/crypto/conf/conf_sap.c
+++ shim/Cryptlib/OpenSSL/crypto/conf/conf_sap.c
@@ -93,12 +93,14 @@
 		{
 		BIO *bio_err;
 		ERR_load_crypto_strings();
+#ifndef OPENSSL_NO_STDIO
 		if ((bio_err=BIO_new_fp(stderr, BIO_NOCLOSE)) != NULL)
 			{
 			BIO_printf(bio_err,"Auto configuration failed\n");
 			ERR_print_errors(bio_err);
 			BIO_free(bio_err);
 			}
+#endif
 		exit(1);
 		}
 
Index: shim/Cryptlib/OpenSSL/crypto/engine/eng_openssl.c
===================================================================
--- shim.orig/Cryptlib/OpenSSL/crypto/engine/eng_openssl.c
+++ shim/Cryptlib/OpenSSL/crypto/engine/eng_openssl.c
@@ -374,11 +374,15 @@
 	BIO *in;
 	EVP_PKEY *key;
 	fprintf(stderr, "(TEST_ENG_OPENSSL_PKEY)Loading Private key %s\n", key_id);
+#ifndef OPENSSL_NO_STDIO
 	in = BIO_new_file(key_id, "r");
 	if (!in)
 		return NULL;
 	key = PEM_read_bio_PrivateKey(in, NULL, 0, NULL);
 	BIO_free(in);
+#else
+	return NULL;
+#endif
 	return key;
 	}
 #endif
Index: shim/Cryptlib/OpenSSL/crypto/x509/by_dir.c
===================================================================
--- shim.orig/Cryptlib/OpenSSL/crypto/x509/by_dir.c
+++ shim/Cryptlib/OpenSSL/crypto/x509/by_dir.c
@@ -92,8 +92,10 @@
 static int new_dir(X509_LOOKUP *lu);
 static void free_dir(X509_LOOKUP *lu);
 static int add_cert_dir(BY_DIR *ctx,const char *dir,int type);
+#ifndef OPENSSL_NO_STDIO
 static int get_cert_by_subject(X509_LOOKUP *xl,int type,X509_NAME *name,
 	X509_OBJECT *ret);
+#endif
 X509_LOOKUP_METHOD x509_dir_lookup=
 	{
 	"Load certs from files in a directory",
@@ -102,7 +104,11 @@
 	NULL, 			/* init */
 	NULL,			/* shutdown */
 	dir_ctrl,		/* ctrl */
+#ifdef OPENSSL_NO_STDIO
+	NULL,			/* get_by_subject */
+#else
 	get_cert_by_subject,	/* get_by_subject */
+#endif
 	NULL,			/* get_by_issuer_serial */
 	NULL,			/* get_by_fingerprint */
 	NULL,			/* get_by_alias */
@@ -242,6 +248,7 @@
 	return(1);
 	}
 
+#ifndef OPENSSL_NO_STDIO
 static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
 	     X509_OBJECT *ret)
 	{
@@ -383,3 +390,4 @@
 	if (b != NULL) BUF_MEM_free(b);
 	return(ok);
 	}
+#endif