Commit Graph

80 Commits

Author SHA1 Message Date
Armin Novak
527db6783b
[cmake] split tests
* Keep BUILD_TESTING, but only run tests compatible with API (for
  packaging)
* Add BUILD_TESTING_INTERNAL for all tests including internal function
  tests that modify API to be run on our CI
2024-10-24 09:45:44 +02:00
akallabeth
cb2cbdabfe
[winpr,ncrypt] fix integer narrow 2024-10-03 18:58:26 +02:00
akallabeth
cd18dea174
[return checks] fix use of unicode functions 2024-09-16 06:48:26 +02:00
akallabeth
29697ca68d
[winpr,ncryt] fix a memory leak
NCryptP11EnumKeys did leak memory under certain conditions
2024-09-12 13:29:55 +02:00
akallabeth
6481993305
[winpr,ncrypt] do not abort test if NCryptEnumKeys fails 2024-09-12 13:29:50 +02:00
akallabeth
f9141fb94b
[winpr,ncrypt] improve logging 2024-09-12 13:29:48 +02:00
akallabeth
e00661d338
[warnings] fix dead store warnings 2024-09-12 13:29:46 +02:00
akallabeth
6a1c3b4545
[function pointer] use macro for GetProcAddress
Cast all results of GetProcAddress with WINPR_FUNC_PTR_CAST
2024-09-04 21:31:48 +02:00
akallabeth
245afb706c
[function pointers] unify casts with macro 2024-09-04 20:06:45 +02:00
akallabeth
190929c018
[warnings] fix function pointer casts 2024-08-30 15:40:01 +02:00
akallabeth
6a3564407e
[warnings] fix clang-tidy issues in winpr 2024-08-29 15:20:39 +02:00
akallabeth
9c9d74e920
[warnings] fix redundant casts 2024-08-29 12:03:09 +02:00
akallabeth
15456e1ee1
[warnings] fix implicit widening conversion 2024-08-29 10:47:20 +02:00
akallabeth
1d33095500
[warnings] fix cert-err33-c
Fix unused return values, cast to void if on purpose
2024-08-29 10:19:27 +02:00
Armin Novak
d71af44bb1
[warnings] disable warnings for generated code
* Disable clang-tidy in test build directories
* Disable compiler warnings for test binary directories.

These contain generated code we can not change, so the warnings are just noise
2024-08-28 09:18:30 +02:00
akallabeth
f938c32afa
[winpr,ncrypt] check p11 for NULL 2024-08-09 10:41:43 +02:00
akallabeth
5e662cfb2d
[winpr,ncrypt] add checks to NCryptOpenP11StorageProviderEx 2024-08-09 09:40:27 +02:00
akallabeth
776083234b
[warnings] fix unused-but-set-variable 2024-07-23 09:14:19 +02:00
akallabeth
b3f268ef86
[winpr,ncrypt] improve pkcs11 logging 2024-07-01 10:25:28 +02:00
akallabeth
fed8943447 [pkcs11.h] remove extra-semi-stmt 2024-04-22 18:02:03 +02:00
Ondrej Holy
35d8bc1782 [winpr,ncrypt] use preferably p11-kit-proxy.so
Currently, the opensc-pkcs11.so library is used for ncrypt support.
However, the p11-kit-proxy.so library is able to aggregate more pkcs11
modules at runtime (OpenSC is one of them, but also some third party
modules that are not supported by OpenSC). Let's use preferably
p11-kit-proxy.so if available.
2024-04-22 17:42:52 +02:00
Ondrej Holy
5a28b046d5 [winpr,ncrypt] bundle pkcs11.h and drop pkcs11-helper dependency
The ncrypt implementation currently relies on the pkcs11-helper library.
That is not available on RHEL for example. Let's bundle the standardized
header file from https://github.com/latchset/pkcs11-headers to avoid the
need for extra dependency.

