Commit Graph

3582 Commits

Author SHA1 Message Date
Armin Novak
208bcbd153 [winpr] Add initializer functions
* Add initializer for wStream
* Add initializer for ASN1 decoder
2026-02-25 19:39:24 +01:00
Armin Novak
48267edf2f [winpr] add WINPR_C_ARRAY_INIT
since C23 allows c++ style initializing replace direct use with this
macro
2026-02-25 19:23:08 +01:00
Armin Novak
a5609b929e [winpr,ncrypt] use pragma once as guard 2026-02-25 15:05:51 +01:00
Armin Novak
5479777822 [winpr,file] fix unit test for WriteFile 2026-02-25 13:39:38 +01:00
Armin Novak
3fcc287b16 [warnings] initialize all va_list 2026-02-25 07:41:39 +01:00
Armin Novak
b7892a7cc1 [winpr,sspi] fix kerberos unused warnings
when building without kerberos, eliminate all unused warnings
2026-02-25 07:41:39 +01:00
Armin Novak
6cebb3e0cd [winpr] fix sign warnings 2026-02-24 16:23:15 +01:00
Armin Novak
8a24443ed6 [nodiscard] fix wrong attribute position 2026-02-24 16:10:11 +01:00
Armin Novak
7c0a0c903b [winpr,crypto] use size_t as length for md[45] 2026-02-24 09:05:46 +01:00
Armin Novak
33bcf76950 [winpr,collections] fix Queue and MessageQueue
EnsureCapacity was nulling the wrong elements, this commit rectifies
that.
2026-02-19 12:07:42 +01:00
Armin Novak
b08892fb9c [winpr,utils] improve TestQueue
properly test queue fill, drain and resize
2026-02-18 15:43:40 +01:00
Armin Novak
d48452faf3 [winpr,utils] Add Queue_Capacity 2026-02-18 15:43:40 +01:00
Armin Novak
b78cb455cb [winpr,queue] improve queue management
* Fix Queue_EnsureCapacity reallocation handling, ensure queue->tail is
  properly updated.
* Fix allocation behaviour, use growthFactor * 32 as block size.
* Add doxygen for Queue_New
2026-02-18 15:43:39 +01:00
Armin Novak
c0d477d278 [winpr,utils] improve TestMessageQueue
properly test queue fill, drain and resize
2026-02-18 15:32:04 +01:00
Armin Novak
57dfd75231 [winpr,utils] add MessageQueue_Capacity 2026-02-18 14:26:03 +01:00
Armin Novak
c9b72743e3 [winpr,utils] ensure message queue capacity
the capacity should always be larger than what is actually used.
2026-02-18 14:26:03 +01:00
Armin Novak
3b286a923d [winpr,stream] improve return checks in Stream_EnsureCapacity
* Properly check all return values and propagate them back to caller
* Simplify new stream size calculation
2026-02-18 14:26:03 +01:00
Armin Novak
d015ba58de [winpr,collections] fix sign warnings 2026-02-17 16:38:35 +01:00
Armin Novak
118afc0b95 [allocations] fix growth of preallocated buffers
* Replace * 2 with * sizeof(WCHAR) for string usages
* Grow streams and other buffers reasonably, e.g. add 128 elements per
  try and check for possible overflows
* Add constant postfix to force them to 64bit
2026-02-17 13:54:34 +01:00
Armin Novak
81cf9f6cf0 [winpr,warnings] properly handle function return 2026-02-16 09:18:36 +01:00
Armin Novak
399d92f26e [winpr] mark function pointers [[nodiscard]] 2026-02-15 23:57:23 +01:00
Armin Novak
606250f4cb [winpr,smartcard] fix returned attribute length
SCARD_ATTR_DEVICE_SYSTEM_NAME_W requires twice the size, so multiply
before return.
2026-02-12 10:01:06 +01:00
Armin Novak
b6b32bf8c4 [winpr,test] replace sscanf 2026-02-10 16:56:48 +01:00
Armin Novak
47c538fd3f [winpr] fix uninitialized variables 2026-02-10 16:56:44 +01:00
Armin Novak
6bf8793589 [winpr,smartcard] remove unused variable 2026-02-10 15:53:05 +01:00
Armin Novak
f8d85ac201 [winpr,smartcard] fix warnings 2026-02-10 15:53:05 +01:00
Armin Novak
52cf5d18f4 [winpr,utils] fix WITH_RESOURCE_VERSIONING
winpr_getApplicationDetailsVersion returned a wrong value.
2026-02-10 15:53:04 +01:00
Armin Novak
7a83036f9a [winpr,smartcard] fix variable data type 2026-02-10 15:53:04 +01:00
akallabeth
e253643386 [winpr,smartcard] simplify PCSC_ReadDeviceSystemName
* If we read SCARD_ATTR_DEVICE_SYSTEM_NAME_A just pass the actual
  destination buffer, no further processing required.
