From 5071a2e30eff57ee1cc59032c62b5ba52741e977 Mon Sep 17 00:00:00 2001 From: gabor-mezei-arm Date: Tue, 29 Jun 2021 11:17:54 +0200 Subject: [PATCH] Use regexp pattern instaed of string Signed-off-by: gabor-mezei-arm --- scripts/mbedtls_dev/crypto_knowledge.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mbedtls_dev/crypto_knowledge.py b/scripts/mbedtls_dev/crypto_knowledge.py index 4a2825292..7214adb4f 100644 --- a/scripts/mbedtls_dev/crypto_knowledge.py +++ b/scripts/mbedtls_dev/crypto_knowledge.py @@ -19,7 +19,7 @@ This module is entirely based on the PSA API. # limitations under the License. import re -from typing import Dict, Iterable, Optional, Tuple +from typing import Dict, Iterable, Optional, Pattern, Tuple from mbedtls_dev.asymmetric_key_data import ASYMMETRIC_KEY_DATA @@ -138,9 +138,9 @@ class KeyType: [self.DATA_BLOCK[:length % len(self.DATA_BLOCK)]]) KEY_TYPE_FOR_SIGNATURE = { - 'PSA_KEY_USAGE_SIGN_HASH': '.*KEY_PAIR', - 'PSA_KEY_USAGE_VERIFY_HASH': '.*KEY.*' - } #type: Dict[str, str] + 'PSA_KEY_USAGE_SIGN_HASH': re.compile('.*KEY_PAIR'), + 'PSA_KEY_USAGE_VERIFY_HASH': re.compile('.*KEY.*') + } #type: Dict[str, Pattern] """Use a regexp to determine key types for which signature is possible when using the actual usage flag. """