| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enable retrieving the "ecdsa-sha2-nistpNNN" name of ECDSA keys with a
new 'ssh_pki_key_ecdsa_name' API. This gives more information than the
'ssh_key_type_to_char' API, which yields "ssh-ecdsa" for ECDSA keys.
The motivation is that this info is useful to have in a server context.
The torture_pki unit test is updated to include the new API, and a few
more passes are added to additionally test 384 and 521-bit keys.
Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
|
|
|
|
|
| |
BUG: https://red.libssh.org/issues/160
Signed-off-by: Alan Dunn <amdunn@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
|
|
| |
(cherry picked from commit 2884bbf5b1bfe915160a1dc03eddbcd000555ec1)
|
|
|
|
| |
(cherry picked from commit f48a99b97c399174ad35b83a91df922f106ade13)
|
|
|
|
| |
(cherry picked from commit 11cfb2903eb319d32a2432a015c61506f50dc78b)
|
|
|
|
| |
(cherry picked from commit 291312c5e4774307a79365623065764220a673e9)
|
|
|
|
|
| |
BUG: https://red.libssh.org/issues/154
(cherry picked from commit adf23533e02d997118d1732f91abf9f116a47cec)
|
|
|
|
|
| |
BUG: https://red.libssh.org/issues/153
(cherry picked from commit 927cd90dc171b7e7a400ab8c1c9474f627e89167)
|
|
|
|
|
| |
BUG: https://red.libssh.org/issues/152
(cherry picked from commit b5efbe75cd7b3881618940f9508b313222176bd8)
|
|
|
|
| |
(cherry picked from commit 437a39c7988ae157e2171f57d8c0cfdcc99584f6)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In packet_send2, rather than issue two separate buffer_prepend_data calls
(each of which may entail realloc + memmove + memcpy), elide the prepend
work into a single buffer_prepend_data: the header information is computed
locally, and a single 5 byte prepend operation is now done instead of
prepending 1, then 4 bytes.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit aa05248ca81e3bd9e949ad724d45518707446e2c)
Conflicts:
src/packet.c
|
|
|
|
|
|
|
| |
Thanks to David Tibbe!
BUG: https://red.libssh.org/issues/151
(cherry picked from commit 04543c9dbc2e7fb3d43985cd913a0b1225be43d5)
|
|
|
|
|
|
| |
Signed-off-by: Alan Dunn <amdunn@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 47bd0b6d1f3176a4539c22741848d37b9357175b)
|
|
|
|
|
|
| |
Signed-off-by: Petar Koretic <petar.koretic@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 8e2590b5353f800a2dd11045a1e7ff4848fc8c25)
|
|
|
|
|
|
|
|
|
| |
ssh_channel_read is a wrapper for ssh_channel_read_timeout with timeout
-1 (infinite) so we call that directly.
Signed-off-by: Petar Koretic <petar.koretic@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit c51f42a566879f61c2349066bc4e8dd35bc5c311)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Defining a non inlined class function in a header will cause multiple
definitions when header is included in more that one file since for each
file function will get defined.
Signed-off-by: Petar Koretic <petar.koretic@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 00d4fbe75336b66262fdca86430655094adb8322)
Conflicts:
include/libssh/libsshpp.hpp
|
|
|
|
|
|
| |
Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit dee8e5688b4395ee379fd7f36f4a488d57fd0d6c)
|
|
|
|
|
|
| |
Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 40d81bb7cafe528639cb201e893ba62db1e813bf)
|
|
|
|
|
|
| |
Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 10bc5ac203a428699508293f91faa460358ca6dc)
|
|
|
|
|
|
| |
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 8ba94022824dadfec2b6650324a06106abaeac13)
|
|
|
|
|
|
| |
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit a2fe341da558d27c348d55b1fbf9824f42ff2432)
|
|
|
|
|
|
|
|
|
|
|
| |
If the sockets are created manually and passed to libssh the internal session
state is set to SSH_SESSION_STATE_SOCKET_CONNECTED. Result of this fix can be
verified by running torture_connect test (torture_connect_socket) with -vvvv
flags.
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit dbb2de272b57c7327204adb7b7bdef5c98bfbfd6)
|
|
|
|
|
|
| |
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 9423a3a065c947ed5ff89da615fbd6ad7f61f60a)
|
|
|
|
|
|
| |
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 0c5d4954a78714c35e18fef9ef1010b3f53ee094)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Mar 16, 09:41, Aris Adamantiadis wrote:
> Hi Petar,
> I agree with the principle, but I don't think this code can work...
> RSA_generate_key takes an RSA* as parameter and in our code we probably
> have key->rsa==NULL. (if we don't then the old code had a memory leak).
>
> Does the test case work ?
>
> Aris
>
Yes, you are right. This works, tested with tests/unittests/torture_pki
Signed-off-by: Petar Koretic <petar.koretic@sartura.hr>
(cherry picked from commit 0b8d24f800bae5f4f86c0eaca41c609f40d7baef)
|
|
|
|
|
|
|
|
|
|
|
| |
The libssh library by default does not allow in-source build (with cmake
MacroEnsureOutOfSourceBuild macro). The INSTALL file (implicitly) suggests
creating a build directory. So lets add build to list of git ignore files to
avoid complaints from git.
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 48354f56ec86bcd23b0947e2eb4ce85b9cdebd0f)
|
|
|
|
|
|
| |
Signed-off-by: Alan Dunn <amdunn@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit f6276fe73940dd35bbd4f95d3cf902bcf69f23f3)
|
|
|
|
|
|
| |
Signed-off-by: Alan Dunn <amdunn@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 2a1089d6079c14da8d24c996402e24a689a9f5d3)
|
|
|
|
| |
(cherry picked from commit fbf73ede1eb4226ebe54698fefffb38ecd8f090b)
|
|
|
|
|
|
| |
Signed-off-by: Alan Dunn <amdunn@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 577840d7f72a3c69c09f2cb477b2c46eb2831f81)
|
|
|
|
|
|
| |
BUG: https://red.libssh.org/issues/147
Signed-off-by: Alan Dunn <amdunn@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Previously, SHA-1 was used always.
BUG: https://red.libssh.org/issues/148
Signed-off-by: Alan Dunn <amdunn@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The commit fixes this build warning:
====
src/server.c:223:8: warning: ‘privkey’ may be used uninitialized in this function [-Wmaybe-uninitialized]
rc = ssh_pki_export_privkey_to_pubkey(*privkey, &pubkey);
^
src/server.c:243:11: note: ‘privkey’ was declared here
ssh_key privkey;
====
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
|
|
| |
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
|
|
|
|
|
|
| |
In 'ssh_bind_listen', move setting of 'sshbind->bindfd' to only happen after
the listen call: otherwise 'bindfd' can be set to a bogus descriptor for the
case that listen fails.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
|
|
| |
We messed up some thing, so we release 0.6.3.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When accepting a new connection, a forking server based on libssh forks
and the child process handles the request. The RAND_bytes() function of
openssl doesn't reset its state after the fork, but simply adds the
current process id (getpid) to the PRNG state, which is not guaranteed
to be unique.
This can cause several children to end up with same PRNG state which is
a security issue.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
After discussion with Aris and it was not obvious enough to understand
the issue we decided to refactor it.
Reviewd-by: Aris Adamantiadis <aris@0xbadc0de.be>
|
|
|
|
|
|
|
|
|
|
| |
Right now the behavior of packet_{en,de}crypt on len == 0 depends on
the behavior of malloc. Instead, make these consistently fail based
on what I assume the desired behavior is due to the first error
message in each.
Signed-off-by: Alan Dunn <amdunn@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we receive a packet of length exactly blocksize, then
packet_decrypt gets called on a buffer of size 0. The check at the
beginning of packet_decrypt indicates that the function should be
called on buffers of at least one blocksize, though the check allows
through zero length. As is packet_decrypt can return -1 when len is 0
because malloc can return NULL in this case: according to the ISO C
standard, malloc is free to return NULL or a pointer that can be freed
when size == 0, and uclibc by default will return NULL here (in
"non-glibc-compatible" mode). The net result is that when using
uclibc connections with libssh can anomalously fail.
Alternatively, packet_decrypt (and probably packet_encrypt for
consistency) could be made to always succeed on len == 0 without
depending on the behavior of malloc.
Thanks to Josh Berlin for bringing conneciton failures with uclibc to
my attention.
Signed-off-by: Alan Dunn <amdunn@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow-up to 4e04ec8, which caused a regression on OS X.
Checking the value of CMAKE_THREAD_LIBS_INIT to decide whether any threading
library is present on a system turns out to be wrong -- in OS X, for
example, usage of pthreads does not depend on any additional linker or
compiler flags, so CMAKE_THREAD_LIBS_INIT is empty and our check in
src/CMakeLists.txt failed (it used to work before 4e04ec8 because
CMAKE_HAVE_THREADS_LIBRARY is set).
Instead, just look for Threads_FOUND, which FindThreads sets just like any
other Find module when it has found what it was looking for.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|