Andreas Schneider
bdca6b7efa
connect: Fix build warning on Windows
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 642a1b1aa4 )
2018-09-25 16:41:31 +02:00
Andreas Schneider
97b2a61d74
config: Fix building without globbing support
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f709c3ac58 )
2018-09-25 16:41:31 +02:00
Andreas Schneider
781ce47dea
include: Do not declare ssh_channel_new() twice
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ae2b9a3bde )
2018-09-25 16:41:31 +02:00
Andreas Schneider
277ee932d6
cmake: Add -Wattributs for configure checks
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1d7520b68a )
2018-09-25 16:41:31 +02:00
Andreas Schneider
c91f530610
Bump version to 0.8.3
libssh-0.8.3
2018-09-21 09:56:06 +02:00
Andreas Schneider
69740ea841
cmake: Bump library version
...
(cherry picked from commit 9c37c8c5a5 )
2018-09-20 17:23:42 +02:00
Chris Townsend
1bb7895cd9
sftpserver: Support some openssh extensions
...
Add support for "hardlink@openssh.com " and
"posix-rename@openssh.com " extensions.
Signed-off-by: Chris Townsend <christopher.townsend@canonical.com >
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6c56c1e0d7 )
2018-09-20 17:23:41 +02:00
Andreas Schneider
a028b88aed
pki: Use strndup in ssh_pki_export_privkey_base64()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit e4711c469f )
2018-09-20 17:23:41 +02:00
Andreas Schneider
8a25f6bb07
tests: Add a test for ssh_pki_export_privkey_base64()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8410f43d8b )
2018-09-20 17:23:41 +02:00
DavidWed
2db453db16
pki: Add ssh_pki_export_privkey_base64()
...
Fixes T53
Signed-off-by: DavidWedderwille <davidwe@posteo.de >
Reviewed-by: Andreas Schneider <asn@samba.org >
(cherry picked from commit d0ce2d1ecd )
2018-09-20 17:23:41 +02:00
Andreas Schneider
03134c2932
tests: Add test for ssh_get_fingerprint_hash()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5a198732a5 )
2018-09-20 17:23:41 +02:00
Andreas Schneider
95d0c143b3
dh: Use ssh_get_fingerprint_hash() in ssh_print_hash()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 92aa2cf496 )
2018-09-20 17:23:41 +02:00
Andreas Schneider
3dcdafa6d7
dh: Add ssh_get_fingerprint_hash()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bbed139eca )
2018-09-20 17:23:41 +02:00
Anderson Toshiyuki Sasaki
75c446c529
dh: Removed duplicated code
...
The code for calculating SHA 512 in ssh_make_sessionid() had been
duplicated; the cases were unified.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
(cherry picked from commit 0eab270754 )
2018-09-20 16:35:05 +02:00
Anderson Toshiyuki Sasaki
4a9c32fc81
dh: Add diffie-hellman-group18-sha512 support
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
(cherry picked from commit 71594f9d6c )
2018-09-20 16:35:05 +02:00
Andreas Schneider
1634c5a91a
buffer: Don't call va_end() twice
...
This is handled in the cleanup.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2ae2baf9ca )
2018-09-20 16:35:04 +02:00
Andreas Schneider
dfa7593c27
examples: Reformat authenticaton.c
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4c47719d98 )
2018-09-20 16:35:04 +02:00
Andreas Schneider
034af66338
sftp: Include stdint.h
...
Thanks to Apex Liu
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a30d542207 )
2018-09-19 12:42:51 +02:00
Anderson Toshiyuki Sasaki
55c7b93a0a
dh: Add diffie-hellman-group16-sha512 support
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d9d3b65df2 )
2018-09-19 12:42:50 +02:00
Harald Sitter
4818cf5606
sftp: fix buffer_unpack argument to be char** rather than char*
...
Summary:
buffer variable 's' gets unpacked as char**, the previous code was passing
a char* causing segfaults on all readlink calls inside the unpacking code
Test Plan:
- without patchy examples/samplesftp segfaults in readlink
- with patchy it doesn't
Reviewers: asn
Differential Revision: https://bugs.libssh.org/D14
Signed-off-by: Harald Sitter <sitter@kde.org >
(cherry picked from commit 97cb302c0e )
2018-09-19 11:56:10 +02:00
Andreas Schneider
316a3a42a4
buffer: Do cleanup if ssh_buffer_unpack() fails in the first loop
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 90373d8394 )
2018-09-19 11:56:10 +02:00
Andreas Schneider
546d9da185
buffer: Fix invalid memory access in ssh_buffer_unpack()
...
Found by oss-fuzz.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 07f7fa7806 )
2018-09-19 11:56:09 +02:00
Andreas Schneider
3b7d997b54
tests: Add OK: and a new line to ssh_ping
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5123f7955b )
2018-09-19 11:56:09 +02:00
Jakub Jelen
129744692c
tests: Wait for the server to start
...
The previous timeout of 500 ms was not enough on slower machines or
while running the tests under valgrind. On much faster machines the
sleep() was bringing unnecessary overhead.
This method opens simple connection to the server verifying it is ready
to accept the connection from the test for 5 seconds. It the server
does not start until then, it fails the tests during initialization,
rather than leaving the cases to run against missing server.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c15ad753a7 )
2018-09-18 18:09:15 +02:00
Anderson Toshiyuki Sasaki
83f6ce0928
tests: Add null checks in torture_threads_pki_rsa.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 63aa274f4b )
2018-09-18 13:30:29 +02:00
Anderson Toshiyuki Sasaki
b5c7f07064
tests: Add null checks in torture_pki_rsa.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8170e30073 )
2018-09-18 13:30:29 +02:00
Anderson Toshiyuki Sasaki
223ba36d54
tests: Add null checks in torture_pki_ed25519.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 77f58a225f )
2018-09-18 13:30:29 +02:00
Anderson Toshiyuki Sasaki
9141e9d4fe
tests: Add null checks in torture_pki_ecdsa.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 48459c37f6 )
2018-09-18 13:30:29 +02:00
Anderson Toshiyuki Sasaki
ead42db7c8
tests: Add null checks and frees in torture_pki_dsa.c
...
These frees are unnecessary because the negative tests should not
allocate the keys, but the static analyser reports memory leak errors.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 31f24ed23e )
2018-09-18 13:30:29 +02:00
Anderson Toshiyuki Sasaki
d5a68bedfd
tests: Add return and null checks in torture_options.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 82c3faa44d )
2018-09-18 13:30:29 +02:00
Anderson Toshiyuki Sasaki
4307489702
tests: Add null checks in torture_config.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7c75e76d10 )
2018-09-18 13:30:29 +02:00
Anderson Toshiyuki Sasaki
f0da1f2e03
examples: Fix code style in samplesftp.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f246e31ca0 )
2018-09-18 13:30:29 +02:00
Anderson Toshiyuki Sasaki
50477cb80b
examples: Fixed possible memory leak in samplesftp.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7390db6bbb )
2018-09-18 13:30:29 +02:00
Andreas Schneider
ded4a81ffe
sftp: Fix a possible null pointer dereference
...
CID 1395721
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit cc83b463ce )
2018-09-18 13:30:29 +02:00
Jakub Jelen
c2bc4e62dd
tests: Verify we can read public key from OpenSSH container
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 39975fdd6d )
2018-09-18 10:17:32 +02:00
Jakub Jelen
f7ab481b22
pki: Implement reading public key from OpenSSH private key container
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1226de875b )
2018-09-18 10:17:32 +02:00
Jakub Jelen
628b529a91
Revert "pkd: Generate host keys in old format"
...
This is no longer needed since libssh can read the private keys
in new OpenSSH format.
This reverts commit 100c9c98ce .
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2307be32cf )
2018-09-18 10:17:32 +02:00
Jakub Jelen
7e25963130
tests: Verify the keys loaded from new OpenSSH format
...
This runs the same test that are ran on the legacy PEM files
also with the new OpenSSH key files.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit eaaa4131de )
2018-09-18 10:17:32 +02:00
Jakub Jelen
91d8f1a256
pki: Allow reading keys in new OpenSSH format
...
This implements reading the OpenSSH key format accross the
cryptographic backends. Most of the code is shared and moved
to pki.c, just the building of the keys is implemented in
pki_privkey_build_*() functions.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 39102224b2 )
2018-09-18 10:17:31 +02:00
Jakub Jelen
61dcc023b0
tests: Provide testing keys also in OpenSSH format
...
This extends the torture API to provide a way to request
keys in different formats. This extends the keys with
private keys in the new OpenSSH format (default since
OpenSSH 7.8).
This also needs modifications to the ed25519 tests, which
do not support PEM format and expected the new format out of the
box.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit e365aed6d2 )
2018-09-18 10:17:31 +02:00
Jakub Jelen
4468a78ee2
pki: Use unpack to simplify public key reading
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d23bda8181 )
2018-09-18 10:17:31 +02:00
Jakub Jelen
8f18063b6d
buffer: Make sure unpack of secure buffers securely cleans up
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 86d521cbe7 )
2018-09-18 10:17:31 +02:00
Andreas Schneider
a167faee3e
libmbedcrypto: Fix creating evp hash
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 856dc698a9 )
2018-09-18 10:17:31 +02:00
Jakub Jelen
0e8f6aaee5
buffer: Reformat ssh_buffer_get_ssh_string
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4d09c6dc31 )
2018-09-17 19:00:31 +02:00
Jakub Jelen
f0a1b94d0d
tests: Use stdbool for with_passphrase argument
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 03a66b8599 )
2018-09-17 19:00:31 +02:00
Jakub Jelen
5d1ddf5920
pki_crypto: Clarify that memory passed with set0 is managed by openssl objects
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c04eac40f3 )
2018-09-17 19:00:31 +02:00
Jakub Jelen
152ae623c2
pki_mbedcrypto: pki_pubkey_build_rsa: properly clean up on error
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8cc0672c0c )
2018-09-17 19:00:31 +02:00
Jakub Jelen
e7bd9d02bc
pki: Initialize pointers to NULL
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8f7214a584 )
2018-09-17 19:00:31 +02:00
Jakub Jelen
9196639940
tests: Drop duplicate ed25519 key creation
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9d2de880ec )
2018-09-17 19:00:31 +02:00
Jakub Jelen
786d7e39a3
buffer: Fix typo
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 039c066da5 )
2018-09-17 19:00:31 +02:00