Make sure software fallback isn't tried on opaque keys

Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 03326f7..77e6304 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -3664,7 +3664,8 @@
                                            signature,
                                            signature_size,
                                            signature_length );
-    if( status != PSA_ERROR_NOT_SUPPORTED )
+    if( status != PSA_ERROR_NOT_SUPPORTED ||
+        psa_key_lifetime_is_external( slot->attr.lifetime ) )
         goto exit;
 
     /* If the operation was not supported by any accelerator, try fallback. */
@@ -3766,7 +3767,8 @@
                                              hash_length,
                                              signature,
                                              signature_length );
-    if( status != PSA_ERROR_NOT_SUPPORTED )
+    if( status != PSA_ERROR_NOT_SUPPORTED ||
+        psa_key_lifetime_is_external( slot->attr.lifetime ) )
         return status;
 
 #if defined(MBEDTLS_RSA_C)