Skip to content

Commit

Permalink
openssl: avoid BIO_reset() warnings since it returns a value
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Dec 10, 2015
1 parent fa9332d commit dd1b44c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/vtls/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);

Expand Down

3 comments on commit dd1b44c

@gvanem
Copy link
Contributor

@gvanem gvanem commented on dd1b44c Feb 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

@jay jay commented on dd1b44c Feb 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Contributor

@gvanem gvanem commented on dd1b44c Feb 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What version of OpenSSL are you using?

1.1.0-pre3-dev the bleeding edge,

Please sign in to comment.