Minor cleanup to fix errors with some unit tests

With the new feature MBEDTLS_PSA_CRYPTO_CONFIG, needed to
add support that when the feature is disabled, if there
are defines like MBEDTLS_ECDSA_C defined, then the PSA_WANT_
equivalent define is also enabled. This ensures the guards in
the library psa_crypto will work properly.

Also fixed an error return code in the driver wrapper for cipher
encrypt setup so it will properly pass unit tests.

Ensured config.py full works properly with the new
MBEDTLS_PSA_CRYPTO_CONFIG, it should not be set when the full
option is used.

Signed-off-by: John Durkop <john.durkop@fermatsoftware.com>
diff --git a/include/mbedtls/config_psa.h b/include/mbedtls/config_psa.h
index 528e215..8b32378 100644
--- a/include/mbedtls/config_psa.h
+++ b/include/mbedtls/config_psa.h
@@ -26,7 +26,9 @@
 #ifndef MBEDTLS_CONFIG_PSA_H
 #define MBEDTLS_CONFIG_PSA_H
 
+#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
 #include "psa/crypto_config.h"
+#endif /* defined(MBEDTLS_PSAY_CRYPTO_CONFIG) */
 
 #ifdef __cplusplus
 extern "C" {
@@ -42,7 +44,7 @@
 #endif /* !defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) */
 #endif /* defined(PSA_WANT_ALG_ECDSA) */
 
-#if defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA)
+#if defined(PSA_WANT_ALG_ECDSA_DETERMINISTIC)
 #if !defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA_DETERMINISTIC)
 #define MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA
 #else /*  && !defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA_DETERMINISTIC) */
@@ -50,6 +52,20 @@
 #endif /* !defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA_DETERMINISTIC) */
 #endif /* defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA) */
 
+#else /* MBEDTLS_PSA_CRYPTO_CONFIG */
+
+/*
+ * Ensure PSA_WANT_* defines are setup properly if MBEDTLS_PSA_CRYPTO_CONFIG
+ * is not defined
+ */
+#ifdef MBEDTLS_ECDSA_C
+#define PSA_WANT_ALG_ECDSA
+#endif /* MBEDTLS_ECDSA_C */
+
+#ifdef MBEDTLS_ECDSA_DETERMINISTIC
+#define PSA_WANT_ALG_ECDSA_DETERMINISTIC
+#endif /* MBEDTLS_ECDSA_DETERMINISTIC */
+
 #endif /* MBEDTLS_PSA_CRYPTO_CONFIG */
 
 #ifdef __cplusplus