1
1

2035 Коммитов

Автор SHA1 Сообщение Дата
Will Cosgrove
7b07910b1c
Initialize sb_intl #226 2018-04-27 12:22:33 -07:00
doublex
83151a65f3 buffer overflow (valgrind) (#159) 2018-04-19 10:45:26 -07:00
Brendan Shanks
6b0f67fd55 mbedTLS: Remove some C99-style intermingled variable declarations (#196) 2018-04-18 15:37:07 -07:00
Will Cosgrove
0dd6f96821
fix for #160 2018-04-18 11:21:20 -07:00
doublex
8abc686f0e fix memory leak when using mbedtls backend (#158)
_libssh2_bn_init_from_bin/_libssh2_bn_free would leak bignum from mbedtls_calloc().
2018-04-18 10:58:35 -07:00
Brendan Shanks
498a5f5b3f mbedTLS: Avoid multiple definition errors for context handles (#197) 2018-04-18 10:53:02 -07:00
Tseng Jun
d04f9b2bd3 Fix the EVP cipher meth memory leakage problem (#244)
* Fix the EVP cipher meth memory leakage problem

Looks good, thanks for the fixes.
2018-04-18 10:08:09 -07:00
Will Cosgrove
2d5b7a891b Added ECDSA defines for WinCNG (#245)
Fixed missing defines preventing building using WinCNG
2018-03-31 22:13:38 +02:00
Will Cosgrove
566d271c75
Fix for _libssh2_rsa_new with OpenSSL 1.0.x
missing d value assignment.
2018-03-30 16:24:38 -07:00
Etienne Samson
54bef4c5da A collection of small fixes (#198)
* tests: Remove if-pyramids

* tests: Switch run_command arguments

* tests: Make run_command a vararg function

* tests: Xcode doesn't obey CMake's test working directory

* openssl: move manual AES-CTR cipher into crypto init

* cmake: Move our include dir before all other include paths
2018-03-20 16:58:13 -07:00
Will Cosgrove
40a79d3558
Fixes incorrect indexing of KEX prefs string
After stripping out an invalid KEX pref entry, it would incorrectly advance again leaving invalid values in the list.
2018-03-15 16:53:58 -07:00
Viktor Szakats
42cf29101e tests: fix checksrc warnings
Also:
* add 'static' qualifier to file-wide const buffers
* fix a non-ANSI C89 comment
* silence a mismatched fprintf() mask warning by adding a cast
2018-03-13 21:32:41 +00:00
Viktor Szakats
c4ee1cb290 cmake: recognize OpenSSL 1.1 .dll names
Also fix some comment typos and a stray tab.
2018-03-13 19:01:07 +00:00
Viktor Szakats
811c341bfd docs: update an URL [ci skip] 2018-03-13 18:52:59 +00:00
Daniel Stenberg
d10da27a07
docs/SECURITY: the max embargo is 14 days now 2018-03-12 21:03:07 +01:00
Viktor Szakats
7697448db6 docs: spelling fixes [ci skip]
Closes https://github.com/libssh2/libssh2/pull/222
2018-03-12 19:21:37 +00:00
Will Cosgrove
e39fcfdd3f
Fixed minor tabs/spacing issues 2018-03-12 11:06:41 -07:00
Will Cosgrove
1bcf309ad8
Update kex.c 2018-03-12 11:04:37 -07:00
Will Cosgrove
228c3d9f48
Added basic bounds checking #206
Basic bounds checking in ecdh_sha2_nistp()
2018-03-12 10:22:52 -07:00
Will Cosgrove
f8b2474fb6
Fixed Clang warning #206
Fixed possible garbage value for secret in an error case
2018-03-12 10:08:13 -07:00
Will Cosgrove
6909dfc07e
Fixed incorrect #if to #ifdef #206
When checking HAVE_OPAQUE_STRUCTS.
2018-03-12 09:59:25 -07:00
Viktor Szakats
e1d8c63476 src: suppress two checksrc warnings
Ref: https://github.com/libssh2/libssh2/pull/235
2018-03-12 11:10:09 +00:00
Viktor Szakats
ef6eaadba5 src: address fopen() warnings, add missing copyright headers
Ref: https://github.com/libssh2/libssh2/pull/235
2018-03-12 11:09:36 +00:00
Viktor Szakats
c274a3fdd4 src: replace sprintf() with snprintf()
Ref: https://github.com/libssh2/libssh2/pull/235
2018-03-12 11:09:10 +00:00
Viktor Szakats
e54ef175d4 src: fix checksrc warnings
Use checksrc.pl from the curl project, with (for now)
suppressed long line warnings and indentation set to
4 spaces. Fixes are whitespace for the most part.

Warning count went down from 2704 to 12.

Also fix codespell typos, two non-ANSI C89 comments
and a stray tab in include/libssh2.h.

Ref: https://github.com/libssh2/libssh2/pull/235
2018-03-12 11:08:21 +00:00
Viktor Szakats
fad6e5bb02 checksrc: add source style checker
This is a slightly extended version of this original source
from the curl project:
8b754c430b/lib/checksrc.pl

This version adds the following options to customize it for
libssh2 (plus some whitespace formatting):

`-i<n>`  to override indentation spaces (2)
`-m<n>`  to override maximum line length (79)

Command-line used to check libssh2 sources:

$ ./checksrc.pl -i4 -m500 *.c *.h

Closes https://github.com/libssh2/libssh2/pull/236
2018-03-12 10:59:15 +00:00
Viktor Szakats
2d4d062813 src: add static qualifier
To private, const strings.

Closes https://github.com/libssh2/libssh2/pull/237
2018-03-12 10:57:01 +00:00
Will Cosgrove
aba34f5f56 Add support for ECDSA keys and host keys (#41)
This commit lands full ECDSA key support when using the OpenSSL
backend. Which includes:

New KEX methods:
ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521

Can now read OpenSSL formatted ECDSA key files.

Now supports known host keys of type ecdsa-sha2-nistp256.

New curve types:
NID_X9_62_prime256v1, NID_secp384r1, NID_secp521r1

Default host key preferred ordering is now nistp256, nistp384,
nistp521, rsa, dss.

Ref: https://github.com/libssh2/libssh2/issues/41

Closes https://github.com/libssh2/libssh2/pull/206
2018-03-09 19:28:38 +00:00
Will Cosgrove
bcd492163b
Fixed possible crash when decoding invalid data
When trying to decode invalid data, it frees the buffer but doesn't nil it so the caller gets a junk memory pointer which they could potentially double free.
2017-12-15 10:42:50 -08:00
Will Cosgrove
0ecc41f16c
Remove call to OpenSSL_add_all_ciphers()
Now lives in libssh2 init() from PR #189
2017-12-14 13:40:25 -08:00
Will Cosgrove
a7df51164d
Fixed incorrect reference to decrypted block
Fixed incorrectly copied memory from p->buf into init instead of from the decrypted buffer block. The only reason this worked was because the crypt() function decrypts the value in-place and overwrites p->buf.  I'm working on a fork that no longer does this and exposed this bug.
2017-12-11 11:31:57 -08:00
Pan
616fd4d1b3 Fix typo in crypt.c (#218) 2017-10-20 10:45:07 -07:00
Kamil Dudka
712c6cbdd2 session: avoid printing misleading debug messages
... while throwing LIBSSH2_ERROR_EAGAIN out of session_startup()

If the session runs in blocking mode, LIBSSH2_ERROR_EAGAIN never reaches
the libssh2 API boundary and, in non-blocking mode, these messages are
suppressed by the condition in _libssh2_error_flags() anyway.

Closes #211
2017-10-17 15:03:48 +02:00
Viktor Szakats
1d0e694d7d win32/GNUmakefile: allow customizing dll suffixes
- New `LIBSSH2_DLL_SUFFIX` envvar will add a suffix to the generated
  libssh2 dll name. Useful to add `-x64` to 64-bit builds so that
  it can live in the same directory as the 32-bit one. By default
  this is empty.

- New `LIBSSH2_DLL_A_SUFFIX` envvar to customize the suffix of the
  generated import library (implib) for libssh2 .dll. It defaults
  to `dll`, and it's useful to modify that to `.dll` to have the
  standard naming scheme for mingw-built .dlls, i.e. `libssh2.dll.a`.

Ref: aaa16f8025

Closes https://github.com/libssh2/libssh2/pull/215
2017-10-15 20:36:59 +00:00
Viktor Szakats
e41d6f4b0e makefile.m32: allow to override gcc, ar and ranlib
Allow to ovverride certain build tools, making it possible to
use LLVM/Clang to build libssh2. The default behavior is unchanged.
To build with clang (as offered by MSYS2), these settings can
be used:

LIBSSH2_CC=clang
LIBSSH2_AR=llvm-ar
LIBSSH2_RANLIB=llvm-ranlib

Also adjust ranlib parameters to be compatible with LLVM/Clang's
ranlib tool.

Closes https://github.com/libssh2/libssh2/pull/214
2017-10-15 17:23:47 +00:00
Will Cosgrove
23b873a9e5 Fixes out of bounds memory access (#210)
If an invalid PEM file is read and the lines are longer than 128 characters it will go out of bounds and crash on line 91.
2017-09-27 11:08:50 -07:00
Kamil Dudka
819ef4f203 scp: do not NUL-terminate the command for remote exec (#208)
It breaks SCP download/upload from/to certain server implementations.

The bug does not manifest with OpenSSH, which silently drops the NUL
byte (eventually with any garbage that follows the NUL byte) before
executing it.

Bug: https://bugzilla.redhat.com/1489736
2017-09-11 12:13:45 -07:00
Viktor Szakats
fe186fef3a openssl.c: remove no longer used variable (#204)
after e378d2e30a40bd9bcee06dc3a4250f269098e200
2017-08-21 17:49:57 -05:00
Will Cosgrove
6762664e7e Fix for #188 (#189)
* Update openssl.c

* Create openssl.h
2017-06-09 14:59:18 -07:00
Marcel Raad
c423b543ca openssl: fix build with OpenSSL 1.1 API (#176)
When building with OPENSSL_API_COMPAT=0x10100000L, OpenSSL_add_all_algorithms
and OpenSSL_add_all_ciphers don't exist. The corresponding functionality is
handled automatically with OpenSSL 1.1.
2017-05-24 10:21:22 -07:00
Sune Bredahl
bbc43cb333 Add support for SHA256 hostkey fingerprints (#180)
Looks good, thanks!
2017-05-24 10:15:53 -07:00
Will Cosgrove
97518ca8bd Fix memory leak of crypt_ctx->h using openSSL 1.1+ (#177)
Need to use EVP_CIPHER_CTX_free instead of EVP_CIPHER_CTX_reset.
2017-05-12 16:34:26 -07:00
Marc Hoersken
323aa08f01 tests/openssh_server/authorized_keys: add key_rsa_encrypted.pub 2017-03-02 22:29:14 +01:00
Marc Hoersken
20a545d37d tests: add simple test for passphrase-protected PEM file support 2017-03-02 00:51:37 +01:00
Marc Hoersken
aefc5db56a os400qc3: enable passphrase-protected PEM file support using pem.c 2017-03-02 00:15:31 +01:00
Marc Hoersken
fe963dfd3a pem: fix indentation and replace assert after 386e012292 2017-03-02 00:14:36 +01:00
Keno Fischer
386e012292 pem: add passphrase-protected PEM file support for libgcrypt and wincng
Since they use our own PEM parser which did not support encrypted
PEM files, trying to use such files on these backends failed.
Fix that by augmenting the PEM parser to support encrypted PEM files.
2017-03-02 00:12:06 +01:00
Thomas
674299c346 misc: use time constant implementation for AES CTR increment 2017-03-01 23:09:33 +01:00
Thomas
2de14f8f9a wincng: add AES CTR mode support (aes128-ctr, aes192-ctr, aes256-ctr) 2017-03-01 23:09:16 +01:00
Thomas
e378d2e30a openssl: move shared AES-CTR code into misc 2017-03-01 23:00:32 +01:00