summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2022-05-20 02:01:53 +0200
committerDirk Engling <erdgeist@erdgeist.org>2022-05-20 02:01:53 +0200
commit133a4bbe527dc8067238e426a43fc90e44972e7d (patch)
tree9f2e5c0b98469a7c745876dece083eb13e84b40f
parent5ded7d393d450303b74aba21df0a6755bbc4360d (diff)
Make mbedtls version dispatch more readable
-rwxr-xr-xvchat-tls.c9
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) {