1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00

mbedtls: fix -Wunused-variable when building with LIBSSH2_NO_RSA

Fixing:
```
src/mbedtls.c:721:24: error: unused variable 'method_buf_len' [-Wunused-variable]
  721 |     size_t keylen = 0, method_buf_len = 0;
      |                        ^~~~~~~~~~~~~~
src/mbedtls.c:717:56: error: unused parameter 'pkey' [-Wunused-parameter]
  717 |                              const mbedtls_pk_context *pkey)
      |                                                        ^
```

Closes #2623
This commit is contained in:
Viktor Szakats
2026-09-14 00:17:29 +02:00
parent 45aa5c5fa4
commit 738c2ac4d1

View File

@@ -718,12 +718,15 @@ static int mbed_pub_priv_key(LIBSSH2_SESSION *session, char **method,
{
char *method_buf = NULL;
unsigned char *key = NULL;
size_t keylen = 0, method_buf_len = 0;
size_t keylen = 0;
int ret = 0;
(void)pkey;
#if LIBSSH2_RSA
if(mbedtls_pk_get_type(pkey) == MBEDTLS_PK_RSA) {
mbedtls_rsa_context *rsa;
size_t method_buf_len;
/* write method */
method_buf_len = sizeof("ssh-rsa") - 1;