Skip to content

Commit 0a00198

Browse files
Fix issues for OpenSSL 3.0 in engine framework.
- Fix build deprecated warnings against OpenSSL 3.0 - Disable QAT SW ECX, QAT HW ECX, Ciphers, PRF and HKDF due to known issues against OpenSSL 3.0. - Update OpenSSL 3.0 License and err files. - Update README and release version to v0.6.7 Signed-off-by: Yogaraj Alamenda <yogarajx.alamenda@intel.com>
1 parent e139a5a commit 0a00198

38 files changed

+1152
-55
lines changed

LICENSE.OPENSSL3.0

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
2+
Apache License
3+
Version 2.0, January 2004
4+
https://www.apache.org/licenses/
5+
6+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7+
8+
1. Definitions.
9+
10+
"License" shall mean the terms and conditions for use, reproduction,
11+
and distribution as defined by Sections 1 through 9 of this document.
12+
13+
"Licensor" shall mean the copyright owner or entity authorized by
14+
the copyright owner that is granting the License.
15+
16+
"Legal Entity" shall mean the union of the acting entity and all
17+
other entities that control, are controlled by, or are under common
18+
control with that entity. For the purposes of this definition,
19+
"control" means (i) the power, direct or indirect, to cause the
20+
direction or management of such entity, whether by contract or
21+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
22+
outstanding shares, or (iii) beneficial ownership of such entity.
23+
24+
"You" (or "Your") shall mean an individual or Legal Entity
25+
exercising permissions granted by this License.
26+
27+
"Source" form shall mean the preferred form for making modifications,
28+
including but not limited to software source code, documentation
29+
source, and configuration files.
30+
31+
"Object" form shall mean any form resulting from mechanical
32+
transformation or translation of a Source form, including but
33+
not limited to compiled object code, generated documentation,
34+
and conversions to other media types.
35+
36+
"Work" shall mean the work of authorship, whether in Source or
37+
Object form, made available under the License, as indicated by a
38+
copyright notice that is included in or attached to the work
39+
(an example is provided in the Appendix below).
40+
41+
"Derivative Works" shall mean any work, whether in Source or Object
42+
form, that is based on (or derived from) the Work and for which the
43+
editorial revisions, annotations, elaborations, or other modifications
44+
represent, as a whole, an original work of authorship. For the purposes
45+
of this License, Derivative Works shall not include works that remain
46+
separable from, or merely link (or bind by name) to the interfaces of,
47+
the Work and Derivative Works thereof.
48+
49+
"Contribution" shall mean any work of authorship, including
50+
the original version of the Work and any modifications or additions
51+
to that Work or Derivative Works thereof, that is intentionally
52+
submitted to Licensor for inclusion in the Work by the copyright owner
53+
or by an individual or Legal Entity authorized to submit on behalf of
54+
the copyright owner. For the purposes of this definition, "submitted"
55+
means any form of electronic, verbal, or written communication sent
56+
to the Licensor or its representatives, including but not limited to
57+
communication on electronic mailing lists, source code control systems,
58+
and issue tracking systems that are managed by, or on behalf of, the
59+
Licensor for the purpose of discussing and improving the Work, but
60+
excluding communication that is conspicuously marked or otherwise
61+
designated in writing by the copyright owner as "Not a Contribution."
62+
63+
"Contributor" shall mean Licensor and any individual or Legal Entity
64+
on behalf of whom a Contribution has been received by Licensor and
65+
subsequently incorporated within the Work.
66+
67+
2. Grant of Copyright License. Subject to the terms and conditions of
68+
this License, each Contributor hereby grants to You a perpetual,
69+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70+
copyright license to reproduce, prepare Derivative Works of,
71+
publicly display, publicly perform, sublicense, and distribute the
72+
Work and such Derivative Works in Source or Object form.
73+
74+
3. Grant of Patent License. Subject to the terms and conditions of
75+
this License, each Contributor hereby grants to You a perpetual,
76+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77+
(except as stated in this section) patent license to make, have made,
78+
use, offer to sell, sell, import, and otherwise transfer the Work,
79+
where such license applies only to those patent claims licensable
80+
by such Contributor that are necessarily infringed by their
81+
Contribution(s) alone or by combination of their Contribution(s)
82+
with the Work to which such Contribution(s) was submitted. If You
83+
institute patent litigation against any entity (including a
84+
cross-claim or counterclaim in a lawsuit) alleging that the Work
85+
or a Contribution incorporated within the Work constitutes direct
86+
or contributory patent infringement, then any patent licenses
87+
granted to You under this License for that Work shall terminate
88+
as of the date such litigation is filed.
89+
90+
4. Redistribution. You may reproduce and distribute copies of the
91+
Work or Derivative Works thereof in any medium, with or without
92+
modifications, and in Source or Object form, provided that You
93+
meet the following conditions:
94+
95+
(a) You must give any other recipients of the Work or
96+
Derivative Works a copy of this License; and
97+
98+
(b) You must cause any modified files to carry prominent notices
99+
stating that You changed the files; and
100+
101+
(c) You must retain, in the Source form of any Derivative Works
102+
that You distribute, all copyright, patent, trademark, and
103+
attribution notices from the Source form of the Work,
104+
excluding those notices that do not pertain to any part of
105+
the Derivative Works; and
106+
107+
(d) If the Work includes a "NOTICE" text file as part of its
108+
distribution, then any Derivative Works that You distribute must
109+
include a readable copy of the attribution notices contained
110+
within such NOTICE file, excluding those notices that do not
111+
pertain to any part of the Derivative Works, in at least one
112+
of the following places: within a NOTICE text file distributed
113+
as part of the Derivative Works; within the Source form or
114+
documentation, if provided along with the Derivative Works; or,
115+
within a display generated by the Derivative Works, if and
116+
wherever such third-party notices normally appear. The contents
117+
of the NOTICE file are for informational purposes only and
118+
do not modify the License. You may add Your own attribution
119+
notices within Derivative Works that You distribute, alongside
120+
or as an addendum to the NOTICE text from the Work, provided
121+
that such additional attribution notices cannot be construed
122+
as modifying the License.
123+
124+
You may add Your own copyright statement to Your modifications and
125+
may provide additional or different license terms and conditions
126+
for use, reproduction, or distribution of Your modifications, or
127+
for any such Derivative Works as a whole, provided Your use,
128+
reproduction, and distribution of the Work otherwise complies with
129+
the conditions stated in this License.
130+
131+
5. Submission of Contributions. Unless You explicitly state otherwise,
132+
any Contribution intentionally submitted for inclusion in the Work
133+
by You to the Licensor shall be under the terms and conditions of
134+
this License, without any additional terms or conditions.
135+
Notwithstanding the above, nothing herein shall supersede or modify
136+
the terms of any separate license agreement you may have executed
137+
with Licensor regarding such Contributions.
138+
139+
6. Trademarks. This License does not grant permission to use the trade
140+
names, trademarks, service marks, or product names of the Licensor,
141+
except as required for reasonable and customary use in describing the
142+
origin of the Work and reproducing the content of the NOTICE file.
143+
144+
7. Disclaimer of Warranty. Unless required by applicable law or
145+
agreed to in writing, Licensor provides the Work (and each
146+
Contributor provides its Contributions) on an "AS IS" BASIS,
147+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148+
implied, including, without limitation, any warranties or conditions
149+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150+
PARTICULAR PURPOSE. You are solely responsible for determining the
151+
appropriateness of using or redistributing the Work and assume any
152+
risks associated with Your exercise of permissions under this License.
153+
154+
8. Limitation of Liability. In no event and under no legal theory,
155+
whether in tort (including negligence), contract, or otherwise,
156+
unless required by applicable law (such as deliberate and grossly
157+
negligent acts) or agreed to in writing, shall any Contributor be
158+
liable to You for damages, including any direct, indirect, special,
159+
incidental, or consequential damages of any character arising as a
160+
result of this License or out of the use or inability to use the
161+
Work (including but not limited to damages for loss of goodwill,
162+
work stoppage, computer failure or malfunction, or any and all
163+
other commercial damages or losses), even if such Contributor
164+
has been advised of the possibility of such damages.
165+
166+
9. Accepting Warranty or Additional Liability. While redistributing
167+
the Work or Derivative Works thereof, You may choose to offer,
168+
and charge a fee for, acceptance of support, warranty, indemnity,
169+
or other liability obligations and/or rights consistent with this
170+
License. However, in accepting such obligations, You may act only
171+
on Your own behalf and on Your sole responsibility, not on behalf
172+
of any other Contributor, and only if You agree to indemnify,
173+
defend, and hold each Contributor harmless for any liability
174+
incurred by, or claims asserted against, such Contributor by reason
175+
of your accepting any such warranty or additional liability.
176+
177+
END OF TERMS AND CONDITIONS

