Commit Graph

350 Commits

Author SHA1 Message Date
akallabeth 965d231e49
[return checks] fix use of CloseHandle 2024-09-16 08:22:31 +02:00
akallabeth fe6d861a5c
[channels] fix VCAPITYPE for all channel entry points 2024-09-03 17:26:58 +02:00
akallabeth 0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
Marc-André Moreau c691ef9c8d allow selecting smartcard emulator at runtime rather than link time 2023-08-21 12:00:17 +02:00
Armin Novak e61880d077 [standard] replace __FUNCTION__ with __func__ 2023-07-27 20:02:43 +02:00
Armin Novak 9af563d4d1 [smartcard] fix message queuing
the queye key must not be 0
2023-07-03 20:53:46 +02:00
Armin Novak a4c6b36a19 [build] fix memory sanitizer stack frame warnings 2023-06-07 09:14:45 +02:00
akallabeth a5b42f0f84 [includes] untangled circular includes 2023-03-15 08:22:23 +01:00
akallabeth c3a82daad6 [channels] simplified client linking 2023-03-01 08:18:34 +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 bc3904ec65 [channel,smartcard] Fix message cleanup on shutdown 2022-12-02 15:08:09 +01:00
akallabeth 1849632c43
Fixed format strings to match arguments (#8254)
* Fixed format strings to match arguments

Reviewed and replaced all %d specifiers to match proper type

* Added proxy dynamic channel command type to log messages.
2022-09-29 14:55:27 +02:00
akallabeth cb96e6143d Fixed -Wshadow warnings 2022-06-30 10:49:02 +02:00
akallabeth 6fd71fe737 Eliminate Dead nested assignment warnings 2022-04-28 12:37:19 +02:00
Armin Novak 4d03d7c0bf Freerdp remove #ifdef HAVE_CONFIG_H 2022-03-03 11:26:48 +01:00
Armin Novak b2ad47a809 Reorganized FreeRDP headers 2022-03-03 11:26:48 +01:00
akallabeth 8cc6582044
Unify struct definitions (#7633)
* Unified enum/struct definitions, fixed include issues

* Fixed mac compilation issues

* Added missing include

* Fixed windows server build warnings

* Fixed VS2010 build issue

* Removed unnecessary library linking

* Fixed ThreadPool WinXP compatibility

* Fixed pr review remarks
2022-02-14 14:59:22 +01:00
Armin Novak 3c72cc3306 Refactored rdpdr and dependent channels
* Move parsing code to core library
* Move definitions to public API to allow access from outside
* Move smartcard related parsing to core library
2022-01-11 12:34:43 +01:00
akallabeth 8c543b1de2 Added smartcard emulation layer 2022-01-11 12:34:43 +01:00
Martin Fleisz 9d031012be smartcard: Fix length of output buffer in device control response 2021-07-07 11:48:56 +02:00
Armin Novak f03b074b01 Fixed warnings with missing prototypes 2021-06-18 11:32:16 +02:00
Armin Novak 4dfee30934 Fixed smartcard related warnings 2021-06-18 11:32:16 +02:00
Armin Novak d36d94766e Replaced assert with WINPR_ASSERT 2021-06-14 09:37:07 +02:00
Biswapriyo Nath 173ab04b59 Use same data types as calling function prototypes. 2021-05-31 13:38:19 +02:00
Ondrej Holy 892cbe3261 Fix various memory leaks reported by Coverity
Covscan report contains various memory leak defects which were marked
as important. I have spent some time analyzing them and although they
were marked as important, most of them are in error cases, so probably
nothing serious. Let's fix most of them anyway. The rest are false
positives, or too complicated to fix, or already fixed in master, or
simply I am unsure about them.

Relates: https://github.com/FreeRDP/FreeRDP/issues/6981
2021-04-27 14:25:20 +02:00
akallabeth fab649a1b9 Fixed return length check for SCardGetAttrib 2021-03-20 14:31:56 +01:00
akallabeth b8a8ae4622
Fixed mac issues with smartcard context cleanup (#6890) 2021-03-12 08:56:23 +01:00
akallabeth 4599dc0a60 Check smartcard_convert_string_list for NULL string
In #6821 it has been reported that there are buggy smartcard
drivers that report a string size but fail to allocate the string
itself. This check avoids a crash with such input parameters
2021-03-09 10:20:42 +01:00
Armin Novak c890db30c7 Fixed smartcard_convert_string_list with 0 length 2021-03-03 11:57:26 +01:00
akallabeth 71c2c3102c Fixed format string in smartcard_trace_state_return 2021-03-02 08:03:35 +01:00
sss 6574fdf6e4 reverted changes from clang-format 2021-02-25 14:05:40 +01:00
Gluzskiy Alexandr bee2e1526d allow to use in single threaded mode
(some client side channels and all server side channels still need to be
ported to new api)

server: build fix, do not disable threads for rfx encoder

cliprdr client channel: implemented support for DisableThreads option
looks like thread does not make sense at all for this channel

do not initialize disabled image codecs (respect settings)

channels: client: rail: added support for DisableThreads setting

changed "BOOL DisableThreads" to "UINT32 ThreadingFlags"
dropped unnecessary apu changes

draft implementation of threading settings aware message handling api
for addins/channels

rail: use new messaging api

fixed memory leak

msgs handlers external api changes (as requested)

msgs_handlers: init fix

fixed memory leak

logic fix

resolved problems appeared after rebase to master, dropped unnecessary
changes

git clang-format origin/master

fixed TestFreeRDPCodecRemoteFX.c

"formatting, run `clang-format` please"

properly use new "rfx_context_new(BOOL, UINT32)" everywhere

passed Threading Flags to "rfx_context_new" where available

in older C standarts veriables declaration must be done before any code

requested changes

clang-format as requested

use broken signatures of standert C functions for m$ s**tos

clang-format

requested changes

requested changes

moved ThreadingFlags to stable api zone

define type for channel msg handler

typo fix

clang-format

build fix

us ThreadingFlags from server settings

git clang-format origin/master

clang-format
2021-02-25 14:05:40 +01:00
akallabeth 59377fce5e Fixed smartcard crash on error return (invalid length) 2021-02-18 16:49:19 +01:00
Armin Novak 4b7208fb6e Always return data on SCardGetStatusChange
If the call fails just return empty data for each reader.
2021-02-10 10:36:51 +01:00
akallabeth bad20340cc Fixed issue with GetAttr where the result buffer was not allocated 2021-02-10 10:36:51 +01:00
akallabeth 14d5ad0d79 Fixed GetAttrib return length 2021-02-10 10:36:51 +01:00
akallabeth b0c11ebd91 Fixed smartcard_unpack_reader_state, allow empty names 2021-02-10 10:36:51 +01:00
akallabeth 8217f5a9e3 Fixed SCardTransmit return 2021-02-10 10:36:51 +01:00
akallabeth f693a60ec2 Unified smartcard call data structs 2021-02-10 10:36:51 +01:00
akallabeth 6cf5ba4736 Unified smartcard handle converstion 2021-02-10 10:36:51 +01:00
akallabeth 09d2806ac6 Fixed various return values in case of result != SCARD_S_SUCCESS 2021-02-10 10:36:51 +01:00
akallabeth 5fc24ef408 Fixed GetAttrib call 2021-02-10 10:36:51 +01:00
akallabeth 2767940891 refactored smartcard allocations 2021-02-10 10:36:51 +01:00
akallabeth b049265203 Fixed SCard debug WCHAR string lengths 2021-02-10 10:36:51 +01:00
akallabeth 082b4b59d3 Fixed SCardGetAttrib pbAttr=NULL argument
If fpbAttrIsNULL!=0 set pbAttr NULL on call to SCardGetAttrib
2021-01-26 13:33:27 +01:00
Martin Fleisz b092ab3b85 channels/smartcard: Fix race in channel cleanup 2021-01-22 09:49:56 +01:00
akallabeth 6e3c00725a Cleaned up collections:
ArrayList, MessageQueue, Queue, PubSub, BipBuffer
ObjectPool and BufferPool
2020-11-06 12:30:13 +01:00
akallabeth 5c0ccb7575 Fixed formatting. 2020-06-04 07:55:12 +02:00
Ondrej Holy c03f68059d smartcard: Teoretical fix of uninitialized values
This tries to fixes the following defects reported by covscan tool:
 - channels/smartcard/client/smartcard_operations.c:958: uninit_use_in_call: Using uninitialized value "ret.cReaders" when calling "smartcard_pack_locate_cards_return".
 - channels/smartcard/client/smartcard_operations.c:932: uninit_use_in_call: Using uninitialized value "ret.cReaders" when calling "smartcard_pack_locate_cards_return".

But I am not sure about it...
2020-06-04 07:55:12 +02:00
Ondrej Holy 7554154a04 smartcard: Fix usage of uninitialized values
This fixes the following defect reported by covscan tool:
 - channels/smartcard/client/smartcard_pack.c:942: uninit_use_in_call: Using uninitialized value "tmp" when calling "ConvertFromUnicode".
 - channels/smartcard/client/smartcard_pack.c:894: uninit_use_in_call: Using uninitialized value "tmp" when calling "ConvertFromUnicode".
 - channels/smartcard/client/smartcard_pack.c:475: uninit_use_in_call: Using uninitialized value "tmp" when calling "ConvertFromUnicode".
2020-06-04 07:55:12 +02:00