From a1e979ffac3b4011a45ac423dcb104bb73d19d17 Mon Sep 17 00:00:00 2001 From: lufia Date: Mon, 29 Apr 2019 15:19:49 +0900 Subject: [PATCH] plan9: update patches --- plan9/apps.patch | 36 +++++----- plan9/crypto.patch | 173 ++++++++++++++++++++++++--------------------- plan9/ssl.patch | 95 ++++++++++++++++++++----- plan9/tls.patch | 58 ++++++++++----- 4 files changed, 232 insertions(+), 130 deletions(-) diff --git a/plan9/apps.patch b/plan9/apps.patch index 8e58472880..54d958a054 100644 --- a/plan9/apps.patch +++ b/plan9/apps.patch @@ -1,6 +1,6 @@ -diff -upr -X mkfile apps/openssl/apps.c apps.plan9/openssl/apps.c ---- apps/openssl/apps.c 2019-03-18 01:33:08.000000000 +0900 -+++ apps.plan9/openssl/apps.c 2019-03-14 01:27:34.000000000 +0900 +diff -uprN -X mkfile apps.orig/openssl/apps.c apps/openssl/apps.c +--- apps.orig/openssl/apps.c 2019-03-18 01:33:08.000000000 +0900 ++++ apps/openssl/apps.c 2019-04-29 12:55:15.000000000 +0900 @@ -146,6 +146,7 @@ #include @@ -9,9 +9,9 @@ diff -upr -X mkfile apps/openssl/apps.c apps.plan9/openssl/apps.c typedef struct { const char *name; -diff -upr -X mkfile apps/openssl/ciphers.c apps.plan9/openssl/ciphers.c ---- apps/openssl/ciphers.c 2018-07-03 23:22:47.000000000 +0900 -+++ apps.plan9/openssl/ciphers.c 2019-03-14 01:27:34.000000000 +0900 +diff -uprN -X mkfile apps.orig/openssl/ciphers.c apps/openssl/ciphers.c +--- apps.orig/openssl/ciphers.c 2018-07-03 23:22:47.000000000 +0900 ++++ apps/openssl/ciphers.c 2019-04-29 12:55:15.000000000 +0900 @@ -49,14 +49,18 @@ struct option ciphers_options[] = { .name = "v", .desc = "Provide cipher listing", @@ -33,9 +33,9 @@ diff -upr -X mkfile apps/openssl/ciphers.c apps.plan9/openssl/ciphers.c .value = 2, }, { NULL }, -diff -upr -X mkfile apps/openssl/dhparam.c apps.plan9/openssl/dhparam.c ---- apps/openssl/dhparam.c 2018-07-03 23:22:47.000000000 +0900 -+++ apps.plan9/openssl/dhparam.c 2019-03-17 15:44:04.000000000 +0900 +diff -uprN -X mkfile apps.orig/openssl/dhparam.c apps/openssl/dhparam.c +--- apps.orig/openssl/dhparam.c 2018-07-03 23:22:47.000000000 +0900 ++++ apps/openssl/dhparam.c 2019-04-29 12:55:15.000000000 +0900 @@ -150,14 +150,18 @@ struct option dhparam_options[] = { .desc = "Generate DH parameters with a generator value of 2 " "(default)", @@ -57,9 +57,9 @@ diff -upr -X mkfile apps/openssl/dhparam.c apps.plan9/openssl/dhparam.c .value = 5, }, { -diff -upr -X mkfile apps/openssl/enc.c apps.plan9/openssl/enc.c ---- apps/openssl/enc.c 2019-03-18 01:33:08.000000000 +0900 -+++ apps.plan9/openssl/enc.c 2019-03-14 01:27:34.000000000 +0900 +diff -uprN -X mkfile apps.orig/openssl/enc.c apps/openssl/enc.c +--- apps.orig/openssl/enc.c 2019-04-29 12:49:58.000000000 +0900 ++++ apps/openssl/enc.c 2019-04-29 12:55:15.000000000 +0900 @@ -153,7 +153,9 @@ static struct option enc_options[] = { .name = "d", .desc = "Decrypt the input data", @@ -114,9 +114,9 @@ diff -upr -X mkfile apps/openssl/enc.c apps.plan9/openssl/enc.c .value = 1, }, { -diff -upr -X mkfile apps/openssl/s_time.c apps.plan9/openssl/s_time.c ---- apps/openssl/s_time.c 2019-02-16 22:08:41.000000000 +0900 -+++ apps.plan9/openssl/s_time.c 2019-03-14 01:27:34.000000000 +0900 +diff -uprN -X mkfile apps.orig/openssl/s_time.c apps/openssl/s_time.c +--- apps.orig/openssl/s_time.c 2019-02-16 22:08:41.000000000 +0900 ++++ apps/openssl/s_time.c 2019-04-29 12:55:15.000000000 +0900 @@ -175,7 +175,9 @@ struct option s_time_options[] = { .name = "new", .desc = "Use a new session ID for each connection", @@ -139,9 +139,9 @@ diff -upr -X mkfile apps/openssl/s_time.c apps.plan9/openssl/s_time.c .value = 2, }, { -diff -upr -X mkfile apps/openssl/x509.c apps.plan9/openssl/x509.c ---- apps/openssl/x509.c 2019-02-16 22:08:41.000000000 +0900 -+++ apps.plan9/openssl/x509.c 2019-03-14 01:27:34.000000000 +0900 +diff -uprN -X mkfile apps.orig/openssl/x509.c apps/openssl/x509.c +--- apps.orig/openssl/x509.c 2019-02-16 22:08:41.000000000 +0900 ++++ apps/openssl/x509.c 2019-04-29 12:55:15.000000000 +0900 @@ -65,6 +65,7 @@ #include "apps.h" diff --git a/plan9/crypto.patch b/plan9/crypto.patch index 8d0435d442..691c13b9b3 100644 --- a/plan9/crypto.patch +++ b/plan9/crypto.patch @@ -1,6 +1,6 @@ -diff -uprN -X mkfile crypto/asn1/a_time_tm.c crypto.plan9/asn1/a_time_tm.c ---- crypto/asn1/a_time_tm.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/asn1/a_time_tm.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/asn1/a_time_tm.c crypto/asn1/a_time_tm.c +--- crypto.orig/asn1/a_time_tm.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/asn1/a_time_tm.c 2019-04-29 12:55:01.000000000 +0900 @@ -246,7 +246,7 @@ ASN1_TIME_set_string_internal(ASN1_TIME if ((tmp = strdup(str)) == NULL) return (0); @@ -73,9 +73,9 @@ diff -uprN -X mkfile crypto/asn1/a_time_tm.c crypto.plan9/asn1/a_time_tm.c } int -diff -uprN -X mkfile crypto/chacha/chacha-merged.c crypto.plan9/chacha/chacha-merged.c ---- crypto/chacha/chacha-merged.c 2019-02-16 22:08:41.000000000 +0900 -+++ crypto.plan9/chacha/chacha-merged.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/chacha/chacha-merged.c crypto/chacha/chacha-merged.c +--- crypto.orig/chacha/chacha-merged.c 2019-02-16 22:08:41.000000000 +0900 ++++ crypto/chacha/chacha-merged.c 2019-04-29 12:55:01.000000000 +0900 @@ -7,6 +7,7 @@ Public domain. #include @@ -84,9 +84,9 @@ diff -uprN -X mkfile crypto/chacha/chacha-merged.c crypto.plan9/chacha/chacha-me #include #define CHACHA_MINKEYLEN 16 -diff -uprN -X mkfile crypto/cryptlib.c crypto.plan9/cryptlib.c ---- crypto/cryptlib.c 2019-02-16 22:08:41.000000000 +0900 -+++ crypto.plan9/cryptlib.c 2019-03-17 00:09:58.000000000 +0900 +diff -uprN -X mkfile crypto.orig/cryptlib.c crypto/cryptlib.c +--- crypto.orig/cryptlib.c 2019-02-16 22:08:41.000000000 +0900 ++++ crypto/cryptlib.c 2019-04-29 12:55:01.000000000 +0900 @@ -119,6 +119,7 @@ #include #include @@ -95,9 +95,21 @@ diff -uprN -X mkfile crypto/cryptlib.c crypto.plan9/cryptlib.c #include #include -diff -uprN -X mkfile crypto/gost/gostr341001_pmeth.c crypto.plan9/gost/gostr341001_pmeth.c ---- crypto/gost/gostr341001_pmeth.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/gost/gostr341001_pmeth.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/evp/e_sm4.c crypto/evp/e_sm4.c +--- crypto.orig/evp/e_sm4.c 2019-04-29 15:06:40.000000000 +0900 ++++ crypto/evp/e_sm4.c 2019-04-29 15:11:37.000000000 +0900 +@@ -84,7 +84,7 @@ sm4_ctr_cipher(EVP_CIPHER_CTX *ctx, unsi + EVP_SM4_KEY *key = EVP_C_DATA(EVP_SM4_KEY, ctx); + + CRYPTO_ctr128_encrypt(in, out, len, &key->ks, ctx->iv, ctx->buf, +- &ctx->num, (block128_f)SM4_encrypt); ++ (unsigned int *)&ctx->num, (block128_f)SM4_encrypt); + return 1; + } + +diff -uprN -X mkfile crypto.orig/gost/gostr341001_pmeth.c crypto/gost/gostr341001_pmeth.c +--- crypto.orig/gost/gostr341001_pmeth.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/gost/gostr341001_pmeth.c 2019-04-29 12:55:01.000000000 +0900 @@ -603,7 +603,7 @@ pkey_gost01_ctrl(EVP_PKEY_CTX *ctx, int } memcpy(ukm, p2, p1); @@ -107,9 +119,10 @@ diff -uprN -X mkfile crypto/gost/gostr341001_pmeth.c crypto.plan9/gost/gostr3410 return 1; } -diff -uprN -X mkfile crypto/ocsp/ocsp_cl.c crypto.plan9/ocsp/ocsp_cl.c ---- crypto/ocsp/ocsp_cl.c 2019-02-16 22:08:41.000000000 +0900 -+++ crypto.plan9/ocsp/ocsp_cl.c 2019-03-16 23:57:18.000000000 +0900 +Binary files crypto.orig/modes/.ctr128.c.swp and crypto/modes/.ctr128.c.swp differ +diff -uprN -X mkfile crypto.orig/ocsp/ocsp_cl.c crypto/ocsp/ocsp_cl.c +--- crypto.orig/ocsp/ocsp_cl.c 2019-02-16 22:08:41.000000000 +0900 ++++ crypto/ocsp/ocsp_cl.c 2019-04-29 12:55:01.000000000 +0900 @@ -70,6 +70,7 @@ #include #include @@ -136,9 +149,9 @@ diff -uprN -X mkfile crypto/ocsp/ocsp_cl.c crypto.plan9/ocsp/ocsp_cl.c V_ASN1_GENERALIZEDTIME) != V_ASN1_GENERALIZEDTIME) { OCSPerror(OCSP_R_ERROR_IN_NEXTUPDATE_FIELD); return 0; -diff -uprN -X mkfile crypto/ocsp/ocsp_srv.c crypto.plan9/ocsp/ocsp_srv.c ---- crypto/ocsp/ocsp_srv.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/ocsp/ocsp_srv.c 2019-03-17 00:20:27.000000000 +0900 +diff -uprN -X mkfile crypto.orig/ocsp/ocsp_srv.c crypto/ocsp/ocsp_srv.c +--- crypto.orig/ocsp/ocsp_srv.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/ocsp/ocsp_srv.c 2019-04-29 12:55:01.000000000 +0900 @@ -64,6 +64,7 @@ #include #include @@ -147,9 +160,9 @@ diff -uprN -X mkfile crypto/ocsp/ocsp_srv.c crypto.plan9/ocsp/ocsp_srv.c /* Utility functions related to sending OCSP responses and extracting * relevant information from the request. -diff -uprN -X mkfile crypto/ocsp/ocsp_vfy.c crypto.plan9/ocsp/ocsp_vfy.c ---- crypto/ocsp/ocsp_vfy.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/ocsp/ocsp_vfy.c 2019-03-17 00:25:51.000000000 +0900 +diff -uprN -X mkfile crypto.orig/ocsp/ocsp_vfy.c crypto/ocsp/ocsp_vfy.c +--- crypto.orig/ocsp/ocsp_vfy.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/ocsp/ocsp_vfy.c 2019-04-29 12:55:01.000000000 +0900 @@ -58,6 +58,7 @@ #include @@ -158,9 +171,9 @@ diff -uprN -X mkfile crypto/ocsp/ocsp_vfy.c crypto.plan9/ocsp/ocsp_vfy.c #include static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs, -diff -uprN -X mkfile crypto/pkcs12/p12_add.c crypto.plan9/pkcs12/p12_add.c ---- crypto/pkcs12/p12_add.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/pkcs12/p12_add.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/pkcs12/p12_add.c crypto/pkcs12/p12_add.c +--- crypto.orig/pkcs12/p12_add.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/pkcs12/p12_add.c 2019-04-29 12:55:01.000000000 +0900 @@ -60,6 +60,7 @@ #include @@ -169,9 +182,9 @@ diff -uprN -X mkfile crypto/pkcs12/p12_add.c crypto.plan9/pkcs12/p12_add.c /* Pack an object into an OCTET STRING and turn into a safebag */ -diff -uprN -X mkfile crypto/pkcs12/p12_p8d.c crypto.plan9/pkcs12/p12_p8d.c ---- crypto/pkcs12/p12_p8d.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/pkcs12/p12_p8d.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/pkcs12/p12_p8d.c crypto/pkcs12/p12_p8d.c +--- crypto.orig/pkcs12/p12_p8d.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/pkcs12/p12_p8d.c 2019-04-29 12:55:01.000000000 +0900 @@ -59,6 +59,7 @@ #include @@ -180,9 +193,9 @@ diff -uprN -X mkfile crypto/pkcs12/p12_p8d.c crypto.plan9/pkcs12/p12_p8d.c PKCS8_PRIV_KEY_INFO * PKCS8_decrypt(const X509_SIG *p8, const char *pass, int passlen) -diff -uprN -X mkfile crypto/pkcs12/p12_p8e.c crypto.plan9/pkcs12/p12_p8e.c ---- crypto/pkcs12/p12_p8e.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/pkcs12/p12_p8e.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/pkcs12/p12_p8e.c crypto/pkcs12/p12_p8e.c +--- crypto.orig/pkcs12/p12_p8e.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/pkcs12/p12_p8e.c 2019-04-29 12:55:01.000000000 +0900 @@ -60,6 +60,7 @@ #include @@ -191,9 +204,9 @@ diff -uprN -X mkfile crypto/pkcs12/p12_p8e.c crypto.plan9/pkcs12/p12_p8e.c X509_SIG * PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, const char *pass, -diff -uprN -X mkfile crypto/pkcs12/p12_utl.c crypto.plan9/pkcs12/p12_utl.c ---- crypto/pkcs12/p12_utl.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/pkcs12/p12_utl.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/pkcs12/p12_utl.c crypto/pkcs12/p12_utl.c +--- crypto.orig/pkcs12/p12_utl.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/pkcs12/p12_utl.c 2019-04-29 12:55:01.000000000 +0900 @@ -61,6 +61,7 @@ #include @@ -202,9 +215,9 @@ diff -uprN -X mkfile crypto/pkcs12/p12_utl.c crypto.plan9/pkcs12/p12_utl.c /* Cheap and nasty Unicode stuff */ -diff -uprN -X mkfile crypto/pkcs7/bio_pk7.c crypto.plan9/pkcs7/bio_pk7.c ---- crypto/pkcs7/bio_pk7.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/pkcs7/bio_pk7.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/pkcs7/bio_pk7.c crypto/pkcs7/bio_pk7.c +--- crypto.orig/pkcs7/bio_pk7.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/pkcs7/bio_pk7.c 2019-04-29 12:55:01.000000000 +0900 @@ -53,6 +53,7 @@ */ @@ -213,9 +226,9 @@ diff -uprN -X mkfile crypto/pkcs7/bio_pk7.c crypto.plan9/pkcs7/bio_pk7.c #include #include -diff -uprN -X mkfile crypto/pkcs7/pk7_doit.c crypto.plan9/pkcs7/pk7_doit.c ---- crypto/pkcs7/pk7_doit.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/pkcs7/pk7_doit.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/pkcs7/pk7_doit.c crypto/pkcs7/pk7_doit.c +--- crypto.orig/pkcs7/pk7_doit.c 2019-04-29 12:49:57.000000000 +0900 ++++ crypto/pkcs7/pk7_doit.c 2019-04-29 12:55:01.000000000 +0900 @@ -64,6 +64,7 @@ #include #include @@ -224,9 +237,9 @@ diff -uprN -X mkfile crypto/pkcs7/pk7_doit.c crypto.plan9/pkcs7/pk7_doit.c static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype, void *value); -diff -uprN -X mkfile crypto/pkcs7/pk7_mime.c crypto.plan9/pkcs7/pk7_mime.c ---- crypto/pkcs7/pk7_mime.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/pkcs7/pk7_mime.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/pkcs7/pk7_mime.c crypto/pkcs7/pk7_mime.c +--- crypto.orig/pkcs7/pk7_mime.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/pkcs7/pk7_mime.c 2019-04-29 12:55:01.000000000 +0900 @@ -57,6 +57,7 @@ #include @@ -235,9 +248,9 @@ diff -uprN -X mkfile crypto/pkcs7/pk7_mime.c crypto.plan9/pkcs7/pk7_mime.c /* PKCS#7 wrappers round generalised stream and MIME routines */ -diff -uprN -X mkfile crypto/poly1305/poly1305-donna.c crypto.plan9/poly1305/poly1305-donna.c ---- crypto/poly1305/poly1305-donna.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/poly1305/poly1305-donna.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/poly1305/poly1305-donna.c crypto/poly1305/poly1305-donna.c +--- crypto.orig/poly1305/poly1305-donna.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/poly1305/poly1305-donna.c 2019-04-29 12:55:01.000000000 +0900 @@ -6,6 +6,7 @@ */ @@ -246,9 +259,9 @@ diff -uprN -X mkfile crypto/poly1305/poly1305-donna.c crypto.plan9/poly1305/poly static inline void poly1305_init(poly1305_context *ctx, const unsigned char key[32]); -diff -uprN -X mkfile crypto/x509/x509_vfy.c crypto.plan9/x509/x509_vfy.c ---- crypto/x509/x509_vfy.c 2019-03-18 01:33:08.000000000 +0900 -+++ crypto.plan9/x509/x509_vfy.c 2019-03-18 01:43:36.000000000 +0900 +diff -uprN -X mkfile crypto.orig/x509/x509_vfy.c crypto/x509/x509_vfy.c +--- crypto.orig/x509/x509_vfy.c 2019-03-18 01:33:08.000000000 +0900 ++++ crypto/x509/x509_vfy.c 2019-04-29 12:55:01.000000000 +0900 @@ -1881,7 +1881,7 @@ X509_cmp_time_internal(const ASN1_TIME * memset(&tm1, 0, sizeof(tm1)); @@ -258,9 +271,9 @@ diff -uprN -X mkfile crypto/x509/x509_vfy.c crypto.plan9/x509/x509_vfy.c if (type == -1) goto out; /* invalid time */ -diff -uprN -X mkfile crypto/x509/x_all.c crypto.plan9/x509/x_all.c ---- crypto/x509/x_all.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/x509/x_all.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/x509/x_all.c crypto/x509/x_all.c +--- crypto.orig/x509/x_all.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/x509/x_all.c 2019-04-29 12:55:01.000000000 +0900 @@ -61,6 +61,7 @@ #include @@ -269,9 +282,9 @@ diff -uprN -X mkfile crypto/x509/x_all.c crypto.plan9/x509/x_all.c #include #include #include -diff -uprN -X mkfile crypto/x509v3/v3_alt.c crypto.plan9/x509v3/v3_alt.c ---- crypto/x509v3/v3_alt.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/x509v3/v3_alt.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/x509v3/v3_alt.c crypto/x509v3/v3_alt.c +--- crypto.orig/x509v3/v3_alt.c 2019-04-29 12:49:57.000000000 +0900 ++++ crypto/x509v3/v3_alt.c 2019-04-29 12:55:01.000000000 +0900 @@ -62,6 +62,7 @@ #include #include @@ -280,9 +293,9 @@ diff -uprN -X mkfile crypto/x509v3/v3_alt.c crypto.plan9/x509v3/v3_alt.c static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); -diff -uprN -X mkfile crypto/x509v3/v3_bitst.c crypto.plan9/x509v3/v3_bitst.c ---- crypto/x509v3/v3_bitst.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/x509v3/v3_bitst.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/x509v3/v3_bitst.c crypto/x509v3/v3_bitst.c +--- crypto.orig/x509v3/v3_bitst.c 2019-04-29 12:49:57.000000000 +0900 ++++ crypto/x509v3/v3_bitst.c 2019-04-29 12:55:01.000000000 +0900 @@ -62,6 +62,7 @@ #include #include @@ -291,9 +304,9 @@ diff -uprN -X mkfile crypto/x509v3/v3_bitst.c crypto.plan9/x509v3/v3_bitst.c static BIT_STRING_BITNAME ns_cert_type_table[] = { {0, "SSL Client", "client"}, -diff -uprN -X mkfile crypto/x509v3/v3_enum.c crypto.plan9/x509v3/v3_enum.c ---- crypto/x509v3/v3_enum.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/x509v3/v3_enum.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/x509v3/v3_enum.c crypto/x509v3/v3_enum.c +--- crypto.orig/x509v3/v3_enum.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/x509v3/v3_enum.c 2019-04-29 12:55:01.000000000 +0900 @@ -59,6 +59,7 @@ #include #include @@ -302,9 +315,9 @@ diff -uprN -X mkfile crypto/x509v3/v3_enum.c crypto.plan9/x509v3/v3_enum.c static ENUMERATED_NAMES crl_reasons[] = { {CRL_REASON_UNSPECIFIED, "Unspecified", "unspecified"}, -diff -uprN -X mkfile crypto/x509v3/v3_ia5.c crypto.plan9/x509v3/v3_ia5.c ---- crypto/x509v3/v3_ia5.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/x509v3/v3_ia5.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/x509v3/v3_ia5.c crypto/x509v3/v3_ia5.c +--- crypto.orig/x509v3/v3_ia5.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/x509v3/v3_ia5.c 2019-04-29 12:55:01.000000000 +0900 @@ -60,6 +60,7 @@ #include @@ -313,9 +326,9 @@ diff -uprN -X mkfile crypto/x509v3/v3_ia5.c crypto.plan9/x509v3/v3_ia5.c #include #include #include -diff -uprN -X mkfile crypto/x509v3/v3_int.c crypto.plan9/x509v3/v3_int.c ---- crypto/x509v3/v3_int.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/x509v3/v3_int.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/x509v3/v3_int.c crypto/x509v3/v3_int.c +--- crypto.orig/x509v3/v3_int.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/x509v3/v3_int.c 2019-04-29 12:55:01.000000000 +0900 @@ -59,6 +59,7 @@ #include @@ -324,9 +337,9 @@ diff -uprN -X mkfile crypto/x509v3/v3_int.c crypto.plan9/x509v3/v3_int.c const X509V3_EXT_METHOD v3_crl_num = { .ext_nid = NID_crl_number, -diff -uprN -X mkfile crypto/x509v3/v3_ocsp.c crypto.plan9/x509v3/v3_ocsp.c ---- crypto/x509v3/v3_ocsp.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/x509v3/v3_ocsp.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/x509v3/v3_ocsp.c crypto/x509v3/v3_ocsp.c +--- crypto.orig/x509v3/v3_ocsp.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/x509v3/v3_ocsp.c 2019-04-29 12:55:01.000000000 +0900 @@ -64,6 +64,7 @@ #ifndef OPENSSL_NO_OCSP @@ -335,9 +348,9 @@ diff -uprN -X mkfile crypto/x509v3/v3_ocsp.c crypto.plan9/x509v3/v3_ocsp.c #include #include #include -diff -uprN -X mkfile crypto/x509v3/v3_pci.c crypto.plan9/x509v3/v3_pci.c ---- crypto/x509v3/v3_pci.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/x509v3/v3_pci.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/x509v3/v3_pci.c crypto/x509v3/v3_pci.c +--- crypto.orig/x509v3/v3_pci.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/x509v3/v3_pci.c 2019-04-29 12:55:01.000000000 +0900 @@ -40,6 +40,7 @@ #include #include @@ -346,9 +359,9 @@ diff -uprN -X mkfile crypto/x509v3/v3_pci.c crypto.plan9/x509v3/v3_pci.c static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext, BIO *out, int indent); -diff -uprN -X mkfile crypto/x509v3/v3_skey.c crypto.plan9/x509v3/v3_skey.c ---- crypto/x509v3/v3_skey.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/x509v3/v3_skey.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/x509v3/v3_skey.c crypto/x509v3/v3_skey.c +--- crypto.orig/x509v3/v3_skey.c 2018-07-03 23:22:46.000000000 +0900 ++++ crypto/x509v3/v3_skey.c 2019-04-29 12:55:01.000000000 +0900 @@ -60,6 +60,7 @@ #include @@ -357,9 +370,9 @@ diff -uprN -X mkfile crypto/x509v3/v3_skey.c crypto.plan9/x509v3/v3_skey.c #include static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, -diff -uprN -X mkfile crypto/x509v3/v3_utl.c crypto.plan9/x509v3/v3_utl.c ---- crypto/x509v3/v3_utl.c 2018-07-03 23:22:46.000000000 +0900 -+++ crypto.plan9/x509v3/v3_utl.c 2019-03-14 01:26:03.000000000 +0900 +diff -uprN -X mkfile crypto.orig/x509v3/v3_utl.c crypto/x509v3/v3_utl.c +--- crypto.orig/x509v3/v3_utl.c 2019-04-29 12:49:57.000000000 +0900 ++++ crypto/x509v3/v3_utl.c 2019-04-29 12:55:01.000000000 +0900 @@ -61,6 +61,7 @@ #include #include @@ -368,7 +381,7 @@ diff -uprN -X mkfile crypto/x509v3/v3_utl.c crypto.plan9/x509v3/v3_utl.c #include #include #include -@@ -682,7 +683,7 @@ static int equal_nocase(const unsigned c +@@ -720,7 +721,7 @@ equal_nocase(const unsigned char *patter skip_prefix(&pattern, &pattern_len, subject, subject_len, flags); if (pattern_len != subject_len) return 0; @@ -377,7 +390,7 @@ diff -uprN -X mkfile crypto/x509v3/v3_utl.c crypto.plan9/x509v3/v3_utl.c } /* Compare using strncmp. */ -@@ -697,7 +698,7 @@ static int equal_case(const unsigned cha +@@ -735,7 +736,7 @@ equal_case(const unsigned char *pattern, skip_prefix(&pattern, &pattern_len, subject, subject_len, flags); if (pattern_len != subject_len) return 0; diff --git a/plan9/ssl.patch b/plan9/ssl.patch index abf1009f20..ba9689e919 100644 --- a/plan9/ssl.patch +++ b/plan9/ssl.patch @@ -1,6 +1,6 @@ -diff -upr -X mkfile ssl/ssl_both.c ssl.plan9/ssl_both.c ---- ssl/ssl_both.c 2019-02-16 22:08:41.000000000 +0900 -+++ ssl.plan9/ssl_both.c 2019-03-14 01:27:10.000000000 +0900 +diff -uprN -X mkfile ssl.orig/ssl_both.c ssl/ssl_both.c +--- ssl.orig/ssl_both.c 2019-04-29 12:49:57.000000000 +0900 ++++ ssl/ssl_both.c 2019-04-29 12:55:07.000000000 +0900 @@ -317,7 +317,7 @@ ssl3_send_change_cipher_spec(SSL *s, int memset(&cbb, 0, sizeof(cbb)); @@ -10,9 +10,9 @@ diff -upr -X mkfile ssl/ssl_both.c ssl.plan9/ssl_both.c s->internal->init_buf->length)) goto err; if (!CBB_add_u8(&cbb, SSL3_MT_CCS)) -diff -upr -X mkfile ssl/ssl_cert.c ssl.plan9/ssl_cert.c ---- ssl/ssl_cert.c 2019-02-16 22:08:41.000000000 +0900 -+++ ssl.plan9/ssl_cert.c 2019-03-14 01:27:10.000000000 +0900 +diff -uprN -X mkfile ssl.orig/ssl_cert.c ssl/ssl_cert.c +--- ssl.orig/ssl_cert.c 2019-04-29 12:49:57.000000000 +0900 ++++ ssl/ssl_cert.c 2019-04-29 12:55:07.000000000 +0900 @@ -133,7 +133,7 @@ int SSL_get_ex_data_X509_STORE_CTX_idx(void) @@ -22,10 +22,10 @@ diff -upr -X mkfile ssl/ssl_cert.c ssl.plan9/ssl_cert.c int got_write_lock = 0; CRYPTO_r_lock(CRYPTO_LOCK_SSL_CTX); -diff -upr -X mkfile ssl/ssl_tlsext.c ssl.plan9/ssl_tlsext.c ---- ssl/ssl_tlsext.c 2019-02-16 22:08:41.000000000 +0900 -+++ ssl.plan9/ssl_tlsext.c 2019-03-14 01:27:10.000000000 +0900 -@@ -651,7 +651,7 @@ tlsext_sni_server_parse(SSL *s, CBS *cbs +diff -uprN -X mkfile ssl.orig/ssl_tlsext.c ssl/ssl_tlsext.c +--- ssl.orig/ssl_tlsext.c 2019-04-29 12:49:57.000000000 +0900 ++++ ssl/ssl_tlsext.c 2019-04-29 12:55:07.000000000 +0900 +@@ -648,7 +648,7 @@ tlsext_sni_server_parse(SSL *s, CBS *cbs *alert = TLS1_AD_UNRECOGNIZED_NAME; return 0; } @@ -34,9 +34,72 @@ diff -upr -X mkfile ssl/ssl_tlsext.c ssl.plan9/ssl_tlsext.c strlen(s->session->tlsext_hostname))) { *alert = TLS1_AD_UNRECOGNIZED_NAME; return 0; -diff -upr -X mkfile ssl/tls13_key_schedule.c ssl.plan9/tls13_key_schedule.c ---- ssl/tls13_key_schedule.c 2019-02-16 22:08:41.000000000 +0900 -+++ ssl.plan9/tls13_key_schedule.c 2019-03-17 22:56:33.000000000 +0900 +diff -uprN -X mkfile ssl.orig/ssl_transcript.c ssl/ssl_transcript.c +--- ssl.orig/ssl_transcript.c 2019-03-18 01:33:08.000000000 +0900 ++++ ssl/ssl_transcript.c 2019-04-29 14:04:24.000000000 +0900 +@@ -176,7 +176,7 @@ tls1_transcript_data(SSL *s, const unsig + if (S3I(s)->handshake_transcript == NULL) + return 0; + +- *data = S3I(s)->handshake_transcript->data; ++ *data = (const unsigned char*)S3I(s)->handshake_transcript->data; + *len = S3I(s)->handshake_transcript->length; + + return 1; +diff -uprN -X mkfile ssl.orig/t1_lib.c ssl/t1_lib.c +--- ssl.orig/t1_lib.c 2019-04-29 12:49:57.000000000 +0900 ++++ ssl/t1_lib.c 2019-04-29 14:07:47.000000000 +0900 +@@ -972,7 +972,7 @@ tls_decrypt_ticket(SSL *s, CBS *session_ + if (HMAC_Update(hctx, CBS_data(&ticket_encdata), + CBS_len(&ticket_encdata)) <= 0) + goto err; +- if (HMAC_Final(hctx, hmac, &hlen) <= 0) ++ if (HMAC_Final(hctx, hmac, (unsigned int*)&hlen) <= 0) + goto err; + + if (!CBS_mem_equal(&ticket_hmac, hmac, hlen)) +diff -uprN -X mkfile ssl.orig/tls13_client.c ssl/tls13_client.c +--- ssl.orig/tls13_client.c 2019-04-29 12:49:57.000000000 +0900 ++++ ssl/tls13_client.c 2019-04-29 14:12:59.000000000 +0900 +@@ -115,7 +115,7 @@ tls13_use_legacy_client(struct tls13_ctx + if (!BUF_MEM_grow_clean(s->internal->init_buf, CBS_len(&cbs) + 4)) + goto err; + +- if (!CBS_write_bytes(&cbs, s->internal->init_buf->data + 4, ++ if (!CBS_write_bytes(&cbs, (uint8_t *)s->internal->init_buf->data + 4, + s->internal->init_buf->length - 4, NULL)) + goto err; + +@@ -585,7 +585,7 @@ tls13_server_certificate_verify_recv(str + if (!CBB_add_bytes(&cbb, cert_verify_pad, sizeof(cert_verify_pad))) + goto err; + if (!CBB_add_bytes(&cbb, server_cert_verify_context, +- strlen(server_cert_verify_context))) ++ strlen((const char *)server_cert_verify_context))) + goto err; + if (!CBB_add_u8(&cbb, 0)) + goto err; +@@ -637,7 +637,7 @@ int + tls13_server_finished_recv(struct tls13_ctx *ctx) + { + struct tls13_secrets *secrets = ctx->hs->secrets; +- struct tls13_secret context = { .data = "", .len = 0 }; ++ struct tls13_secret context = { .data = (unsigned char *)"", .len = 0 }; + struct tls13_secret finished_key; + uint8_t transcript_hash[EVP_MAX_MD_SIZE]; + size_t transcript_hash_len; +@@ -718,7 +718,7 @@ int + tls13_client_finished_send(struct tls13_ctx *ctx) + { + struct tls13_secrets *secrets = ctx->hs->secrets; +- struct tls13_secret context = { .data = "", .len = 0 }; ++ struct tls13_secret context = { .data = (unsigned char *)"", .len = 0 }; + struct tls13_secret finished_key; + uint8_t transcript_hash[EVP_MAX_MD_SIZE]; + size_t transcript_hash_len; +diff -uprN -X mkfile ssl.orig/tls13_key_schedule.c ssl/tls13_key_schedule.c +--- ssl.orig/tls13_key_schedule.c 2019-02-16 22:08:41.000000000 +0900 ++++ ssl/tls13_key_schedule.c 2019-04-29 12:55:07.000000000 +0900 @@ -186,9 +186,9 @@ tls13_hkdf_expand_label(struct tls13_sec goto err; if (!CBB_add_u8_length_prefixed(&cbb, &child)) @@ -49,9 +112,9 @@ diff -upr -X mkfile ssl/tls13_key_schedule.c ssl.plan9/tls13_key_schedule.c goto err; if (!CBB_add_u8_length_prefixed(&cbb, &child)) goto err; -diff -upr -X mkfile ssl/tls13_record_layer.c ssl.plan9/tls13_record_layer.c ---- ssl/tls13_record_layer.c 2019-03-18 01:33:08.000000000 +0900 -+++ ssl.plan9/tls13_record_layer.c 2019-03-17 23:03:15.000000000 +0900 +diff -uprN -X mkfile ssl.orig/tls13_record_layer.c ssl/tls13_record_layer.c +--- ssl.orig/tls13_record_layer.c 2019-04-29 12:49:57.000000000 +0900 ++++ ssl/tls13_record_layer.c 2019-04-29 12:55:07.000000000 +0900 @@ -253,7 +253,7 @@ tls13_record_layer_set_traffic_key(const const EVP_MD *hash, struct tls13_secret *iv, struct tls13_secret *nonce, struct tls13_secret *traffic_key) diff --git a/plan9/tls.patch b/plan9/tls.patch index 8d83c64630..f6f7029879 100644 --- a/plan9/tls.patch +++ b/plan9/tls.patch @@ -1,7 +1,33 @@ -diff -uprN -X mkfile tls/tls.c tls.plan9/tls.c ---- tls/tls.c 2019-02-16 22:08:41.000000000 +0900 -+++ tls.plan9/tls.c 2019-03-14 01:27:17.000000000 +0900 -@@ -421,7 +421,7 @@ tls_configure_ssl(struct tls *ctx, SSL_C +diff -uprN -X mkfile tls.orig/tls.c tls/tls.c +--- tls.orig/tls.c 2019-04-29 12:49:58.000000000 +0900 ++++ tls/tls.c 2019-04-29 14:28:00.000000000 +0900 +@@ -274,8 +274,10 @@ tls_configure(struct tls *ctx, struct tl + int + tls_cert_hash(X509 *cert, char **hash) + { +- char d[EVP_MAX_MD_SIZE], *dhex = NULL; +- int dlen, rv = -1; ++ unsigned char d[EVP_MAX_MD_SIZE]; ++ char *dhex = NULL; ++ int rv = -1; ++ unsigned int dlen; + + free(*hash); + *hash = NULL; +@@ -301,8 +303,10 @@ tls_cert_hash(X509 *cert, char **hash) + int + tls_cert_pubkey_hash(X509 *cert, char **hash) + { +- char d[EVP_MAX_MD_SIZE], *dhex = NULL; +- int dlen, rv = -1; ++ unsigned char d[EVP_MAX_MD_SIZE]; ++ char *dhex = NULL; ++ int rv = -1; ++ unsigned int dlen; + + free(*hash); + *hash = NULL; +@@ -423,7 +427,7 @@ tls_configure_ssl(struct tls *ctx, SSL_C SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1_2); if (ctx->config->alpn != NULL) { @@ -10,9 +36,9 @@ diff -uprN -X mkfile tls/tls.c tls.plan9/tls.c ctx->config->alpn_len) != 0) { tls_set_errorx(ctx, "failed to set alpn"); goto err; -diff -uprN -X mkfile tls/tls_conninfo.c tls.plan9/tls_conninfo.c ---- tls/tls_conninfo.c 2018-07-03 23:22:47.000000000 +0900 -+++ tls.plan9/tls_conninfo.c 2019-03-14 01:27:17.000000000 +0900 +diff -uprN -X mkfile tls.orig/tls_conninfo.c tls/tls_conninfo.c +--- tls.orig/tls_conninfo.c 2018-07-03 23:22:47.000000000 +0900 ++++ tls/tls_conninfo.c 2019-04-29 12:55:11.000000000 +0900 @@ -119,9 +119,9 @@ tls_get_peer_cert_times(struct tls *ctx, goto err; if ((after = X509_get_notAfter(ctx->ssl_peer_cert)) == NULL) @@ -25,9 +51,9 @@ diff -uprN -X mkfile tls/tls_conninfo.c tls.plan9/tls_conninfo.c goto err; if (!ASN1_time_tm_clamp_notafter(&after_tm)) goto err; -diff -uprN -X mkfile tls/tls_ocsp.c tls.plan9/tls_ocsp.c ---- tls/tls_ocsp.c 2018-07-03 23:22:47.000000000 +0900 -+++ tls.plan9/tls_ocsp.c 2019-03-14 01:27:17.000000000 +0900 +diff -uprN -X mkfile tls.orig/tls_ocsp.c tls/tls_ocsp.c +--- tls.orig/tls_ocsp.c 2018-07-03 23:22:47.000000000 +0900 ++++ tls/tls_ocsp.c 2019-04-29 12:55:11.000000000 +0900 @@ -61,7 +61,7 @@ tls_ocsp_asn1_parse_time(struct tls *ctx if (gt == NULL) return -1; @@ -37,9 +63,9 @@ diff -uprN -X mkfile tls/tls_ocsp.c tls.plan9/tls_ocsp.c V_ASN1_GENERALIZEDTIME) == -1) return -1; if ((*gt_time = timegm(&tm)) == -1) -diff -uprN -X mkfile tls/tls_server.c tls.plan9/tls_server.c ---- tls/tls_server.c 2018-07-03 23:22:47.000000000 +0900 -+++ tls.plan9/tls_server.c 2019-03-14 01:27:17.000000000 +0900 +diff -uprN -X mkfile tls.orig/tls_server.c tls/tls_server.c +--- tls.orig/tls_server.c 2018-07-03 23:22:47.000000000 +0900 ++++ tls/tls_server.c 2019-04-29 12:55:11.000000000 +0900 @@ -67,7 +67,7 @@ tls_server_alpn_cb(SSL *ssl, const unsig struct tls *ctx = arg; @@ -49,9 +75,9 @@ diff -uprN -X mkfile tls/tls_server.c tls.plan9/tls_server.c OPENSSL_NPN_NEGOTIATED) return (SSL_TLSEXT_ERR_OK); -diff -uprN -X mkfile tls/tls_verify.c tls.plan9/tls_verify.c ---- tls/tls_verify.c 2018-07-03 23:22:47.000000000 +0900 -+++ tls.plan9/tls_verify.c 2019-03-14 01:27:17.000000000 +0900 +diff -uprN -X mkfile tls.orig/tls_verify.c tls/tls_verify.c +--- tls.orig/tls_verify.c 2018-07-03 23:22:47.000000000 +0900 ++++ tls/tls_verify.c 2019-04-29 12:55:11.000000000 +0900 @@ -134,7 +134,7 @@ tls_check_subject_altname(struct tls *ct data = ASN1_STRING_data(altname->d.dNSName); len = ASN1_STRING_length(altname->d.dNSName);