diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2022-05-20 02:01:53 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2022-05-20 02:01:53 +0200 |
commit | 133a4bbe527dc8067238e426a43fc90e44972e7d (patch) | |
tree | 9f2e5c0b98469a7c745876dece083eb13e84b40f /vchat-tls.c | |
parent | 5ded7d393d450303b74aba21df0a6755bbc4360d (diff) |
Make mbedtls version dispatch more readable
Diffstat (limited to 'vchat-tls.c')
-rwxr-xr-x | vchat-tls.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/vchat-tls.c b/vchat-tls.c index c4b014a..dbfd927 100755 --- a/vchat-tls.c +++ b/vchat-tls.c | |||
@@ -481,12 +481,11 @@ int vc_tls_connect( int serverfd, vc_x509store_t *vc_store ) | |||
481 | char *password = NULL; | 481 | char *password = NULL; |
482 | char password_buf[1024]; | 482 | char password_buf[1024]; |
483 | while (1) { | 483 | while (1) { |
484 | #if MBEDTLS_SSL_MAJOR_VERSION_3 < 3 | 484 | ret = mbedtls_pk_parse_keyfile(&s->_key, vc_store->keyfile, password |
485 | ret = mbedtls_pk_parse_keyfile(&s->_key, vc_store->keyfile, password); | 485 | #if MBEDTLS_SSL_MAJOR_VERSION_3 >= 3 |
486 | #else | 486 | , mbedtls_ctr_drbg_random, &s->_ctr_drbg |
487 | // ret = fprintf(stderr, "ERROR: %d\n", mbedtls_pk_parse_keyfile(&s->_key, vc_store->keyfile, password, mbedtls_ctr_drbg_random, &s->_ctr_drbg)); | ||
488 | ret = mbedtls_pk_parse_keyfile(&s->_key, vc_store->keyfile, password, mbedtls_ctr_drbg_random, &s->_ctr_drbg); | ||
489 | #endif | 487 | #endif |
488 | ); | ||
490 | if (!ret) | 489 | if (!ret) |
491 | break; | 490 | break; |
492 | if (ret != MBEDTLS_ERR_PK_PASSWORD_REQUIRED && ret != MBEDTLS_ERR_PK_PASSWORD_MISMATCH) { | 491 | if (ret != MBEDTLS_ERR_PK_PASSWORD_REQUIRED && ret != MBEDTLS_ERR_PK_PASSWORD_MISMATCH) { |