@@ -3678,13 +3678,6 @@ int wh_Client_Cmac(whClientContext* ctx, Cmac* cmac, CmacType type,
36783678 cmac -> aes .keylen = keyLen ;
36793679 }
36803680
3681- #ifdef WOLFHSM_CFG_CANCEL_API
3682- /* if the client marked they may want to cancel, handle the
3683- * response in a separate call */
3684- if (ctx -> cancelable ) {
3685- return ret ;
3686- }
3687- #endif
36883681
36893682 uint16_t res_len = 0 ;
36903683 do {
@@ -3719,63 +3712,6 @@ int wh_Client_Cmac(whClientContext* ctx, Cmac* cmac, CmacType type,
37193712
37203713#endif /* !NO_AES */
37213714
3722- #ifdef WOLFHSM_CFG_CANCEL_API
3723- int wh_Client_CmacCancelableResponse (whClientContext * c , Cmac * cmac ,
3724- uint8_t * out , uint16_t * outSz )
3725- {
3726- whMessageCrypto_CmacResponse * res = NULL ;
3727- uint8_t * dataPtr = NULL ;
3728- int ret ;
3729- uint16_t group ;
3730- uint16_t action ;
3731- uint16_t dataSz ;
3732-
3733- if (c == NULL || cmac == NULL ) {
3734- return WH_ERROR_BADARGS ;
3735- }
3736-
3737- /* Get data pointer */
3738- dataPtr = (uint8_t * )wh_CommClient_GetDataPtr (c -> comm );
3739- if (dataPtr == NULL ) {
3740- return WH_ERROR_BADARGS ;
3741- }
3742-
3743- do {
3744- ret = wh_Client_RecvResponse (c , & group , & action , & dataSz ,
3745- (uint8_t * )dataPtr );
3746- } while (ret == WH_ERROR_NOTREADY );
3747-
3748- /* check for out of sequence action */
3749- if (ret == 0 &&
3750- (group != WH_MESSAGE_GROUP_CRYPTO || action != WC_ALGO_TYPE_CMAC )) {
3751- ret = WH_ERROR_ABORTED ;
3752- }
3753- if (ret == 0 ) {
3754- /* Setup generic header and get pointer to response data */
3755- ret = _getCryptoResponse (dataPtr , WC_ALGO_TYPE_CMAC , (uint8_t * * )& res );
3756- /* wolfCrypt allows positive error codes on success in some scenarios */
3757- if (ret >= 0 ) {
3758- /* Restore non-sensitive state from server response */
3759- memcpy (cmac -> buffer , res -> resumeState .buffer , AES_BLOCK_SIZE );
3760- memcpy (cmac -> digest , res -> resumeState .digest , AES_BLOCK_SIZE );
3761- cmac -> bufferSz = res -> resumeState .bufferSz ;
3762- cmac -> totalSz = res -> resumeState .totalSz ;
3763-
3764- if (out != NULL && outSz != NULL ) {
3765- if (res -> outSz > * outSz ) {
3766- ret = WH_ERROR_BUFFER_SIZE ;
3767- }
3768- else {
3769- uint8_t * packOut = (uint8_t * )(res + 1 );
3770- memcpy (out , packOut , res -> outSz );
3771- * outSz = res -> outSz ;
3772- }
3773- }
3774- }
3775- }
3776- return ret ;
3777- }
3778- #endif /* WOLFHSM_CFG_CANCEL_API */
37793715
37803716#ifdef WOLFHSM_CFG_DMA
37813717int wh_Client_CmacDma (whClientContext * ctx , Cmac * cmac , CmacType type ,
0 commit comments