Skip to content

Commit ce99c7c

Browse files
Bug Fixes and update README.
- Move Engine load error messages to print in console. - Fix qatlib and QAT_SW co-existence build. - Fix issue with disable prf and gcm provider build. - Fix issue sm3 ctx initilization. Signed-off-by: Yogaraj Alamenda <yogarajx.alamenda@intel.com>
1 parent 7cc5eb9 commit ce99c7c

File tree

12 files changed

+193
-201
lines changed

12 files changed

+193
-201
lines changed

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Process this file with autoconf to produce a configure script.
33

44
AC_PREREQ([2.68])
5-
AC_INIT([qatengine], [0.6.12], [])
5+
AC_INIT([qatengine], [0.6.13], [])
66
AC_CONFIG_SRCDIR([config.h.in])
77
AC_CONFIG_HEADERS([config.h])
88
AC_CONFIG_AUX_DIR([.])
@@ -255,7 +255,7 @@ AC_SUBST([LIBQATNAME], "qatengine")
255255
AC_CHECK_FILE(${qat_hw_dir_prefix}/include/qat/icp_sal_versions.h,
256256
[with_icp_sal_versions_h=yes],
257257
[with_icp_sal_versions_h=no])
258-
if test "x$with_icp_sal_versions_h" = "xyes" -a "x$enable_qat_sw" = "x"
258+
if test "x$with_icp_sal_versions_h" = "xyes"
259259
then
260260
if test `grep "define SAL_INFO2_DRIVER_SW_VERSION_TYPE \"in-tree\"" ${qat_hw_dir_prefix}/include/qat/icp_sal_versions.h | wc -l` = "1"
261261
then
@@ -377,7 +377,7 @@ then
377377
if test "x$ac_cv_lib_crypto_mb_mbx_getversion" = "xyes"
378378
then
379379
AC_CHECK_FILE(/usr/local/lib/libcrypto_mb.so,
380-
[AC_SUBST([QAT_SW_CRYPTO_MB_LIB], ["-Wl,-rpath,/usr/local/lib -L/usr/loca/lib -lcrypto_mb"])],
380+
[AC_SUBST([QAT_SW_CRYPTO_MB_LIB], ["-Wl,-rpath,/usr/local/lib -L/usr/local/lib -lcrypto_mb"])],
381381
[AC_SUBST([QAT_SW_CRYPTO_MB_LIB], ["-lcrypto_mb"])])
382382
AC_SUBST([cflags_qat_sw], ["-DQAT_SW"])
383383
fi

docs/limitations.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
in the Intel&reg; QAT OpenSSL\* Engine configuration when building against earlier
2222
versions of the Linux driver.
2323
* Support for QAT HW ECX, QAT SW ECX, QAT HW PRF and QAT HW HKDF is disabled when built
24-
against OpenSSL 3.0 due to known issues instead it uses non-accelerated implementation
25-
from OpenSSL.
24+
against OpenSSL 3.0 engine interface due to known issues, instead it uses
25+
non-accelerated implementation from OpenSSL.
2626
* There is known performance scaling issue (performance drop with threads >32)
2727
with ECDSA Ciphers in the QAT Software acceleration using multithread mode
2828
in the Haproxy application. This issue is not observed when using RSA ciphers
@@ -37,9 +37,8 @@
3737
Performance drop observed in mulithread scenario for all ciphers suites
3838
due to the locks at engine_table_select in OpenSSL.
3939
* OpenSSL 1.1.1n introduced misleading error message(undefined symbol: EVP_PKEY_get_base_id)
40-
during engine load which can be ignored as it is not a real failure. Details of error
41-
message can be found [here][1]
40+
during engine load which can be ignored as it is not a real failure. This is later fixed in
41+
OpenSSL\* 1.1.1o release.
4242
* AES-CBC-HMAC-SHA chained ciphers does not support pipeline feature when built with
4343
OpenSSL 3.0 as the corresponding support is not available in OpenSSL 3.0.
44-
45-
[1]:https://github.com/openssl/openssl/issues/17962
44+
* There is a known issue with OpenSSL s_server application using qatprovider on OpenSSL 3.0.

docs/software_requirements.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Driver for FreeBSD. This release was validated on the following:
88

99
* Operating system: CentOS\* 7.4 64-bit version & FreeBSD\* 11.4 64-bit version
1010
* Kernel: GNU\*/Linux\* 3.10.0-693
11-
* Intel&reg; Communications Chipset C62X Series Software for Linux\*, version **4.16**
12-
* Intel&reg; Communications Chipset C62X Series Software for FreeBSD\*, version **3.11**
13-
* OpenSSL\* 1.1.1n & 3.0.1
11+
* Intel&reg; Communications Chipset C62X Series Software for Linux\*, version **4.18**
12+
* Intel&reg; Communications Chipset C62X Series Software for FreeBSD\*, version **3.12**
13+
* OpenSSL\* 1.1.1o & 3.0.3
1414

