Skip to content

Commit c7cd3b6

Browse files
authored
Merge pull request #8543 from JacobBarthelmeh/fsl_caam
handle unsupported fsl algo
2 parents 42d2b81 + 40b9fc3 commit c7cd3b6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

wolfcrypt/src/port/caam/wolfcaam_fsl_nxp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,8 +849,8 @@ int SynchronousSendRequest(int type, unsigned int args[4], CAAM_BUFFER *buf,
849849
#endif
850850

851851
default:
852-
WOLFSSL_MSG("Unknown/unsupported type");
853-
return -1;
852+
WOLFSSL_MSG("Unknown/unsupported type. Returning unavailable");
853+
return CRYPTOCB_UNAVAILABLE;
854854
}
855855

856856
if (ret != 0) {

wolfcrypt/src/port/caam/wolfcaam_init.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,11 @@ int wc_caamAddAndWait(CAAM_BUFFER* buf, int sz, word32 arg[4], word32 type)
501501
return RAN_BLOCK_E;
502502
}
503503

504+
if (ret == CRYPTOCB_UNAVAILABLE) {
505+
WOLFSSL_MSG("Driver does not support requested operation");
506+
return ret;
507+
}
508+
504509
if (ret == ResourceNotAvailable) {
505510
WOLFSSL_MSG("Waiting on CAAM driver");
506511
return WC_HW_WAIT_E;

0 commit comments

Comments
 (0)