@@ -2287,6 +2287,9 @@ int wh_Client_Ed25519Sign(whClientContext* ctx, ed25519_key* key,
22872287 ret = wh_Client_SendRequest (ctx , group , action , req_len ,
22882288 (uint8_t * )dataPtr );
22892289 if (ret == WH_ERROR_OK ) {
2290+ /* Server will evict at this point. Reset evict */
2291+ evict = 0 ;
2292+
22902293 uint16_t res_len = 0 ;
22912294 do {
22922295 ret = wh_Client_RecvResponse (ctx , & group , & action , & res_len ,
@@ -2326,6 +2329,10 @@ int wh_Client_Ed25519Sign(whClientContext* ctx, ed25519_key* key,
23262329 }
23272330 }
23282331
2332+ if (evict != 0 ) {
2333+ (void )wh_Client_KeyEvict (ctx , key_id );
2334+ }
2335+
23292336 return ret ;
23302337}
23312338
@@ -2394,6 +2401,9 @@ int wh_Client_Ed25519Verify(whClientContext* ctx, ed25519_key* key,
23942401 ret = wh_Client_SendRequest (ctx , group , action , req_len ,
23952402 (uint8_t * )dataPtr );
23962403 if (ret == WH_ERROR_OK ) {
2404+ /* Server will evict at this point. Reset evict */
2405+ evict = 0 ;
2406+
23972407 uint16_t res_len = 0 ;
23982408 do {
23992409 ret = wh_Client_RecvResponse (ctx , & group , & action , & res_len ,
@@ -2421,6 +2431,10 @@ int wh_Client_Ed25519Verify(whClientContext* ctx, ed25519_key* key,
24212431 }
24222432 }
24232433
2434+ if (evict != 0 ) {
2435+ (void )wh_Client_KeyEvict (ctx , key_id );
2436+ }
2437+
24242438 return ret ;
24252439}
24262440
0 commit comments