Commit Graph

3202 Commits

Author SHA1 Message Date
akallabeth
a3686f0f1f Fixed Wmissing-prototypes warnings 2022-12-09 15:58:26 +01:00
akallabeth
3ddf99ad64 Fixed Wformat warnings 2022-12-09 15:58:26 +01:00
akallabeth
7e31b877fc [winpr, tests] Fixed ASN unit test const warning 2022-12-09 15:58:26 +01:00
akallabeth
389817cb57 [winpr,crypto] fixed const correctness of md4/5 2022-12-09 15:58:26 +01:00
akallabeth
aaae70ff05 Fixed missing const casts 2022-12-09 15:58:26 +01:00
akallabeth
bf0ce5bf3a [winpr,sspi] Fixed const correctness of API
sspi_GetAuthIdentityVersion and sspi_GetAuthIdentityFlags do not
modify, make arguments const
Same is true for sspi_GetAuthIdentityUserDomainW,
sspi_GetAuthIdentityUserDomainA, sspi_GetAuthIdentityPasswordA and
sspi_GetAuthIdentityPasswordW
2022-12-09 15:58:26 +01:00
Armin Novak
558d5b5e8d [build,ci] update ci to not always build kerberos
disable kerberos for targets not supporting it
2022-12-09 12:36:12 +01:00
Armin Novak
73d5f37537 [build] move krb5 detection to winpr
only used internally in winpr, no need for project wide configuration
2022-12-09 12:36:12 +01:00
Armin Novak
f2016c77c5 [winpr] renamed WITH_GSS_NO_NTLM_FALLBACK 2022-12-09 12:36:12 +01:00
Armin Novak
819a62a8df Disable kerberos support for android and ios 2022-12-09 12:36:12 +01:00
Armin Novak
2fdae68bbd [build] disable krb5 support on windows
windows provides native support, no need for libkrb5
2022-12-09 12:36:12 +01:00
fifthdegree
ad87144ce5 Rename WITH_GSSAPI to WITH_KRB5
Change cmake variables to not be gssapi specific
2022-12-09 12:36:12 +01:00
akallabeth
fb6c48bcc3 [winpr] define WINPR_ASSERT to assert
If WITH_VERBOSE_WINPR_ASSERT is not set define WINPR_ASSERT to be the
normal C assert
2022-12-09 11:09:38 +01:00
akallabeth
c7bd8c3df9 [winpr,sspi] fix kerberos resource cleanup
kerberos cache and keytab were not properly cleaned up for cases where
the credentials were not available in kerberos
2022-12-09 11:08:11 +01:00
akallabeth
6613155275 [winpr,utils] pretty print stacktrace
do not add an additional newline in the messages.
2022-12-09 10:28:40 +01:00
Armin Novak
074f28073a [winpr,sspi] enable negotiate by default 2022-12-08 11:07:00 +01:00
akallabeth
9ca34bc876 [winpr,sspi] fix memory leak in kerberos_InitializeSecurityContextA 2022-12-02 15:08:09 +01:00
akallabeth
b0aef46caf [winpr,krb] fixed kerbeos context handling 2022-12-02 15:08:09 +01:00
Armin Novak
e1eacad74c [scard] fixed memory leak
card_id_and_name_* return allocated values, free after use
2022-12-02 15:08:09 +01:00
Armin Novak
58bc1ee4c9 [smartcard] fix multi string conversion 2022-12-02 15:08:09 +01:00
David Fort
bc8afa0ad5 ncrypt_pkcs11: fix buffer allocation for key name 2022-12-02 15:08:09 +01:00
Armin Novak
0091f72761 [winpr,smartcard] fix PCSC_SCardListReaders 2022-12-02 15:08:09 +01:00
Armin Novak
bbf893a5d8 [winpr,crt] fix unicode conversion functions
There are subtle differences between MultiByteToWideChar,
WideCharToMultibyte and the ICU equivalents
2022-11-29 15:42:10 +01:00
akallabeth
6014efc19b [winpr,smartcart] simplified casts 2022-11-28 10:42:36 +01:00
akallabeth
66dad5deae fixed review issues
* Overallocation in unicode functions
* Removed useless statements
* Fixed loop indices
2022-11-28 10:42:36 +01:00
akallabeth
7bf8b46726 [smartcard] Use multistring convertion functions 2022-11-28 10:42:36 +01:00
Armin Novak
2784d54d6f Deprecate MultiByteToWideChar and WideCharToMultiByte 2022-11-28 10:42:36 +01:00
Armin Novak
6f2d7f94cf Deprecate ConvertFromUnicode and ConvertToUnicode 2022-11-28 10:42:36 +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
Armin Novak
2aefa9418d [winpr,stream] Added functions to read/write utf-8
* Stream_Write_UTF16_String_From_UTF8 writes a UTF-8 string to a
      stream in UTF-16 encoding
    * Stream_Read_UTF16_String_To_UTF8 reads a UTF-16 encoded string
      from the stream and returns it in UTF-8 encoding
2022-11-28 10:42:36 +01:00
Armin Novak
0fb8c9e87e [winpr,crt] Added ConvertMszWCharNToUtf8* 2022-11-28 10:42:36 +01:00
akallabeth
4f7114a140 [winpr,crt] Added ConvertMszUtf8NToWChar*
A conversion function that can handle multistrings (e.g. each element is
'\0' delimited, termination is '\0\0')
2022-11-28 10:42:36 +01:00
akallabeth
5c91c30a18 [winpr,crt] Added new unicode conversion functions
* Added functions converting WCHAR to/from UTF-8 with given buffers
  and proper size_t arguments to have a centralized check for
  integer overflows on RDP deserialization
* Added allocating functions converting WCHAR to/from UTF-8 as
  convenience
2022-11-28 10:42:36 +01:00
akallabeth
5ae159303f [winpr,crt] Added unicode conversion backends
* Support apple with NSString
* Support android via JNI
* Split ICU to own file
2022-11-28 10:42:36 +01:00
akallabeth
00ee213f97 [winpr,android] Unify JNI_OnLoad
* Split JNI_OnLoad and JNI_OnUnload to own module to be usable from more
  than only timezone
* Explicitly call System.loadLibrary('winpr') (and other FreeRDP
  libraries) in android client as JNI_OnLoad is only triggered by that
  and not implicit loading
2022-11-28 10:42:36 +01:00
akallabeth
113290c35c [winpr,string] Use size_t arguments
* Use size_t arguments for ByteSwapUnicode, ConvertLineEndingToLF
  and ConvertLineEndingToCRLF
* Simplify code of line conversion functions
2022-11-28 10:42:36 +01:00
akallabeth
3262e11d1f [winpr,asn] fix too verbose log message 2022-11-24 11:43:01 +01:00
Armin Novak
7b95014157 [winpr,crypto] Split crypto header renamed
* Renamed custom winpr crypto function header
* Added compatiblity header
2022-11-23 09:39:56 +01:00
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