* In case of SCARD_ATTR_DEVICE_SYSTEM_NAME_W allocate a WCHAR version of
  the result, copy back to destination buffer.
2026-02-09 10:27:09 +01:00
Martin Fleisz
67705cfb35 Merge pull request #12207 from akallabeth/vendor-by-app
Vendor by app
2026-02-09 10:24:17 +01:00
miguel-cv
19b8e80b70 Add missing attribute in smartcard_pcsc
Add SCARD_ATTR_DEVICE_SYSTEM_NAME_A and SCARD_ATTR_DEVICE_SYSTEM_NAME_W to be more compliant with what windows expects. Returns the (provided by pcsc) reader_name.
2026-01-30 09:15:11 +01:00
Armin Novak
5f7f1672ff [winpr,utils] add application details getter/setter
* Allow an application to set a vendor/product/version namespace to search
  for configuration files/settings/...
* Replace all WINPR_VENDOR_STRING et al macros with these getters
2026-01-29 22:47:40 +01:00
Armin Novak
81d6ed2784 [winpr,path] modify GetCombinedPath
Allow the subPath argument to be a format string with variadic
arguments. This allows to generate a subPath on the fly. This change is
API compatible.
2026-01-29 22:47:30 +01:00
akallabeth
d17dc23257 [winpr,test] TestSynchTimerQueue: use int64
The calculations might overflow or be negative, so use INT64 to store
and present the results.
2026-01-28 09:52:49 +01:00
akallabeth
076a8386a6 Merge pull request #12186 from akallabeth/error-handling-fixes
Error handling fixes
2026-01-26 17:05:19 +01:00
akallabeth
1e4c1cd526 [winpr] mark all WINPR_ATTR_MALLOC also nodiscard 2026-01-26 13:39:41 +01:00
akallabeth
d93fda1c56 [winpr,sspi] mark unused function parameters
silence warnings about unused parameters for API function
implementations
2026-01-26 11:26:50 +01:00
akallabeth
5013b28e8b Merge pull request #12171 from jadahl/wip/ntlm-kerberos-package-info
Add support for querying SECPKG_ATTR_PACKAGE_INFO to NTLM and Kerberos
2026-01-25 17:04:48 +01:00
akallabeth
75ca7c181f [winpr,wlog] remove duplicate wlog destroy 2026-01-23 22:20:51 +01:00
Jonas Ådahl
92ad023764 ntlm: Implement support for querying the package info attribute 2026-01-22 12:50:24 +01:00
Jonas Ådahl
d2c68dcada kerberos: Implement support for querying the package info attribute 2026-01-22 12:50:24 +01:00
Jonas Ådahl
49b6d99c69 libwinpr/sspi: Expose free/allocate functions for context buffers
This will be necessary to allow implementing support for querying the
package info attribute.
2026-01-22 12:50:24 +01:00
akallabeth
8a53798049 [core,freerdp] eliminate uninitialized warning 2026-01-20 17:15:13 +01:00
akallabeth
cf0a37ceb9 [winpr,sspi] fix Heimdal support
Add support to kerberos_ATTR_AUTH_IDENTITY
2026-01-20 17:15:07 +01:00
akallabeth
5d89c9033e [winpr,sspi] fix Heimdal support
Add support to kerberos_ATTR_AUTH_IDENTITY
2026-01-20 16:41:40 +01:00
Jonas Ådahl
0da2c31a9b kerberos: Add support for querying SECPKG_ATTR_AUTH_IDENTITY
This krb5_unparse_name_flags() to retrieve the user part of the
principal, and krb5_princ_realm() for the domain, while checking for
buffer overflows before writing to the auth identity structure.
2026-01-20 15:22:41 +01:00
akallabeth
84d3d99338 [clang-tidy] clean up code warnings 2026-01-19 13:05:26 +01:00
akallabeth
fb8efd45f2 [c,format] fix format string and review warnings 2026-01-16 13:36:14 +01:00
akallabeth
35b9d1b338 [c,printf] fix wlog format string to match arguments 2026-01-16 11:43:33 +01:00
akallabeth
8388fea2f7 [c,printf] fix wlog format string to match arguments 2026-01-16 11:43:30 +01:00