Armin Novak
d03f230426
[winpr,crypto] Split headers
...
Split windows API emulation from custom functions
Including both might yield issues with OpenSSL headers
2022-11-21 13:27:08 +01:00
Armin Novak
f81b3b05d2
Fixed -Wtautological-value-range-compare
2022-11-21 10:12:31 +01:00
Armin Novak
7c5652c15a
Fixed -Wmissing-prototypes
2022-11-21 10:12:31 +01:00
Armin Novak
a40ade5abc
Fixed -Wincompatible-pointer-types
2022-11-21 10:12:31 +01:00
Armin Novak
bc7c4cc6a1
Fixde -Wimplicit-function-declaration
2022-11-21 10:12:31 +01:00
Armin Novak
9adc1e4b08
Fixed -Wunreachable-code-return
2022-11-21 10:12:31 +01:00
Armin Novak
31c1700c0c
Fixed -Wunused-variable
2022-11-21 10:12:31 +01:00
Armin Novak
921315fdbf
Fixed -Wmissing-variable-declarations
2022-11-21 10:12:31 +01:00
Armin Novak
dacebc62a3
Use Stream_CheckAndLogRequiredLength, fix WLog TAG
...
* Log stream length requirement violations
* Use proper defines for WLog tags
2022-11-21 09:57:27 +01:00
Armin Novak
43eccb6247
[winpr,io] removed unused unimplemented functions
2022-11-21 09:16:54 +01:00
Mike Gilbert
3053543068
winpr/string.h: #include <stdio.h> for snprintf
...
Fixes failure with -Werror=implicit-function-declaration.
```
FAILED: libfreerdp/CMakeFiles/freerdp.dir/core/state.c.o
/usr/bin/ccache /usr/bin/cc -DEXT_PATH=\"/usr/local/lib64/freerdp3/extensions\" -DFREERDP_EXPORTS -DNDEBUG -DWITH_OPENSSL -DWITH_VERBOSE_WINPR_ASSERT -DWITH_WAYLAND -DWITH_X11 -DWITH_XKBFILE -D_FILE_OFFSET_BITS=64 -Dfreerdp_EXPORTS -I/home/floppym/src/FreeRDP/winpr/include -I/home/floppym/src/FreeRDP/build/winpr/include -I/home/floppym/src/FreeRDP/build -I/home/floppym/src/FreeRDP/build/include -I/home/floppym/src/FreeRDP/include -Werror=implicit-function-declaration -fPIC -Wall -fvisibility=hidden -Wimplicit-function-declaration -Wredundant-decls -fno-omit-frame-pointer -O3 -DNDEBUG -flto=auto -fno-fat-lto-objects -fPIC -std=gnu11 -MD -MT libfreerdp/CMakeFiles/freerdp.dir/core/state.c.o -MF libfreerdp/CMakeFiles/freerdp.dir/core/state.c.o.d -o libfreerdp/CMakeFiles/freerdp.dir/core/state.c.o -c /home/floppym/src/FreeRDP/libfreerdp/core/state.c
In file included from /home/floppym/src/FreeRDP/libfreerdp/core/state.c:24:
/home/floppym/src/FreeRDP/libfreerdp/core/state.c: In function ‘state_run_result_string’:
/home/floppym/src/FreeRDP/winpr/include/winpr/string.h:186:19: error: implicit declaration of function ‘snprintf’ [-Werror=implicit-function-declaration]
186 | #define _snprintf snprintf
| ^~~~~~~~
/home/floppym/src/FreeRDP/libfreerdp/core/state.c:67:9: note: in expansion of macro ‘_snprintf’
67 | _snprintf(buffer, buffersize, "%s [%d]", name, status);
| ^~~~~~~~~
/home/floppym/src/FreeRDP/libfreerdp/core/state.c:25:1: note: include ‘<stdio.h>’ or provide a declaration of ‘snprintf’
24 | #include <winpr/string.h>
+++ |+#include <stdio.h>
25 |
/home/floppym/src/FreeRDP/winpr/include/winpr/string.h:186:19: warning: incompatible implicit declaration of built-in function ‘snprintf’ [-Wbuiltin-declaration-mismatch]
186 | #define _snprintf snprintf
| ^~~~~~~~
/home/floppym/src/FreeRDP/libfreerdp/core/state.c:67:9: note: in expansion of macro ‘_snprintf’
67 | _snprintf(buffer, buffersize, "%s [%d]", name, status);
| ^~~~~~~~~
/home/floppym/src/FreeRDP/winpr/include/winpr/string.h:186:19: note: include ‘<stdio.h>’ or provide a declaration of ‘snprintf’
186 | #define _snprintf snprintf
| ^~~~~~~~
/home/floppym/src/FreeRDP/libfreerdp/core/state.c:67:9: note: in expansion of macro ‘_snprintf’
67 | _snprintf(buffer, buffersize, "%s [%d]", name, status);
| ^~~~~~~~~
cc1: some warnings being treated as errors
```
Bug: https://bugs.gentoo.org/881695
2022-11-18 06:43:11 +01:00
Richard E. Silverman
7bbb8706ee
fix segfault on missing CSP
...
These routines:
NCryptOpenStorageProvider()
winpr_NCryptOpenStorageProviderEx
would segfault with PKCS11 support enabled, if the user did not supply
a service provider name ("CSP"); they assumed the parameter
pszProviderName would always be non-NULL, but it's NULL in that case.
2022-11-16 14:18:22 +01:00
akallabeth
d71174d091
[winpr, crt] Added wcsstr implementation
2022-11-14 09:28:22 +01:00
akallabeth
cf5cb35697
[winpr, crt] Fix wcs*cmp and wcs*len checks
2022-11-14 09:28:22 +01:00
akallabeth
ed57dd37b9
Added function _wcsncmp
...
* Compare WCHAR strings up to n characters
2022-11-14 09:28:22 +01:00
Armin Novak
843680e543
Clipboard syntesizer replaces path separators
...
The clipboard expects windows style paths, so replace all / with \
2022-10-28 08:22:43 +02:00
Armin Novak
f9faf3d3d5
Unified synthetic file cleanup
2022-10-28 08:22:43 +02:00
Armin Novak
a7a8e7ee8d
Fixed read/write of filedescriptorw times
2022-10-28 08:22:43 +02:00
Armin Novak
096e98d8b5
Moved verbose log message
...
Do not log expected abort conditions
2022-10-28 08:22:43 +02:00
Armin Novak
dbb1889a54
Removed unused BipBuffer
2022-10-27 10:39:25 +02:00
Armin Novak
4ea4f5e936
Fixed compile error for old openssl
2022-10-27 10:03:32 +02:00
akallabeth
22dce52d15
Add function winpr_MoveFileEx
2022-10-25 13:58:05 +02:00
fifthdegree
78ba60f50f
Check for NULL pointer in winpr_Digest_Free
2022-10-24 08:33:57 +02:00
akallabeth
68ad8d5a1c
Added missing return in winpr_Digest_New
2022-10-20 19:24:41 +02:00
Armin Novak
2a181c19c5
Added missing include
2022-10-19 20:33:17 +02:00
Armin Novak
a66d9d1706
Improve OpenSSL provider loading
...
* Added log messages for failure to load a provider
* Add code to clean up loaded providers on shutdown
2022-10-19 20:33:17 +02:00
Armin Novak
1f6476016d
Update command line option /sec*
...
* Deprecate /sec-* flags
* Allow multiple arguments for /sec
2022-10-19 20:31:53 +02:00
fifthdegree
ffe8e45aff
Pass bindings through Negotiate on first call
2022-10-19 18:55:38 +02:00
fifthdegree
e847f159a6
Try to use the smartcard key name Windows uses
...
Windows expects the containerName field in TSSmartCardCreds to be what
it would use for a smartcard key's name. Try to accomodate that (at
least for PIV and GIDS cards).
2022-10-19 18:55:38 +02:00
akallabeth
eb77fd7b0d
Added replacement HMAC-MD5 implementation
2022-10-19 08:17:11 +02:00
akallabeth
3a5fb5e3a3
Added replacement MD5 implementation
2022-10-19 08:17:11 +02:00
akallabeth
309a6bea77
Added replacement MD4 implementation
2022-10-19 08:17:11 +02:00
akallabeth
1e1b3b6c3c
Updated TestCryptoHash
...
Do multiple updates to hashes to better test implementation
2022-10-19 08:17:11 +02:00
akallabeth
43c5289928
Replaced memset/ZeroMemory with initializer
...
* Addes WINPR_ASSERT on many occations
* Replaced memset with array initializer
* Replaced ZeroMemory with array initializer
2022-10-14 12:11:01 +02:00
David Fort
57d2a27980
fix smartcard listing
...
This commit fixes various bugs that I've noticed on some windows systems with
smartcards that contains multiple certificates:
* With some drivers if you retrieve the ATR while enumerating the NCrypt keys, it seems to
confuse the NCrypt key context (and you're unable to retrieve certificate property). As
we don't use the ATR, let's remove the ATR retrieval.
* if don't give any user or domain on the command line, in settings you get User=Domain=NULL,
but if you pass /u:user, you get User="user" and Domain = ""(empty string not NULL). The
smartcard filtering by user/domain was not ready for that.
2022-10-14 12:05:16 +02:00
akallabeth
b70db86e51
Fixed uninitialized variable warnings
2022-10-14 11:16:23 +02:00
akallabeth
bba18b7af5
Fixed -Waddress warnings
2022-10-13 14:38:06 +02:00
Armin Novak
1d71ace487
Fixed PubSub, return error on NULL
2022-10-13 13:57:11 +02:00
David Fort
f76c14c256
fix smartcard logon with smartcard emulation
...
When smartcard emulation was enabled we were dumping the key and cert to
temporary files for PKINIT call, but they were deleted before we have
actually done the PKINIT. This patch fixes it.
It also add debug statement for the listing of smartcard keys / certs.
This also fixes the listing of smartcard on certain windows configurations
were we have to force NCRYPT_SILENT when doing a NCryptOpenKey.
2022-10-13 12:03:58 +02:00
Marc-André Moreau
27a865af74
Add Negotiate SSPI authentication module filtering
2022-10-12 22:07:45 +02:00
akallabeth
2f84a4856c
Fixed missing-field-initializers warnings
2022-10-11 13:28:30 +02:00
akallabeth
9d197b263c
Fixed conditional-uninitialized warnings
2022-10-11 13:28:30 +02:00
akallabeth
23082b090c
Removed misleading comments
2022-10-11 13:28:30 +02:00
Martin Fleisz
b45f580055
sspi: Do not call copy on empty strings
...
It might happen that the username/domain/password strings are set to an
empty string. This means that the null pointer check will pass but the
application will assert in the copy helper function.
This fix simple checks the length of the identity strings and only calls
copy in case the length is greater than 0.
2022-10-11 12:15:47 +02:00
Armin Novak
5476d48025
Use Stream_StaticInit for bitmap read
2022-10-10 15:29:45 +02:00
Armin Novak
d879d87610
Use static wStream for packet logger
2022-10-10 15:29:45 +02:00
David Fort
58a3919435
winpr: add some checks in InitializeSecurityContext and AcceptSecurityContext
...
In native windows SSPI, AcceptSecurityContext and InitializeSecurityContext return
SEC_E_INVALID_HANDLE if the provided context is an empty context. Add the checks so
that our SSPI implementation behave the same way.
2022-10-10 09:01:04 +02:00
fifthdegree
d6c614b583
Fix bugs and add features in sspi packages
...
* Kerberos: correctly set principal when no service part is provided
* Kerberos: don't expect a krb_ap_rep when mutual auth was not requested
* Kerberos: include gss header in max signature length
* Negotiate: tolerate optimistic token being the final one
* Kerberos: support channel bindings
* Negotiate: pass channel bindings to sub-mechanism
* NTLM: tolerate receiving an input buffer desc on first call
2022-10-06 21:33:01 +02:00
Marc-André Moreau
479e891545
check return values for SetCredentialsAttributes, throw warnings for unsupported attributes
2022-09-30 19:33:12 +02:00
Marc-André Moreau
fddb0dac75
add missing OOM checks
2022-09-30 19:33:12 +02:00