diff --git a/src/internal.c b/src/internal.c index e397490f8..81710b0a4 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1873,6 +1873,14 @@ int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method, void* heap) ctx->noPskDheKe = 1; #endif +#if defined(WOLFSSL_QT) + /* Qt retrieves supported cipher list at initialization + * from get_cipher_compat(). + * Qt doesn't not allow to use a cipher if it is not in the supported list. + * Therefore, we need to enable PSK cipher at the beginning. + */ + ctx->havePSK = 1; +#endif ctx->heap = heap; /* wolfSSL_CTX_load_static_memory sets */ #ifdef HAVE_WOLF_EVENT diff --git a/tests/api.c b/tests/api.c index ad2ad6dc1..d23eaf576 100644 --- a/tests/api.c +++ b/tests/api.c @@ -968,7 +968,9 @@ static void test_wolfSSL_CTX_load_verify_locations(void) WS_RETURN_CODE(WOLFSSL_BAD_FILE,WOLFSSL_FAILURE)); -#if !defined(NO_WOLFSSL_DIR) && !defined(WOLFSSL_TIRTOS) +#if !defined(NO_WOLFSSL_DIR) && !defined(WOLFSSL_TIRTOS) && \ + (defined(WOLFSSL_QT) && \ + !(WOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS & WOLFSSL_LOAD_FLAG_IGNORE_BAD_PATH_ERR)) /* invalid path */ AssertIntEQ(wolfSSL_CTX_load_verify_locations(ctx, NULL, bogusFile), WS_RETURN_CODE(BAD_PATH_ERROR,WOLFSSL_FAILURE)); @@ -1313,8 +1315,10 @@ static int test_wolfSSL_CertManagerLoadCABuffer(void) #ifdef NO_RSA AssertIntEQ(ret, ASN_UNKNOWN_OID_E); #else + #if !(WOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS & WOLFSSL_LOAD_FLAG_DATE_ERR_OKAY) AssertIntEQ(ret, ASN_AFTER_DATE_E); #endif + #endif #endif return ret; @@ -1991,7 +1995,7 @@ static void test_server_wolfSSL_new(void) /* invalid context */ AssertNull(ssl = wolfSSL_new(NULL)); -#ifndef WOLFSSL_SESSION_EXPORT +#if !defined(WOLFSSL_SESSION_EXPORT) && !defined(WOLFSSL_QT) AssertNull(ssl = wolfSSL_new(ctx_nocert)); #endif