Commit Graph

56 Commits

Author SHA1 Message Date
Armin Novak
50e9d3adf9 Implemented new AuthenticateEx callbacks. 2021-09-04 18:01:30 +02:00
Armin Novak
5fb59a23a9 Fixed lots of compilation warnings and type mismatches 2021-06-16 15:21:56 +02:00
akallabeth
b494a193db Refactored certificate API:
* Proper encapsulation
* known_hosts2 backend extended (storing PEM)
* New backend storing each host certificate in a file
2021-05-11 08:00:18 +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
Armin Novak
ac4bb3c103 End connection before user callbacks if aborted.
If somewhere in freerdp_connect freerdp_abort_connect was called
the user callbacks Authenticate, GatewayAuthenticate and
Verify[Changed|X509]Certificate[Ex] must not be called.
2020-02-19 16:44:42 +01:00
Armin Novak
7d252cdc8e Added freerdp_set_last_error_ex function
This new function allows better logging of call locations
for errors. Additionally added freerdp_set_error_log macro
to record function, file and line the error was set.

Signed-off-by: Armin Novak <armin.novak@thincast.com>
2020-01-08 17:39:25 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Martin Fleisz
645cd3208f core: Fix handling of PromptForCredentials setting
The prompt for credentials setting was incorrectly used in FreeRDP. If
this setting is set to 1 in a rdp file the client should prompt for
credentials even if it has credentials stored for this connection. If
the setting is set to 0 the client should either use the stored
credentials (if present) or ask for username/password otherwise.
This PR changes the old handling (if PromptForCredentials was set to 0
no credential prompting was done) to the desired behavior.
2019-08-20 16:25:08 +02:00
Armin Novak
3b38479ec5 Added PromptForCredentials setting. 2019-07-15 12:01:30 +02:00
Armin Novak
90d2e42600 Fixed ntlm_authenticate, split return from continue flag. 2018-11-13 11:22:37 +01:00
Armin Novak
847ee233f4 Fixed resource leak in rpc_ntlm_http_request 2018-10-25 12:49:42 +02:00
Armin Novak
88d310ff2c Fixed compiler warnings (casts, ...) 2018-10-18 09:09:30 +02:00
Armin Novak
fc9ff6d2fc Made gateway NTLM self contained. 2018-09-28 12:29:29 +02:00
Armin Novak
f5f155b057 Refactored RpcClient functions 2018-09-27 16:26:46 +02:00
Armin Novak
8a677d6cf2 Refactored rdg channel structs. 2018-09-27 16:05:14 +02:00
Armin Novak
d748adbf14 Refactored gateway ncacn HTTP to be self contained. 2018-09-27 15:19:41 +02:00
Armin Novak
a5fdf9e006 Refactored gateway HTTP to be self contained. 2018-09-27 15:04:41 +02:00
Armin Novak
c3f008c36c Functions static where appropriate. 2018-01-15 13:22:01 +01:00
Armin Novak
4ca6b9bf10 Unified random functions and remaining MD5. 2016-02-24 20:41:01 +01:00
Bernhard Miklautz
bf73f4e4f1 Fix unchecked strdups
* add missing checks
* adapt function return values where necessary
* add initial test for settings
2015-06-22 19:09:59 +02:00
Marc-André Moreau
0e57706de5 libfreerdp-core: cleanup connect error codes, fix Win32 NLA 2015-02-17 21:01:27 -05:00
Marc-André Moreau
4ecff39eb6 libfreerdp-core: more tsg in/out channel refactoring 2015-02-12 14:08:38 -05:00
Marc-André Moreau
c92e82b3dc libfreerdp-core: improve TSG virtual connection and channel management 2015-02-12 12:03:15 -05:00
Marc-André Moreau
75cad064f1 libfreerdp-core: refactor tsg virtual connection, in/out channels 2015-02-11 15:26:22 -05:00
Marc-André Moreau
70fab69347 libfreerdp-core: gateway connection refactoring 2015-02-11 14:27:29 -05:00
Marc-André Moreau
f8259f94c5 libfreerdp-core: add event-driven RTS connection code 2015-02-03 20:39:47 -05:00
Marc-André Moreau
1bf0e2ee03 libfreerdp-core: add more IN/OUT gateway channel states 2015-02-03 16:33:45 -05:00
Marc-André Moreau
7b25f9130b libfreerdp-core: improve error handling in ts gateway 2015-02-03 14:44:31 -05:00
Marc-André Moreau
5aea07d401 libfreerdp-core: add better state machine transitions to ts gateway 2015-02-02 18:50:26 -05:00
Marc-André Moreau
e0b0c77ecb libfreerdp-core: improve http parsing 2015-02-02 17:16:32 -05:00
Marc-André Moreau
4239a1d4f4 libfreerdp-core: remove TS Gateway send queue 2015-02-01 20:47:43 -05:00
Marc-André Moreau
f79deaff7b libfreerdp-core: partial OUT channel recycling support 2015-01-13 16:35:34 -05:00
Marc-André Moreau
fc38dcc775 libfreerdp-core: gateway cleanup 2015-01-13 13:50:46 -05:00
Marc-André Moreau
cc2321d359 libfreerdp-core: fix leak and use after free in tsg ListDictionary usage 2014-12-11 17:08:22 -05:00
Marc-André Moreau
d8e10ac04a freerdp: patch leaks reported by valgrind when using TS Gateway 2014-12-11 11:25:34 -05:00
Hardening
dd6d829550 Allow transport_write calls to be non-blocking
This big patch allows to have non-blocking writes. To achieve
this, it slightly changes the way transport is handled. The misc transport
layers are handled with OpenSSL BIOs. In the chain we insert a
bufferedBIO that will bufferize write calls that couldn't be honored.