Makefile.am

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ endif
1919
endif
2020

2121
QAT_COMMON_SRC = e_qat.c \
22-
e_qat_err.c \
2322
qat_fork.c \
2423
qat_events.c \
2524
qat_utils.c \
2625
qat_evp.c
2726

27+
if QAT_OPENSSL_3
28+
QAT_ERR_SRC = qat_prov_err.c
29+
else
30+
QAT_ERR_SRC = e_qat_err.c
31+
endif
32+
2833
if QAT_HW
2934
QAT_HW_SRC = qat_hw_init.c \
3035
qat_hw_asym_common.c \
@@ -61,6 +66,7 @@ if QAT_SW_IPSEC
6166
endif
6267

6368
qatengine_la_SOURCES = ${QAT_COMMON_SRC} \
69+
${QAT_ERR_SRC} \
6470
${QAT_HW_SRC} \
6571
${QAT_HW_111_SRC} \
6672
${QAT_HW_MEM_SRC} \
@@ -71,7 +77,7 @@ AM_CPPFLAGS = $(includes_openssl) $(includes_qat_hw_usdm) \
7177
$(includes_qat_hw) $(includes_qat_sw)
7278

7379
AM_CFLAGS = $(cflags) $(cflags_cc_opt) $(cflags_qat_debug_file) \
74-
$(cflags_mem_driver) $(cflags_openssl_300) \
80+
$(cflags_mem_driver) $(cflags_openssl_3) \
7581
$(cflags_qat_engine_id) $(cflags_qat_hw_intree) \
7682
$(cflags_qat_hw) $(cflags_qat_sw) $(cflags_qat_sw_ipsec) \
7783
$(enable_qat_hw_rsa) $(enable_qat_hw_ciphers) \
@@ -110,6 +116,12 @@ if QAT_OPENSSL_110
110116
-rebuild -reindex -nostatic -write *.c
111117

