Permalink
Browse files

openssl: avoid BIO_reset() warnings since it returns a value

  • Loading branch information...
bagder committed Dec 10, 2015
1 parent fa9332d commit dd1b44c6126a03c6a696fa749e2a32eb616e9131
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/vtls/openssl.c
View
@@ -2217,7 +2217,8 @@ static int asn1_object_dump(ASN1_OBJECT *a, char *buf, size_t len)
do { \
long info_len = BIO_get_mem_data(mem, &ptr); \
Curl_ssl_push_certinfo_len(data, _num, _label, ptr, info_len); \
BIO_reset(mem); \
if(1!=BIO_reset(mem)) \
break; \
} WHILE_FALSE
static void pubkey_show(struct SessionHandle *data,
@@ -2520,12 +2521,12 @@ static CURLcode servercert(struct connectdata *conn,
ASN1_TIME_print(mem, X509_get_notBefore(connssl->server_cert));
len = BIO_get_mem_data(mem, (char **) &ptr);
infof(data, "\t start date: %.*s\n", len, ptr);
BIO_reset(mem);
rc = BIO_reset(mem);
ASN1_TIME_print(mem, X509_get_notAfter(connssl->server_cert));
len = BIO_get_mem_data(mem, (char **) &ptr);
infof(data, "\t expire date: %.*s\n", len, ptr);
BIO_reset(mem);
rc = BIO_reset(mem);
BIO_free(mem);

3 comments on commit dd1b44c

@gvanem

This comment has been minimized.

Show comment
Hide comment
@gvanem

gvanem Feb 5, 2016

Member

Here is another warning from gcc 5.1 (TDM-MingW):

vtls/openssl.c:2246:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0; i<sk_X509_EXTENSION_num(exts); i++) {
             ^
Member

gvanem replied Feb 5, 2016

Here is another warning from gcc 5.1 (TDM-MingW):

vtls/openssl.c:2246:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(i=0; i<sk_X509_EXTENSION_num(exts); i++) {
             ^
@jay

This comment has been minimized.

Show comment
Hide comment
@jay

jay Feb 7, 2016

Member

@gvanem sk_X509_EXTENSION_num is a macro that in 1.0.2 uses sk_num to retrieve what is an integer. Regardless I fixed it in d6a8869, thanks. What version of OpenSSL are you using?

Member

jay replied Feb 7, 2016

@gvanem sk_X509_EXTENSION_num is a macro that in 1.0.2 uses sk_num to retrieve what is an integer. Regardless I fixed it in d6a8869, thanks. What version of OpenSSL are you using?

@gvanem

This comment has been minimized.

Show comment
Hide comment
@gvanem

gvanem Feb 7, 2016

Member

What version of OpenSSL are you using?

1.1.0-pre3-dev the bleeding edge,

Member

gvanem replied Feb 7, 2016

What version of OpenSSL are you using?

1.1.0-pre3-dev the bleeding edge,

Please sign in to comment.