1515
## qat_sw Requirements
1616
Successful operation of the Intel&reg; QAT Software acceleration requires a
@@ -31,7 +31,7 @@ This release was validated on the following:
3131
* Intel&reg; Crypto Multi-buffer library from the [ipp-crypto][1] release
3232
version **IPP Crypto 2021.5**
3333
* Intel&reg; Multi-Buffer crypto for IPsec Library release version **v1.2**
34-
* OpenSSL\* 1.1.1n & 3.0.1
34+
* OpenSSL\* 1.1.1o & 3.0.3
3535

3636
[1]:https://github.com/intel/ipp-crypto
3737
[2]:https://github.com/intel/ipp-crypto/tree/develop/sources/ippcp/crypto_mb

e_qat.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@
144144
const char *engine_qat_id = STR(QAT_ENGINE_ID);
145145
#if defined(QAT_HW) && defined(QAT_SW)
146146
const char *engine_qat_name =
147-
"Reference implementation of QAT crypto engine(qat_hw & qat_sw) v0.6.12";
147+
"Reference implementation of QAT crypto engine(qat_hw & qat_sw) v0.6.13";
148148
#elif QAT_HW
149149
const char *engine_qat_name =
150-
"Reference implementation of QAT crypto engine(qat_hw) v0.6.12";
150+
"Reference implementation of QAT crypto engine(qat_hw) v0.6.13";
151151
#else
152152
const char *engine_qat_name =
153-
"Reference implementation of QAT crypto engine(qat_sw) v0.6.12";
153+
"Reference implementation of QAT crypto engine(qat_sw) v0.6.13";
154154
#endif
155155
unsigned int engine_inited = 0;
156156

@@ -421,15 +421,15 @@ int hw_support(void) {
421421
vpclmulqdq = 1;
422422

423423
DEBUG("Processor Support - AVX512F = %u, VAES = %u, VPCLMULQDQ = %u\n",
424-
avx512f, vaes, vpclmulqdq);
424+
avx512f, vaes, vpclmulqdq);
425425

426426
if (avx512f && vaes && vpclmulqdq) {
427427
qat_sw_ipsec = 1;
428428
return 1;
429429
} else {
430-
WARN("Processor unsupported - AVX512F = %u, VAES = %u, VPCLMULQDQ = %u\n",
431-
avx512f, vaes, vpclmulqdq);
432-
return 0;
430+
fprintf(stderr, "Processor unsupported for QAT_SW - AVX512F = %u, VAES = %u, VPCLMULQDQ = %u\n",
431+
avx512f, vaes, vpclmulqdq);
432+
return 0;
433433
}
434434
}
435435
#endif
@@ -468,7 +468,7 @@ int qat_engine_init(ENGINE *e)
468468
#ifdef QAT_HW
469469
if (qat_hw_offload) {
470470
if (!qat_init(e)) {
471-
WARN("QAT initialization Failed\n");
471+
fprintf(stderr, "QAT_HW initialization Failed\n");
472472
return 0;
473473
}
474474
}
@@ -477,7 +477,7 @@ int qat_engine_init(ENGINE *e)
477477
#ifdef QAT_SW
478478
if (qat_sw_offload) {
479479
if (!multibuff_init(e)) {
480-
WARN("Multibuff initialization Failed\n");
480+
fprintf(stderr, "QAT_SW initialization Failed\n");
481481
return 0;
482482
}
483483
}
@@ -858,21 +858,21 @@ static int bind_qat(ENGINE *e, const char *id)
858858
if (icp_sal_userIsQatAvailable() == CPA_TRUE) {
859859
qat_hw_offload = 1;
860860
} else {
861-
WARN("Qat Intree device not available\n");
862861
# ifndef QAT_SW
862+
fprintf(stderr, "Qat Intree device not available\n");
863863
goto end;
864864
# endif
865865
}
866866
# else
867867
if (access(QAT_DEV, F_OK) == 0) {
868868
qat_hw_offload = 1;
869869
if (access(QAT_MEM_DEV, F_OK) != 0) {
870-
WARN("Qat memory driver not present\n");
870+
fprintf(stderr, "Qat memory driver not present\n");
871871
goto end;
872872
}
873873
} else {
874-
WARN("Qat device not available\n");
875874
# ifndef QAT_SW
875+
fprintf(stderr, "Qat device not available\n");
876876
goto end;
877877
# endif
878878
}
@@ -885,12 +885,12 @@ static int bind_qat(ENGINE *e, const char *id)
885885
}
886886

887887
if (!ENGINE_set_id(e, engine_qat_id)) {
888-
WARN("ENGINE_set_id failed\n");
888+
fprintf(stderr, "ENGINE_set_id failed\n");
889889
goto end;
890890
}
891891

892892
if (!ENGINE_set_name(e, engine_qat_name)) {
893-
WARN("ENGINE_set_name failed\n");
893+
fprintf(stderr, "ENGINE_set_name failed\n");
894894
goto end;
895895
}
896896

