Skip to content

Commit 0569903

Browse files
committed
plan9: simplify patches
1 parent d8a4192 commit 0569903

File tree

8 files changed

+29
-267
lines changed

8 files changed

+29
-267
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ include/openssl/*.h
167167

168168
/crypto/*
169169
!/crypto/Makefile.am.*
170-
!/crypto/mkfile
171170
!/crypto/compat/arc4random.h
172171
!/crypto/compat/b_win.c
173172
!/crypto/compat/explicit_bzero_win.c

README.plan9

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,19 @@
1010
## Steps that apply to all builds ##
1111

1212
Before building LibreSSL, You must install latest 9legacy stable patches, and
13-
two pull-requests for 0intro/plan9-contrib.
13+
four pull-requests for 0intro/plan9-contrib and lufia/plan9.
1414

1515
* https://github.com/0intro/plan9-contrib/pull/6
1616
* https://github.com/0intro/plan9-contrib/pull/7
17+
* https://github.com/0intro/plan9-contrib/pull/13
18+
* https://github.com/lufia/plan9/pull/10
1719

1820
Once you have a source tree, either by downloaded using git and having
1921
run the `autogen.sh` script above, or by downloading a release distribution from
2022
an OpenBSD mirror, run these commands to build and install the package on most
2123
systems:
2224

2325
```sh
24-
./gen-mkfile.sh lib crypto/Makefile.am
25-
./gen-mkfile.sh lib ssl/Makefile.am
26-
./gen-mkfile.sh lib tls/Makefile.am
27-
./gen-mkfile.sh bin apps/openssl/Makefile.am
28-
./gen-mkfile.sh include include/Makefile.am
2926
mk
3027
mk install
3128
```

autogen.rc

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@ rfork ne
66
ape/psh ./update.sh
77

88
for(f in `{ls apps/*/*.c}){
9-
sed 's/ \.opt\.value = (.*),$/ .opt = { .value = \1 },/' $f >/tmp/autogen.$pid
9+
sed 's/ \.opt\.([a-zA-Z0-9_]+) = (.*),$/ .opt = { .\1 = \2 },/' $f >/tmp/autogen.$pid
1010
cp /tmp/autogen.$pid $f
1111
}
12+
for(f in `{grep -l '<openssl/(asn1|ocsp|pkcs12|x509v3)\.h>' */*.c */*/*.c}){
13+
awk '
14+
{ print }
15+
n > 0 { next }
16+
/^#include[ \t]+<openssl\/(asn1|ocsp|pkcs12|x509v3)\.h>$/ {
17+
print "#include <openssl/asn1t.h>"
18+
n++
19+
}
20+
' $f >/tmp/autogen.$pid
21+
cp /tmp/autogen.$pid $f
22+
}
23+
rm /tmp/autogen.$pid
24+
25+
cp plan9/apps.mkfile apps/mkfile
26+
ape/psh ./gen-mkfile.sh lib crypto/Makefile.am
27+
ape/psh ./gen-mkfile.sh lib ssl/Makefile.am
28+
ape/psh ./gen-mkfile.sh lib tls/Makefile.am
29+
ape/psh ./gen-mkfile.sh bin apps/openssl/Makefile.am
30+
ape/psh ./gen-mkfile.sh include include/Makefile.am

gen-mkfile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ function mkfilehdr(m, wfile, a,n,i,name) {
386386
# -T flag is dropped; will cause incompatible type signatures error.
387387
# -w flag is dropped; is very chatty.
388388
# -B flag is needed because apps/openssl still have K&R style prototype.
389-
print "CFLAGS=-FV -B -c\\" >>wfile
389+
print "CFLAGS=-FV -B -u -c\\" >>wfile
390390
printf "\t-I%s/include\\\n", topdir() >>wfile
391391
printf "\t-I%s/include/compat\\\n", topdir() >>wfile
392392
for(name in defs)
File renamed without changes.

plan9/apps.patch

Lines changed: 0 additions & 31 deletions
This file was deleted.

plan9/crypto.patch

Lines changed: 0 additions & 220 deletions
Original file line numberDiff line numberDiff line change
@@ -20,116 +20,6 @@ diff -uprN -X mkfile crypto.orig/cryptlib.c crypto/cryptlib.c
2020
#include <unistd.h>
2121

2222
#include <openssl/opensslconf.h>
23-
diff -uprN -X mkfile crypto.orig/ocsp/ocsp_cl.c crypto/ocsp/ocsp_cl.c
24-
--- crypto.orig/ocsp/ocsp_cl.c Sun May 31 21:08:12 2020
25-
+++ crypto/ocsp/ocsp_cl.c Sun May 31 19:27:31 2020
26-
@@ -70,6 +70,7 @@
27-
#include <openssl/pem.h>
28-
#include <openssl/x509.h>
29-
#include <openssl/x509v3.h>
30-
+#include <openssl/asn1t.h>
31-
32-
/* Utility functions related to sending OCSP requests and extracting
33-
* relevant information from the response.
34-
diff -uprN -X mkfile crypto.orig/ocsp/ocsp_srv.c crypto/ocsp/ocsp_srv.c
35-
--- crypto.orig/ocsp/ocsp_srv.c Sun May 31 21:08:12 2020
36-
+++ crypto/ocsp/ocsp_srv.c Sun May 31 19:27:31 2020
37-
@@ -64,6 +64,7 @@
38-
#include <openssl/pem.h>
39-
#include <openssl/x509.h>
40-
#include <openssl/x509v3.h>
41-
+#include <openssl/asn1t.h>
42-
43-
/* Utility functions related to sending OCSP responses and extracting
44-
* relevant information from the request.
45-
diff -uprN -X mkfile crypto.orig/ocsp/ocsp_vfy.c crypto/ocsp/ocsp_vfy.c
46-
--- crypto.orig/ocsp/ocsp_vfy.c Sun May 31 21:08:12 2020
47-
+++ crypto/ocsp/ocsp_vfy.c Sun May 31 19:27:32 2020
48-
@@ -58,6 +58,7 @@
49-
50-
#include <openssl/ocsp.h>
51-
#include <openssl/err.h>
52-
+#include <openssl/asn1t.h>
53-
#include <string.h>
54-
55-
static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs,
56-
diff -uprN -X mkfile crypto.orig/pkcs12/p12_add.c crypto/pkcs12/p12_add.c
57-
--- crypto.orig/pkcs12/p12_add.c Sun May 31 21:08:13 2020
58-
+++ crypto/pkcs12/p12_add.c Sun May 31 19:27:32 2020
59-
@@ -60,6 +60,7 @@
60-
61-
#include <openssl/err.h>
62-
#include <openssl/pkcs12.h>
63-
+#include <openssl/asn1t.h>
64-
65-
/* Pack an object into an OCTET STRING and turn into a safebag */
66-
67-
diff -uprN -X mkfile crypto.orig/pkcs12/p12_p8d.c crypto/pkcs12/p12_p8d.c
68-
--- crypto.orig/pkcs12/p12_p8d.c Sun May 31 21:08:13 2020
69-
+++ crypto/pkcs12/p12_p8d.c Sun May 31 19:27:32 2020
70-
@@ -59,6 +59,7 @@
71-
#include <stdio.h>
72-
73-
#include <openssl/pkcs12.h>
74-
+#include <openssl/asn1t.h>
75-
76-
PKCS8_PRIV_KEY_INFO *
77-
PKCS8_decrypt(const X509_SIG *p8, const char *pass, int passlen)
78-
diff -uprN -X mkfile crypto.orig/pkcs12/p12_p8e.c crypto/pkcs12/p12_p8e.c
79-
--- crypto.orig/pkcs12/p12_p8e.c Sun May 31 21:08:13 2020
80-
+++ crypto/pkcs12/p12_p8e.c Sun May 31 19:27:32 2020
81-
@@ -60,6 +60,7 @@
82-
83-
#include <openssl/err.h>
84-
#include <openssl/pkcs12.h>
85-
+#include <openssl/asn1t.h>
86-
87-
X509_SIG *
88-
PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, const char *pass,
89-
diff -uprN -X mkfile crypto.orig/pkcs12/p12_utl.c crypto/pkcs12/p12_utl.c
90-
--- crypto.orig/pkcs12/p12_utl.c Sun May 31 21:08:13 2020
91-
+++ crypto/pkcs12/p12_utl.c Sun May 31 19:27:32 2020
92-
@@ -61,6 +61,7 @@
93-
#include <string.h>
94-
95-
#include <openssl/pkcs12.h>
96-
+#include <openssl/asn1t.h>
97-
98-
/* Cheap and nasty Unicode stuff */
99-
100-
diff -uprN -X mkfile crypto.orig/pkcs7/bio_pk7.c crypto/pkcs7/bio_pk7.c
101-
--- crypto.orig/pkcs7/bio_pk7.c Sun May 31 21:08:13 2020
102-
+++ crypto/pkcs7/bio_pk7.c Sun May 31 19:27:32 2020
103-
@@ -53,6 +53,7 @@
104-
*/
105-
106-
#include <openssl/asn1.h>
107-
+#include <openssl/asn1t.h>
108-
#include <openssl/pkcs7.h>
109-
#include <openssl/bio.h>
110-
111-
diff -uprN -X mkfile crypto.orig/pkcs7/pk7_doit.c crypto/pkcs7/pk7_doit.c
112-
--- crypto.orig/pkcs7/pk7_doit.c Sun May 31 21:08:13 2020
113-
+++ crypto/pkcs7/pk7_doit.c Sun May 31 19:27:32 2020
114-
@@ -64,6 +64,7 @@
115-
#include <openssl/objects.h>
116-
#include <openssl/x509.h>
117-
#include <openssl/x509v3.h>
118-
+#include <openssl/asn1t.h>
119-
120-
static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
121-
void *value);
122-
diff -uprN -X mkfile crypto.orig/pkcs7/pk7_mime.c crypto/pkcs7/pk7_mime.c
123-
--- crypto.orig/pkcs7/pk7_mime.c Sun May 31 21:08:13 2020
124-
+++ crypto/pkcs7/pk7_mime.c Sun May 31 19:27:32 2020
125-
@@ -57,6 +57,7 @@
126-
127-
#include <openssl/asn1.h>
128-
#include <openssl/x509.h>
129-
+#include <openssl/asn1t.h>
130-
131-
/* PKCS#7 wrappers round generalised stream and MIME routines */
132-
13323
diff -uprN -X mkfile crypto.orig/poly1305/poly1305-donna.c crypto/poly1305/poly1305-donna.c
13424
--- crypto.orig/poly1305/poly1305-donna.c Sun May 31 21:08:13 2020
13525
+++ crypto/poly1305/poly1305-donna.c Sun May 31 19:27:32 2020
@@ -141,113 +31,3 @@ diff -uprN -X mkfile crypto.orig/poly1305/poly1305-donna.c crypto/poly1305/poly1
14131

14232
static inline void poly1305_init(poly1305_context *ctx,
14333
const unsigned char key[32]);
144-
diff -uprN -X mkfile crypto.orig/x509/x_all.c crypto/x509/x_all.c
145-
--- crypto.orig/x509/x_all.c Sun May 31 21:08:16 2020
146-
+++ crypto/x509/x_all.c Sun May 31 19:27:32 2020
147-
@@ -61,6 +61,7 @@
148-
#include <openssl/opensslconf.h>
149-
150-
#include <openssl/asn1.h>
151-
+#include <openssl/asn1t.h>
152-
#include <openssl/buffer.h>
153-
#include <openssl/evp.h>
154-
#include <openssl/stack.h>
155-
diff -uprN -X mkfile crypto.orig/x509v3/v3_alt.c crypto/x509v3/v3_alt.c
156-
--- crypto.orig/x509v3/v3_alt.c Sun May 31 21:08:16 2020
157-
+++ crypto/x509v3/v3_alt.c Sun May 31 19:27:32 2020
158-
@@ -62,6 +62,7 @@
159-
#include <openssl/conf.h>
160-
#include <openssl/err.h>
161-
#include <openssl/x509v3.h>
162-
+#include <openssl/asn1t.h>
163-
164-
static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method,
165-
X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
166-
diff -uprN -X mkfile crypto.orig/x509v3/v3_bitst.c crypto/x509v3/v3_bitst.c
167-
--- crypto.orig/x509v3/v3_bitst.c Sun May 31 21:08:16 2020
168-
+++ crypto/x509v3/v3_bitst.c Sun May 31 19:27:33 2020
169-
@@ -62,6 +62,7 @@
170-
#include <openssl/conf.h>
171-
#include <openssl/err.h>
172-
#include <openssl/x509v3.h>
173-
+#include <openssl/asn1t.h>
174-
175-
static BIT_STRING_BITNAME ns_cert_type_table[] = {
176-
{0, "SSL Client", "client"},
177-
diff -uprN -X mkfile crypto.orig/x509v3/v3_enum.c crypto/x509v3/v3_enum.c
178-
--- crypto.orig/x509v3/v3_enum.c Sun May 31 21:08:16 2020
179-
+++ crypto/x509v3/v3_enum.c Sun May 31 19:27:33 2020
180-
@@ -59,6 +59,7 @@
181-
#include <stdio.h>
182-
#include <string.h>
183-
#include <openssl/x509v3.h>
184-
+#include <openssl/asn1t.h>
185-
186-
static ENUMERATED_NAMES crl_reasons[] = {
187-
{CRL_REASON_UNSPECIFIED, "Unspecified", "unspecified"},
188-
diff -uprN -X mkfile crypto.orig/x509v3/v3_ia5.c crypto/x509v3/v3_ia5.c
189-
--- crypto.orig/x509v3/v3_ia5.c Sun May 31 21:08:17 2020
190-
+++ crypto/x509v3/v3_ia5.c Sun May 31 19:27:33 2020
191-
@@ -60,6 +60,7 @@
192-
#include <string.h>
193-
194-
#include <openssl/asn1.h>
195-
+#include <openssl/asn1t.h>
196-
#include <openssl/conf.h>
197-
#include <openssl/err.h>
198-
#include <openssl/x509v3.h>
199-
diff -uprN -X mkfile crypto.orig/x509v3/v3_int.c crypto/x509v3/v3_int.c
200-
--- crypto.orig/x509v3/v3_int.c Sun May 31 21:08:17 2020
201-
+++ crypto/x509v3/v3_int.c Sun May 31 19:27:33 2020
202-
@@ -59,6 +59,7 @@
203-
#include <stdio.h>
204-
205-
#include <openssl/x509v3.h>
206-
+#include <openssl/asn1t.h>
207-
208-
const X509V3_EXT_METHOD v3_crl_num = {
209-
.ext_nid = NID_crl_number,
210-
diff -uprN -X mkfile crypto.orig/x509v3/v3_ocsp.c crypto/x509v3/v3_ocsp.c
211-
--- crypto.orig/x509v3/v3_ocsp.c Sun May 31 21:08:17 2020
212-
+++ crypto/x509v3/v3_ocsp.c Sun May 31 19:27:33 2020
213-
@@ -64,6 +64,7 @@
214-
#ifndef OPENSSL_NO_OCSP
215-
216-
#include <openssl/asn1.h>
217-
+#include <openssl/asn1t.h>
218-
#include <openssl/conf.h>
219-
#include <openssl/err.h>
220-
#include <openssl/ocsp.h>
221-
diff -uprN -X mkfile crypto.orig/x509v3/v3_pci.c crypto/x509v3/v3_pci.c
222-
--- crypto.orig/x509v3/v3_pci.c Sun May 31 21:08:17 2020
223-
+++ crypto/x509v3/v3_pci.c Sun May 31 19:27:33 2020
224-
@@ -40,6 +40,7 @@
225-
#include <openssl/conf.h>
226-
#include <openssl/err.h>
227-
#include <openssl/x509v3.h>
228-
+#include <openssl/asn1t.h>
229-
230-
static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext,
231-
BIO *out, int indent);
232-
diff -uprN -X mkfile crypto.orig/x509v3/v3_skey.c crypto/x509v3/v3_skey.c
233-
--- crypto.orig/x509v3/v3_skey.c Sun May 31 21:08:17 2020
234-
+++ crypto/x509v3/v3_skey.c Sun May 31 19:27:33 2020
235-
@@ -60,6 +60,7 @@
236-
#include <string.h>
237-
238-
#include <openssl/err.h>
239-
+#include <openssl/asn1t.h>
240-
#include <openssl/x509v3.h>
241-
242-
static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method,
243-
diff -uprN -X mkfile crypto.orig/x509v3/v3_utl.c crypto/x509v3/v3_utl.c
244-
--- crypto.orig/x509v3/v3_utl.c Sun May 31 21:08:17 2020
245-
+++ crypto/x509v3/v3_utl.c Sun May 31 19:27:33 2020
246-
@@ -61,6 +61,7 @@
247-
#include <stdio.h>
248-
#include <string.h>
249-
250-
+#include <openssl/asn1t.h>
251-
#include <openssl/bn.h>
252-
#include <openssl/conf.h>
253-
#include <openssl/err.h>

update.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ do_cp_libc() {
6363
CP_LIBC='do_cp_libc'
6464

6565
CP='cp -p'
66-
LS='ls -1'
6766
GREP='grep'
6867
if [ -x /opt/csw/bin/ggrep ]; then
6968
GREP='/opt/csw/bin/ggrep'
@@ -75,7 +74,6 @@ OBJECTS='perl objects.pl'
7574
OBJ_DAT='perl obj_dat.pl'
7675
if [ `uname` = Plan9 ]; then
7776
CP='cp'
78-
LS='ls'
7977
find_c_src() {
8078
du -a $1 |
8179
sed 's/^[ ]*[0-9][0-9]*[ ]*//' |
@@ -346,7 +344,7 @@ chmod 755 tests/testssl
346344
# add headers
347345
(cd include/openssl
348346
$CP Makefile.am.tpl Makefile.am
349-
for i in `$LS *.h|sort`; do
347+
for i in `ls -1 *.h|sort`; do
350348
echo "opensslinclude_HEADERS += $i" >> Makefile.am
351349
done
352350
echo endif >> Makefile.am
@@ -394,25 +392,25 @@ echo "if !ENABLE_LIBTLS_ONLY" >> man/Makefile.am
394392
echo dist_man3_MANS = >> man/Makefile.am
395393
echo dist_man5_MANS = >> man/Makefile.am
396394
(cd man
397-
for i in `$LS $libssl_src/man/*.3 | sort`; do
395+
for i in `ls -1 $libssl_src/man/*.3 | sort`; do
398396
NAME=`basename "$i"`
399397
$CP $i .
400398
echo "dist_man3_MANS += $NAME" >> Makefile.am
401399
done
402400

403-
for i in `$LS $libcrypto_src/man/*.3 | sort`; do
401+
for i in `ls -1 $libcrypto_src/man/*.3 | sort`; do
404402
NAME=`basename "$i"`
405403
$CP $i .
406404
echo "dist_man3_MANS += $NAME" >> Makefile.am
407405
done
408406

409-
for i in `$LS $libtls_src/man/*.3 | sort`; do
407+
for i in `ls -1 $libtls_src/man/*.3 | sort`; do
410408
NAME=`basename "$i"`
411409
$CP $i .
412410
echo "dist_man3_MANS += $NAME" >> Makefile.am
413411
done
414412

415-
for i in `$LS $libcrypto_src/man/*.5 | sort`; do
413+
for i in `ls -1 $libcrypto_src/man/*.5 | sort`; do
416414
NAME=`basename "$i"`
417415
$CP $i .
418416
echo "dist_man5_MANS += $NAME" >> Makefile.am

0 commit comments

Comments
 (0)