aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaulik Patel <Maulik.Patel@arm.com>2021-03-24 15:38:44 +0000
committerDavid Hu <david.hu@arm.com>2021-03-29 10:14:57 +0200
commitb11b067596d3f2decba9ba8630de1340ae7b29ae (patch)
tree19ab8b28868b339f7f2db8e83a85ec23483d7838
parente056d18c8a6a059dfefe7c01b737cbcfcb10031b (diff)
downloadtrusted-firmware-m-b11b067596d3f2decba9ba8630de1340ae7b29ae.tar.gz
Crypto: Fix psa arch test failures.
Update expected return value of psa_cipher_finish decrypt test with short input to PSA_ERROR_INVALID_ARGUMENT as per PSA Crypto 1.0.0. Also, update the invalid hash algorithm mask as per Mbedtls 2.25.0. Signed-off-by: Maulik Patel <maulik.patel@arm.com> Change-Id: I74c1b27a893297bb2a942fa1489b3dd100293feb
-rw-r--r--lib/ext/psa_arch_tests/0002-Fix-psa-arch-test-failures.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/ext/psa_arch_tests/0002-Fix-psa-arch-test-failures.patch b/lib/ext/psa_arch_tests/0002-Fix-psa-arch-test-failures.patch
new file mode 100644
index 000000000..a7626cbc3
--- /dev/null
+++ b/lib/ext/psa_arch_tests/0002-Fix-psa-arch-test-failures.patch
@@ -0,0 +1,58 @@
+From 9e3049ccfda24cadd29f67a09c42f6caccd45be2 Mon Sep 17 00:00:00 2001
+From: Maulik Patel <Maulik.Patel@arm.com>
+Date: Wed, 24 Mar 2021 11:01:49 +0000
+Subject: [PATCH] Fix psa arch test failures.
+
+Update expected return value of psa_cipher_finish Decrypt test
+with short input to PSA_ERROR_INVALID_ARGUMENT as per PSA Crypto 1.0.0
+Also update the invalid hash algorithm mask as per Mbedtls 2.25.0.
+
+Signed-off-by: Maulik Patel <maulik.patel@arm.com>
+---
+ api-tests/dev_apis/crypto/test_c037/test_data.h | 4 ++--
+ api-tests/val/nspe/val_crypto.h | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/api-tests/dev_apis/crypto/test_c037/test_data.h b/api-tests/dev_apis/crypto/test_c037/test_data.h
+index 36e05f0..317ed75 100644
+--- a/api-tests/dev_apis/crypto/test_c037/test_data.h
++++ b/api-tests/dev_apis/crypto/test_c037/test_data.h
+@@ -1,5 +1,5 @@
+ /** @file
+- * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
++ * Copyright (c) 2019-2021, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+@@ -269,7 +269,7 @@ static const test_data check1[] = {
+ .output_size = 0,
+ .expected_output = NULL,
+ .expected_output_length = 0,
+- .expected_status = PSA_ERROR_BAD_STATE
++ .expected_status = PSA_ERROR_INVALID_ARGUMENT
+ },
+
+ #endif
+diff --git a/api-tests/val/nspe/val_crypto.h b/api-tests/val/nspe/val_crypto.h
+index 7270a40..5045a3f 100644
+--- a/api-tests/val/nspe/val_crypto.h
++++ b/api-tests/val/nspe/val_crypto.h
+@@ -1,5 +1,5 @@
+ /** @file
+- * Copyright (c) 2018-2020, Arm Limited or its affiliates. All rights reserved.
++ * Copyright (c) 2018-2021, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+@@ -48,7 +48,7 @@
+
+ #define PSA_KEY_LIFETIME_INVALID 0xFFFFFFFF
+ #define PSA_KEY_USAGE_INVALID 0xFFFFFFFF
+-#define PSA_HASH_ALG_INVALID 0x01FFFFFF
++#define PSA_HASH_ALG_INVALID 0x02FFFFFF
+ #define PSA_ALG_INVALID 0xFFFFFFFF
+ #define PSA_KEY_DERIVATION_STEP_INVALID 0x0000FFFF
+
+--
+2.17.1
+