Skip to content

Commit a530427

Browse files
Zhu, GuodongYogaraj-Alamenda
authored andcommitted
Fix aes-cbc failure issue in testapp.
Testapp will set the ENGINE to NULL if this algorithm is disabled in configuration or disabled by Co-existence bitmap. Signed-off-by: Zhu, Guodong <guodong.zhu@intel.com> Signed-off-by: Yogaraj Alamenda <yogarajx.alamenda@intel.com>
1 parent cb3db21 commit a530427

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/tests_aes_cbc_hmac_sha.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static inline int set_pkt_threshold(ENGINE *e, const char* cipher, int thr)
164164
ret = ENGINE_ctrl_cmd(e, "SET_CRYPTO_SMALL_PACKET_OFFLOAD_THRESHOLD",
165165
0, (void *)thr_str, NULL, 0);
166166
if (ret != 1)
167-
WARN("Not able to set threshold %d for cipher %s\n", thr, cipher);
167+
FAIL_MSG("Failed to set threshold %d for cipher %s\n", thr, cipher);
168168

169169
return ret;
170170
}
@@ -1137,6 +1137,14 @@ static int run_aes_cbc_hmac_sha(void *pointer)
11371137
*/
11381138
ti.e = args->e;
11391139

1140+
if (ti.e) {
1141+
EVP_CIPHER *cipher = (EVP_CIPHER *)ENGINE_get_cipher(ti.e, NID_aes_256_cbc_hmac_sha256);
1142+
/* Set Engine to NULL if this algorithm is disabled in configuration or
1143+
disabled by the co-existence algorithm bitmap. */
1144+
if (cipher == NULL || cipher == EVP_aes_256_cbc_hmac_sha256())
1145+
ti.e = NULL;
1146+
}
1147+
11401148
/*
11411149
* For the qat engine, offload all packet sizes to engine
11421150
* by setting the threshold sizes to 0 for the cipher under test.
@@ -1145,11 +1153,8 @@ static int run_aes_cbc_hmac_sha(void *pointer)
11451153
ret = set_pkt_threshold(ti.e, ti.c->name, 0);
11461154
/* Set engine to NULL as threshhold will fail if NID not supported*/
11471155
if (ret != 1) {
1148-
ti.e = NULL;
1149-
ret = 1;
1150-
}
1151-
if (ret != 1)
11521156
return 0;
1157+
}
11531158
}
11541159

11551160
if (args->performance) {

0 commit comments

Comments
 (0)