]> git.kaiwu.me - nginx.git/commitdiff
SSL: backed out changeset e7cb5deb951d, reimplemented properly.
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 15 Dec 2016 16:00:23 +0000 (19:00 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 15 Dec 2016 16:00:23 +0000 (19:00 +0300)
Changeset e7cb5deb951d breaks build on CentOS 5 with "dereferencing
type-punned pointer will break strict-aliasing rules" warning.  It is
backed out.

Instead, to keep builds with BoringSSL happy, type of the "value"
variable changed to "char *", and an explicit cast added before calling
ngx_parse_http_time().

src/event/ngx_event_openssl.c
src/event/ngx_event_openssl_stapling.c

index 39f7cae89c41aeeb4a6a3f9e84245988159a9429..c98e3c2b023d2761be389ffcce54c122c58bc643 100644 (file)
@@ -4049,7 +4049,7 @@ ngx_ssl_parse_time(
     ASN1_TIME *asn1time)
 {
     BIO     *bio;
-    u_char  *value;
+    char    *value;
     size_t   len;
     time_t   time;
 
@@ -4069,9 +4069,9 @@ ngx_ssl_parse_time(
 
     BIO_write(bio, "Tue ", sizeof("Tue ") - 1);
     ASN1_TIME_print(bio, asn1time);
-    len = BIO_get_mem_data(bio, (char **) &value);
+    len = BIO_get_mem_data(bio, &value);
 
-    time = ngx_parse_http_time(value, len);
+    time = ngx_parse_http_time((u_char *) value, len);
 
     BIO_free(bio);
 
index 5e1eb502d7e2d62f361483f39a4b34638b0bfe02..d332c112e220b343b2b4499ac5ec2a7a5985f4fa 100644 (file)
@@ -773,7 +773,7 @@ static time_t
 ngx_ssl_stapling_time(ASN1_GENERALIZEDTIME *asn1time)
 {
     BIO     *bio;
-    u_char  *value;
+    char    *value;
     size_t   len;
     time_t   time;
 
@@ -793,9 +793,9 @@ ngx_ssl_stapling_time(ASN1_GENERALIZEDTIME *asn1time)
 
     BIO_write(bio, "Tue ", sizeof("Tue ") - 1);
     ASN1_GENERALIZEDTIME_print(bio, asn1time);
-    len = BIO_get_mem_data(bio, (char **) &value);
+    len = BIO_get_mem_data(bio, &value);
 
-    time = ngx_parse_http_time(value, len);
+    time = ngx_parse_http_time((u_char *) value, len);
 
     BIO_free(bio);