Deprecate mbedtls_cipher_auth_xxcrypt()
This temporarily breaks all.sh '*deprecated*' (deprecated functions still used
in the library), which will be fix in the next commit.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/tests/suites/test_suite_cipher.function b/tests/suites/test_suite_cipher.function
index 543ccf6..3b6d1e3 100644
--- a/tests/suites/test_suite_cipher.function
+++ b/tests/suites/test_suite_cipher.function
@@ -1022,17 +1022,10 @@
int ret;
int using_nist_kw, using_nist_kw_padding;
- unsigned char output[300]; /* Temporary buffer for results of
- * encryption and decryption. */
- unsigned char *output_tag = NULL; /* Temporary buffer for tag in the
- * encryption step. */
mbedtls_cipher_context_t ctx;
size_t outlen;
- unsigned char *tmp_tag = NULL;
- unsigned char *tmp_cipher = NULL;
-
unsigned char *cipher_plus_tag = NULL;
size_t cipher_plus_tag_len;
unsigned char *decrypt_buf = NULL;
@@ -1040,8 +1033,19 @@
unsigned char *encrypt_buf = NULL;
size_t encrypt_buf_len = 0;
- mbedtls_cipher_init( &ctx );
+#if !defined(MBEDTLS_DEPRECATED_WARNING) && \
+ !defined(MBEDTLS_DEPRECATED_REMOVED)
+ unsigned char output[300]; /* Temporary buffer for results of
+ * encryption and decryption. */
+ unsigned char *output_tag = NULL; /* Temporary buffer for tag in the
+ * encryption step. */
+ unsigned char *tmp_tag = NULL;
+ unsigned char *tmp_cipher = NULL;
+
memset( output, 0xFF, sizeof( output ) );
+#endif /* !MBEDTLS_DEPRECATED_WARNING && !MBEDTLS_DEPRECATED_REMOVED */
+
+ mbedtls_cipher_init( &ctx );
/* Initialize PSA Crypto */
#if defined(MBEDTLS_USE_PSA_CRYPTO)
@@ -1062,6 +1066,12 @@
cipher_id == MBEDTLS_CIPHER_AES_256_KW ||
using_nist_kw_padding;
+ /****************************************************************
+ * *
+ * Part 1: non-deprecated API *
+ * *
+ ****************************************************************/
+
/*
* Prepare context for decryption
*/
@@ -1126,7 +1136,7 @@
TEST_ASSERT( memcmp( decrypt_buf, clear->x, clear->len ) == 0 );
}
- /* Free this, but keep cipher_plus_tag for legacy function with PSA */
+ /* Free this, but keep cipher_plus_tag for deprecated function with PSA */
mbedtls_free( decrypt_buf );
decrypt_buf = NULL;
@@ -1187,6 +1197,15 @@
encrypt_buf = NULL;
}
+ /****************************************************************
+ * *
+ * Part 2: deprecated API *
+ * *
+ ****************************************************************/
+
+#if !defined(MBEDTLS_DEPRECATED_WARNING) && \
+ !defined(MBEDTLS_DEPRECATED_REMOVED)
+
/*
* Prepare context for decryption
*/
@@ -1278,6 +1297,8 @@
}
}
+#endif /* !MBEDTLS_DEPRECATED_WARNING && !MBEDTLS_DEPRECATED_REMOVED */
+
exit:
mbedtls_cipher_free( &ctx );