comparison src/event/ngx_event_openssl_stapling.c @ 6842:25d0d6dabe00

SSL: backed out changeset e7cb5deb951d, reimplemented properly. 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().
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 15 Dec 2016 19:00:23 +0300
parents e7cb5deb951d
children e3723f2a11b7
comparison
equal deleted inserted replaced
6841:e7cb5deb951d 6842:25d0d6dabe00
771 771
772 static time_t 772 static time_t
773 ngx_ssl_stapling_time(ASN1_GENERALIZEDTIME *asn1time) 773 ngx_ssl_stapling_time(ASN1_GENERALIZEDTIME *asn1time)
774 { 774 {
775 BIO *bio; 775 BIO *bio;
776 u_char *value; 776 char *value;
777 size_t len; 777 size_t len;
778 time_t time; 778 time_t time;
779 779
780 /* 780 /*
781 * OpenSSL doesn't provide a way to convert ASN1_GENERALIZEDTIME 781 * OpenSSL doesn't provide a way to convert ASN1_GENERALIZEDTIME
791 791
792 /* fake weekday prepended to match C asctime() format */ 792 /* fake weekday prepended to match C asctime() format */
793 793
794 BIO_write(bio, "Tue ", sizeof("Tue ") - 1); 794 BIO_write(bio, "Tue ", sizeof("Tue ") - 1);
795 ASN1_GENERALIZEDTIME_print(bio, asn1time); 795 ASN1_GENERALIZEDTIME_print(bio, asn1time);
796 len = BIO_get_mem_data(bio, (char **) &value); 796 len = BIO_get_mem_data(bio, &value);
797 797
798 time = ngx_parse_http_time(value, len); 798 time = ngx_parse_http_time((u_char *) value, len);
799 799
800 BIO_free(bio); 800 BIO_free(bio);
801 801
802 return time; 802 return time;
803 } 803 }