For an access with Tls security the BIO chain would look like this:
  FreeRdp Code ===> SSL bio ===> buffered BIO ===> socket BIO

The buffered BIO will store bytes that couldn't be send because of
blocking write calls.

This patch also rework TSG so that it would look like this in the
case of SSL security with TSG:
                                         (TSG in)
                              > SSL BIO => buffered BIO ==> socket BIO
                             /
FreeRdp => SSL BIO => TSG BIO
                             \
                              > SSL BIO => buffered BIO ==> socket BIO
                                        (TSG out)

So from the FreeRDP point of view sending something is only BIO_writing
on the frontBio (last BIO on the left).
2014-05-21 17:42:31 +02:00
Hardening
9f1d0201ec Changes for base64
This patch changes the prototype for decode_base64 so that the encode / decode
method are consistant (encode(BYTE *) => char* and decode(char*) => BYTE*).
It also does some improvements with unrolling loops so that end conditions are
tested only at the end.
The patch also adds some unitary tests.
Before the patch base64_decode() made valgrind complain about uninitialized
bits, after valgrind is happy and very quiet.
2014-05-11 22:49:10 +02:00
Zhang Zhaolong
69eee0709d core: fix memory leak in case of error out. 2014-04-26 12:08:30 +08:00
Hardening
ef38a5e55d Fix multiple WWW-Authenticate headers
This patch fixes the case with the server trying to negociate the authentication
method and returning multiple WWW-Authenticate headers.
2014-04-19 09:14:14 +02:00
Hardening
1d1844aabd Treat OOM cases 2014-04-09 16:07:06 +02:00
Benoît LeBlanc
3e1dfc6311 updated context error messages. utility macros for getting error code CLASS/TYPE 2014-03-21 13:45:43 -04:00
Benoît LeBlanc
d1b9565f51 Added context-specific error management.
Added error codes to replace connectErrorCode.
2014-03-20 18:19:54 -04:00
Marc-André Moreau
8a44b2baa6 libfreerdp-core: add spn-class option 2014-02-12 00:43:02 -05:00
Benoît LeBlanc
9245d364cc Fixed handling gateway authentication error
Handle NULL pdu
2013-12-18 12:59:53 -05:00
Benoît LeBlanc
3adff0ec60 - added CANCELEDBYUSER error code.
- AUTHENTICATIONERROR error code correclty set on gateway authentication (http error 401)
- Better error handling on connection errors and user cancelation
2013-12-13 10:11:36 -05:00
Benoît LeBlanc
8c1f836ac8 - SSL verification callback: send correct hostname and port
- Gateway Authentication callback.
- Handling “use same credentials”
2013-12-06 22:15:45 -05:00
Marc-André Moreau
1d893ed268 libwinpr-sspi: add support for NTLMv2 Channel Binding Token (CBT) 2013-01-09 00:20:08 -05:00
Marc-André Moreau
8267f2cb88 libfreerdp-core: fix usage of proper gateway credentials 2012-12-18 10:51:43 -05:00
Marc-André Moreau
b53bdba143 libfreerdp-core: TSG cleanup 2012-12-13 20:23:37 -05:00
Marc-André Moreau
7ff2be09b2 libfreerdp-core: more TSG memory cleanup 2012-12-12 22:03:40 -05:00