1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-20 02:42:09 +03:00

openssl: silence -Wunused-value warnings

Seen with gcc 12.

Manual: https://www.openssl.org/docs/man3.1/man3/BIO_reset.html

```
./quictls/linux-a64-musl/usr/include/openssl/bio.h:555:34: warning: value computed is not used [-Wunused-value]
  555 | # define BIO_reset(b)            (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./libssh2/src/openssl.c:3518:5: note: in expansion of macro 'BIO_reset'
./libssh2/src/openssl.c:3884:5: note: in expansion of macro 'BIO_reset'
./libssh2/src/openssl.c:3995:5: note: in expansion of macro 'BIO_reset'
```
Ref: https://github.com/curl/curl-for-win/actions/runs/6696392318/job/18194032712#step:3:5060

Closes #1205
This commit is contained in:
Viktor Szakats
2023-10-30 17:42:32 +00:00
parent f64e6318f0
commit bf285500e6

View File

@@ -3515,7 +3515,7 @@ _libssh2_pub_priv_keyfile(LIBSSH2_SESSION *session,
"file: Unable to open private key file"); "file: Unable to open private key file");
} }
BIO_reset(bp); (void)BIO_reset(bp);
pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void *)passphrase); pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void *)passphrase);
BIO_free(bp); BIO_free(bp);
@@ -3881,7 +3881,7 @@ _libssh2_pub_priv_keyfilememory(LIBSSH2_SESSION *session,
return _libssh2_error(session, LIBSSH2_ERROR_ALLOC, return _libssh2_error(session, LIBSSH2_ERROR_ALLOC,
"Unable to allocate memory when" "Unable to allocate memory when"
"computing public key"); "computing public key");
BIO_reset(bp); (void)BIO_reset(bp);
pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void *)passphrase); pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void *)passphrase);
#ifdef HAVE_SSLERROR_BAD_DECRYPT #ifdef HAVE_SSLERROR_BAD_DECRYPT
sslError = ERR_get_error(); sslError = ERR_get_error();
@@ -3992,7 +3992,7 @@ _libssh2_sk_pub_keyfilememory(LIBSSH2_SESSION *session,
return _libssh2_error(session, LIBSSH2_ERROR_ALLOC, return _libssh2_error(session, LIBSSH2_ERROR_ALLOC,
"Unable to allocate memory when" "Unable to allocate memory when"
"computing public key"); "computing public key");
BIO_reset(bp); (void)BIO_reset(bp);
pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void *)passphrase); pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void *)passphrase);
BIO_free(bp); BIO_free(bp);