Skip to content

Commit

Permalink
SSL: backed out changeset e7cb5deb951d, reimplemented properly.
Browse files Browse the repository at this point in the history
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().
  • Loading branch information
mdounin committed Dec 15, 2016
1 parent 592dbcc commit 3294292
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/event/ngx_event_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4049,7 +4049,7 @@ ngx_ssl_parse_time(
ASN1_TIME *asn1time)
{
BIO *bio;
u_char *value;
char *value;
size_t len;
time_t time;

Expand All @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions src/event/ngx_event_openssl_stapling.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);

Expand Down

0 comments on commit 3294292

Please sign in to comment.