| 1422 | } |
| 1423 | |
| 1424 | static int |
| 1425 | process_cpu_auth_hmac(uint8_t *src, uint8_t *dst, |
| 1426 | __rte_unused uint8_t *iv, |
| 1427 | EVP_PKEY *pkey, |
| 1428 | int srclen, |
| 1429 | EVP_MD_CTX *ctx, |
| 1430 | const EVP_MD *algo, |
| 1431 | uint16_t d_len) |
| 1432 | { |
| 1433 | size_t dstlen; |
| 1434 | unsigned char temp_dst[64]; |
| 1435 | |
| 1436 | if (EVP_DigestSignInit(ctx, NULL, algo, NULL, pkey) <= 0) |
| 1437 | goto process_auth_err; |
| 1438 | |
| 1439 | if (EVP_DigestSignUpdate(ctx, (char *)src, srclen) <= 0) |
| 1440 | goto process_auth_err; |
| 1441 | |
| 1442 | if (EVP_DigestSignFinal(ctx, temp_dst, &dstlen) <= 0) |
| 1443 | goto process_auth_err; |
| 1444 | |
| 1445 | memcpy(dst, temp_dst, d_len); |
| 1446 | return 0; |
| 1447 | process_auth_err: |
| 1448 | CCP_LOG_ERR("Process cpu auth failed"); |
| 1449 | return -EINVAL; |
| 1450 | } |
| 1451 | |
| 1452 | static int cpu_crypto_auth(struct ccp_qp *qp, |
| 1453 | struct rte_crypto_op *op, |
no test coverage detected