Commit Graph

21 Commits

Author SHA1 Message Date
Armin Novak
28ece6bb46 Replaced stdio logging with WLog 2014-09-09 16:31:46 +02:00
Norbert Federa
cdcdec99bc OpenSSL thread safety
freerdp/winpr had the following issues:
* The non reentrant SSL_library_init() was called concurrently (crash)
* Missing code/api to set the eventually required OpenSSL static and dynamic locking callbacks
* Missing code/api to free the application-global or thread-local OpenSSL data and tables

This commit creates two new winpr functions:

BOOL winpr_InitializeSSL(DWORD flags):

Use the flag WINPR_SSL_INIT_ALREADY_INITIALIZED if you want to tell winpr that
your application has already initialized OpenSSL.
If required use the flag WINPR_SSL_INIT_ENABLE_LOCKING to tell winpr that it
should set the OpenSSL static and dynamic locking callbacks.
Otherwise just call it with the flag WINPR_SSL_INIT_DEFAULT.

The recommended way is that your application calls this function once before
any threads are created. However, in order to support lazy OpenSSL library
initialization winpr_InitializeSSL() can also safely be called multiple times
and concurrently because it uses the new InitOnceExecuteOnce() function to
guarantee that the initialization is only performed successfully once during
the life time of the calling process.

BOOL winpr_CleanupSSL(DWORD flags):

If you create a thread that uses SSL you should call this function before the
thread returns using the flag WINPR_SSL_CLEANUP_THREAD in order to clean up
the thread-local OpenSSL data and tables.
Call the function with the flag WINPR_SSL_CLEANUP_GLOBAL before terminating
your application.

Note: This commit only replaced the current occurences of the
SSL_load_error_strings(); SSL_library_init(); pairs in the freerdp source
with winpr_InitializeSSL(). None of the server or client applications has been
changed according to the recommended usage described above (TBDL).
2014-07-28 21:55:57 +02:00
Marc-André Moreau
c5a1a8ac27 libwinpr-sspi: fix native sspi build 2014-06-05 22:10:08 -04:00
Hardening
7701c9d934 Replace printf(...) by fprintf(stderr, ...) 2013-03-28 23:06:34 +01:00
Marc-André Moreau
35033497d8 libwinpr-sspi: implement partial Schannel EncryptMessage/DecryptMessage support 2013-02-18 21:50:33 -05:00
Marc-André Moreau
01e8eb8204 libwinpr-sspi: complete Schannel handshake 2013-02-18 20:07:29 -05:00
hardening
865ff2a5f8 Fixed compilation with -Wstrict-prototypes 2013-02-14 22:20:43 +01:00
Marc-André Moreau
136bbc8bf7 libwinpr-sspi: start implementing Schannel EncryptMessage 2013-01-11 14:23:54 -05:00
Marc-André Moreau
b868af322e libwinpr-sspi: fix Schannel TLS handshake 2013-01-10 17:12:27 -05:00
Marc-André Moreau
59084a09ba libwinpr-sspi: fix Schannel TLS handshake 2013-01-10 12:19:07 -05:00
Marc-André Moreau
609459f8a6 libwinpr-sspi: fix build on Linux 2013-01-05 12:35:24 -05:00
Marc-André Moreau
985721d035 libwinpr-sspi: start implementing ISC and ASC for Schannel 2013-01-03 13:36:19 -05:00
Marc-André Moreau
45ad6e9ac9 libwinpr-sspi: started OpenSSL-based Schannel implementation 2012-12-23 20:20:41 -05:00
Marc-André Moreau
85690a3ec7 libwinpr-sspi: improve Schannel QueryCredentialsAttributes stubs 2012-12-23 14:38:58 -05:00
Marc-André Moreau
af05962a8e libwinpr-sspi: added more Schannel definitions 2012-12-22 12:18:13 -05:00
Marc-André Moreau
093a0edd9c libwinpr-sspi: add schannel definitions 2012-12-22 03:58:09 -05:00
Marc-André Moreau
f9ad678a51 libfreerdp-client: fix /pcb and /pcid 2012-12-22 02:39:39 -05:00
Marc-André Moreau
5184af6b97 libwinpr-sspi: fix PLUID data type in API definitions 2012-08-22 22:38:27 -04:00
Marc-André Moreau
308fe01b3c libwinpr-sspi: fix API data types 2012-08-22 22:24:29 -04:00
Marc-André Moreau
faa4311232 libwinpr: add proper config.h inclusions 2012-08-14 17:20:53 -04:00
Marc-André Moreau
384af1d93b include: move winpr include directory inside winpr 2012-08-14 15:49:39 -04:00