112118
else
113-
rm -f e_qat_err.c e_qat.txt && perl -I$(with_openssl_dir) $(with_openssl_dir)/util/mkerr.pl -conf e_qat.ec \
119+
if QAT_OPENSSL_3
120+
perl -I$(with_openssl_dir) $(with_openssl_dir)/util/mkerr.pl -conf qat_prov.ec \
114121
-rebuild -reindex *.c
122+
else
123+
rm -f e_qat_err.c e_qat.txt && perl -I$(with_openssl_dir) $(with_openssl_dir)/util/mkerr.pl -conf e_qat.ec \
124+
-rebuild -reindex *.c
125+
126+
endif
115127
endif

configure.ac

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ then
247247
ac_default_prefix=$with_openssl_install_dir
248248
if test "`grep "define OPENSSL_VERSION_MAJOR" $with_openssl_install_dir/include/openssl/opensslv.h | awk '{print $4}'`" = "3"
249249
then
250-
AC_MSG_NOTICE([Build QAT engine against OpenSSL 3.0.0])
251-
AC_SUBST([cflags_openssl_300], ["-DSSL_QAT_USE_ASYNC_CALLBACK"])
250+
AC_MSG_NOTICE([Build QAT engine against OpenSSL 3.0])
251+
AC_SUBST([cflags_openssl_3], ["-DQAT_OPENSSL_3 -DOPENSSL_SUPPRESS_DEPRECATED"])
252252
libdir="\$(with_openssl_install_dir)/lib/engines-3"
253253
else
254254
AC_MSG_NOTICE([Build QAT engine against OpenSSL 1.1.x])
@@ -270,8 +270,8 @@ else
270270
includes_openssl="`pkg-config --variable=includedir libcrypto`"
271271
if test "`grep "define OPENSSL_VERSION_MAJOR" $includes_openssl/openssl/opensslv.h | awk '{print $4}'`" = "3"
272272
then
273-
AC_MSG_NOTICE([Build QAT engine against OpenSSL 3.0.0])
274-
AC_SUBST([cflags_openssl_300], ["-DSSL_QAT_USE_ASYNC_CALLBACK"])
273+
AC_MSG_NOTICE([Build QAT engine against OpenSSL 3.0])
274+
AC_SUBST([cflags_openssl_3], ["-DQAT_OPENSSL_3 -DOPENSSL_SUPPRESS_DEPRECATED"])
275275
else
276276
if test "`grep "define OPENSSL_VERSION_NUMBER 0x10100" $includes_openssl/openssl/opensslv.h | wc -l`" = "1"
277277
then
@@ -283,6 +283,7 @@ else
283283
AC_SUBST([libdir])
284284
fi
285285
AM_CONDITIONAL([QAT_OPENSSL_110], [test "x$cflags_openssl_110" != "x"])
286+
AM_CONDITIONAL([QAT_OPENSSL_3], [test "x$cflags_openssl_3" != "x"])
286287