Related: https://github.com/FreeRDP/FreeRDP/discussions/9982
2024-04-22 17:42:52 +02:00
Ondrej Holy
cef3d5e9d4 [winpr,ncrypt] replace deprecated symbol
The CKK_ECDSA symbol is deprecated, it is recommended to use CKK_EC
instead. Let's do this as a preparation for the follow-up changes.
2024-04-22 17:42:52 +02:00
Ondrej Holy
73991c48ce [winpr,ncrypt] obtain module path from provider
Currently, the module path is hardcoded in the build_pkinit_args function.
Let's obtain the module path from provider as a preparation for the
follow-up changes.
2024-04-22 17:42:52 +02:00
Ondrej Holy
79975cfbe3 [winpr,ncrypt] drop redundant library paths
The pkcs11 implementaion contains a list of the standard library paths
for various architectures and distribution. But that list also contains
just the opensc-pkcs11.so basename without path. Therefor I am conviced
that all those other entries can be simply dropped. Let's do that as
a preparation for the follow-up changes.
2024-04-22 17:42:52 +02:00
akallabeth
0c9fb50170 [coverity] fix unchecked return 2024-04-12 13:30:35 +02:00
akallabeth
19d9afc0b4 [coverity] 1543289 Double free 2024-04-12 09:45:09 +02:00
akallabeth
8bef31fdae [coverity] 1543108 Resource leak 2024-04-11 12:04:07 +02:00
akallabeth
d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +01:00
akallabeth
0e44b2c674 [clang-tidy] clang-analyzer-unix.Malloc 2024-02-15 11:49:16 +01:00
akallabeth
0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
akallabeth
207def5c56 [clang-tidy] readability-isolate-declaration 2024-02-15 11:49:16 +01:00
akallabeth
bb42d425ed [gcc,clang] add support for attribute(malloc)
Mark all malloc like functions and add their appropriate free function
to let the compiler complain on mismatches
2024-02-02 15:10:40 +01:00
David Fort
8d461f40ab [build] fix some warnings 2023-12-19 16:34:41 +01:00
Armin Novak
a16479f5d5 [winpr,ncrypt] cast constants to SECURITY_STATUS 2023-10-16 15:10:13 +02:00
akallabeth
9cee9b3c08 [c standard] use WINPR_FALLTHROUGH
use the macro to silence intentional switch fallthrough locations
2023-08-25 12:56:36 +02:00
Armin Novak
ef5c0e78ab [build] use define WINPR_FALLTHROUGH
with c17 compatible compilers annotate with [[fallthrough]]
2023-07-31 23:46:53 +02:00
Armin Novak
c26f356225 [winpr,ncrypt] do not link pkcs11 for dynamic detection 2023-07-17 14:04:03 +02:00
Armin Novak
81e95e51ca [winpr,ncrypt] log problems during cert enumeration 2023-06-07 23:05:54 +02:00
Armin Novak
641022b795 [logging] remove __FUNCTION__ from actual message
prefer the log formatter to provide that information.
2023-01-25 16:26:39 +01:00
akallabeth
2479ebd816 Fixed compiler warnings 2023-01-10 17:38:00 +01:00
akallabeth
37ab25e19d Fixed all Wdocumentation warnings 2022-12-12 14:24:55 +01:00
akallabeth
d4808dd3e1 Fixed various compiler warnings 2022-12-09 15:58:26 +01:00
akallabeth
7ab917dca8 Fixed Wsign-compare warnings 2022-12-09 15:58:26 +01:00
Armin Novak
bd7e2263ad fixed const and type cast warnings 2022-12-09 15:58:26 +01:00
akallabeth
0186a9b303 Fixed some warnings 2022-12-09 15:58:26 +01:00
akallabeth
7f221a653d Fixed Wpedantic warnings 2022-12-09 15:58:26 +01:00
akallabeth
7894cf545c Fixed Wmissing-varialbe-declarations warnings 2022-12-09 15:58:26 +01:00
David Fort
bc8afa0ad5 ncrypt_pkcs11: fix buffer allocation for key name 2022-12-02 15:08:09 +01:00
akallabeth
5799fb2018 Replace ConvertFromUnicode and ConvertToUnicode
* Use new ConvertUtf8ToWChar, ConvertUtf8NToWChar,
  ConvertUtf8ToWCharAlloc and ConvertUtf8NToWCharAlloc
* Use new ConvertWCharToUtf8, ConvertWCharNToUtf8,
  ConvertWCharToUtf8Alloc and ConvertWCharNToUtf8Alloc
* Use new Stream UTF16 to/from UTF8 read/write functions
* Use new settings UTF16 to/from UTF8 read/write functions
2022-11-28 10:42:36 +01:00