@@ -965,7 +965,7 @@ static int bind_qat(ENGINE *e, const char *id)
965965
if (hw_support()) {
966966
# ifdef ENABLE_QAT_SW_GCM
967967
if (!vaesgcm_init_ipsec_mb_mgr()) {
968-
WARN("IPSec Multi-Buffer Manager Initialization failed\n");
968+
fprintf(stderr, "IPSec Multi-Buffer Manager Initialization failed\n");
969969
goto end;
970970
}
971971
# endif
@@ -1000,7 +1000,7 @@ static int bind_qat(ENGINE *e, const char *id)
10001000
ret &= ENGINE_set_finish_function(e, qat_engine_finish);
10011001
ret &= ENGINE_set_cmd_defns(e, qat_cmd_defns);
10021002
if (ret == 0) {
1003-
WARN("Engine failed to register init, finish or destroy functions\n");
1003+
fprintf(stderr, "Engine failed to register init, finish or destroy functions\n");
10041004
}
10051005

10061006
/*
@@ -1046,13 +1046,13 @@ static ENGINE *engine_qat(void)
10461046
ret = ENGINE_new();
10471047

10481048
if (!ret) {
1049-
WARN("Failed to create Engine\n");
1049+
fprintf(stderr, "Failed to create Engine\n");
10501050
QATerr(QAT_F_ENGINE_QAT, QAT_R_QAT_CREATE_ENGINE_FAILURE);
10511051
return NULL;
10521052
}
10531053

10541054
if (!bind_qat(ret, engine_qat_id)) {
1055-
WARN("Qat engine bind failed\n");
1055+
fprintf(stderr, "Qat Engine bind failed\n");
10561056
ENGINE_free(ret);
10571057
return NULL;
10581058
}

qat_hw_gcm.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,6 @@ int QAT_AES_CIPHER_CTX_encrypting(QAT_GCM_CTX *qctx)
10071007
}
10081008
#endif
10091009

1010-
#ifndef QAT_OPENSSL_PROVIDER
10111010
/******************************************************************************
10121011
* function:
10131012
* qat_aes_gcm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
@@ -1241,7 +1240,7 @@ int qat_aes_gcm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
12411240
DEBUG("Function result = %d\n",ret_val);
12421241
return ret_val;
12431242
}
1244-
#endif
1243+
12451244
/******************************************************************************
12461245
* function:
12471246
* qat_aes_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
@@ -1349,9 +1348,7 @@ int qat_aes_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
13491348

13501349
/* Distinguish the Update and TLS case */
13511350
if (qctx->tls_aad_len >= 0) {
1352-
#ifndef QAT_OPENSSL_PROVIDER
13531351
return qat_aes_gcm_tls_cipher(ctx, out, in, len);
1354-
#endif
13551352
}
13561353

13571354
/* If either key or IV not set, throw error here. */

qat_hw_prf.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
#ifndef QAT_HW_PRF_H
4848
#define QAT_HW_PRF_H
4949

50-
#ifdef ENABLE_QAT_HW_PRF
51-
5250
#include <pthread.h>
5351
#include <string.h>
5452
#include <signal.h>
@@ -72,13 +70,14 @@
7270
* early on here if they are exceeded rather than later on
7371
* down in the driver.
7472
*/
75-
#if CPA_CY_API_VERSION_NUM_MAJOR > 2
76-
# define QAT_TLS1_PRF_SECRET_MAXBUF 1024
77-
#else
78-
# define QAT_TLS1_PRF_SECRET_MAXBUF 512
79-
#endif
80-
#define QAT_TLS1_PRF_SEED_MAXBUF 64
81-
#define QAT_TLS1_PRF_LABEL_MAXBUF 136
73+
# ifdef ENABLE_QAT_HW_PRF
74+
# if CPA_CY_API_VERSION_NUM_MAJOR > 2
75+
# define QAT_TLS1_PRF_SECRET_MAXBUF 1024
76+
# else
77+
# define QAT_TLS1_PRF_SECRET_MAXBUF 512
78+
# endif
79+
# define QAT_TLS1_PRF_SEED_MAXBUF 64
80+
# define QAT_TLS1_PRF_LABEL_MAXBUF 136
8281

8382
/* QAT TLS pkey context structure */
8483
typedef struct {
@@ -101,6 +100,6 @@ void qat_prf_cleanup(EVP_PKEY_CTX *ctx);
101100
int qat_prf_tls_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
102101
size_t *olen);
103102
int qat_tls1_prf_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
104-
#endif /* DISABLE_QAT_HW_PRF */
103+
# endif /* DISABLE_QAT_HW_PRF */
105104

106105
#endif /* QAT_HW_PRF_H */

qat_provider.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
# include <openssl/provider.h>
5151
# include <openssl/bio.h>
5252

53-
# define QAT_PROVIDER_VERSION_STR "v0.6.12"
54-
# define QAT_PROVIDER_FULL_VERSION_STR "QAT Provider v0.6.12"
53+
# define QAT_PROVIDER_VERSION_STR "v0.6.13"
54+
# define QAT_PROVIDER_FULL_VERSION_STR "QAT Provider v0.6.13"
5555

5656
# if defined(QAT_HW) && defined(QAT_SW)
5757
# define QAT_PROVIDER_NAME_STR "QAT Provider for QAT_HW and QAT_SW"

0 commit comments

Comments
 (0)