View | Details | Raw Unified | Return to bug 234447
Collapse All | Expand All

(-)www/mod_pagespeed/Makefile (-1 / +1 lines)
Lines 2-8 Link Here
2
2
3
PORTNAME=	mod_pagespeed
3
PORTNAME=	mod_pagespeed
4
PORTVERSION=	1.12.34.2
4
PORTVERSION=	1.12.34.2
5
PORTREVISION=	17
5
PORTREVISION=	18
6
PORTEPOCH=	1
6
PORTEPOCH=	1
7
CATEGORIES=	www devel
7
CATEGORIES=	www devel
8
MASTER_SITES=	LOCAL/mmokhi:boringssl,chromium_base,chromium_build,googleurl,gflags_arch,gflags_src,libjpeg_turbo_src,yasm_patched,libwebp,modpb64 \
8
MASTER_SITES=	LOCAL/mmokhi:boringssl,chromium_base,chromium_build,googleurl,gflags_arch,gflags_src,libjpeg_turbo_src,yasm_patched,libwebp,modpb64 \
(-)www/mod_pagespeed/files/patch-third__party_grpc_src_src_core_lib_security_credentials_jwt_jwt__verifier.c (+44 lines)
Line 0 Link Here
1
--- third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c.orig	2018-12-27 21:47:56 UTC
2
+++ third_party/grpc/src/src/core/lib/security/credentials/jwt/jwt_verifier.c
3
@@ -467,6 +467,7 @@ static EVP_PKEY *pkey_from_jwk(const grp
4
   const grpc_json *key_prop;
5
   RSA *rsa = NULL;
6
   EVP_PKEY *result = NULL;
7
+  BIGNUM *ee = NULL, *nn = NULL;
8
 
9
   GPR_ASSERT(kty != NULL && json != NULL);
10
   if (strcmp(kty, "RSA") != 0) {
11
@@ -480,14 +481,29 @@ static EVP_PKEY *pkey_from_jwk(const grp
12
   }
13
   for (key_prop = json->child; key_prop != NULL; key_prop = key_prop->next) {
14
     if (strcmp(key_prop->key, "n") == 0) {
15
-      rsa->n = bignum_from_base64(validate_string_field(key_prop, "n"));
16
-      if (rsa->n == NULL) goto end;
17
+      BIGNUM *n = bignum_from_base64(validate_string_field(key_prop, "n"));
18
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
19
+      rsa->n = n;
20
+#else
21
+      RSA_set0_key(rsa, &n, NULL, NULL);
22
+#endif
23
+      if (n == NULL) goto end;
24
     } else if (strcmp(key_prop->key, "e") == 0) {
25
-      rsa->e = bignum_from_base64(validate_string_field(key_prop, "e"));
26
-      if (rsa->e == NULL) goto end;
27
+      BIGNUM *e = bignum_from_base64(validate_string_field(key_prop, "e"));
28
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
29
+      rsa->e = e;
30
+#else
31
+      RSA_set0_key(rsa, NULL, &e, NULL);
32
+#endif
33
+      if (e == NULL) goto end;
34
     }
35
   }
36
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
37
   if (rsa->e == NULL || rsa->n == NULL) {
38
+#else
39
+  RSA_get0_key(rsa, &nn, &ee, NULL);
40
+  if (ee == NULL || nn == NULL) {
41
+#endif
42
     gpr_log(GPR_ERROR, "Missing RSA public key field.");
43
     goto end;
44
   }
(-)www/mod_pagespeed/files/patch-third__party_serf_instaweb__ssl__buckets.c (-1 / +141 lines)
Lines 1-6 Link Here
1
--- third_party/serf/instaweb_ssl_buckets.c.orig	2017-06-08 22:22:39 UTC
1
--- third_party/serf/instaweb_ssl_buckets.c.orig	2017-06-08 22:22:39 UTC
2
+++ third_party/serf/instaweb_ssl_buckets.c
2
+++ third_party/serf/instaweb_ssl_buckets.c
3
@@ -1697,11 +1697,15 @@ int serf_ssl_cert_depth(const serf_ssl_c
3
@@ -253,7 +253,11 @@ apps_ssl_info_callback(const SSL *s, int
4
 /* Returns the amount read. */
5
 static int bio_bucket_read(BIO *bio, char *in, int inlen)
6
 {
7
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
8
     serf_ssl_context_t *ctx = bio->ptr;
9
+#else
10
+    serf_ssl_context_t *ctx = BIO_get_data(bio);
11
+#endif
12
     const char *data;
13
     apr_status_t status;
14
     apr_size_t len;
15
@@ -297,7 +301,11 @@ static int bio_bucket_read(BIO *bio, cha
16
 /* Returns the amount written. */
17
 static int bio_bucket_write(BIO *bio, const char *in, int inl)
18
 {
19
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
20
     serf_ssl_context_t *ctx = bio->ptr;
21
+#else
22
+    serf_ssl_context_t *ctx = BIO_get_data(bio);
23
+#endif
24
     serf_bucket_t *tmp;
25
 
26
     serf__log(SSL_VERBOSE, __FILE__, "bio_bucket_write called for %d bytes\n",
27
@@ -325,7 +333,11 @@ static int bio_bucket_write(BIO *bio, co
28
 /* Returns the amount read. */
29
 static int bio_file_read(BIO *bio, char *in, int inlen)
30
 {
31
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
32
     apr_file_t *file = bio->ptr;
33
+#else
34
+    apr_file_t *file = BIO_get_data(bio);
35
+#endif
36
     apr_status_t status;
37
     apr_size_t len;
38
 
39
@@ -350,7 +362,11 @@ static int bio_file_read(BIO *bio, char 
40
 /* Returns the amount written. */
41
 static int bio_file_write(BIO *bio, const char *in, int inl)
42
 {
43
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
44
     apr_file_t *file = bio->ptr;
45
+#else
46
+    apr_file_t *file = BIO_get_data(bio);
47
+#endif
48
     apr_size_t nbytes;
49
 
50
     BIO_clear_retry_flags(bio);
51
@@ -368,10 +384,16 @@ static int bio_file_gets(BIO *bio, char 
52
 
53
 static int bio_bucket_create(BIO *bio)
54
 {
55
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
56
     bio->shutdown = 1;
57
     bio->init = 1;
58
     bio->num = -1;
59
     bio->ptr = NULL;
60
+#else
61
+    BIO_set_shutdown(bio, 1);
62
+    BIO_set_init(bio, 1);
63
+    BIO_set_data(bio, NULL);
64
+#endif
65
 
66
     return 1;
67
 }
68
@@ -405,6 +427,7 @@ static long bio_bucket_ctrl(BIO *bio, in
69
     return ret;
70
 }
71
 
72
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
73
 static BIO_METHOD bio_bucket_method = {
74
     BIO_TYPE_MEM,
75
     "Serf SSL encryption and decryption buckets",
76
@@ -434,6 +457,11 @@ static BIO_METHOD bio_file_method = {
77
     NULL /* sslc does not have the callback_ctrl field */
78
 #endif
79
 };
80
+#else
81
+static BIO_METHOD *bio_bucket_method = NULL;
82
+static BIO_METHOD *bio_file_method = NULL;
83
+#endif
84
+
85
 
86
 typedef enum san_copy_t {
87
     EscapeNulAndCopy = 0,
88
@@ -1088,7 +1116,9 @@ static void init_ssl_libraries(void)
89
         }
90
 #endif
91
 
92
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
93
         CRYPTO_malloc_init();
94
+#endif
95
         ERR_load_crypto_strings();
96
         SSL_load_error_strings();
97
         SSL_library_init();
98
@@ -1172,8 +1202,22 @@ static int ssl_need_client_cert(SSL *ssl
99
             continue;
100
         }
101
 
102
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
103
         bio = BIO_new(&bio_file_method);
104
         bio->ptr = cert_file;
105
+#else
106
+        if (bio_file_method == NULL) {
107
+            bio_file_method = BIO_meth_new(BIO_TYPE_FILE, "Wrapper around APR file structures");
108
+            BIO_meth_set_write(bio_file_method, bio_file_write);
109
+            BIO_meth_set_read(bio_file_method, bio_file_read);
110
+            BIO_meth_set_gets(bio_file_method, bio_file_gets);
111
+            BIO_meth_set_ctrl(bio_file_method, bio_bucket_ctrl);
112
+            BIO_meth_set_create(bio_file_method, bio_bucket_create);
113
+            BIO_meth_set_destroy(bio_file_method, bio_bucket_destroy);
114
+        }
115
+        bio = BIO_new(bio_file_method);
116
+        BIO_set_data(bio, cert_file);
117
+#endif
118
 
119
         ctx->cert_path = cert_path;
120
         p12 = d2i_PKCS12_bio(bio, NULL);
121
@@ -1351,8 +1395,21 @@ static serf_ssl_context_t *ssl_init_cont
122
     disable_compression(ssl_ctx);
123
 
124
     ssl_ctx->ssl = SSL_new(ssl_ctx->ctx);
125
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
126
     ssl_ctx->bio = BIO_new(&bio_bucket_method);
127
     ssl_ctx->bio->ptr = ssl_ctx;
128
+#else
129
+    if (bio_bucket_method == NULL) {
130
+        bio_bucket_method = BIO_meth_new(BIO_TYPE_MEM, "Serf SSL encryption and decryption buckets");
131
+        BIO_meth_set_write(bio_bucket_method, bio_bucket_write);
132
+        BIO_meth_set_read(bio_bucket_method, bio_bucket_read);
133
+        BIO_meth_set_ctrl(bio_bucket_method, bio_bucket_ctrl);
134
+        BIO_meth_set_create(bio_bucket_method, bio_bucket_create);
135
+        BIO_meth_set_destroy(bio_bucket_method, bio_bucket_destroy);
136
+    }
137
+    ssl_ctx->bio = BIO_new(bio_bucket_method);
138
+    BIO_set_data(ssl_ctx->bio, ssl_ctx);
139
+#endif
140
 
141
     SSL_set_bio(ssl_ctx->ssl, ssl_ctx->bio, ssl_ctx->bio);
142
 
143
@@ -1697,11 +1754,15 @@ int serf_ssl_cert_depth(const serf_ssl_c
4
 int serf_ssl_check_host(const serf_ssl_certificate_t *cert,
144
 int serf_ssl_check_host(const serf_ssl_certificate_t *cert,
5
                         const char* hostname)
145
                         const char* hostname)
6
 {
146
 {

Return to bug 234447