287288
# If both QAT HW and QAT SW configured, then check the libraries from standard location and use accordingly.
288289
if test "x$cflags_qat_hw_intree" = "x"
@@ -385,7 +386,7 @@ else
385386
AC_MSG_NOTICE([Not Accelerating RSA to Hardware])
386387
fi
387388

388-
if test "x$enable_qat_hw_ciphers" != "xno" -a "x$cflags_qat_hw" != "x"
389+
if test "x$enable_qat_hw_ciphers" != "xno" -a "x$cflags_qat_hw" != "x" -a "x$cflags_openssl_3" = "x"
389390
then
390391
enable_qat_hw_ciphers="-DENABLE_QAT_HW_CIPHERS"
391392
AC_MSG_NOTICE([Accelerating CIPHERS to Hardware])
@@ -430,7 +431,7 @@ else
430431
AC_MSG_NOTICE([Not Accelerating DH to Hardware])
431432
fi
432433

433-
if test "x$enable_qat_hw_prf" != "xno" -a "x$cflags_qat_hw" != "x"
434+
if test "x$enable_qat_hw_prf" != "xno" -a "x$cflags_qat_hw" != "x" -a "x$cflags_openssl_3" = "x"
434435
then
435436
enable_qat_hw_prf="-DENABLE_QAT_HW_PRF"
436437
AC_MSG_NOTICE([Accelerating PRF to Hardware])
@@ -439,7 +440,7 @@ else
439440
AC_MSG_NOTICE([Not Accelerating PRF to Hardware])
440441
fi
441442

442-
if test "x$enable_qat_hw_hkdf" = "xyes" -a "x$cflags_qat_hw" != "x"
443+
if test "x$enable_qat_hw_hkdf" = "xyes" -a "x$cflags_qat_hw" != "x" -a "x$cflags_openssl_3" = "x"
443444
then
444445
enable_qat_hw_hkdf="-DENABLE_QAT_HW_HKDF"
445446
AC_MSG_NOTICE([Accelerating HKDF to Hardware])
@@ -448,7 +449,7 @@ else
448449
AC_MSG_NOTICE([Not Accelerating HKDF to Hardware])
449450
fi
450451

451-
if test "x$enable_qat_hw_ecx" != "xno" -a "x$cflags_qat_hw" != "x"
452+
if test "x$enable_qat_hw_ecx" != "xno" -a "x$cflags_qat_hw" != "x" -a "x$cflags_openssl_3" = "x"
452453
then
453454
enable_qat_hw_ecx="-DENABLE_QAT_HW_ECX"
454455
AC_MSG_NOTICE([Accelerating X25519/X448 to Hardware])
@@ -484,7 +485,7 @@ else
484485
AC_MSG_NOTICE([Not Accelerating RSA to Software (Multi-buffer)])
485486
fi
486487

487-
if test "x$enable_qat_sw_ecx" != "xno" -a "x$cflags_qat_sw" != "x"
488+
if test "x$enable_qat_sw_ecx" != "xno" -a "x$cflags_qat_sw" != "x" -a "x$cflags_openssl_3" = "x"
488489
then
489490
enable_qat_sw_ecx="-DENABLE_QAT_SW_ECX"
490491
AC_MSG_NOTICE([Accelerating X25519 to Software (Multi-buffer)])

docs/licensing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ The Licensing of the files within this project is split as follows:
44

55
| Component |License | Details |
66
|---|---|---|
7-
| Intel® QuickAssist Technology(QAT) OpenSSL* Engine | BSD License | Intel&reg; QuickAssist Technology(QAT) OpenSSL\* Engine - BSD License. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). Please see the `LICENSE` and `LICENSE.OPENSSL` file contained in the top level folder. Further details can be found in the file headers of the relevant files. |
7+
| Intel® QuickAssist Technology(QAT) OpenSSL* Engine | BSD-3-Clause | Intel&reg; QuickAssist Technology(QAT) OpenSSL\* Engine - BSD-3-Clause. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). Please see the `LICENSE` and `LICENSE.OPENSSL` file contained in the top level folder. Further details can be found in the file headers of the relevant files. |
88
| Example Intel&reg; Contiguous Memory Driver contained within the folder `qat_contig_mem` | GPLv2 License | Please see the file headers within the `qat_contig_mem` folder, and the full GPLv2 license contained in the file `LICENSE.GPL` within the `qat_contig_mem` folder. |
99
|Example Intel&reg; QuickAssist Technology Driver Configuration Files contained within the folder hierarchy `qat` | Dual BSD/GPLv2 License | Please see the file headers of the configuration files, and the full GPLv2 license contained in the file `LICENSE.GPL` within the `qat` folder. |

