1
1

35 Коммитов

Автор SHA1 Сообщение Дата
Marc Hoersken
cf544d0f4c wincng.c: fixed _libssh2_wincng_hash_final return value
_libssh2_wincng_hash_final was returning the internal BCRYPT
status code instead of a valid libssh2 return value (0 or -1).

This also means that _libssh2_wincng_hash never returned 0.
2015-12-22 13:38:10 +01:00
Marc Hoersken
d0ffeba72e wincng.c: fixed possible memory leak in _libssh2_wincng_hash
If _libssh2_wincng_hash_update failed _libssh2_wincng_hash_final
would never have been called before.

Reported by Zenju.
2015-12-22 13:36:56 +01:00
sune
4961014033 WinCNG: support for SHA256/512 HMAC
Closes #47
2015-09-17 15:27:30 +02:00
Marc Hoersken
858930cae5 wincng.c: fixed indentation 2015-05-19 23:12:43 +02:00
sbredahl
08fa27b628 wincng.c: fixed memleak in (block) cipher destructor 2015-05-19 22:59:16 +02:00
Marc Hoersken
0340d4586e Revert "wincng.c: fix clear memory feature compilation with mingw"
This reverts commit 2d2744efdd0497b72b3e1ff6e732aa4c0037fc43.

Autobuilds show that this did not solve the issue.
And it seems like RtlFillMemory is defined to memset,
which would be optimized out by some compilers.
2015-04-03 15:02:39 +02:00
Marc Hoersken
2d2744efdd wincng.c: fix clear memory feature compilation with mingw 2015-04-03 14:48:34 +02:00
Marc Hoersken
864950cf16 wincng.c: fix possible use of uninitialized variables 2015-03-23 21:36:10 +01:00
Marc Hoersken
09a559433e wincng.c: fix unused argument warning if clear memory is not enabled 2015-03-23 21:33:24 +01:00
Marc Hoersken
57dea4df6d wincng: Added explicit clear memory feature to WinCNG backend
This re-introduces the original feature proposed during
the development of the WinCNG crypto backend. It still needs
to be added to libssh2 itself and probably other backends.

Memory is cleared using the function SecureZeroMemory which is
available on Windows systems, just like the WinCNG backend.
2015-03-22 16:52:35 +01:00
Marc Hoersken
77020c7961 wincng.c: fixed mixed line-endings 2015-03-22 16:52:31 +01:00
Marc Hoersken
e52f35d9f4 wincng.c: fixed use of invalid parameter types in a8d14c5dcf 2015-03-22 16:32:50 +01:00
Marc Hoersken
a8d14c5dcf wincng.c: only try to load keys corresponding to the algorithm 2015-03-22 16:29:53 +01:00
Marc Hoersken
0c90b8bd9b wincng.c: moved PEM headers into definitions 2015-03-22 16:22:15 +01:00
Marc Hoersken
aa4e649d94 wincng: fixed mismatch with declarations in crypto.h 2015-03-22 15:58:00 +01:00
Marc Hoersken
71d45d3df1 wincng: add support for authentication keys to be passed in memory
Based upon 18cfec8336e and daa2dfa2db.
2015-03-22 15:41:51 +01:00
Alexander Lamaison
1de36eb5b4 Build build breakage in WinCNG backend caused when adding libssh2_userauth_publickey_frommemory.
The new feature isn't implemented for the WinCNG backend currently, but the WinCNG backend didn't contain any implementation of the required backend functions - even ones that returns an error.  That caused link errors.

This change fixes the problem by providing an implementation of the backend functions that returns an error.
2015-03-16 23:39:30 +00:00
Marc Hoersken
8f799f98d9 silence multiple data conversion warnings 2014-12-26 11:05:34 +01:00
Marc Hoersken
c0bface8a7 wincng.c: explicitly ignore BCrypt*AlgorithmProvider return codes
Fixes VS2012 code analysis warning C6031:
return value ignored: <function> could return unexpected value
2014-12-15 01:00:52 +01:00
Marc Hoersken
f31c9fb221 wincng.c: fix possible invalid memory write access
Fixes VS2012 code analysis warning C6386:
buffer overrun: accessing 'pbOutput', the writable size is
'cbOutput' bytes, but '3' bytes may be written: libssh2 wincng.c 610
2014-12-15 01:00:48 +01:00
Marc Hoersken
bc9d735664 wincng.c: fix possible NULL pointer de-reference of bignum
Fixes VS2012 code analysis warning C6011:
dereferencing NULL pointer 'bignum'. libssh2 wincng.c 1567
2014-12-15 00:59:11 +01:00
Marc Hoersken
06ff22f1a6 wincng.c: fix possible use of uninitialized memory
Fixes VS2012 code analysis warning C6001:
using uninitialized memory 'cbDecoded'. libssh2 wincng.c 553
2014-12-15 00:59:09 +01:00
Guenter Knauf
19f1402f1d wincng.c: silent some more gcc compiler warnings. 2014-12-11 21:39:47 +01:00
Guenter Knauf
df5c61dbca wincng.c: silent gcc compiler warnings. 2014-12-11 21:35:18 +01:00
Marc Hoersken
9d50d43a83 wincng.c: specify the required libraries for dependencies using MSVC
Initially reported by Bob Kast as "for MS VS builds, specify the
libraries that are required so they don't need to go into all
project files that may use this library". Thanks a lot.
2014-05-19 20:45:14 +02:00
Marc Hoersken
d63e32dd30 wincng.c: Fixed memory leak in case of an error during ASN.1 decoding 2014-05-18 14:58:21 +02:00
Marc Hoersken
b22b23703c wincng.c: Fixed warning about pointer targets differing in signedness 2014-05-18 11:39:22 +02:00
Marc Hoersken
a58b0dacb4 wincng: Made data parameter to hash update function constant
Initially reported by Bob Kast as "formal parameter must be const
since it is used in contexts where the actual parameter may be const".
Thanks a lot.
2014-05-17 23:35:11 +02:00
Marc Hoersken
6e710d7fb6 wincng: fix cross-compilation against the w64 mingw-runtime package 2014-04-25 14:20:08 +02:00
Marc Hoersken
aba11380a1 wincng: Fixed use of possible uninitialized variable pPaddingInfo
Reported by Bob Kast, thanks a lot.
2014-03-22 23:23:18 +01:00
Marc Hoersken
2c46c4bf95 wincng: Added cast for double to unsigned long conversion 2014-03-22 23:12:59 +01:00
Marc Hoersken
160776d218 wincng: Cleaned up includes and check NTSTATUS using macro
Removed header file combination that is not supported on a real
Windows platform and can only be compiled using MinGW. Replaced
custom NTSTATUS return code checks with BCRYPT_SUCCESS macro.
2014-03-22 23:08:14 +01:00
Marc Hoersken
4440e05d48 Added Windows Cryptography API: Next Generation based backend 2014-03-16 17:01:16 +01:00
Peter Stuge
a5bf809b80 Revert "Added Windows Cryptography API: Next Generation based backend"
This reverts commit d385230e15715e67796f16f3e65fd899f21a638b.
2013-09-15 13:32:38 +02:00
Marc Hoersken
d385230e15 Added Windows Cryptography API: Next Generation based backend 2013-09-07 22:38:14 +02:00