Commit Graph

2297 Commits

Author SHA1 Message Date
Armin Novak
1bb4f121b4 Fixed formatting. 2017-11-17 12:45:28 +01:00
Brent Collins
9ca9df1ead Make the new winpr_Digest*MD5_Allow_FIPS functions more generic to no longer be MD5 specific in design. This way the FIPS override
could easily be extended to more digests in the future. For now, an attempt to use these functions with anything other than MD5 will
not work.
2017-11-17 12:43:07 +01:00
Brent Collins
922a0fa495 Fix checks for openssl version numbers around fips changes, they were using an incorrect version matching 1.1.0 and not 1.0.1
Simplify the logic to enable openssl fips mode
2017-11-17 12:43:07 +01:00
Brent Collins
a0526317ea Fix the return values of the winpr_Digest_Init functions which were accidentally removed
during rework in previous checkin.
2017-11-17 12:43:07 +01:00
Brent Collins
68ab485e63 Fix logic error in reworked MD5 call for establishing keys, and fix some minor whitespace issues. 2017-11-17 12:43:07 +01:00
Brent Collins
7aa9e7a97f Fix variable definition placement to adhere to older C standard. 2017-11-17 12:43:06 +01:00
Brent Collins
5284100bb0 FIPS_mode() and FIPS_mode_set() does not exist in OpenSSL versions before 1.0.1 2017-11-17 12:43:06 +01:00
Brent Collins
2dddae738f Change initialization of EVP_CIPHER_CTX to use API function instead of trying to calloc().
Fix some warnings noted from build output.
2017-11-17 12:43:06 +01:00
Brent Collins
497ba442be Workaround for missing EVP_CIPH_FLAG_FIPS_NON_ALLOW flag in openssl 1.0.0. 2017-11-17 12:43:06 +01:00
Brent Collins
d98b88642b Add new command-line option to force xfreerdp into a fips compliant mode.
This option will ensure that NLA is disabled(since NTLM uses weak crypto algorithms), FIPS
encryption is enabled, and ensure fips mode is enabled for openssl.

Selectively override specific uses of MD5/RC4 with new API calls specifically tailored to override FIPS.

Add comments on why overriding the use of these algorithms under FIPS is acceptable for the locations where overrides happen.

Remove check of server proprietary certificate which was already being ignore to avoid use of MD5.

Initialize winpr openssl earlier to ensure fips mode is set before starting using any crypto algorithms.
2017-11-17 12:43:06 +01:00
David Fort
0d92c725c6
Merge pull request #4000 from akallabeth/ign_keyword_fix
Command line ignore empty if flag set
2017-11-16 13:26:01 +01:00
Armin Novak
7b58495e7b Fixed warnings and formatting. 2017-11-15 15:56:24 +01:00
Armin Novak
1fd6308ef5 Functions static, warnings fixed. 2017-11-15 15:56:24 +01:00
Armin Novak
90e1d39fec Fixed formatting and warnings. 2017-11-15 15:56:24 +01:00
Armin Novak
44dfaf7841 Fixed dead store warning. 2017-11-15 15:56:24 +01:00
Armin Novak
3baba6f9c0 Removed unused argument. 2017-11-15 15:56:24 +01:00
Armin Novak
f24158fe07 Fixed missing function return check. 2017-11-15 15:56:24 +01:00
Armin Novak
0aa5a83536 Fixed multiple warnings in parser 2017-11-15 15:56:21 +01:00
Armin Novak
26d079e53b Fixed compile warnings. 2017-11-15 15:54:38 +01:00
Armin Novak
4eb5b8e349 Replaced atoi 2017-11-15 15:52:16 +01:00
Armin Novak
8c2bd951ae Allow printing of custom arguments in help. 2017-11-15 15:25:34 +01:00
Armin Novak
65f4c560d3 Fixed uninitialized values and leaks. 2017-11-13 16:20:57 +01:00
dodo040
60406794ce fix Kerberos flavour's detection (MIT/Heimdal) and double free for MIT<1.13 2017-11-13 16:20:56 +01:00
dodo040
1d97286a76 fix undeclared identifier on Windows 2017-11-13 16:20:56 +01:00
dodo040
335de159b0 use SSIZE_T instead of ssize_t 2017-11-13 16:20:56 +01:00
dodo040
9adb971181 handle missing ssize_t on Windows 2017-11-13 16:20:56 +01:00
dodo040
3e897a63cb remove useless includes 2017-11-13 16:20:56 +01:00
dodo040
e0a9999fb2 fix: GSS API init, enterprise name management, variable names and format code 2017-11-13 16:20:56 +01:00
dodo040
b81f168f0e initial commit for kerberos support 2017-11-13 16:20:55 +01:00
David Fort
de7d7e43c9 serial redirection: implement event char
The signotec signature device requires the eventChar support to work properly in
serial redirection mode. This implementation is basic but does the job for this
device.