docs/limitations.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@
2727
of the Intel&reg; QAT driver for Linux. Use `--with-cc-opt="-DQAT_HW_DISABLE_NONZERO_MEMFREE"`
2828
in the Intel&reg; QAT OpenSSL\* Engine configuration when building against earlier
2929
versions of the Linux driver.
30+
* Support for QAT HW ECX, QAT SW ECX, QAT HW PRF and QAT HW HKDF is disabled when built
31+
against OpenSSL 3.0 due to known issues instead it uses non-accelerated implementation
32+
from OpenSSL.
3033

3134
[1]:https://github.com/openssl/openssl/pull/2581

docs/software_requirements.md

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

99
* Operating system: CentOS\* 7.4 64-bit version & FreeBSD\* 11.3 64-bit version
1010
* Kernel: GNU\*/Linux\* 3.10.0-693
11-
* Intel&reg; Communications Chipset C62X Series Software for Linux\*, version **4.13**
12-
* Intel&reg; Communications Chipset C62X Series Software for FreeBSD\*, version **3.9**
11+
* Intel&reg; Communications Chipset C62X Series Software for Linux\*, version **4.14**
12+
* Intel&reg; Communications Chipset C62X Series Software for FreeBSD\*, version **3.10**
1313
* OpenSSL\* 1.1.1k
1414

1515
## qat_sw Requirements

e_qat.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
#include "qat_fork.h"
8888
#include "qat_evp.h"
8989
#include "qat_utils.h"
90-
#include "e_qat_err.h"
90+
9191
#ifdef QAT_HW
9292
# include "qat_hw_ciphers.h"
9393
# include "qat_hw_polling.h"
@@ -150,10 +150,10 @@
150150
const char *engine_qat_id = STR(QAT_ENGINE_ID);
151151
#ifdef QAT_HW
152152
const char *engine_qat_name =
153-
"Reference implementation of QAT crypto engine(qat_hw) v0.6.6";
153+
"Reference implementation of QAT crypto engine(qat_hw) v0.6.7";
154154
#else
155155
const char *engine_qat_name =
156-
"Reference implementation of QAT crypto engine(qat_sw) v0.6.6";
156+
"Reference implementation of QAT crypto engine(qat_sw) v0.6.7";
157157
#endif
158158
unsigned int engine_inited = 0;
159159

@@ -919,10 +919,12 @@ static int bind_qat(ENGINE *e, const char *id)
919919
goto end;
920920
}
921921

922+
#ifndef QAT_OPENSSL_3
922923
if (!ENGINE_set_pkey_meths(e, qat_pkey_methods)) {
923924
WARN("ENGINE_set_pkey_meths failed\n");
924925
goto end;
925926
}
927+
#endif
926928
# ifdef QAT_INTREE
927929
}
928930
# endif
@@ -939,13 +941,15 @@ static int bind_qat(ENGINE *e, const char *id)
939941
goto end;
940942
}
941943
}
944+
# ifndef QAT_OPENSSL_3
942945
if (mbx_get_algo_info(MBX_ALGO_X25519)) {
943946
DEBUG("Multibuffer ECDH X25519 Supported\n");
944947
if (!ENGINE_set_pkey_meths(e, multibuff_x25519_pkey_methods)) {
945948
WARN("ENGINE_set_pkey_meths failed\n");
946949
goto end;
947950
}
948951
}
952+
# endif
949953

950954
if (mbx_get_algo_info(MBX_ALGO_ECDHE_NIST_P256) &&
951955
mbx_get_algo_info(MBX_ALGO_ECDHE_NIST_P384) &&

e_qat.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@
5151
# include <unistd.h>
5252
# include <string.h>
5353

54+
# ifdef QAT_OPENSSL_3
55+
# include "qat_prov_err.h"
56+
# else
57+
# include "e_qat_err.h"
58+
# endif
59+
5460
# ifdef QAT_HW
5561
# include "cpa.h"
5662
# include "cpa_types.h"

0 commit comments

Comments
 (0)