Sponsored by: Rangee GmbH (http://www.rangee.de)
2017-11-06 22:26:17 +01:00
Armin Novak
269c78802d Fixed #4199: ConvertFindDataAToW string length 2017-10-31 16:52:08 +01:00
Mike Gilbert
5cd230ac74 winpr: _IoCreateDeviceEx: fix mkdir error check
The mkdir(2) function returns 0 on success, and -1 on error.

This resolves an error in TestIoDevice when /tmp/.device/ does not
exist.

Bug: https://bugs.gentoo.org/635838
2017-10-30 11:59:35 -04:00
Roman Kalashnikov
612e8b0710
Update semaphore.c 2017-10-28 11:59:23 +03:00
Roman Kalashnikov
4db363f107
Fixed Expression 'pComm != NULL' is always true
pComm was checked earlier in 1363 string:
`if (pComm == NULL)`
2017-10-28 01:48:41 +03:00
Roman Kalashnikov
67a97612e6
Fixed duplicated assigne 2017-10-28 01:46:06 +03:00
Armin Novak
3840b27945 Fixed file timestamps. 2017-10-12 11:28:07 +02:00
Bernhard Miklautz
1aec784f75 feat: add support for .source_version
When building packages, especially when source packages are used, git is
not necessarily available or the source isn't provided in git. In those
cases it wasn't possible to set the GIT_REVISION and --version shows
"n/a" for the git revision.

If the file .source_version is available now the content of it is used
as GIT_REVISION. Packagers might want to add a .source_version file
when they don't build the packages from git.

Possible breaking change:

The variable PRODUCT_VERSION isn't available anymore. Use GIT_REVISION
instead.
2017-10-06 15:02:23 +02:00
Armin Novak
bcfa434da2 Fixed resizing of PubSub 2017-09-25 13:33:04 +02:00
David Fort
babeb34d88 Merge pull request #4060 from akallabeth/icu_support
Using ICU instead of custom unicode conversion.
2017-09-25 09:33:58 +02:00
Bernhard Miklautz
3626676ac6 winpr/makecert: fix linking against libcrypto
Use OPENSSL_CRYPTO_LIBRARIES instead of linking against crypto directly.
2017-09-23 14:13:39 +02:00
Bernhard Miklautz
bbd11eef1d Merge pull request #4045 from akallabeth/drive_fixes_overlayfs
Drive fixes overlayfs
2017-09-22 17:22:00 +02:00
David Fort
5115ecd948 Merge pull request #4063 from akallabeth/auth_fixes
Fixed leaks, certificate comparison and channel context cleanup
2017-08-30 10:19:12 +02:00
Bernhard Miklautz
52fbfb7b12 fix clang warnings, directly include wtypes.h (#4097)
* build: clang use -Wno-unused-command-line-argument

With clang 5.0 builds are quite noisy otherwise.

* Directly include wtypes.h

Directly include winpr/wtypes.h where _fseeki64 or _ftelli64 is used.

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning: parentheses-equality

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning: tautological-compare

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning:
incompatible pointer types passing 'size_t *' (aka 'unsigned
long *') to parameter of type 'UINT32 *' (aka 'unsigned int *')
[-Wincompatible-pointer-types]
2017-08-29 09:09:38 +02:00
Armin Novak
7e32e90d4c Fixed RSA generation for OpenSSL >= 1.1 2017-08-17 13:16:32 +02:00
Armin Novak
f143fcc298 Fixed data type, eliminate warning. 2017-08-16 15:45:11 +02:00
Armin Novak
9ebfbc1fcb FindNextFileAx, continue if a inalid file is found. 2017-08-16 10:25:23 +02:00
Bernhard Miklautz
ed36f55f3e Merge pull request #4088 from akallabeth/file_api_64bit_fixes
fseeko and ftello for 64bit file support.
2017-08-16 10:04:13 +02:00
Armin Novak
c3d4b7d262 fseeko and ftello for 64bit file support. 2017-08-14 08:42:49 +02:00
Armin Novak
82d9ebc380 Fixed FileSetFilePointer warnings 2017-08-10 16:56:20 +02:00
MartinHaimberger
80ed23779f Merge pull request #4076 from akallabeth/SetFilePointer_fix
Set file pointer fix
2017-08-09 10:35:37 +02:00
Armin Novak
7d7e5487ab Fixed SetFilePointer, added SetFilePointerEx 2017-08-08 10:51:50 +02:00
Jura Sasek
a84c5cbfb9 Sun keyboard 2017-08-04 13:09:32 +02:00
Armin Novak
efe6971899 Skip FIFO files in listings. 2017-08-04 09:01:13 +02:00
Armin Novak
0a23bdf61f Abort CreateFile for existing files of type FIFO 2017-08-03 14:45:19 +02:00
Armin Novak
436829142e Mapped ENOTCONN to ERROR_FILE_NOT_FOUND 2017-08-03 14:38:20 +02:00
Mike Gabriel
dc075fb133 Fix warning in man pages
"warning: can't find macro file `www.tmac))'""`"
2017-08-03 08:41:50 +02:00
Mike Gabriel
c045bddf3f Fix typos in some error messages 2017-08-03 08:38:05 +02:00
David Fort
c84065f40c Merge pull request #4069 from yurashek/master
Build on Solaris
2017-08-02 09:53:38 +02:00
Armin Novak
11fa9f6753 Free credentials on exit. 2017-07-28 08:39:49 +02:00
Armin Novak
ceda244165 Fixed uninitialized values and leaks. 2017-07-28 08:35:31 +02:00
Valery Kartel
9bf9ff9e8a Fix build with LibreSSL 2017-07-26 17:12:14 +03:00
Armin Novak
1868acb0ac Using ICU instead of custom unicode conversion.
If WITH_ICU CMake option is set the unicode conversion routines
use ICU instead of custom conversion code.
2017-07-26 13:00:45 +02:00
Armin Novak
c8f97efb40 Added EROFS mapping. 2017-07-26 11:02:55 +02:00
Armin Novak
2beaf2c612 Added error message in case of unmapped ERRNO value. 2017-07-24 15:08:44 +02:00
Armin Novak
d1ebc39b07 Fixed file errno mapping. 2017-07-24 15:05:48 +02:00
Armin Novak
06f6c0f8cb Removed STANDARD_RIGHTS_WRITE from writeable check. 2017-07-24 11:31:48 +02:00
Armin Novak
41f919b8bd Fixed integer size warnings. 2017-07-24 11:31:48 +02:00
Armin Novak
2d18267538 Stream convenience functions to read/write strings. 2017-07-24 08:58:15 +02:00
Bernhard Miklautz
f23e10f64b clipboard: fix possible invalid memory access
Fix an possible issue found by Sébastien Duquette.
2017-07-20 09:35:42 +02:00
Armin Novak
0490aeb018 Fixed clang malloc integer overflow warnings. 2017-07-20 09:29:48 +02:00
dodo040
2f22e679e0 fix format code 2017-07-19 13:16:08 +02:00
dodo040
4e055453ab fix smartcard argument parsing 2017-07-19 13:16:08 +02:00
dodo040
722e927c64 redirect specific smartcard readers 2017-07-19 13:16:08 +02:00
akallabeth
f0fb219580 Merge pull request #4041 from wayk/PathMakePathA
Fixed PathMakePathA (returned true even if it can't create the last f…
2017-07-17 12:26:48 +02:00
Robert Corrigan
005c4df9b0 Update time zone data to July 2017 2017-07-14 17:16:08 -04:00
François Dubois
2a1fde25c8 Fixed PathMakePathA (returned true even if it can't create the last folder of the path) 2017-07-12 14:47:08 -04:00
Norbert Federa
36b8f54c5e Fixed a few compiler warnings 2017-07-10 17:52:05 +02:00
Olivier Blin
d65c2a90ea Fix clipboard POSIX build because of basename conflict
FreeRDP/winpr/libwinpr/clipboard/posix.c:397:20: error: conflicting types for ‘basename’
 static const char* basename(const char* name)
                    ^
In file included from FreeRDP/winpr/include/winpr/collections.h:25:0,
                 from FreeRDP/winpr/libwinpr/clipboard/posix.c:37:
/usr/include/string.h:599:14: note: previous declaration of ‘basename’ was here
 extern char *basename (const char *__filename) __THROW __nonnull ((1));
2017-07-05 18:48:37 +02:00
weizhenwei
fa1c65b656 refactor to remove duplicate code and replace free+malloc with realloc 2017-06-22 10:21:20 +08:00
weizhenwei
64fce8717f fix memroy leak of fd at FindFirstFileW() 2017-06-21 15:26:28 +08:00
Armin Novak
33a153c07d Command line ignore empty if flag set
When CommandLineParseArgumentsA is called with flag
COMMAND_LINE_IGN_UNKNOWN_KEYWORD return success if the
command line is empty.
2017-06-12 12:23:10 +02:00
David Fort
5ef9232703 Merge pull request #3905 from ilammy/x11-cliprdr/file-clipping
Local-to-remote file clipping for xfreerdp
2017-06-07 21:20:34 +02:00
ilammy
987d7dd886 winpr/file: add missing NULL check
ValidFileNameComponent() has been missing a NULL check for its argument.
It's pretty obvious that NULL is not a valid file name component.
2017-05-24 23:19:39 +03:00
ilammy
a85cf1b749 wClipboard: drop WITH_DEBUG_WCLIPBOARD option
This preprocessor definition has been initially intended to disable some
computationally expensive logging, however it turned out that there is
not much computation involved in the resulting implementation of new
wClipboard subsystems. Therefore we do not actually need the compilation
option, the logs can be filtered by "com.winpr.wclipboard.*" tag at
runtime if necessary. So drop the WITH_DEBUG_WCLIPBOARD CMake option and
convert all detailed logs to use WLOG_TRACE level via WLog_VRB macro.
2017-05-24 23:17:33 +03:00
Jura Sasek
4edb5cf7e6 Build for Solaris 2017-05-24 04:27:01 -07:00
David Fort
48163a27db Merge pull request #3906 from akallabeth/addin_cast_fix
Addin cast fix
2017-05-22 11:12:05 +02:00
davewheel
4bfb4dddbf Add a callback to provide NTLM hashes on server-side
Adds a callback that allows servers to compute NTLM hashes by themselves. The typical
use of this callback is to provide a function that gives precomputed hash values.

Sponsored by: Wheel Systems (http://www.wheelsystems.com)
2017-05-18 14:24:24 +02:00
Armin Novak
620b1ea603 Added 64bit file support flag for linux. 2017-05-10 14:58:12 +02:00
Armin Novak
4ba7670e43 Fixed right shift on 32bit platforms. 2017-05-04 09:20:10 +02:00
David Fort
677c4e2105 Merge pull request #3919 from akallabeth/rdpdr_hotplug_fix
Fixed hotplug mount locations.
2017-04-27 14:11:51 +02:00
Armin Novak
d1e7ce9ce0 Fixed FindFirstFileA, do not strip trailing slash 2017-04-27 08:59:21 +02:00
Armin Novak
dafa6cef67 Fixed memory corruption in Find*FileW 2017-04-27 08:31:53 +02:00
ilammy
843ab1c234 winpr: fix field names of FILEDESCRIPTOR struct
The file name field is actually called cFileName on Windows. Use this
name in WinPR's struct definition as well for compatibility.
2017-04-21 14:13:52 +03:00
ilammy
d341973247 winpr: include Windows headers in <winpr/shell.h>
This header file (currently) provides definitions of FILEDESCRIPTOR
structure and GetUserProfileDirectory() function. However, it does so
only when included on non-Windows platforms. The code which includes it
fails to build on Windows because the definitions are absent and it
causes weird compilation errors (like FILEDESCRIPTOR being treated as
the name of a function argument).

Inculde <shlobj.h> to get FILEDESCRIPTOR and <userenv.h> for the
GetUserProfileDirectory() function. (And hope that this will not
pull more Windows headers than we need in the files which include
<winpr/shell.h>.)
2017-04-21 00:44:46 +03:00
Armin Novak
920a76d57e Fix #3922: Use stat insead of lstat 2017-04-19 08:28:00 +02:00
Robert Corrigan
97c5494b98 Update timezone data to Apr 2017 2017-04-18 16:15:13 -04:00
Norbert Federa
736675aa01 Merge pull request #3901 from akallabeth/openssl_1_1_no_legacy
Fixed OpenSSL 1.1 no legacy compile issues.
2017-04-11 15:00:30 +02:00
Armin Novak
4e32334621 Added error return in GetFileAttributesExA. 2017-04-11 11:34:11 +02:00
Armin Novak
b0289e3ed8 Fixed cast warnings. 2017-04-10 10:39:01 +02:00
ilammy
44b04cafef wClipboard: disallow Windows reserved names
Another issue revealed during testing is that older Windows systems
cannot handle the reserved file names well. While Windows 8 and 10 are
fine (they silently abort the file transfer), using reserved names with
Windows 7 can flat out crash explorer.exe or result into weird error
messages like "fatal error: 0x00000000 ERROR_SUCCESS".

This is not required by MS-RDPECLIP specification, but we should try to
avoid this issue as not using reserved file names seems to be assumed
a common sense in Windows protocols.

The most convenient way to handle the issue would be on wClipboard level
so that WinPR's clients do not bother with it. We should prohibit the
reserved names from being used in FILEDESCRIPTOR, failing the conversion
if we see such a file.

POSIX subsystem (the only one at the moment) handles remote file names
in two places so move the Unicode conversion and the new validation
check into a separate function.

The reserved file name predicate is placed into <winpr/file.h> so that
it can be used in other places too. For example, other wClipboard local
file subsystems will need it. (It would be really nice to enforce this
check somewhere in the common code, so that the subsystems can't miss
it, but other places can miss some errors thus we're doing it here, as
early as possible.)

The predicate acts on separate file name components rather than full
file names because the backslash is a reserved character too. If we
process full file names this can result in phantom directory entry in
the remote file name. Not to say that handling ready-made components
spares us from splitting the full file name to extract them :)

The implementation is... a bit verbose, but that's fine by me. In the
absence of functions for case-insensitive wide string comparison and
the need to check for the [0-9] at the end of some file names this is
quite readable. Thanks to FAT and NTFS for being case-insensitive and
to MS-DOS for having reserved file names in the first place.
2017-04-09 03:17:07 +03:00