Andreas Schneider
7850307210
Bump version to 0.8.8
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2019-12-09 19:28:54 +01:00
Andreas Schneider
30c0f0c0e3
cpack: Ignore patch files and other stuff
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit ecc78ec154 )
2019-12-09 19:28:48 +01:00
Anderson Toshiyuki Sasaki
b0edec4e8d
CVE-2019-14889: scp: Quote location to be used on shell
...
Single quote file paths to be used on commands to be executed on remote
shell.
Fixes T181
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 3830c7ae6e )
2019-12-09 17:34:30 +01:00
Andreas Schneider
391c78de9d
CVE-2019-14889: scp: Don't allow file path longer than 32kb
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 0b5ee39726 )
2019-12-09 17:34:28 +01:00
Anderson Toshiyuki Sasaki
2ba1dea549
CVE-2019-14889: misc: Add function to quote file names
...
The added function quote file names strings to be used in a shell.
Special cases are treated for the charactes '\'' and '!'.
Fixes T181
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c4ad1aba98 )
2019-12-09 17:34:20 +01:00
Anderson Toshiyuki Sasaki
82c375b7c9
CVE-2019-14889: scp: Log SCP warnings received from the server
...
Fixes T181
Previously, warnings received from the server were ignored. With this
change the warning message sent by the server will be logged.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c75d417d06 )
2019-12-09 17:33:37 +01:00
Anderson Toshiyuki Sasaki
4aea835974
CVE-2019-14889: scp: Reformat scp.c
...
Fixes T181
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 42c727d0c1 )
2019-12-09 17:33:35 +01:00
Andreas Schneider
2fbeb2ac88
gitlab-ci: Mips is dead
...
Debian removed the cross compiling toolchain. So lets drop it.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit d02c06268e )
2019-11-04 09:50:56 +01:00
Andreas Schneider
e981113ee1
doc: Add a note about OpenSSL linking
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 144e551614 )
2019-03-13 10:36:42 +01:00
Andreas Schneider
3736a0367b
libcrypto: Add missing includes for modes.h
...
This defines block128_f.
Fixes T133.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 65bc24d8a4 )
2019-03-13 10:33:08 +01:00
Andreas Schneider
be73335f8e
sftp: Document how to free memory retruned by sftp_canonicalize_path()
...
Fixes T129
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7c444c09d7 )
2019-02-27 08:34:36 +01:00
Andreas Schneider
52986115b8
Bump version to 0.8.7
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2019-02-25 10:00:04 +01:00
Andreas Schneider
7a49ee5ffc
cmake: Bump API version to 4.7.4
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a1559505a5 )
2019-02-22 18:21:25 +01:00
Dirkjan Bussink
c842bc2e8b
Remove SHA384 HMAC
...
This is not supported by OpenSSH and not recommended to be implemented
either.
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 369051a5b4 )
2019-02-22 18:21:25 +01:00
Dirkjan Bussink
8892577296
Use constant time comparison function for HMAC comparison
...
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com >
Reviewed-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 46d15b3161 )
2019-02-22 18:21:25 +01:00
Andreas Schneider
ac7c64a769
pki_gcrypt: Include missing stdbool.h
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8a73e48184 )
2019-02-22 11:42:26 +01:00
Andreas Schneider
47014eb273
pki: Fix size type for len in privatekey_string_to_buffer()
...
src/pki_gcrypt.c:485:10: error: assuming signed overflow does not occur
when simplifying conditional to constant [-Werror=strict-overflow]
Fixes T132
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7a8ed6d02b )
2019-02-22 11:42:26 +01:00
Andreas Schneider
2223106113
connect: Fix size type for i an j in ssh_select()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 58113d489e )
2019-02-22 11:42:26 +01:00
David Wedderwille
4af77362b0
connector: Fallback on the socket output callback
...
Fixes T124
Signed-off-by: David Wedderwille <davidwe@posteo.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit b73ffb3f91 )
2019-02-22 11:42:26 +01:00
Till Wimmer
f4a0fcc85e
connector: Don't NULL connector (in|out) channels on event remove
...
Signed-off-by: Till Wimmer <g4-lisz@tonarchiv.ch >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 16a52a8362 )
2019-02-22 11:42:26 +01:00
Till Wimmer
fa150ef8d2
options: Removed outdated param annotations of ssh_options_set()
...
Signed-off-by: Till Wimmer <g4-lisz@tonarchiv.ch >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d27b817acc )
2019-02-22 11:42:26 +01:00
Jakub Jelen
810dbd3db1
config: Avoid buffer overflow
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1af10fcdb3 )
2019-02-22 11:42:26 +01:00
Jon Simons
fa6aa125a2
tests/pkd: repro rsa-sha2-{256,512} negotiation bug
...
Add four passes to the pkd tests to exercise codepaths where an
OpenSSH client requests these HostKeyAlgorithms combinations:
* rsa-sha2-256
* rsa-sha2-512
* rsa-sha2-256,rsa-sha2-512
* rsa-sha2-512,rsa-sha2-256
The tests demonstrate that the third combination currently fails:
libssh ends up choosing `rsa-sha2-512` instead of `rsa-sha2-256`,
and the initial exchange fails on the client side citing a signature
failure.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c2077ab775 )
2019-02-07 14:22:58 +01:00
Jon Simons
a4948f6212
kex: honor client preference for rsa-sha2-{256,512} host key algorithms
...
Ensure to honor the client preference ordering when enabling one of
the RFC8332 RSA signature extensions (`rsa-sha2-{256,512}`).
Before this change, libssh unconditionally selects the `rsa-sha2-512`
algorithm for clients which may have offered "rsa-sha2-256,rsa-sha2-512".
The change can be observed before-and-after with the pkd tests:
./pkd_hello -t torture_pkd_openssh_rsa_rsa_sha2_256_512
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5d279a7ad7 )
2019-02-07 14:22:30 +01:00
Jon Simons
e05e4ae971
pki_crypto: plug pki_signature_from_blob leaks
...
In 3341f49a49 , some direct assignments
to OpenSSL structures was replaced with usage of getter and setter
macros. Ensure to `bignum_safe_free` a couple of intermediate values
in error paths for `pki_signature_from_blob` DSS and ECDSA cases.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c0102e6a59 )
2019-02-07 14:22:26 +01:00
Jon Simons
b6d275537e
pki: NULL check pki_signature_from_rsa_blob result
...
Check for a potential NULL result from `pki_signature_from_rsa_blob`
in `pki_signature_from_blob`. Otherwise the following `sig->type_c`
will result in a segfault.
Introduced in 7f83a1efae .
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ccd73db90c )
2019-02-07 14:22:23 +01:00
Jakub Jelen
e69fb89e98
pki_container_openssh: Add padding to be compatible with OpenSSH
...
OpenSSH has a block size of 8 so we need to always add padding.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 128015bb17 )
2019-02-07 13:53:03 +01:00
Andreas Schneider
f9beb3c690
gitlab-ci: Disable debian cross mips runner
...
This runner always times out.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit fae1ed7ded )
2019-01-09 17:23:51 +01:00
Jakub Jelen
bfc39d578d
kex: List also the SHA2 extension when ordering hostkey algorithms
...
By default, the list of already stored known host types is preferred,
but this selection so far ignored the SHA2 extension and excluded these
keys in the KEXINIT list leading to not using this extension if not
explicitly enabled from configuration.
This commit extends the default list with the SHA2 signatures algoritms
and compares only base types so they can be listed in the KEXINIT list.
This adjust the tests to expect the full list of algorithms to pass.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 531b80a60b )
2019-01-09 17:22:50 +01:00
Jakub Jelen
0acfd81f85
server: Correctly handle extensions
...
If the server had an RSA host key, it provided unconditionally SHA2
signatures without consulting the client proposed list of supported host
keys.
This commit implements more fine-grained detection of the extension
to provide the client with valid signatures according to RFC 8332
Section 3.1.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 27fe60954c )
2019-01-09 17:22:48 +01:00
Jakub Jelen
d028b2495d
dh: Make sure we do not access uninitialized memory
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ca62632170 )
2019-01-09 17:22:45 +01:00
Andreas Schneider
68fc17caac
Bump version to 0.8.6
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-12-24 07:59:04 +01:00
Andreas Schneider
d327712739
Bump SO version to 4.7.3
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-12-24 07:59:02 +01:00
Andreas Schneider
fded1fb9eb
channels: Don't call ssh_channel_close() twice
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6cd8d4a24a )
2018-12-13 21:30:35 +01:00
Anderson Toshiyuki Sasaki
a6e055c42b
packet: Allow SSH2_MSG_EXT_INFO when authenticated
...
When the server requests rekey, it can send the SSH2_MSG_EXT_INFO. This
message was being filtered out by the packet filtering. This includes a
test to enforce the filtering rules for this packet type.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit fe309ba43f )
2018-12-10 17:50:27 +01:00
Andreas Schneider
32221ea9fb
channels: Send close if we received a remote close
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c3067f8e73 )
2018-12-10 17:50:22 +01:00
Andreas Schneider
917ba07478
channels: Reformat ssh_channel_free()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1d5b222cc4 )
2018-12-10 17:50:19 +01:00
Andreas Schneider
bcdbc11732
channel: Add SSH_CHANNEL_FLAG_CLOSED_LOCAL
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 13b9d268d4 )
2018-12-10 17:50:17 +01:00
Andreas Schneider
79289dc506
channel: Reformat ssh_channel_close()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0ba10870d1 )
2018-12-10 17:50:14 +01:00
Andreas Schneider
45172a70fa
sftp: Do not overwrite errors set by channel functions
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 3784226fd8 )
2018-11-30 18:57:39 +01:00
Anderson Toshiyuki Sasaki
7b0c80b475
tests: Test calling ssh_init() after ssh_finalize()
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c413834764 )
2018-11-30 18:57:39 +01:00
Anderson Toshiyuki Sasaki
d5bc9a1ace
libcrypto: Fix access violation in ssh_init()
...
This fixes an access violation when ssh_init() was called after
ssh_finalize() in Windows when using OpenSSL 1.0.2 and libssh statically
linked.
Fixes T120
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 41b0d263d6 )
2018-11-30 18:57:39 +01:00
Jakub Jelen
80d3e10b47
tests: Verify that signatures are sane and can not be verified by non-matching key
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 130256c348 )
2018-11-30 18:57:39 +01:00
Jakub Jelen
455d495c74
pki: Sanitize input to verification
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit b72c9eead6 )
2018-11-30 18:57:39 +01:00
Jakub Jelen
b1bae1d90f
pki: Return default RSA key type for DIGEST_AUTO
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c7628fbfea )
2018-11-30 18:57:39 +01:00
Jakub Jelen
ad4f1dbea0
pki: Verify the provided public key has expected type
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 783e5fd206 )
2018-11-30 18:57:39 +01:00
Jakub Jelen
5ffe695c3c
pki: Sanity-check signature matches base key type
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c79c33e224 )
2018-11-30 18:57:39 +01:00
Jakub Jelen
230a437288
tests: Do not require base RSA type for SHA2 extension whitelist
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 968fdf4e18 )
2018-11-30 18:57:38 +01:00
Jakub Jelen
1df272c3cc
packet_cb: Properly verify the signature type
...
Issue reported by Tilo Eckert <tilo.eckert@flam.de >
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bc91fa98ea )
2018-11-30 18:57:38 +01:00
Jakub Jelen
c3a57fe2dc
pki: Separate signature extraction and verification
...
Initial solution proposed by Tilo Eckert <tilo.eckert@flam.de >
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d2434c69c0 )
2018-11-30 18:57:38 +01:00
Jakub Jelen
a238df2436
pki: Set correct type for imported signatures
...
Issue reported by Tilo Eckert <tilo.eckert@flam.de >
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7f83a1efae )
2018-11-30 18:57:38 +01:00
Jakub Jelen
f5e8fa5c5f
pki: Use self-explanatory variable names
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7b725e6bc7 )
2018-11-30 18:57:38 +01:00
Jakub Jelen
0a07266d9c
The largest ECDSA key has 521 bits
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 46d8840f7e )
2018-11-30 18:57:38 +01:00
Jakub Jelen
953eae880f
pki_gcrypt: Do not abort on bad signature
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c1fdb56d23 )
2018-11-30 18:57:38 +01:00
Jakub Jelen
1d5215a5af
server: Do not send SSH_MSG_EXT_INFO after rekey
...
This should not be a problem for well-behaving clients that do not
append the ext-info-c to the rekey, but if they do, we should not
send it either.
Resolves: T121
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-23 17:31:53 +01:00
Jakub Jelen
2d06a83b82
kex: Do not negotiate extensions during rekey
...
The RFC 8308 clearly says, that the additional ext-info-c should
be added only to the first SSH_MSG_KEXINIT.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-23 17:31:51 +01:00
Jakub Jelen
fd844cac6d
tests: Verify setting NULL knownhosts does not crash
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-23 17:31:29 +01:00
Jakub Jelen
a106a00e0d
options: Do not crash when setting knownhosts to NULL (T108)
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-23 17:31:26 +01:00
Aris Adamantiadis
d8372c3063
gcrypt: Bugfix for very slow ecdh
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9546b20dec )
2018-11-21 16:55:19 +01:00
Tilo Eckert
946210534e
socket: Add missing braces
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit b227c12ad2 )
2018-11-21 12:27:01 +01:00
Tilo Eckert
fe0331cf40
socket: Remove redundant code
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f369d02932 )
2018-11-20 08:46:46 +01:00
Tilo Eckert
709c48eab6
socket: Fix potential buffer overrun
...
If nread is < 0 and no exception callback is set,
the following code block would cause a buffer overrun.
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0b9e07fbdc )
2018-11-20 08:46:44 +01:00
Tilo Eckert
3d56bdae37
pki: Fix typos in documentation
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c47cdc0f97 )
2018-11-20 08:46:43 +01:00
Tilo Eckert
8b4de1c477
packet: Fix timeout on hostkey type mismatch instead of proper error
...
If the hostkey type was not in the list of acceptable hostkey
types, the function failed to set the error state. Due to the
fact that the calling function ssh_packet_process() does not
handle the SSH_ERROR return code, the newkeys packet from the
server was silently ignored, stalling the connection until a
timeout occurred.
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4b6eb05023 )
2018-11-20 08:46:41 +01:00
Nicolas Viennot
906f63ba97
packets: Fix ssh_send_keepalive()
...
ssh_send_keepalive() should use global_request() to properly configure
the state machine for packet filtering.
Signed-off-by: Nicolas Viennot <nicolas@viennot.biz >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 59ada799d7 )
2018-11-20 07:55:43 +01:00
Andreas Schneider
26ea4f059a
COPYING: Reformat the last paragraph
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bb5d46c190 )
2018-11-20 07:55:42 +01:00
Andreas Schneider
3b46198c42
tests: Fix chroot_wrapper location
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit aa56b8ca53 )
2018-11-15 16:36:21 +01:00
Sanne Raymaekers
3de34944ad
tests: Ensure the ssh session fd is read-/writeable in torture_proxycommand
...
Signed-off-by: Sanne Raymaekers <sraymaek@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 03c30e9c8a )
2018-11-15 16:35:43 +01:00
Sanne Raymaekers
69cb3c5835
knownhosts: Take StrictHostKeyChecking option into account
...
Signed-off-by: Sanne Raymaekers <sraymaek@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 67f418218b )
2018-11-08 20:12:47 +01:00
Rosen Penev
5102b16cf1
crypto: Fix compilation for OpenSSL without deprecated APIs
...
Added missing bn.h include.
Made engine.h include conditional, otherwise it would fail.
DSA_generate_parameters was deprecated long before 1.1.0.
Signed-off-by: Rosen Penev <rosenp@gmail.com >
(cherry picked from commit 61cac32288 )
2018-11-08 09:32:42 +01:00
Christophe Giboudeaux
dc071dc6cf
cmake: Refresh the CMake Config files
...
This commit fixes a couple issues in the CMake configuration files and uses
native features from CMake:
* libssh-build-tree-settings.cmake is deleted. There was a typo that made
this file unusable, anyway.
* use the macros available in CMakePackageConfigHelpers.cmake to generate
the version file and check that the files exist
* Remove the LIBSSH_THREADS_LIBRARY variable, it used the non-existent
LIBSSH_THREADS_LIBRARY_NAME variable.
* Fix the in tree build. libssh can be used uninstalled again.
Test plan:
The values were tested after installing the new files and also without running
'make install'.
Signed-off-by: Christophe Giboudeaux <christophe@krop.fr >
(cherry picked from commit aa899f8ec0 )
2018-11-06 14:02:33 +01:00
Jakub Jelen
a8d4fbaccb
tests: Improve error reporting in auth test
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7e44ce1556 )
2018-11-02 11:43:17 +01:00
Jakub Jelen
56b7d2da4d
tests: Typo -- the flags should be checked according to the comment
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5fc4d5b22a )
2018-11-02 11:43:09 +01:00
Jakub Jelen
a4b99eedf2
knownhosts: Make sure we have both knownhosts files ready
...
If either one is missing at this point, fill it with default vaules in
ssh_options_apply().
Previously, when setting up only knownhosts, global_knownhosts file
was left pointing to NULL and the ssh_known_hosts_read_entries()
was trying to open NULL file which is invalid.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5159cd96e8 )
2018-11-02 11:43:04 +01:00
Jakub Jelen
8a8498b586
client: Reformat comment
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 35c417312c )
2018-11-02 11:42:52 +01:00
Jakub Jelen
44b32e940e
tests/pkd: Properly clean up memory
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit e1a8b359c1 )
2018-11-02 11:42:50 +01:00
Jakub Jelen
059079581a
session: Drop unused structure member (SSHv1)
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c8519c435e )
2018-11-02 11:42:48 +01:00
Jakub Jelen
f11be32e11
misc: Properly check for errors returned from getpwuid_r()
...
Resolves: T118
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d85bc347d3 )
2018-11-02 11:42:42 +01:00
Jakub Jelen
a9be4ab73e
misc: Reformat ssh_get_user_home_dir and ssh_file_readaccess_ok
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9c4baa7fd5 )
2018-11-02 11:42:39 +01:00
Andreas Schneider
273fb4cfc6
Bump version to 0.8.5
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-29 10:50:51 +01:00
Andreas Schneider
56f7c27852
Bump SO version to 4.7.2
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a4342b97d6 )
2018-10-29 09:34:09 +01:00
Mike Frysinger
1285b37b60
doc: fix up various typos and trailing whitespace
...
Signed-off-by: Mike Frysinger <vapier@gentoo.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 963c3077a4 )
2018-10-28 14:31:12 +01:00
Andreas Schneider
b7de358cdc
libcrypto: Fix memory leak in evp_final()
...
Fixes T116
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a280747462 )
2018-10-28 14:31:09 +01:00
Meng Tan
bea6393de0
gssapi: Set correct state after sending GSSAPI_RESPONSE (select mechanism OID)
...
Signed-off-by: Meng Tan <mtan@wallix.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bce8d56705 )
2018-10-26 09:03:58 +02:00
Sanne Raymaekers
9158cc524c
socket: Undouble socket fds
...
Fixes T115
Signed-off-by: Sanne Raymaekers <sraymaek@redhat.com >
(cherry picked from commit ced05eb6db )
2018-10-26 09:03:40 +02:00
Meng Tan
8ba10ef42b
client: Send KEX as soon as banners are exchanged
...
Signed-off-by: Meng Tan <mtan@wallix.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit b796924fea )
2018-10-24 19:56:36 +02:00
Jakub Jelen
2ff8a09ee6
tests: Verify we can authenticate using ed25519 key
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0386e088eb )
2018-10-19 21:22:21 +02:00
Jakub Jelen
d52fa9a02c
tests: Global known_hosts are used for host key verification
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit e91bb29e9d )
2018-10-19 21:22:21 +02:00
Jakub Jelen
ec3fdb434c
knownhosts: Consult also the global known hosts file
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f622c4309b )
2018-10-19 21:22:21 +02:00
Jakub Jelen
d877969db3
options: Set the global known_hosts file
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ae6b0e0f49 )
2018-10-19 21:22:21 +02:00
Jakub Jelen
b1a7bd21ad
tests: Verify the hostkey ordering for negotiation is correct
...
Previously, not all of the host keys algorithms were used for algorithm
negotiation. This verifies the algorithms list is sane and ordered
with the key types from known hosts in the first place.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bdb3bb9ccd )
2018-10-19 21:22:21 +02:00
Jakub Jelen
0831b85002
tests: Generate valid known_hosts file, fixing the current test
...
Previously, the file contained the known_hosts strings separated
by NULL bytes which somehow magically worked.
The test was also expecting all the keys from the file will have
the same key type, which was not indeed true.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 32e502a79d )
2018-10-19 21:22:21 +02:00
Jakub Jelen
34d1f5e097
tests: Verify the ecdsa key types are handled correctly
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6ec5a08639 )
2018-10-19 21:22:21 +02:00
Jakub Jelen
fcf2cd0d9e
kex: Use all supported hostkey algorithms for negotiation
...
Previously, only the algorithms we had a keys for in known_hosts
were used, which could lead to no-matching algorithms errors if the
one key we used to depend on was removed from the server.
This commit adds also the other algorithms, but lists them only after
all the key types we have in known_hosts file.
Resolves: T105
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 35a6455489 )
2018-10-19 21:22:21 +02:00
Jakub Jelen
4a4ca44b19
kex: Honor more host key algorithms than the first one (ssh-ed25519)
...
The code as it was written used only the first algorithm from
preferred_hostkeys array and compared it with the list returned
from the known hosts.
This commit is fixing the code so we actually compare each of the
algorithms from both of the lists and returns the intersection.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c1a8c41c5d )
2018-10-19 21:22:21 +02:00
Jakub Jelen
17a6c3f88f
knownhosts: Use the correct name for ECDSA keys for host key negotiation
...
The conversion from ssh_keytype_e to string does not work for ECDSA keys,
because different key lengths have different string representation.
The usage of type_c should work also for every other key type in future,
but it does not reflrect different signature types (SHA2 extension for RSA
keys), but this early in the key exchange phase, we can not make any
assumptions about supported extensions by the server.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 893b69d82b )
2018-10-19 21:22:21 +02:00
Jakub Jelen
e24bb932ed
tests: Do not trace sshd
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9285e8516b )
2018-10-19 21:22:21 +02:00
Andreas Schneider
5c2d444fa8
tests: Add option tests for global and user specific known_hosts
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 49e287006f )
2018-10-19 14:05:23 +02:00
Andreas Schneider
9763563c02
options: Add support for getting the known_hosts locations
...
Fixes T111
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 85fc0d5b83 )
2018-10-19 14:05:21 +02:00
Andreas Schneider
5f9d9f4a53
examples: Explicitly track auth state in samplesshd-kbdint
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0ff566b6dd )
2018-10-19 14:05:16 +02:00
Andreas Schneider
e8f3207a0d
messages: Check that the requested service is 'ssh-connection'
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9c200d3ef4 )
2018-10-19 14:05:14 +02:00
Meng Tan
e5cee205c1
server: Set correct state after sending INFO_REQUEST (Kbd Interactive)
...
Signed-off-by: Meng Tan <mtan@wallix.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4ea46eecce )
2018-10-19 14:05:12 +02:00
Andreas Schneider
63056d1bb1
priv: Add ssize_t if not available with MSVC
...
Fixes T113
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Tested-by: Wolf Wolfswinkel <wolf.wolfswinkel@objectplus.nl >
(cherry picked from commit 009ca5c9dd )
2018-10-19 14:05:08 +02:00
Andreas Schneider
09e4f3d331
packet: Add missing break in ssh_packet_incoming_filter()
...
CID 1396239
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit fe618a35dc )
2018-10-19 14:05:05 +02:00
Andreas Schneider
4b886ac656
src: Fix typos
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 795389ae1b )
2018-10-19 14:05:02 +02:00
Andreas Schneider
789df0b7d0
Bump version to 0.8.4
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-16 09:25:01 +02:00
Andreas Schneider
66a222a73c
Bump ABI to 4.7.1
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 60037f3275 )
2018-10-16 09:25:01 +02:00
Anderson Toshiyuki Sasaki
09a7638575
CVE-2018-10933: Add tests for packet filtering
...
Created the test torture_packet_filter.c which tests if packets are
being correctly filtered.
Fixes T101
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-16 09:19:40 +02:00
Anderson Toshiyuki Sasaki
203818608a
CVE-2018-10933: Introduced packet filtering
...
The packet filter checks required states for the incoming packets and
reject them if they arrived in the wrong state.
Fixes T101
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-16 09:19:40 +02:00
Anderson Toshiyuki Sasaki
f8c452cbef
CVE-2018-10933: Check channel state when OPEN_FAILURE arrives
...
When a SSH2_MSG_OPEN_FAILURE arrives, the channel state is checked
to be in SSH_CHANNEL_STATE_OPENING.
Fixes T101
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-16 09:19:40 +02:00
Anderson Toshiyuki Sasaki
adeaa69cc5
CVE-2018-10933: Check channel state when OPEN_CONFIRMATION arrives
...
When a SSH2_MSG_OPEN_CONFIRMATION arrives, the channel state is checked
to be in SSH_CHANNEL_STATE_OPENING.
Fixes T101
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-16 09:19:40 +02:00
Anderson Toshiyuki Sasaki
72bce5ece7
CVE-2018-10933: Set correct state after sending MIC
...
After sending the client token, the auth state is set as
SSH_AUTH_STATE_GSSAPI_MIC_SENT. Then this can be expected to be the
state when a USERAUTH_FAILURE or USERAUTH_SUCCESS arrives.
Fixes T101
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-16 09:19:40 +02:00
Anderson Toshiyuki Sasaki
7819621fc2
CVE-2018-10933: Introduce SSH_AUTH_STATE_AUTH_NONE_SENT
...
The introduced auth state allows to identify when a request without
authentication information was sent.
Fixes T101
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-16 09:19:40 +02:00
Anderson Toshiyuki Sasaki
fcfba0d8aa
CVE-2018-10933: Introduce SSH_AUTH_STATE_PASSWORD_AUTH_SENT
...
The introduced auth state allows to identify when authentication using
password was tried.
Fixes T101
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-16 09:19:40 +02:00
Anderson Toshiyuki Sasaki
b166ac4749
CVE-2018-10933: Introduced new auth states
...
Introduced the states SSH_AUTH_STATE_PUBKEY_OFFER_SENT and
SSH_AUTH_STATE_PUBKEY_AUTH_SENT to know when SSH2_MSG_USERAUTH_PK_OK and
SSH2_MSG_USERAUTH_SUCCESS should be expected.
Fixes T101
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-16 09:19:40 +02:00
Tilo Eckert
160a416ef6
chacha: remove re-declared type
...
re-declaring typedefs are not supported by some compilers
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
(cherry picked from commit d13517e922 )
2018-10-13 22:09:18 +02:00
Tilo Eckert
59071bc4c5
knownhosts: Fix invalid read of known_hosts token
...
Fixes invalid read introduced by commit 21962d.
Accessing tokens[4] for a known_hosts line of
three tokens led to randomly rejected host keys.
This commit completely removes the check because
the optional comments field may contain whitespace.
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
(cherry picked from commit 45058285fc )
2018-10-13 22:09:16 +02:00
Andreas Schneider
2ae63251d3
init: Only add DllMain if we create a shared library
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f747e46f33 )
2018-10-09 11:40:54 +02:00
Andreas Schneider
eefae820b5
cmake: Always build position independent code
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-02 15:26:52 +02:00
Anderson Toshiyuki Sasaki
0792fb37b0
messages: Fixed possible memory leak in ssh_message_queue
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit cc513c4c9a )
2018-09-27 15:39:20 +02:00
Anderson Toshiyuki Sasaki
e23c28a82b
examples: Add null checks in libssh_scp.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 31202822a7 )
2018-09-27 15:39:20 +02:00
Anderson Toshiyuki Sasaki
7291b50420
examples: Fix libssh_scp.c code style
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6118628424 )
2018-09-27 15:39:20 +02:00
Anderson Toshiyuki Sasaki
c1d61617fb
examples: Fix possible memory leak in libssh_scp.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 00e5ef1b3c )
2018-09-27 15:39:20 +02:00
Anderson Toshiyuki Sasaki
488fb47c32
tests: Add frees to avoid memory leak errors
...
The added frees are unnecessary, but the static analyser does not know.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6eef4b4a3c )
2018-09-27 15:39:20 +02:00
Anderson Toshiyuki Sasaki
721132696c
tests: Replace ssh_buffer_free() with SSH_BUFFER_FREE()
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 79e907402e )
2018-09-27 15:39:20 +02:00
Anderson Toshiyuki Sasaki
ee034e0484
tests: Replace ssh_string_free() with SSH_STRING_FREE()
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ca7da823c3 )
2018-09-27 15:39:20 +02:00
Anderson Toshiyuki Sasaki
d56c8fdfc6
tests: Replace ssh_key_free() with SSH_KEY_FREE()
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2eaa23a20e )
2018-09-27 15:39:20 +02:00
Anderson Toshiyuki Sasaki
4269b62153
tests: Use SSH_STRING_FREE_CHAR
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 143b5e2e50 )
2018-09-27 15:39:20 +02:00
Anderson Toshiyuki Sasaki
c6c63030c5
include: Add SSH_KEY_FREE
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 11d480134c )
2018-09-27 15:39:20 +02:00
Alberto Aguirre
afa5dbb8b1
sftpserver: allocate packet on sftp_server_new
...
Ensure sftp_server_new allocates the packet and payload as
sftp_packet_read now expects the packet and payload to be
pre-allocated.
Similarly, ensure sftp_get_client_message does not free the packet.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 14f5624ff5 )
2018-09-25 16:42:08 +02:00
David Wedderwille
bd7e8295e2
connector: Add checks if file descriptor is a socket
...
Fixes T104
Signed-off-by: David Wedderwille <davidwe@posteo.de >
(cherry picked from commit 9adc2d36eb )
2018-09-25 16:41:31 +02:00
Andreas Schneider
933d9c6b07
socket: Pass MSG_NOSIGNAL to send()
...
This avoid that we get a SIGPIPE.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1e5e09563a )
2018-09-25 16:41:31 +02:00
Andreas Schneider
0f0eb05e03
socket: Return ssize_t for ssh_socket_unbuffered_write()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 35bf5334b8 )
2018-09-25 16:41:31 +02:00
Andreas Schneider
171a950a80
socket: Reformat ssh_socket_write()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a7604c7d6e )
2018-09-25 16:41:31 +02:00
Andreas Schneider
b1b1da0f97
socket: Reformat ssh_socket_unbuffered_write()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c5cadaa982 )
2018-09-25 16:41:31 +02:00
Andreas Schneider
7453038d74
socket: Return ssize_t for ssh_socket_unbuffered_read()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit caf50270c6 )
2018-09-25 16:41:31 +02:00
Andreas Schneider
29ef92a95e
socket: Reformat ssh_socket_pollcallback()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit b7a29c7ffd )
2018-09-25 16:41:31 +02:00
Andreas Schneider
6650685758
socket: Reformat ssh_socket_unbuffered_read()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 491a42d046 )
2018-09-25 16:41:31 +02:00
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
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
Jakub Jelen
c33710d112
tests: Verify the pubkey authentication works with ECDSA keys
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 6efbf7a30e )
2018-09-17 19:00:31 +02:00
Andreas Schneider
a14a80f35f
auth: Fix ecdsa pubkey auth
...
Pair-Programmed-With: Jakub Jelen <jjelen@redhat.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit e5170107c9 )
2018-09-17 19:00:31 +02:00
Andreas Schneider
0389ff6d9d
tests: Do not call sftp_canonicalize_path()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 30df04a8a5 )
2018-09-17 19:00:31 +02:00
Andreas Schneider
8954fccfdb
tests: Add a sftp benchmark test for write/read
...
The tests writes and reads a file of 128M.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit aaca395bd3 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
332df98fc9
sftp: Move the packet payload to the message
...
This reduces memory allocations and copying.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0762057eb9 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
d4cc3f69c6
sftp: Use SSH_BUFFER_FREE in sftp_message_free()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 57153f6481 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
534c58c475
sftp: Reformat sftp_message_free()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4c32befd93 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
84fd910423
sftp: Allocate a new buffer in sftp_packet_read() if needed
...
We will move the buffer to the message instead of duplicating the
memory.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit be8302e2f3 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
d51f77c2b1
sftp: Reformat sftp_read_and_dispatch()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 97d2e1f4cb )
2018-09-17 10:53:01 +02:00
Andreas Schneider
47376cbc77
sftp: Validate the packet handle before we allocate memory
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 12fc0ea1bf )
2018-09-17 10:53:01 +02:00
Andreas Schneider
85c3db3e89
sftp: Reformat sftp_get_message()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 573eab0d51 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
3f8a522c7f
sftp: Use bool for is_eof in sftp_packet_read()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0e317e612f )
2018-09-17 10:53:01 +02:00
Andreas Schneider
eb08802b7c
sftp: Use 's' only in the scope it is needed
...
This revaled a bug when reading the packet type.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 01135703a3 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
dc587045bf
sftp: Use 16K for the transfer buffer size
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c070414309 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
9b495b72c5
sftp: Get the packet type directly from the buffer
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d2cc4eccc7 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
2ce6c56609
sftp: Limit packet size to 256 MB
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 38781f69b0 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
9caef95899
sftp: Directly read and validate the packet size from the bufffer
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit dc4faf9952 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
66c2630aaf
sftp: Use read_packet from sftp handle
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit cbbc6ddcb6 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
b8f63ee2df
sftp: Simplify the code for reading data
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a7456bf4d5 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
68adb49996
sftp: Reformat sftp_packet_read()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit afc14fe003 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
12e94bfd18
sftp: Keep a ssh_packet for reading in the sftp handle
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 79a3fcac72 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
4fc3d7a27f
sftp: Remove ZERO_STRUCTP from sftp_free()
...
The structure doesn't hold any sensitive data and this would be
optimized away anyway.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 945afaa6b4 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
466bb332c1
sftp: Reformat sftp_free()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d840a05be3 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
ff25b45367
sftp: Reformat sftp_new()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 662c30eb72 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
df83f4fb57
include: Add SSH_BUFFER_FREE
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 29b5477849 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
5bda3ab9f6
cmake: Correctly detect if glob has gl_flags member
...
Thanks to Baruch Siach.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2e8f2f03e7 )
2018-09-17 10:53:01 +02:00
Andreas Schneider
9a057159a2
config: Fix size type
...
src/config.c:562:12: error: assuming signed overflow does not occur when
simplifying conditional to constant [-Werror=strict-overflow]
if (args < 1) {
^
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ceecd3fd6f )
2018-09-06 09:25:05 +02:00
Andreas Schneider
9c0875dd5d
cmake: Use -Wpedantic and remove -pedantic-errors
...
We get -Werror if -DPICKY_DEVELOPER=ON is set.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bfd33ecf29 )
2018-09-06 09:25:03 +02:00
Jakub Jelen
1fa5a2a504
tests: UsePrivilegeSeparation has no effect since OpenSSH 7.5
...
Additionally, we can already work around the privilege separation.
http://www.openssh.com/txt/release-7.5
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 56317caafc )
2018-09-05 21:57:40 +02:00
Jakub Jelen
a08a2f52fb
tests: Do not trace sshd
...
OpenSSH's sshd does not work well under valgrind so lets avoid tracing it.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ca4fb9c6f8 )
2018-09-05 21:57:38 +02:00
Andreas Schneider
21d37f8605
cmake: Move CompilerFlags to own file
...
They need to be included before the project() call.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 91800eb243 )
2018-09-05 21:57:35 +02:00
Andreas Schneider
e43586b4de
cmake: Update defaults
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2923ad59f9 )
2018-09-05 21:57:24 +02:00
Jakub Jelen
dc7e1bdb39
tests: Verify the Match keyword from configuration file
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 556ad59a5a )
2018-09-05 12:39:02 +02:00
Jakub Jelen
03d559b066
tests: No need to restore log level now
...
Since the verbosity is now set from the setup phase, we do not
need to reset the verbosity, especially not to any arbirary value
such as WARNING.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit fcb203cb2d )
2018-09-05 12:39:02 +02:00
Jakub Jelen
3191c1f6be
tests: Use global verbosity in tests
...
This allows adjusting the log level of config and options tests using
environment variable LIBSSH_VERBOSITY as it works in most of the other
tests.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6dbcc21921 )
2018-09-05 12:39:02 +02:00
Jakub Jelen
d46f01cb7c
tests: Missing unlink
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2eccd04ff6 )
2018-09-05 12:39:02 +02:00
Jakub Jelen
04e290a19b
config: Parse Match keyword
...
Amends f818e63f8 , which introduced the constants and matching of this
configuration option, but did not implement the handling of the values
which was causing the configuration parser failing for certain
configurations.
This commit exposes match_pattern_list() from match.c
Red Hat Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1624425
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit e9b44d26b1 )
2018-09-05 12:39:02 +02:00
Jakub Jelen
bad407f5e2
config: Do not overwrite previously matched result in Host blocks
...
The match_hostname() expects comma separated list, while the Host
config keyword in openssh uses spaces separated list by default.
Therefore any subseqent match or negated match in space separated
list will overwrite the previous matches.
This also adjusts the tests to make sure both of the versions work.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9f5f10552b )
2018-09-05 12:39:02 +02:00
Andreas Schneider
2787756efe
tests: Define LIBSSH_STATIC for torture_cmocka
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 458bda8877 )
2018-09-05 12:39:01 +02:00
Andreas Schneider
7b35afdf6b
tests: Fix linking unit tests
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 3d35250c07 )
2018-09-05 12:39:01 +02:00
Andreas Schneider
dba2903e38
channels: Allow infinite timeout for ssh_channel_read_timout()
...
This is also documented.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ef06ef2c1b )
2018-09-05 12:39:01 +02:00
Andreas Schneider
965014b035
libsshpp: Initialize the string returned by getIssueBanner()
...
Fixes T13
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ba1ff992ce )
2018-09-04 20:54:52 +02:00
Andreas Schneider
c4ec92f375
channels: Don't read from a closed channel
...
Fixes T76
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit e558827c4e )
2018-09-04 20:35:30 +02:00
Andreas Schneider
54cf9d1364
auth: Use calloc to allocate memory
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 1e195a232a )
2018-09-04 20:00:04 +02:00
Andreas Schneider
23ce6d7156
misc: Use C99 initializer to initialize string
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit d1cd914012 )
2018-09-04 20:00:04 +02:00
Andreas Schneider
07473976e1
pki_container: Use string functions for cleanup
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit c3980d433a )
2018-09-04 20:00:04 +02:00
Andreas Schneider
51063fe07e
packet: Use C99 initializer to reset session->in_packet
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 78498ee289 )
2018-09-04 20:00:04 +02:00
Andreas Schneider
9cc1af1d53
packet: Reformat ssh_packet_parse_type()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 76f5a60a82 )
2018-09-04 20:00:04 +02:00
Andreas Schneider
8a83bc0569
gzip: Use calloc in initcompress() and initdecompress()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 07986731c6 )
2018-09-04 20:00:04 +02:00
Andreas Schneider
0181f5b5ed
kex: Use C99 initializer instead of memset
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit f1608778be )
2018-09-04 20:00:04 +02:00
Andreas Schneider
eaae8ce086
channels: Remove memset in ssh_channel_do_free()
...
We have nice tools to detect that in the meantime.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 72e91d5131 )
2018-09-04 20:00:04 +02:00
Andreas Schneider
0b2072dd30
channels: Reformat ssh_channel_free()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 4af4b59e21 )
2018-09-04 20:00:04 +02:00
Andreas Schneider
2e77cf6b34
channels: Use calloc() in ssh_channel_new()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit ca464ca2ba )
2018-09-04 20:00:04 +02:00
Andreas Schneider
ad3c052e1c
channel: Reformat ssh_channel_new()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 9ac6ac6c26 )
2018-09-04 20:00:04 +02:00
Andreas Schneider
57d9d97866
pki_mbedcrypto: Use explicit_bzero()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit b6b5a61c97 )
2018-09-04 20:00:04 +02:00
Andreas Schneider
22747c862a
pki_crypto: Use explicit_bzero()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 1acb82e38a )
2018-09-04 20:00:04 +02:00
Andreas Schneider
fed755eee5
getpass: Use explicit_bzero()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit a6d59811bb )
2018-09-04 20:00:04 +02:00
Andreas Schneider
804410f8ad
getpass: Use calloc to allocate memory
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit d4a443d56c )
2018-09-04 20:00:04 +02:00
Andreas Schneider
df57a9a81d
wrapper: Use explicit_bzero() in crypto_free()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 62bff4aff1 )
2018-09-04 20:00:04 +02:00
Andreas Schneider
97076780a5
wrapper: Fix size type
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit f8e68b92b8 )
2018-09-04 20:00:04 +02:00
Andreas Schneider
899553f9f7
wrapper: Reformat crypto_free()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 9c5d2d4543 )
2018-09-04 20:00:04 +02:00
Andreas Schneider
2edff5e69e
tests: Add a test for sftp_canonicalize_path()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7867126aa6 )
2018-09-04 19:00:50 +02:00
Andreas Schneider
37f451171b
sftp: Fix segfault in sftp_canonicalize_path()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4774d2b9f7 )
2018-09-04 19:00:47 +02:00
Andreas Schneider
2efc1721d8
string: Don't allow to allocate strings bigger than 256M
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit f48dcb26e3 )
2018-09-04 12:29:41 +02:00
Andreas Schneider
e9613e6b52
string: Reformat ssh_string_new()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit d1f23cd6d8 )
2018-09-04 12:29:40 +02:00
Andreas Schneider
73fbe68ccd
sftp: Use ssh_buffer_pack() in sftp_fstat()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit e601dbd8e3 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
0cb282df99
sftp: Reformat sftp_lstat()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f3ffd8aa41 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
fdb0c0a29b
sftp: Use ssh_buffer_pack() in sftp_xstat()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4d98b1cd7e )
2018-09-03 19:04:13 +02:00
Andreas Schneider
2e56db3b2f
sftp: Reformat sftp_xstat()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit b00a0578f9 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
4eb759bf40
sftp: Use ssh_buffer_unpack() in sftp_canonicalize_path()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 336c097ae7 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
c3987a9796
sftp: Use ssh_buffer_pack() in sftp_canonicalize_path()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1dd8466f66 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
a070c942e7
sftp: Reformat sftp_canonicalize_path()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8b19ef05f3 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
113b1872cf
sftp: Use sftp_buffer_pack() in sftp_fstatvfs()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7e11e41a9f )
2018-09-03 19:04:13 +02:00
Andreas Schneider
c7dc2937fc
sftp: Reformat sftp_fstatvfs()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5914ea7c75 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
075895da40
sftp: Use ssh_buffer_pack() in sftp_fsync()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f1e84d5e67 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
7930086a37
sftp: Use ssh_buffer_pack() in sftp_statvfs()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8e3dd09e11 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
3f376f848d
sftp: Reformat sftp_statvfs()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ae0afec98d )
2018-09-03 19:04:13 +02:00
Andreas Schneider
3cee61a65b
sftp: Use ssh_buffer_unpack() in sftp_readlink()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0be43c333e )
2018-09-03 19:04:13 +02:00
Andreas Schneider
90321f732e
sftp: Use ssh_buffer_pack() in sftp_readlink()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 83a5d3b258 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
c6140b1a4c
sftp: Reformat sftp_readlink()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bb4bdec184 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
9290d89570
sftp: Use ssh_buffer_pack() in sftp_setstat()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit e0449ba21f )
2018-09-03 19:04:13 +02:00
Andreas Schneider
da9ab71f88
sftp: Reformat sftp_setstat()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8a56b90c3e )
2018-09-03 19:04:13 +02:00
Andreas Schneider
53dfee98d2
sftp: Use ssh_buffer_pack() in sftp_mkdir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 218c67a51d )
2018-09-03 19:04:13 +02:00
Andreas Schneider
bb14611f86
sftp: Reformat sftp_mkdir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 89c525bbf1 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
b1aca92268
sftp: Use ssh_buffer_pack in sftp_open()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2c0baef7d4 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
2b524655ae
sftp: Reformat sftp_open()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bfb6718b50 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
b51594c34a
sftp: Use ssh_buffer_pack() in sftp_handle_close()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d99c066a0b )
2018-09-03 19:04:13 +02:00
Andreas Schneider
b409b7d092
sftp: Reformat sftp_handle_close()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2844942c1b )
2018-09-03 19:04:13 +02:00
Andreas Schneider
4256936fed
sftp: Use ssh_buffer_pack() in sftp_readdir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 3a729829fd )
2018-09-03 19:04:13 +02:00
Andreas Schneider
fdb6dc7069
sftp: Reformat sftp_readdir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 576fdbe1e8 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
6291900234
sftp: Use ssh_buffer_pack() in sftp_opendir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 87df9cfc5d )
2018-09-03 19:04:13 +02:00
Andreas Schneider
216bd2abd8
sftp: Reformat sftp_opendir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ea375d1605 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
574f279f00
buffer: Precalculate the size required for ssh_buffer_pack()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c15bd2831f )
2018-09-03 19:04:13 +02:00
Andreas Schneider
d886870bbf
buffer: Only reduce the buffer size if it gets bigger than 64K
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit efef877356 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
f56c93cccd
buffer: Only allow to allocate a maximum of 256MB
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 254a0f7132 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
bbd17bc97a
buffer: Always preallocate a buffer with 64 bytes
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d2131b286f )
2018-09-03 19:04:13 +02:00
Andreas Schneider
26fa923b55
buffer: Rewrite ssh_buffer_free()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c1c32bda14 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
177a082974
buffer: Use bool for secure buffer
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a1b57d3b94 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
ce3ee332d4
buffer: Reformat buffer_shift()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit be703974e9 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
eb95f8fa85
buffer: Cleanup buffer_verify
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 29f36791c9 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
8d3db75724
cmake: Store Profiling and AddressSanitizer flags in the cache
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 492e3d5c77 )
2018-09-03 15:43:06 +02:00
Andreas Schneider
e1fbc02209
cmake: Add -fstack-clash-protection
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9a3f43f4ee )
2018-09-03 15:43:04 +02:00
Andreas Schneider
766041d956
cmake: Small improvements to AddCMockaTest
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit baa434ebed )
2018-09-02 13:58:42 +02:00
Andreas Schneider
f880a7728f
auth: Fix freeing memory in ssh_userauth_agent_publickey()
...
CID 1395453
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f99e6766d6 )
2018-09-02 10:30:54 +02:00
Andreas Schneider
013203301f
include: Add SSH_STRING_FREE() and SSH_STRING_FREE_CHAR()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 3efc64112a )
2018-09-02 10:30:52 +02:00
Andreas Schneider
bfb60befa7
gitlab-ci: Correctly run AddressSanitizer with cmake
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bc19f892eb )
2018-09-01 21:34:04 +02:00
Andreas Schneider
4d34890624
messages: Fix memory leak in ssh_packet_userauth_request
...
Found by AddressSanitizer.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f8fc0b9dfb )
2018-09-01 21:34:02 +02:00
Andreas Schneider
6751c0e2c3
gitlab-ci: Enable address sanitzer build
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1b12a2415d )
2018-09-01 17:15:11 +02:00
Andreas Schneider
a641b6ea79
tests: Fix memory leaks in torture_hashes
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1c0ac0b12e )
2018-09-01 17:15:09 +02:00
Andreas Schneider
fa3c73016d
auth: Fix a memory leak in ssh_userauth_agent_publickey()
...
CID 1230358
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ea2b403ab2 )
2018-09-01 09:43:43 +02:00
Andreas Schneider
ffabd8c6ed
pki: Fix a memory leak in ssh_pki_do_sign()
...
CID 1395335
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8323cd791f )
2018-09-01 09:43:40 +02:00
Andreas Schneider
219a311925
packet: Add a bound check for nr_extensions
...
CID 1395335
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 461ebd1e2f )
2018-09-01 09:43:36 +02:00
Andreas Schneider
8e3af4d859
doc: Update Public Key Algorithms
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit be147e897d )
2018-08-31 15:04:54 +02:00
Jakub Jelen
9fa614a36d
tests: Properly initilize library in threads tests
...
This was already done in the torture_threads_pki.
Without the explicit initialization, we can observe random
failures tests (at least of the torture_threads_crypto) from
various threads.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6b10bbea2f )
2018-08-31 14:30:53 +02:00
Jakub Jelen
3d207f72a0
pki: Support RSA SHA2 signatures of sessionid for server
...
This involves mostly creation of host keys proofs but needs
to follow the same procedure as the client authentication
signatures.
At the same time, the SHA2 extension is enabled in the pkd
so we are able to atomicaly provide correct signatures and
pass tests.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit b4c8bd9fe4 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
f53d2f7511
server: We should list SHA2 variants in offered hostkeys
...
The SHA2 variants should be preferred. Also the buffer needs to be
extended to fit all possible public key algorithms.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5d13006650 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
b853d99546
server: Support for extension negotiation
...
This includes intercepting the ext-info-c string from
the client kex proposal, configuring the server to allow using
this extension and sending the SSH_MSG_EXT_INFO packet back
to the client after the new keys are in use.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6fa5e8adb0 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
a09976e3d6
messages: Create correct digest for pki signatures
...
This does not affect old signatures, where the public key algorithm
matches the public key type.
This is a problem when using SHA2 extension for the RSA keys, where
the new signature algorithsm are introduced in addition to the
exitsing ssh-rsa which was ignored throughout the code.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 60ad7ee15d )
2018-08-31 14:30:53 +02:00
Jakub Jelen
1ba0432524
tests: Verify the public key algorithms can be limited by configuration option
...
SSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES configuration option can limit
what keys can or can not be used for public key authentication.
This is useful for disabling obsolete algorithms while not completely
removing the support for them or allows to configure what public key
algorithms will be used with the SHA2 RSA extension.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5fe81e89fb )
2018-08-31 14:30:53 +02:00
Jakub Jelen
7dcd749ee1
auth: Prevent authentication with non-allowed key algorithms
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 09cf301eee )
2018-08-31 14:30:53 +02:00
Jakub Jelen
30368fb06a
tests: PUBLICKEY_ACCEPTED_TYPES are effective
...
Verify the PUBLICKEY_ACCEPTED_TYPES option is handled correctly
and affects the signature algorithm selection based on the
extensions and can be used to limit list of offered mechanisms
to the server.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 594c62d718 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
fd6b7db1ce
pki: Allow filtering accepted public key types based on the configuration
...
This effectively allows to disable using the SHA2 extension, disable
other old public key mechanisms out of the box (hello DSA) or force
the new SHA2-based key algorithm types if needed.
This exposes the default_methods array from kex.c.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4169be45eb )
2018-08-31 14:30:53 +02:00
Jakub Jelen
53514b2a40
tests: Cover PubkeyAcceptedTypes configuration option
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5d53f519bc )
2018-08-31 14:30:53 +02:00
Jakub Jelen
0e20418296
config: Accept the PubkeyAcceptedTypes configuration option
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 37864b6575 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
92b59ace9e
options: The new option SSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES
...
This option allows to specify acceptable public key algorithms
and reflects the PubkeyAcceptedTypes configuration option from
OpenSSH.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4521ab73b6 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
af7b5b78ee
kex: The public key algorithms are no longer only host keys
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9ca6127b91 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
2b67e2d54c
SHA2 extension in the ssh-agent interface
...
The new constants for flags are defined in draft-miller-ssh-agent-02
are active if the SHA2 extension is negotiated with the server.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ebb01549d0 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
f44994f1e6
tests: SHA2 extension signatures
...
This introduces a new test case for RSA unit tests, verifying that
libraries are able to provide and verify the RSA signatures with
SHA2 hash algorithms.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 945469c9e0 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
97d6eb84a4
auth: Support SHA2 extension for pubkey authentication (RFC 8332)
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 82da0c3361 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
33f2211cae
pki: RSA signatures with SHA2 hash algorithms (RFC 8332)
...
* This change introduces a new API to request signature using
one key and different hash algorithms. This is used only with
RSA keys, that used to have SHA1 hardcoded, but the new
algorithsms allow to use the SHA2 hashes, if the extension
is negotiated.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1f08aabe43 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
03aff19b80
kex: Offer SHA2 extension signature algorithms by default
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 3ca7e1eea9 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
cf660fe27c
pki: Support RSA verification using different hash algorithms
...
This changes the private API by adding one more argument to function
pki_signature_from_blob()
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit fa60827840 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
f9d60e1360
client: Handle the MSG_EXT_INFO packet signalling supported extensions
...
RFC 8308: The extension negotiation in Secure Shell (SSH) Protocol
RFC 8332: Use of RSA Keys with SHA-256 and SHA-512
in the Secure Shell (SSH) Protocol
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 761225712a )
2018-08-31 14:30:53 +02:00
Jakub Jelen
1098280e43
kex: Signalize support for the extension negotiation in client (RFC 8308)
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit df13d8c61f )
2018-08-31 14:30:53 +02:00
Jakub Jelen
62301834f4
pkd: Produce more useful logs
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit cbccae795d )
2018-08-31 14:30:53 +02:00
Jakub Jelen
3e0ac84001
pkd: Generate host keys in old format
...
This is required to work against OpenSSH 7.8, which is now
writing keys in new openssh format by default
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 100c9c98ce )
2018-08-31 14:30:53 +02:00
Andreas Schneider
4d26e08789
tests: Ignore SIGPIPE in pkd
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d7a64b9519 )
2018-08-31 14:30:53 +02:00
Andreas Schneider
3c4403c400
cmake: Use -fstack-protector-strong if possible
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit fc212d73ed )
2018-08-31 14:30:53 +02:00
Andreas Schneider
8dcde7a74f
examples: Reformat ssh_client
...
The example should be clean code if possible.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2b05e46b62 )
2018-08-31 14:30:53 +02:00
Andreas Schneider
bb7cd8e22b
doc: Update that_style
...
We don't need the source css files.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8d8b64cc3f )
2018-08-31 08:05:07 +02:00
Andreas Schneider
7458e95ee5
poll: Fix size types in ssh_event_free()
...
src/poll.c:1024:9: error: assuming signed overflow does not occur when
simplifying conditional to constant [-Werror=strict-overflow]
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 11d87238b8 )
2018-08-30 08:59:56 +02:00
Andreas Schneider
2f69c5f022
poll: Reformat ssh_event_free()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8243030c55 )
2018-08-30 08:59:53 +02:00
Andreas Schneider
efdd567a1b
Bump version to 0.8.2
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-30 07:54:10 +02:00
Andreas Schneider
cff8f7c0b5
cmake: VERSION_GREATER_EQUAL is not suppored by cmake 3.3
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 20ca6e09dd )
2018-08-30 07:35:45 +02:00
Andreas Schneider
fe4a4b1b79
cmake: Only support building docs the on cmake >= 3.9
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 66a0f14a0c )
2018-08-29 21:52:33 +02:00
Andreas Schneider
8caf653e97
cmake: Fix SSP compiler flag check
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit aba6e34b63 )
2018-08-29 21:52:31 +02:00
Andreas Schneider
88c4d532ab
Bump library version to 4.6.0
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4fcc0bd407 )
2018-08-29 19:17:00 +02:00
Andreas Schneider
e69d063252
cmake: Fix final map generation
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7960b8ed1b )
2018-08-29 19:16:58 +02:00
Anderson Toshiyuki Sasaki
a35218da74
cmake: Fix target to make sure copy runs in the end
...
The target created to copy the file must be the one make dist is
depending on. Otherwise it will not copy the generated files to the
desired path.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2aeee5194c )
2018-08-29 19:16:57 +02:00
Anderson Toshiyuki Sasaki
4d8e2cdc8b
cmake: Fix extract_symbols COPY_TO
...
Moved the symbols list formatting to the ExtractSymbols.cmake. The
resulting list of symbols is sorted and printed in a more readable way
(one symbol per line). Fixed the script to copy the generated symbols.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ca925588b0 )
2018-08-29 19:16:55 +02:00
Andreas Schneider
3d0f2977bf
examples: Use ssh_print_hash()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5b07c1aa2c )
2018-08-29 19:16:53 +02:00
Jan-Niklas Burfeind
230929a4b2
tests: Add torture_hashes for pubkey hashes
...
Signed-off-by: Jan-Niklas Burfeind <libssh@aiyionpri.me >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9510a538c2 )
2018-08-29 19:16:52 +02:00
Jan-Niklas Burfeind
c847216ca4
dh: Add ssh_print_hash() function which can deal with sha256
...
Signed-off-by: Jan-Niklas Burfeind <libssh@aiyionpri.me >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f32cb70675 )
2018-08-29 19:16:50 +02:00
Jan-Niklas Burfeind
cacd2fa999
dh: Add SSH_PUBLICKEY_HASH_SHA256 to ssh_get_publickey_hash()
...
Signed-off-by: Jan-Niklas Burfeind <libssh@aiyionpri.me >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1499b38aef )
2018-08-29 19:16:49 +02:00
Andreas Schneider
0b688e4829
sftp: Use strndup()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 509331ec81 )
2018-08-29 19:16:48 +02:00
Andreas Schneider
27cf0ea06b
misc: Add strndup implementation if not provides by the OS
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 247983e982 )
2018-08-29 19:16:46 +02:00
Andreas Schneider
e473108e1b
cmake: Require at least abimap-0.3.1
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f0e99961b6 )
2018-08-29 19:16:45 +02:00
Andreas Schneider
c74cc9a606
cmake: Detect abimap version
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2291c75ab0 )
2018-08-29 19:16:44 +02:00
Andreas Schneider
619e60cf0e
cmake: Fix typo in doc file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 77b4801e11 )
2018-08-29 19:16:42 +02:00
Andreas Schneider
37b3657481
tests: Fix size types in pkd
...
tests/pkd/pkd_hello.c:743:12: error: assuming signed overflow does not
occur when simplifying conditional to constant [-Werror=strict-overflow]
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a3c8dac6b6 )
2018-08-29 11:13:05 +02:00
Andreas Schneider
c1211a4e1a
doc: Update doxygen documentation
...
This fixes some issues with the new docs and uses a new modern style.
https://github.com/jl-wynen/that_style
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5334cb9d55 )
2018-08-29 11:13:03 +02:00
Andreas Schneider
95d34b5937
doc: Remove obsolete Doxyfile.in
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9a73fa885a )
2018-08-29 11:13:01 +02:00
Alex Hermann
6dc3f666c5
misc: Set default port to 22 in ssh_path_expand_escape()
...
Fixes, among others, ProxyCommand with %p when no port is used on
commandline or config file, thus using the default port.
Fixes T94
Signed-off-by: Alex Hermann <alex@hexla.nl >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 23f60a56f3 )
2018-08-28 15:45:07 +02:00
Andreas Schneider
8e4491a532
cmake: Fix doxygen generation
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 648f5cf400 )
2018-08-27 16:47:02 +02:00
Anderson Toshiyuki Sasaki
492095b2a7
cmake: Fix FindABIMap targets
...
Fix the targets and output files handling to make the symbols to be
updated correctly when a symbol is added or removed.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f49bb1b6a3 )
2018-08-27 16:46:59 +02:00
Jakub Jelen
d516642980
doc: There is no hostbased authentication implemented
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f0a4c1e888 )
2018-08-27 12:25:12 +02:00
Andreas Schneider
193845ecdd
auth: Reset errors on successful authentication
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a0fec81221 )
2018-08-27 12:25:10 +02:00
Andreas Schneider
598d04d5d9
error: Add ssh_reset_error() function
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0aad4de5f4 )
2018-08-27 12:25:09 +02:00
Andreas Schneider
06c5dd9c84
auth: Also log the current auth method
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 280519af29 )
2018-08-27 12:25:07 +02:00
Andreas Schneider
6632659907
auth: Fix the pending_call_state of ssh_userauth_password()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0ae376f133 )
2018-08-27 12:25:05 +02:00
Andreas Schneider
86bf835d50
session: Group auth variables in a struct
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 73c9d60e5a )
2018-08-27 12:25:03 +02:00
Jakub Jelen
c9d0362a6b
sftp: Avoid race condition reading incomplete data messages
...
This changes amends f561e6bcb3 which
introduces same check in one place, but miss it in other two places.
We encountered this issue with qemu using SFTP to transfer large
data chunks and in some cases, the file transfer was interrupted
without any reason. From the debug messages, it showed up that
last part of data message/packet was not handled in the time
of the sftp_read() call, therefore the ssh_channel_read() returned
zero (there was no more data to read yet), which made the whole
transfer fail hard instead of retrying later.
The proposed change is reusing the code from previously referenced
commit also in the other places.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ae3825dfb2 )
2018-08-27 09:30:14 +02:00
Andreas Schneider
d2989f28db
auth: Fix possible NULL pointer dereference
...
explicit_bzero() doesn't handle NULL.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8f1e995cec )
2018-08-27 09:30:12 +02:00
Andreas Schneider
0bab6013d0
cmake: Check if the linker supports version scripts
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4de8ed684b )
2018-08-27 09:30:10 +02:00
Anderson Toshiyuki Sasaki
361d93586c
docs: Update threading documentation
...
Updated threading documentation mentioning changes in the requirements
to use libssh in multithread scenarios.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d0f3cdfa10 )
2018-08-24 14:59:12 +02:00
Andreas Schneider
0db13661b4
cmake: Improve compiler flag detection
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a97e227a9d )
2018-08-24 07:53:20 +02:00
Andreas Schneider
c866592d7d
options: Fix size types
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 119a457357 )
2018-08-24 07:53:18 +02:00
Andreas Schneider
eb90325bed
cmake: Allow zero for variadic macro argument
...
This is also needed for clang.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4ae7e35d9c )
2018-08-23 22:41:25 +02:00
Andreas Schneider
c878545977
cmake: Add header to AddCCompilerFlag.cmake
...
(cherry picked from commit 47bf099c36 )
2018-08-23 22:41:23 +02:00
Andreas Schneider
741021513b
options: Fix integer types
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9a43298b3a )
2018-08-23 22:41:21 +02:00
Andreas Schneider
97e8aba080
options: Reformat ssh_options_getopt()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 3f17154367 )
2018-08-23 22:41:19 +02:00
Andreas Schneider
802d46d040
cmake: Disable include_guard as oss-fuzz's cmake version is too old
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f8435e261c )
2018-08-22 12:12:27 +02:00
Andreas Schneider
96718df15e
gitlab-ci: Add target to build the docs
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6162b63d5e )
2018-08-22 09:09:13 +02:00
Andreas Schneider
89bd779e78
cmake: Remove obsolete UseDoxygen.cmake
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 19e081aedb )
2018-08-22 09:09:12 +02:00
Andreas Schneider
b5af3e74d7
cmake: Use FindDoxygen package provided by cmake
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a154bd9f22 )
2018-08-22 09:09:10 +02:00
Andreas Schneider
2d3932d988
doc: Update Doxyfile.in
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit e618298bda )
2018-08-22 09:09:08 +02:00
Andreas Schneider
d0c1583ad2
knownhosts: Add knownhosts to libssh_session group
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7e1b67754c )
2018-08-22 09:09:06 +02:00
Andreas Schneider
59ff4064ba
libssh: Document ssh_known_hosts_e
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 868623f9a8 )
2018-08-22 09:09:04 +02:00
Andreas Schneider
00a68c985f
libsshpp: Match documentation with the code
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 49f92cf5cd )
2018-08-22 09:09:02 +02:00
Andreas Schneider
e862ea556c
channels: Fix timeout variable to match documentation
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c2fc9ac956 )
2018-08-22 09:09:00 +02:00
Andreas Schneider
a4704cba0b
cmake: Remove obsolete DefineCompilerFlags.cmake
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9820a35a9e )
2018-08-22 09:08:20 +02:00
Andreas Schneider
455b3a7865
cmake: Set -D_FORTIFY_SOURCE=2 if possible
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5e9435924c )
2018-08-22 09:08:19 +02:00
Andreas Schneider
fabaab1540
gssapi: Fix size types
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 64a354159f )
2018-08-22 09:08:17 +02:00
Andreas Schneider
8ac49ff181
options: Fix size types
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0a46690eca )
2018-08-22 09:08:15 +02:00
Andreas Schneider
cdf55a18d2
kex: Fix size types
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 26263aabd4 )
2018-08-22 09:08:13 +02:00
Andreas Schneider
d158ca7101
tests: Check return code of setuid()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6867a35004 )
2018-08-22 09:08:12 +02:00
Andreas Schneider
664b7ebfa1
known_hosts: Update documentation of deprecated knwon_hosts functions
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 7946104566 )
2018-08-21 11:40:48 +02:00
Andreas Schneider
163c488e30
gitlab-ci: Add two builds with optimizations turned on
...
This enables the optimizer and will give use additional compiler
warnings and errors.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 140ddf5109 )
2018-08-20 18:43:25 +02:00
Andreas Schneider
4b5bfa7a9d
gitlab-ci: Enable PICKY_DEVELOPER
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 887908107a )
2018-08-20 18:43:23 +02:00
Andreas Schneider
decbadda45
cmake: Add support for picky developer flags
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8855a140cf )
2018-08-20 18:43:22 +02:00
Andreas Schneider
f00d780c16
cmake: Improve compiler flag detection
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a9a99fb31f )
2018-08-20 18:43:20 +02:00
Andreas Schneider
1daa2e4609
cmake: Check for -Werror in ConfigureChecks.cmake
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 26a4097742 )
2018-08-20 18:43:19 +02:00
Andreas Schneider
d84bc3ad8e
cmake: Respect CMAKE_REQUIRED_* variables in CHECK_C_COMPILER_FLAG_SSP
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 99a9cf0fcb )
2018-08-20 18:43:18 +02:00
Andreas Schneider
a9350e3205
tests: Make sure pointer are initialized in torture_pki_ed25519
...
Fixes compiler warnings.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit fd157befae )
2018-08-20 18:43:16 +02:00
Andreas Schneider
95e3a7e7a3
tests: Make sure pointer are initialized in torture_pki_ecdsa
...
Fixes compiler warnings.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6f6840a88a )
2018-08-20 18:43:15 +02:00
Andreas Schneider
e4cecee7d3
tests: Make sure pointer are initialized in torture_pki_dsa
...
Fixes compiler warnings.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 562e579675 )
2018-08-20 18:43:14 +02:00
Andreas Schneider
8b867b41d3
tests: Make sure pointer are initialized in torture_pki_rsa
...
Fixes compiler warnings.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1e89896d05 )
2018-08-20 18:43:12 +02:00
Andreas Schneider
c6bd2fe734
tests: Use ZERO_STRUCT for readfds
...
This fixes a compiler warning on FreeBSD.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 3b896750b8 )
2018-08-20 18:43:11 +02:00
Andreas Schneider
d7e52b99bd
tests: Fix function declaration in pkd_hello
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f433949dcd )
2018-08-20 18:43:09 +02:00
Andreas Schneider
a640d9472a
tests: Fix function declaration in torture_packet
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8e418ea020 )
2018-08-20 18:43:08 +02:00
Andreas Schneider
b15103ef4e
log: Make sure the buffer for date is big enough
...
src/log.c:71:32: error: '%06ld' directive output may be truncated
writing between 6 and 20 bytes into a region of size between 0 and 63
[-Werror=format-truncation=]
snprintf(buf, len, "%s.%06ld", tbuf, (long)tv.tv_usec);
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6766b0a860 )
2018-08-20 18:43:06 +02:00
Andreas Schneider
95071cd1fe
agent: Fix type of the buffer
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ce45de9ea2 )
2018-08-20 18:43:05 +02:00
Andreas Schneider
18a888f9fb
mbedtls: Use getter for ssh_mbedtls_ctr_drbg
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 85d2c0371a )
2018-08-20 18:43:04 +02:00
Andreas Schneider
bbfc41948a
examples: Fix function declaration in sshnetcat
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1d9f548204 )
2018-08-20 18:43:02 +02:00
Andreas Schneider
c29a8cc084
include: Fix shadow variables in libsshpp
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit dad456a1ee )
2018-08-20 18:43:00 +02:00
Jakub Jelen
54e7af83e6
sftp: Fix the debug message in sftp_enqueue()
...
This fixes the assignment of variables to comments and makes
the output symmetric with sftp_dequeue().
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a0214dfc9a )
2018-08-18 10:01:47 +02:00
Jakub Jelen
3483d6327d
tests: Unsupported and unknown configuration options do not crash
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit c004b43fde )
2018-08-16 18:18:17 +02:00
Jakub Jelen
5869345899
config: Do not access negative indexes of seen array
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
(cherry picked from commit 6848c23d84 )
2018-08-16 18:18:15 +02:00
Andreas Schneider
0cad2778b4
cmake: Correctly detect support for __bounded__ attribute
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4104d2fb91 )
2018-08-16 17:47:14 +02:00
Andreas Schneider
24de1fbde8
init: Fix DllMain
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 86d00f438c )
2018-08-16 09:22:12 +02:00
Andreas Schneider
131728a680
cmake: Fix optional ABIMap detection
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
(cherry picked from commit f65882cca6 )
2018-08-14 15:55:15 +02:00
Andreas Schneider
e949e135b6
Bump version to 0.8.1
2018-08-13 22:19:33 +02:00
Andreas Schneider
1510b63d20
cmake: Bump library version for release
...
(cherry picked from commit a3475c2e4b )
2018-08-13 22:19:25 +02:00
Andreas Schneider
0db4d9bd46
init: Add a library constructor and destructor for VC
...
If we compile with Visual Studio, we need a DllMain() for running init
and finialize which is the same as a constructor and destructor.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4d87256ca7 )
2018-08-13 22:12:22 +02:00
Andreas Schneider
1e17e084bf
cmake: Only set -Werror on UNIX
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6aa9392699 )
2018-08-13 22:12:21 +02:00
Andreas Schneider
a2c14c5ec5
cmake: Improve NSIS detection on Windows
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0656f8a43d )
2018-08-13 22:12:19 +02:00
Anderson Toshiyuki Sasaki
b99849c831
init: ignore init counter if destructor calls finalize
...
If the destructor calls finalize, ignore the init counter and finalize
the library anyway.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 66a3bc0332 )
2018-08-13 15:27:51 +02:00
Andreas Schneider
c7d4286ca1
cmake: Fix PACKAGE and VERSION in config.h
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit dbce0e5228 )
2018-08-13 13:49:30 +02:00
Andreas Schneider
434e2b7212
cmake: Fix pkg-config file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8ef35a005c )
2018-08-13 13:49:28 +02:00
Andreas Schneider
acf0f0fa6e
cmake: Remove obsolete libssh_threads.pc.cmake
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8425dce7b2 )
2018-08-13 13:49:26 +02:00
Anderson Toshiyuki Sasaki
220e6b66e8
threads: use static error check mutex initializer if available
...
This changes the condition to use the static error check mutex
initializer. If it is not available, use the default static mutex
initializer.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0be1ae0e3b )
2018-08-13 13:49:24 +02:00
Andreas Schneider
c4d4731ddf
cmake: Only install static lib if built WITH_STATIC_LIB
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 83898f3f6c )
2018-08-13 13:49:21 +02:00
Andreas Schneider
139ccaa78c
include: Fix version number
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-13 11:01:27 +02:00
Andreas Schneider
c42410b560
init: Only use constructor attribute if available
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f2b6899298 )
2018-08-13 11:00:52 +02:00
Andreas Schneider
120f11812d
cmake: Detect constructor and destructor attributes
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4c058aefd9 )
2018-08-13 11:00:50 +02:00
Andreas Schneider
500486d501
cmake: Fix fallthrough attribute detection
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8c2ad7bdd3 )
2018-08-13 11:00:48 +02:00
Andreas Schneider
6708debd4c
cmake: Fix check for bounded attribute
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit e04a8b3abd )
2018-08-13 11:00:47 +02:00
Andreas Schneider
852a8b4875
cmake: Set the PACKAGE_VERSION correctly
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 15ab612592 )
2018-08-13 11:00:45 +02:00
Andreas Schneider
9c6b4ecb48
cpack: Fix ignore files
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-10 14:24:02 +02:00
Andreas Schneider
d66ea0b3b1
Update ChangeLog entries for 0.8.0
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-10 12:20:57 +02:00
Andreas Schneider
1d93b94086
cmake: Remove DESCRIPTION from project
...
This is only available with cmake >= 3.9.0. It should fix oss-fuzz.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-10 12:20:57 +02:00
Anderson Toshiyuki Sasaki
efc427fdce
cmake: Introduce symbol versioning
...
This adds a cmake module, FindABIMap, which looks for abimap and
provides functions to generate a symbol version linker script.
The module can be included using find_package(ABIMap).
This also adds the option to compile with symbol versioning. The symbol
list is obtained from the header files by filtering those marked with
the LIBSSH_API modifier.
Such symbols are used as input to generate the version script used by
the linker. The version script is automatically updated as new symbols
marked with LIBSSH_API are added to the header files.
If any symbol is removed, the build will fail due to break in the ABI.
Symbol versioning is enabled by default if abimap has been found. It is
disabled in non-UNIX platforms. It can be disabled by passing
"-DWITH_SYMBOL_VERSIONING=OFF" option to cmake.
Pair-Programmed-With: Andreas Schneider <asn@cryptomilk.org >
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-08 20:58:23 +02:00
Andreas Schneider
0f64bc78a8
ABI: Add map file for library version 4.5.0
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-08 20:58:23 +02:00
Andreas Schneider
2dbb7ff091
cmake: Update cmake and cpack config
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-08 20:58:23 +02:00
Andreas Schneider
b77fa93551
gitlab-ci: Point openSUSE to its krb5-config
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-08 20:58:23 +02:00
Andreas Schneider
8ce4004260
tests: Free memory of tmp_file in torture_knownhosts_parsing
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-08 15:04:59 +02:00
Andreas Schneider
8c11367410
tests: Fix memory leak in torture_knownhosts_read_file()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-08 15:04:59 +02:00
Andreas Schneider
460026459b
tests: Do not leak memory when freeing ed25519 keys
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-08 15:04:59 +02:00
Andreas Schneider
6c87316a9c
session: Fix memory leak of global_knownhosts
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-08 15:04:59 +02:00
Andreas Schneider
96476f74af
kownhosts: Fix a memory leak in ssh_session_has_known_hosts_entry()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-08 15:04:59 +02:00
Andreas Schneider
52b57077de
knownhosts: Fix a memory leak in ssh_session_get_known_hosts_entry()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-08 15:04:59 +02:00
Andreas Schneider
2839d48cb8
tests: Fix a typo in torture.c
...
Thanks Nikos for spotting it.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-07 15:41:45 +02:00
Marcin Szalowicz
5ea81166bf
include: Fix segfault in getIssueBanner, add missing wrappers in libsshpp
...
Also make some private properties protected
Signed-off-by: Marcin Szalowicz <marcin.szalowicz@oracle.com >
2018-08-07 14:31:55 +02:00
Andreas Schneider
a86d1d335b
torture: Increase wait time for sshd startup
...
It is much slower when started with valgrind.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 15:23:43 +02:00
Anderson Toshiyuki Sasaki
18dd902307
gssapi: set error state when GSSAPI auth fails
...
When errors occurred, the session auth state was not being updated,
leading to failures due to the wrong state in following authentication
methods.
Fixes T56
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 10:48:16 +02:00
Anderson Toshiyuki Sasaki
d85827f646
auth: Some code style fixes
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 10:26:19 +02:00
Anderson Toshiyuki Sasaki
6e74c6c1dc
auth: Improve pending call error messages
...
This can help when debugging in the future
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 10:26:00 +02:00
Andreas Schneider
ec6df9896a
tests: Add missing check for valid fd
...
CID 1032753
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 09:52:14 +02:00
Andreas Schneider
ab7c5c448c
tests: Add additional NULL checks
...
CID 1393894
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 09:43:51 +02:00
Andreas Schneider
5871d604cd
tests: Use fstat instead of lstat
...
CID 1393878
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 09:38:59 +02:00
Andreas Schneider
f6fe7488e3
tests: Add some null checks
...
CID 1393898
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 09:36:50 +02:00
Andreas Schneider
24aef4fbf1
sftp: Add missing size checks
...
CID 1238630
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 09:36:50 +02:00
Andreas Schneider
fbfe002460
tests: Check for memory allocation error in torture_pki_ed25519_sign()
...
CID 1393899
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 09:36:47 +02:00
Andreas Schneider
c7525c056c
tests: Improve torture_connect_socket()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 08:58:27 +02:00
Andreas Schneider
1509693cce
tests: null terminate buffer in torture_read_one_line()
...
CID 1393902
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 08:52:42 +02:00
Andreas Schneider
67ef808a95
tests: Add additional NULL check in torture_pki_rsa_write_privkey()
...
CID 1393904
CID 1393903
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 08:50:11 +02:00
Andreas Schneider
aeefcd8199
tests: Initialize readfds in torture_channel_select()
...
CID 1393905
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 08:46:37 +02:00
Andreas Schneider
9bc050d07d
tests: Check return code of ssh_pki_import_privkey_base64
...
CID 1393906
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 08:44:28 +02:00
Andreas Schneider
c2776f70c1
tests: Improve test checks
...
CID 1394620
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-06 08:32:07 +02:00
Andreas Schneider
e6020f94bf
server: Fix echo access in ssh_message_auth_interactive_request()
...
Fixes T94
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-03 19:08:57 +02:00
Anderson Toshiyuki Sasaki
9305762fcd
Remove internal calls to ssh_init
...
Since the call is made automatically when the library is loaded, these
calls are no longer required (if the library is not linked statically).
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-03 16:43:03 +02:00
Anderson Toshiyuki Sasaki
e0e0d62a71
tests: Run thread tests on Windows
...
When pthreads is available, run the threads tests on Windows
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-03 16:43:03 +02:00
Anderson Toshiyuki Sasaki
708f127788
tests: Add test for RSA PKI running on threads
...
Run the tests from torture_pki_rsa.c on threads. Tests requiring files
to be removed are not tested, since they would require the access to
the files to be synchronized.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-03 16:43:03 +02:00
Anderson Toshiyuki Sasaki
dd3d867452
tests: Add test for crypto running on threads
...
The test run crypto test on multiple threads.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-03 16:43:03 +02:00
Anderson Toshiyuki Sasaki
5443863723
tests: Add test for buffer running on threads
...
The test run buffer tests on multiple threads.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-03 16:43:03 +02:00
Anderson Toshiyuki Sasaki
edcdef94ee
tests: Add test for init running on threads
...
The test runs ssh_init()/ssh_finalize() on multiple threads.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-03 16:43:03 +02:00
Anderson Toshiyuki Sasaki
04cc7b769a
threads: Add Windows threads implementation
...
Added Windows threads implementation based on CriticalSection.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-03 16:43:03 +02:00
Anderson Toshiyuki Sasaki
83b43443e5
threads: Automatically call ssh_init on load
...
This makes unnecessary to call ssh_init() when the library is
dynamically loaded. Also removes the threads shared library. The used
threads implementation is chosen in configuration time, changing the
ssh_threads_get_default() depending on the available threads library.
Internally, it is expected a threads implementation providing:
- void ssh_mutex_lock(void **mutex);
- void ssh_mutex_unlock(void **mutex);
- struct ssh_threads_callbacks_struct *ssh_threads_get_default(void);
and a crypto implementation providing:
- int crypto_thread_init(struct ssh_threads_callbacks_struct *user_callbacks);
- void crypto_thread_finalize(void);
This adds internal threads implementation for pthreads and noop.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-03 16:43:03 +02:00
Andreas Schneider
6a077fe750
gitlab-ci: Build with cmake3 on CentOS7
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-03 16:43:03 +02:00
Andreas Schneider
b2a681bd29
cmake: Require at least cmake 3.1
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-03 16:43:03 +02:00
Jakub Jelen
18077673ac
pki: Log really the signature algorithm type
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-01 16:05:37 +02:00
Jakub Jelen
25407209b0
pkd: Add missing ECDH mechanisms + whitespace cleanup
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-01 16:05:12 +02:00
Jakub Jelen
0e886ba803
pkd: Support ed25519 host keys in server
...
This adds support for the ed25519 keys in the pkd framework and adds
openssh-only tests utilizing these host keys (dropbear does not support
them yet).
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-01 16:04:40 +02:00
Jakub Jelen
c8429113fa
bind: Complete loading ed25519 in server
...
Previously, the support was only partial and if the ed25519 key was
the only one, the internal checks were failing the tests.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-01 16:03:48 +02:00
Jakub Jelen
e1d2454dd7
session: Do not search for RSA1 keys in ~/.ssh/identity
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-01 16:03:41 +02:00
Jakub Jelen
ed738bee34
test: Fix text labels (copy & paste error)
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-01 16:03:17 +02:00
Pino Toscano
12284b75fa
buffer: Add and use ssh_buffer_allocate_size()
...
Add a small helper for ssh_buffer to ensure that the buffer has a
certain amount of space already preallocated. This can be useful in case
it is known how much data is going to be added to a buffer, to avoid
multiple reallocations.
Make use of it in few places in the library.
Signed-off-by: Pino Toscano <ptoscano@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-08-01 11:04:33 +02:00
Andreas Schneider
afa4021ded
tests: Add umask() around mkstemp()
...
CID 1391450
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-07 11:38:59 +02:00
Andreas Schneider
c425082394
tests: Fix errno check in pkd
...
CID 1393877
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-07 11:35:00 +02:00
Aris Adamantiadis
db9da99a36
bignum: Make bignum_free safer
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-05 14:35:13 +02:00
Andreas Schneider
c3dac948c9
pki: Improve pubkey buffer handling form file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-05 13:21:23 +02:00
Andreas Schneider
c866768da4
torture_pki_dsa: Improve torture_pki_dsa_publickey_base64
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-05 13:15:14 +02:00
Aris Adamantiadis
2b40ad29c0
crypto: Split init and finalize functions
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-05 12:55:23 +02:00
Andreas Schneider
38c53db953
libcrypto: Use new RAND_priv_bytes() for strong randomness
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-05 12:12:17 +02:00
Andreas Schneider
c503bb572e
crytpo: Make sure we check return of ssh_get_random() correctly
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-05 12:12:14 +02:00
Aris Adamantiadis
36a727e656
bignum: Harmonize ssh_get_random()
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-05 12:09:52 +02:00
Andreas Schneider
7b9a07c363
cmake: Print if server testing is enabled
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-04 20:33:31 +02:00
Jakub Jelen
4b298ca770
kex: Check allocation result
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-04 08:24:54 +02:00
Jakub Jelen
8e211c0689
tests: Verify various host keys can be successfully negotiated and verified
...
This verifies that all the supported host keys can be used and
verified by the client, including the SHA2 extension in RFC 8332.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-04 07:52:50 +02:00
Jakub Jelen
d25b8fb550
packet: Avoid warnings by using correct template
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-04 07:48:32 +02:00
Jakub Jelen
f1b36c18f6
client: Properly reset session structures on disconnect
...
torture_connect_double test case used to test the connect only up
to key exchange phase, but not after the new keys are stated to be
used for communication. The keys from previous connectoin were not
cleaned up from the previous invocation as well as the seqence
number was not reset and therefore any further packet was failing
with length-check errors or MAC errors.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-04 07:47:54 +02:00
Andreas Schneider
b3a7e86a4a
knownhosts: Fix memory leak
...
CID 1393774
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-04 07:09:24 +02:00
Andreas Schneider
d316390825
gitlab-ci: Only enable freebsd runner where it is enabled
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-03 15:08:40 +02:00
Andreas Schneider
3141dec632
known_hosts: Remove deprecated ssh_knownhosts_algorithms()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-03 15:08:40 +02:00
Andreas Schneider
539d7ba249
kex: Use ssh_known_hosts_get_algorithms()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-03 15:08:40 +02:00
Andreas Schneider
83a46c7756
tests: Add knownhosts test for detecting conflics
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-03 15:08:40 +02:00
Andreas Schneider
2d90bc9d6b
knownhosts: Fix checking if server is known
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-03 15:08:40 +02:00
Andreas Schneider
de44fdfd35
tests: Add knownhosts test for SSH_KNOWN_HOSTS_UNKNOWN
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-03 15:08:40 +02:00
Andreas Schneider
65a5154eff
tests: Add knownhosts test for SSH_KNOWN_HOSTS_OTHER
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-03 15:08:40 +02:00
Andreas Schneider
613dcc95e6
knownhosts: Fix return codes
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-03 15:08:40 +02:00
Andreas Schneider
77e1761734
tests: Add client test for ssh_known_hosts_get_algorithms()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-03 15:08:40 +02:00
Andreas Schneider
e49e4e13f3
knownhosts: Implement ssh_known_hosts_get_algorithms()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-03 15:08:38 +02:00
Andreas Schneider
e73ae60e1a
tests: Use assert_ssh_return_code() in client tests
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-03 07:45:51 +02:00
Andreas Schneider
584c345451
gitlab-ci: Fix mips compilation on debian
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-02 09:53:02 +02:00
Andreas Schneider
bfbd574098
gitlab-ci: Add missing debian variable
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-02 09:06:42 +02:00
Andreas Schneider
b4462bdea0
tests: Use assert_ssh_return_code() in torture_algorithms
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-02 08:03:20 +02:00
Andreas Schneider
6b8d1aa836
gitlab-ci: Fix path to toolchain file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 15:41:50 +02:00
Andreas Schneider
d90b88588f
gitlab-ci: Add 32bit build on openSUSE
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 15:39:27 +02:00
Andreas Schneider
6a715b80d6
cmake: Unset CMAKE_REQUIRED_* variables
...
This should fix the 'gcc -m32' build!
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 15:27:09 +02:00
Andreas Schneider
084769b88c
libcrypto: Fix size printing
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 15:27:09 +02:00
Andreas Schneider
f4408f38a3
torture: Give sshd at least 100ms to start.
...
This should avoid some 'No route to host' errors.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 15:27:09 +02:00
Andreas Schneider
6dd9303729
chachapoly: Use a function instead of an extern variable
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
a19513b87a
example: Add missing error checks in ssh_server_fork
...
CID 1393676
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
21962dd154
known_hosts: Simplify invalid tokens check
...
CID 1393677
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
8917b84840
examples: Make gobal variables static in scp_download
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
4b0fd10a99
examples: Define LIMIT as unsinged long
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
3350fd7479
chachapoly: Make global variables static
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
c98b00a5f4
log: Make global variables static
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
88673b2d1f
channels: Fix NULL check in channel_rcv_data callback
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
f425ebb098
tests: Use new assert ssh return code macros in torture_connect
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
f6284eafd6
torture: Add assert macros for ssh return codes
...
This allows us to print errors from ssh sessions.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
cf250171de
include: Add arpa/inet.h for htonl
...
This should fix a build warning on FreeBSD.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
a82e24f024
config: Initialize glob_t with C99 initializer
...
Should fix a build warning on FreeBSD.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-30 14:37:04 +02:00
Andreas Schneider
60450ef936
gitlab-ci: Fix stage
2018-06-29 17:26:34 +02:00
Andreas Schneider
d11d764c9d
gitlab-ci: Fix path for artifacts
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 16:55:40 +02:00
Nikos Mavrogiannopoulos
ac5c90d771
gitlab-ci: Add build for mips platform
...
This tests multiple items, (1) cross compilation, (2) compilation
on debian and (3) CI run on MIPS systems, tested under qemu. This target
was originally written for GnuTLS by Michael Weiser.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
Reviewed-by: Andreas Schneider <asn@samba.org >
2018-06-29 16:53:33 +02:00
Andreas Schneider
14045f516e
doc: Document server testing
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 16:22:59 +02:00
Tilo Eckert
3e70f06fc8
doc: add documentation about building with client tests
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 15:59:08 +02:00
Tilo Eckert
a2a6dddacf
tests: adjust test for kex string "curve25519"
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 15:57:57 +02:00
Tilo Eckert
a366bb3b45
tests: add pkd tests for kex curve25519
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 15:57:51 +02:00
Tilo Eckert
a4a6017e6e
tests: add algorithm tests for kex curve25519
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 15:57:45 +02:00
Tilo Eckert
e60cb2ee10
kex: add curve25519-sha256 as alias for curve25519-sha256@libssh.org
...
see: https://tools.ietf.org/id/draft-ietf-curdle-ssh-curves-07.html
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 15:57:11 +02:00
Aris Adamantiadis
da0f360478
kex: log negotiated methods
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 15:55:37 +02:00
Andreas Schneider
206f3ff895
Rest in Peace SSHv1
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2018-06-29 14:41:14 +02:00
Andreas Schneider
81b4320318
gitlab: Fix build on FreeBSD
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 11:45:14 +02:00
Andreas Schneider
bed60f9b84
kex: Enable chacha20-poly1304 KEX with mbedtls
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 11:41:22 +02:00
Andreas Schneider
10728f8577
cmake: Disable torture_packet on Windows
...
The test uses socketpair().
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 10:57:36 +02:00
Andreas Schneider
72141cae0b
gitlab: Disable client testing on freebsd
...
The host doesn't have cwrap installed.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 10:54:35 +02:00
Andreas Schneider
ec842c3ca3
gitlab: Remove the debian aarch64 build
...
This doesn't work anymore
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 10:52:46 +02:00
Andreas Schneider
054d2dffc1
gitlab: Add SERVER_TESTING and updates for cmake
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 10:49:52 +02:00
Andreas Schneider
d971983d5e
cmake: Add SERVER_TESTING option
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 10:49:14 +02:00
Andreas Schneider
946f8f64ef
cmake: Rename WITH_CLIENT_TESTING option to CLIENT_TESTING
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 10:32:07 +02:00
Andreas Schneider
84ac7d1de0
cmake: Rename WITH_TESTING option to UNIT_TESTING
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 10:31:53 +02:00
Andreas Schneider
f4ddf9df53
tests: Fix key parsing in torture_pki_dsa_publickey_base64
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 10:05:06 +02:00
Andreas Schneider
d7477dc745
tests: Remove system includes from torture_packet
...
This fixes the build on Windows. Those come in via the include of
socket.c anyway.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 09:35:54 +02:00
Andreas Schneider
1444ae5add
pki: Fix random memory corruption
...
Fixes T78
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 09:30:59 +02:00
Andreas Schneider
aa95eb1965
tests: Move CHACHA20 define out of HAVE_DSA ifdef
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-29 09:08:07 +02:00
Andreas Schneider
649a7490a6
gitlab: Do not build with SSHv1 support
...
This will be removed soon.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 18:00:47 +02:00
Jon Simons
c089b700c6
chacha: fix build for mbedTLS
...
Fix the build for mbedTLS:
* set HAVE_CHACHA for non-mbedTLS builds
* only compile chachapoly.c when HAVE_CHACHA
* use empty CHACHA20 in src/kex.c unless HAVE_CHACHA
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Jon Simons
c8d6445d44
packet_crypt: remove set_decrypt_key upon ssh_packet_decrypt_len
...
In 06b9901e64 , invocations of `set_decrypt_key`
and `set_encrypt_key` were moved into the `ssh_packet_newkeys` callback, away
from the packet decrypt and encrypt functions.
Remove the extra `set_decrypt_key` for the case that an `aead_decrypt_length`
is not NULL. At this time, only the chacha20-poly1305@openssh.com cipher
is affected by this change.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Jon Simons
d4a4ce4d44
chacha: use a cipher cleanup callback
...
With this change there is less code specific to the
chacha20-poly1305 cipher found in src/wrapper.c.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Jon Simons
7a2624dee4
packet_crypt: fix unused variable compiler warning
...
The local `rc` variable here is never set. Fix a warning that is
emitted due to `-Wunused-variable`.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Jon Simons
f827833d82
tests: fix torture_packet.c test_data
...
Make the `test_data` larger so that tests do not read beyond
its length. Observed in testing with an `-fsanitize=address`
build locally.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Jon Simons
6f38e0b771
pkd: move chacha20-poly1305@openssh.com tests to OPENSSHONLY section
...
Dropbear does not currently implement the 'chacha20-poly1305@openssh.com '
cipher, so move it into the OPENSSHONLY suite.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Jon Simons
622ff855f5
pkd: add passes for chacha20-poly1305@openssh.com cipher
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Alberto Aguirre
26734a547a
torture_packet: Set encryption/decryption keys
...
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Alberto Aguirre
1ece5a849c
packet_crypt: Avoid setting keys every time
...
Avoid setting keys on every packet decrypt or encrypt operation.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Aris Adamantiadis
23accdde1a
tests: send more packets of various sizes
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Aris Adamantiadis
321ec2cb1c
tests: packet encryption unit testing
...
That code is really ugly, but it wasn't meant to be modular at all in the
first place.
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Aris Adamantiadis
27711f6a4c
tests: test for chacha20-poly1305@openssh.com
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Aris Adamantiadis
238202d380
libgcrypt: make it compatible with chacha20
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Aris Adamantiadis
8a735d5eb7
chacha: packet decryption
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Aris Adamantiadis
d038c4dee7
chacha: packet encryption
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Aris Adamantiadis
ebd76bf347
cmake: detect "bounded" compiler attribute
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Aris Adamantiadis
acc1ade74a
external: Add ChaCha and Poly1305 implementations from OpenSSH
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Andreas Schneider
72e4500da9
gitlab: Disable SSHv1 support
...
This will be removed soon.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Andreas Schneider
c4f3bf4ffa
torture: Remove unused variable
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:05:58 +02:00
Andreas Schneider
c563ed636a
Remove vim modelines from all files
...
If you want modelines use my vim plugin:
https://github.com/cryptomilk/git-modeline.vim
git config --add vim.modeline "ts=4 sw=4 et"
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 08:41:08 +02:00
Andreas Schneider
f3de2974a9
tests: Disable ssh_is_ipaddr("255.255.255") on Win32
...
Till we get the issue fixed in Wine.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 08:36:54 +02:00
Andreas Schneider
1b8ce5a6ed
tests: Workaround for a Wine bug
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 08:27:08 +02:00
Jon Simons
deb7630c67
pkd: log but ignore ungraceful client disconnects
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 21:38:35 -07:00
Jon Simons
cbd9569b99
pkd: move hmac-sha2-256 to OpenSSH-only lists
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 19:52:32 -07:00
Jon Simons
a45a04ff4d
pkd: omit -v for dbclient by default
...
The `-v` is only recognized by `dbclient` when dropbear is built
in its DEBUG_TRACE mode. Omit that flag by default to avoid a
warning log emitted to stderr.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 19:42:57 -07:00
Jon Simons
7aa496d844
pkd: remove blowfish-cbc cipher passes
...
Support for the `blowfish-cbc` cipher has been removed from OpenSSH
as of version 7.6. Remove this cipher from the pkd tests so that
the tests will pass together with a modern OpenSSH client.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 19:42:51 -07:00
Jon Simons
bf10a66b5d
pkd: emit error message for OpenSSH clients < 7.0
...
Emit a friendly error message for OpenSSH clients older than
7.0. Some of the recent pkd changes now require a modern
client to support some newer config options.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 19:42:43 -07:00
Jon Simons
adc817cf13
pkd: specify PubkeyAcceptedTypes for OpenSSH client
...
As of OpenSSH 6.9, support for `ssh-dss` user keys is disabled by default
at runtime. Specify an explicit `-o PubkeyAcceptedKeyTYpes` in the pkd
tests to explicitly enable each user key type being tested, including
`ssh-dss`.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 19:42:37 -07:00
Jon Simons
787a649390
pkd: specify HostKeyAlgorithms for OpenSSH client
...
As of OpenSSH 6.9, support for `ssh-dss` host keys is disabled by default
at runtime. Specify an explicit `-o HostKeyAlgorithms` in the pkd tests
to explicitly enable each host key type being tested, including `ssh-dss`.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 19:42:33 -07:00
Jon Simons
54690e6cdd
pkd: run with SOCKET_WRAPPER_LIBRARY
...
Use the socket_wrapper preload shim when running the `pkd_hello`
test with `make test`. The end goal here is to get this test
running alongside normal tests in regular CI. Changes to do
this:
* Configure PKD_ENVIRONMENT for the `pkd_hello_i1` test in the
CMakeLists.txt file.
* Add a `--socket-wrapper-dir|-w` flag that is used to opt-in to
initializing a SOCKET_WRAPPER_DIR as expected by the socket_wrapper
library.
A runtime flag is used here to make it easy to run `pkd_hello`
with the socket_wrapper library while avoiding a hard dependency.
Testing done: observed socker_wrapper in effect with `strace`;
running `make test` uses the wrapper correctly on my local
machine.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 19:41:10 -07:00
Jon Simons
4e3fb81172
pkd: add_test pkd_hello_i1 for make test
...
Add an entry for a `pkd_hello_i1` test which runs one iteration
through each of the pkd algorithm combinations.
Testing done: now `make test` will run `pkd_hello -i1` which
completes in ~25 seconds on my local machine.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 19:41:02 -07:00
Jon Simons
6273c409e3
pkd: fix missing config.h #include
...
Ensure to include config.h so that the `HAVE_DSA` value is properly set
when building the pkd tests.
Introduced with 778652460f ,
Testing done: with this change, the `pkd_hello` test is passing on an
OpenSSL 1.1.0 build for me. Previously it would fail pubkey exchange
early on for DSA- and ECDSA-type host keys.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 21:25:36 +02:00
Jon Simons
7798d39187
dh: fix two leaks in ssh_get_pubkey_hash
...
Fix two memory leaks in `ssh_get_pubkey_hash` for some error paths.
The local `h` buffer and `ctx` MD5 context each must be free'd for
the SSH_ERROR cases.
Introduced with 16217454d5 .
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 21:25:34 +02:00
Jon Simons
58ef1e96b8
dh: fix ssh_get_pubkey_hash indentation
...
Fix `ssh_get_pubkey_hash` indentation to use softabs
with 4 spaces. No change in behavior.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 21:25:32 +02:00
Jon Simons
732818ebb2
tests: fix -Wunused-function warning in torture_pki_ecdsa.c
...
Wrap some function definitions with `HAVE_LIBCRYPTO` ifdefs to
match their usages in `torture_run_tests`.
Fixes this warning I observe when building locally:
torture_pki_ecdsa.c:341:13: warning:
‘torture_pki_ecdsa_write_privkey’ defined but not used
[-Wunused-function]
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 21:25:30 +02:00
Jon Simons
448de134ac
ecdh: fix SSH_MSG_KEXDH_REPLY for mbedTLS
...
Ensure to provide the `ssh_string` pubkey blob to the buffer packing
routine when computing the SSH_MSG_KEXDH_REPLY message, rather than
the new `ssh_key` type.
Introduced with 16217454d5 .
Testing done: with this change, the `pkd_hello` test is passing on a
mbedTLS build for me. Previously it would segfault during pubkey
exchange with "ecdh-sha2-nistp256".
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 21:25:28 +02:00
Jon Simons
fd3d8d6496
ecdh: fix SSH_MSG_KEXDH_REPLY for libgcrypt
...
Ensure to provide the `ssh_string` pubkey blob to the buffer packing
routine when computing the SSH_MSG_KEXDH_REPLY message, rather than
the new `ssh_key` type.
Introduced with 16217454d5 .
Testing done: with this change, the `pkd_hello` test is passing on a
libgcrypt build for me. Previously it would segfault during pubkey
exchange with "ecdh-sha2-nistp256".
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 21:25:26 +02:00
Jon Simons
0b90ab102e
ecdh: fix SSH_MSG_KEXDH_REPLY for libcrypto
...
Ensure to provide the `ssh_string` pubkey blob to the buffer packing
routine when computing the SSH_MSG_KEXDH_REPLY message, rather than
the new `ssh_key` type.
Introduced with 16217454d5 .
Testing done: with this change, `pkd_hello` test is passing on an
OpenSSL 1.1.0 build for me. Previously it would segfault during
pubkey exchange with "ecdh-sha2-nistp256".
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 21:25:24 +02:00
Anderson Toshiyuki Sasaki
cd3170fcb1
gitlab: Use wine to run tests built for Windows
...
When building in a cross-compiling environment, use wine to run the
tests.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 21:23:12 +02:00
Anderson Toshiyuki Sasaki
9eaf55898e
cmake: Added executable exension on test binaries
...
This is necessary when building the tests for Windows.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 21:20:26 +02:00
Andreas Schneider
10e1e396fc
gitlab: Add build with mbedtls
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 12:01:54 +02:00
Andreas Schneider
c1db283c39
gitlab: Enable build with libgcrypt
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 12:01:51 +02:00
Andreas Schneider
6c97122120
torture: Don't exclude filter mechanism on Windows
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 10:51:45 +02:00
Andreas Schneider
0dd33d8ed1
torture: Don't include sys/socket.h on Windows
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 10:44:31 +02:00
Andreas Schneider
0db12d7f75
gitlab: Don't error out if obj exists
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 10:16:45 +02:00
Anderson Toshiyuki Sasaki
c1d8ba47dd
gitlab: Added builds for Windows using MinGW
...
Only the unit tests are run.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 09:45:35 +02:00
Andreas Schneider
dc4cc08c3a
gitlab: Use obj dir for building
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 09:45:35 +02:00
Andreas Schneider
e880cafed0
tests: Call ssh_session_is_known_server()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 09:45:35 +02:00
Andreas Schneider
1ae014f52a
dh: Fix reference to ssh_session_update_known_hosts()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 09:45:35 +02:00
Andreas Schneider
1369559385
include: Fix reference to ssh_session_update_known_hosts
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 09:45:35 +02:00
Andreas Schneider
7ef72ec91f
doc: Updated guided tour for knownhosts changes
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 09:45:35 +02:00
Andreas Schneider
b74a184172
torture: Fix building on Windows
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-27 09:45:35 +02:00
Alberto Aguirre
b50fb638f7
knownhosts: Fix windows build failure
...
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-25 08:20:40 +02:00
Andreas Schneider
e06ae8e096
include: Declare ge25519_base as extern
...
Thanks to Tilo Eckart.
The global variable "ge25519_base" is referenced in the module
"src/external/ed25519.c" and initialized in "src/external/ge25519.c".
The lack of the extern keyword in the header results in different
instances being compiled into both translation units with some
compilers.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-21 17:41:32 +02:00
Andreas Schneider
0940b0f29b
knownhosts: Do not double free memory
...
CID 1393236
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-06 08:38:14 +02:00
Andreas Schneider
03b05c8a5e
tests: Add missing newline to KNOWN_HOST_ENTRY_ED25519
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-05 14:42:21 +02:00
Andreas Schneider
9e4f9a26d4
tests: Allow knownhosts verify test to validate ed25519 and ecdsa
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-05 10:50:59 +02:00
Andreas Schneider
f5f8c0fc76
knownhosts: Fix resource leak in ssh_known_hosts_parse_line()
...
CID 1391444
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-05 10:44:54 +02:00
Andreas Schneider
c4dbe3b863
knownhosts: Fix a memory leak on error
...
CID 1391446
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-05 10:43:08 +02:00
Andreas Schneider
669678119c
knownhosts: Fix possible null pointer dereference
...
CID 1391447
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-05 10:35:42 +02:00
Andreas Schneider
34e7a3cf8c
knownhosts: Fix resource leak in ssh_session_update_known_hosts()
...
CID 1391448
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-05 10:34:56 +02:00
Andreas Schneider
1001cbbb99
knownhosts: Fix resource leak in ssh_known_hosts_read_entries()
...
CID 1391449
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-05 10:34:49 +02:00
Aris Adamantiadis
36d52ee205
buffer: Add ssh_buffer_allocate() function
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 16:55:23 +02:00
Aris Adamantiadis
0ad462102a
packet: Add more debugging
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 16:55:21 +02:00
Aris Adamantiadis
c6ee41bff3
cmake: add WITH_PACKET_DEBUG option
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 16:55:18 +02:00
Andreas Schneider
5012a9c146
examples: Use new known hosts functions
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:20:28 +02:00
Andreas Schneider
93781f9d5a
libsshpp: Use new known hosts functions
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:20:28 +02:00
Andreas Schneider
4550c99222
known_hosts: Mark ssh_is_server_known as deprecated
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:20:28 +02:00
Andreas Schneider
a209f928d2
kwonhosts: Add functions to check if servers public key is known
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:20:28 +02:00
Andreas Schneider
f23dbe6f42
knownhosts: Add ssh_session_update_known_hosts()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:20:28 +02:00
Andreas Schneider
974e1831a0
knownhosts: Add ssh_session_export_known_hosts_entry()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:20:28 +02:00
Andreas Schneider
963c46e4fb
knownhosts: Add ssh_session_has_known_hosts_entry()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:20:28 +02:00
Andreas Schneider
32c49ea134
misc: Add ssh_list_count()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:20:28 +02:00
Andreas Schneider
a465ea2d49
knownhosts: Add ssh_known_hosts_read_entries()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:20:28 +02:00
Andreas Schneider
702e9e8ad5
knownhosts: Introduce new known hosts managing functions
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:20:28 +02:00
Andreas Schneider
250bf37a28
tortrue: Add ed25519 hostkey to sshd
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:20:28 +02:00
Andreas Schneider
952c64b4c0
threads: Fix compiler warning
...
Use a protype for libcrypto_lock_callback().
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:18:12 +02:00
Andreas Schneider
bcaeaf17af
tests: Fix size for bob_ssh_cert
...
Fixes a gcc8 warning.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 11:12:36 +02:00
Jim McDonough
f4e57a6e22
Add builds for opensuse tumbleweed
...
Signed-off-by: Jim McDonough <jmcdonough@suse.com >
2018-05-30 14:33:47 +02:00
Andreas Schneider
8457580f61
wrapper: Fix memory leak when freeing server_pubkey
...
Thanks to John McVann.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-05-14 08:17:08 +02:00
Andreas Schneider
f1ff9ae00c
torture: Increase wait time for process termination to 10ms
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-05-07 21:01:05 +02:00
Andreas Schneider
ed4ea51bb8
connector: Add missing check for POLLHUP to detect EOF
...
Thanks to Chris Townsend.
Fixes T81
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-05-07 20:36:56 +02:00
Andreas Schneider
22a92da30d
auth: Handle SSH_AUTH_PARTIAL in agent auth correctly
...
Thanks to Orion Poplawski.
Fixes T82
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-05-07 20:32:13 +02:00
Andreas Schneider
362b20a0bc
server: Fix segfault in dh_handshake_server()
...
Thanks to Felix Jones
Fixes T91
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-05-07 20:09:56 +02:00
Andreas Schneider
72f6b34dbc
tests: We should only init and finalize libssh once
...
This should fix a segfault with gcrypt.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-05-07 08:33:32 +02:00
Andreas Schneider
816234350d
pki: Fix duplicating ed25519 public keys
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-25 16:25:32 +02:00
Andreas Schneider
4aeb0cfd9c
server: Fix session pubkey import
...
This is a regression introduced by 16217454d5
We import the pubkey into current_crypto which is NULL instead of
next_crypto.
Fixes T90
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-20 13:47:46 +02:00
Nikos Mavrogiannopoulos
be414423d7
Introduce a gitlab CI for centos7, debian and Fedora
...
This introduces builds for:
centos7 with openssl 1.0.x (x86-64)
fedora28 with openssl 1.1.x (x86-64)
fedora28 with libgcrypt (x86-64) - disabled
debian with openssl 1.0.x (aarch64)
address-sanitizer (gcc) - disabled
undefined-sanitizer (gcc)
static-analyzer (clang)
See https://gitlab.com/libssh/libssh-mirror/
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-18 10:57:32 +02:00
Nikos Mavrogiannopoulos
abd1a1f372
README: Added markdown readmine with gitlab CI badge
...
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-18 10:51:43 +02:00
Andreas Schneider
c705fb6e3b
kex1: Add missing NULL check in make_rsa1_string()
...
CID 1388445
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-18 10:33:55 +02:00
Andreas Schneider
1a36aa21ba
packet_cb: Fix the if check in ssh_packet_newkeys()
...
CID 1388446
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-18 10:32:35 +02:00
Andreas Schneider
c2f8010b60
known_hosts: Do not leak pubkey_buffer in check_public_key()
...
CID: 1388447
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-18 10:29:21 +02:00
Andreas Schneider
64985f7bea
server: Do not leak pubkey_blob in ssh_get_key_params()
...
CID 1388448
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-18 10:27:01 +02:00
Nikos Mavrogiannopoulos
3f562ee586
buffer: Do not call explicit_bzero with null arguments
...
This allows compiling and testing with undefined sanitizer.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-18 10:24:47 +02:00
Nikos Mavrogiannopoulos
eb796b4bbb
buffer: Do not call memcpy with null arguments
...
This allows compiling and testing with undefined sanitizer.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-18 10:24:42 +02:00
Andreas Schneider
87b8d232bd
buffer: Apply coding style to ssh_buffer_reinit()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-18 10:22:03 +02:00
Andreas Schneider
6f1f8d2bdb
buffer: Apply coding style to realloc_buffer()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-18 10:22:03 +02:00
Nikos Mavrogiannopoulos
a95bc8a016
kex1: Use libcrypto-compat.h for RSA_get0_key with OpenSSL
...
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-17 18:00:52 +02:00
Nikos Mavrogiannopoulos
f3a19d8c96
torture_path_expand_tilde_unix: use getpwuid() if no env variables
...
This allows operating under environments where the username variables
are not present.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-17 17:59:14 +02:00
Meng Tan
e005fd310f
Fix ssh_event_add_session() when session socket has two pollhandlers
...
Signed-off-by: Meng Tan <mtan@wallix.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-10 11:20:52 +02:00
Axel Eppe
fb2fefb3c6
channels: add ssh_channel_request_send_break to support RFC 4335
...
Signed-off-by: Axel Eppe <aeppe@google.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-10 11:16:23 +02:00
Andreas Schneider
6026fc8036
cmake: Fix libfuzzer linking with clang6
...
This is always available using -fsanitize=fuzzer now.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-04-10 11:13:57 +02:00
Andreas Schneider
2cc5b5865c
kex1: Use new dh pubkey import functions
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-28 10:20:54 +02:00
Andreas Schneider
8d65edb41f
kex1: Fix building with OpenSSL 1.1+
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-28 10:20:32 +02:00
Andreas Schneider
1247ba3398
channels1: Add missing config.h include
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-28 10:11:45 +02:00
Alberto Aguirre
be22c0d442
Add a NODELAY option
...
Add a new option SSH_OPTIONS_NODELAY to enable or disable the
Nagle Algorithm (TCP_NODELAY) on the session socket.
Improved performance can be achieved for some applications like
sftp servers by enabling SSH_OPTIONS_NODELAY as typically, the
next request won't arrive until the server replies, which are
typically small writes.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-21 20:44:04 +01:00
Andreas Schneider
467d78a442
tests: Fix mixed code compiler warning in torture_rand
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-21 20:41:16 +01:00
Andreas Schneider
a4aeee972c
torture: Increase wait time for the sshd process to exit
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-21 20:40:04 +01:00
Andreas Schneider
16217454d5
crypto: Change the type of server_pubkey to ssh_key
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-21 20:40:02 +01:00
Alberto Aguirre
7e1e0e5098
misc: Use SecureZeroMemory if available for explicit_bzero
...
Useful on Windows platforms where SecureZeroMemory is available.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-11 22:58:49 +01:00
Alberto Aguirre
3fa0e3959c
misc: Use memset_s if available for explicit_bzero
...
Useful on OSX where memset_s is available.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-11 22:58:13 +01:00
Alberto Aguirre
dd20253fec
tests: fix OSX build errors when enabling tests
...
Fix OSX build error about embedding a directive within macro arguments.
Apparently, snprintf is implemented as a macro on that platform.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-11 22:54:47 +01:00
Alberto Aguirre
85ab4ee53a
connector: ensure channel callbacks are removed
...
ssh_connector_free fails to remove the in/out channel callbacks
as ssh_connector_remove_event sets the in/out channel variables
to NULL.
Have ssh_connector_free, remove the channel callbacks first before
invoking ssh_connector_remove_event.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-07 15:48:04 +01:00
Alberto Aguirre
25f31760aa
connector: Check for POLLHUP on in_fd
...
POLLHUP needs to be checked on in_fd, which may be a pipe.
A pipe in Linux signals EOF through POLLHUP (see:
http://www.greenend.org.uk/rjk/tech/poll.html )
Without checking POLLHUP, a client could spin up indefinetely
doing ssh_event_dopoll.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-07 15:47:03 +01:00
Juraj Vijtiuk
d11869bdb6
pki: Add mbedTLS ECDSA key comparison support
...
Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-03-07 15:44:05 +01:00
Andreas Schneider
81847bf513
priv: Implement explicit_bzero as a function if not available
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Alberto Aguirre <albaguirre@gmail.com >
2018-03-02 18:07:42 +01:00
Andreas Schneider
bba40abc76
priv: Fix explicit_bzero macro if we pass a function
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-02-22 16:28:24 +01:00
Alberto Aguirre
0c12643466
sftp: Remove stray semi-colon in sftp.h header
...
The stray semi-colon in sftp.h is flagged when using -pedantic
which affects clients that include the header and use -pedantic
and -Werror on their codebase.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-02-22 16:28:24 +01:00
Andreas Schneider
1319d2ceb2
cmake: Mark LIBSSH_LIBRARIES and LIBSSH_INCLUDE_DIR as advanced
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-02-16 16:52:02 +01:00
Andreas Schneider
cc1f496741
pki: Use explicit_bzero() to wipe privkey in memory
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-02-16 16:51:37 +01:00
jvijtiuk
963111b836
tests: Fix segfault with mbedTLS built without threading support
...
torture_rand and torture_server_x11 call ssh_init without checking
the return value. If mbedTLS is built without threading support
ssh_init fails but the tests continue and then segfault since threading
wasn't correctly initialised.
Add a section that documents requirements for mbedTLS usage in a
multi threaded environment to README.mbedtls.
Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-02-12 20:05:49 +01:00
Andreas Schneider
ebcff9fd63
src: Use explicit_bzero() if available on the platform
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-02-12 14:41:27 +01:00
Andreas Schneider
25ff1214a4
cmake: Build ssh_server_fuzzer if enabled
...
Fixes T67
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-02-04 11:52:45 +01:00
Alex Gaynor
d84b0926f0
tests: Added a fuzzer for the server
...
Fixes T67
Signed-off-by: Alex Gaynor <alex.gaynor@gmail.com >
2018-02-04 11:51:58 +01:00
Meng Tan
f19158cadf
Set channel as bound when accepting channel open request
...
Signed-off-by: Meng Tan <mtan@wallix.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-02-01 18:23:38 +01:00
Andreas Schneider
459677e20e
libssh: Bump the version to 0.7.90
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-29 20:43:35 +01:00
Andreas Schneider
43bd7b6eee
dh: Use calloc() instead of malloc()
2018-01-18 18:57:18 +01:00
Andreas Schneider
d7c47f529f
pki_gcrypt: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-18 18:55:52 +01:00
Andreas Schneider
2cff66c155
threads: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-18 18:55:04 +01:00
Andreas Schneider
78ce67f579
sftpserver: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-18 18:54:18 +01:00
Andreas Schneider
2fb8198c48
server: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-18 18:53:35 +01:00
Andreas Schneider
2ea3683347
kex: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-18 18:52:04 +01:00
Andreas Schneider
aaeb938ca4
channels: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-18 18:52:04 +01:00
Andreas Schneider
ef4a81ea0c
auth: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-18 18:52:00 +01:00
Andreas Schneider
e9073a6bdb
torture_pki_ed25519: Add tests for private key with passphrase
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:31:02 +01:00
Andreas Schneider
9086d5ca33
torture_pki_ecdsa: Add tests for private key with passphrase
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:31:02 +01:00
Andreas Schneider
3c65057fad
torture_key: Add ecdsa keys with passphrase
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:31:02 +01:00
Andreas Schneider
f9b1dece41
torture_pki_dsa: Add tests for private key with passphrase
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:31:02 +01:00
Andreas Schneider
f7a2330de7
torture_pki_rsa: Add tests for private key with passphrase
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:31:02 +01:00
Andreas Schneider
67b8f3d6df
pki_crypto: Fix private key generation with password
...
We need to specify a cipher when we generate a key with a password.
OpenSSH uses aes_128_cbc, so we should use the same.
Thanks to Julian Lunz for the report.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:31:02 +01:00
Andreas Schneider
b0af812710
tests: Move torture keys to own file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:31:02 +01:00
Andreas Schneider
d13a17a27c
cmake: Move ed25519 tests into unix part
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:31:02 +01:00
Andreas Schneider
ddfc36aa56
tests: Move rsa tests to own test file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:31:02 +01:00
Andreas Schneider
a5997d180d
tests: Remove obsolete setup_both_keys()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:31:02 +01:00
Andreas Schneider
51875db70c
tests: Move ed25519 functions to the right file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:31:02 +01:00
Andreas Schneider
5ad7da7fd2
tests: Move ecdsa tests to own test file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:27:52 +01:00
Andreas Schneider
59308bc269
tests: Move dsa tests to own test file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:27:52 +01:00
Andreas Schneider
fd2ef07f37
tests: Move helper functions to a common file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:24:11 +01:00
Andreas Schneider
e19163eabb
libgcrypt: Add missing config.h include
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:24:11 +01:00
Andreas Schneider
37acd3eca8
torture: Give sshd more time to start up
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-10 22:24:11 +01:00
Andreas Schneider
cc13e85202
tests: Fix torture_pki with libcrypto
...
This stops asking for a passphrase on commandline.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-04 15:35:37 +01:00
Andreas Schneider
720739bc2a
Happy new year!
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-01-02 08:05:59 +01:00
jvijtiuk
ea99215664
pki: Fix accidental ECC switch case fallthroughs into ed25119 cases when built without ECC
...
Summary:
When ed25519 was introduced in commit 93c7b81b4e ,
the ed25519 case was added after the ecdsa case in src/pki.c. The ecdsa case seems to
have relied on falling through to report an error, when HAVE_ECC is not defined.
If HAVE_ECC is not defined, but ecdsa keys are used, with for example,
ssh_pki_import_pubkey_file, the code fallthroughs into the ed25519 case.
Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr >
Test Plan: Unit tests passed. No memory leaks found with valgrind.
Reviewers: asn
Differential Revision: https://bugs.libssh.org/D13
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-28 20:46:37 +01:00
Jakub Jelen
c3c492a190
config: Avoid long -> int -> long casting for timeout configuration option
...
Fixes: T80
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-28 20:42:53 +01:00
Juraj Vijtiuk
778652460f
add mbedtls crypto support
...
Summary:
This patch adds support for mbedTLS as a crypto backend for libssh.
mbedTLS is an SSL/TLS library that has been designed to mainly be used
in embedded systems. It is loosely coupled and has a low memory
footprint. mbedTLS also provides a cryptography library (libmbedcrypto)
that can be used without the TLS modules.
The patch is unfortunately quite big, since several new files had to
be added.
DSA is disabled at compile time, since mbedTLS doesn't support DSA
Patch review and feedback would be appreciated, and if any issues or
suggestions appear, I'm willing to work on them.
Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr >
Test Plan:
* The patch has been tested with a Debug and MinSizeRel build, with
libssh unit tests, client tests and the pkd tests.
* All the tests have been run with valgrind's memcheck, drd and helgrind
tools.
* The examples/samplessh client works when built with the patch.
Reviewers: asn, aris
Subscribers: simonsj
Differential Revision: https://bugs.libssh.org/D1
2017-12-28 11:17:39 +01:00
Jakub Jelen
5c3b1ee0a4
options: Rewrite set() description to get()
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-28 11:17:39 +01:00
Jakub Jelen
4dec2f989c
options: Move SSH_OPTIONS_ADD_IDENTITY to *set() function description
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-21 12:38:23 +01:00
Eric Bentley
5fdfa8fe44
docs: correction for importing key file
...
Signed-off-by: ebentley66@gmail.com
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-21 12:31:11 +01:00
Jakub Jelen
176b92a4f4
tests/client/algorithms: Respect global verbosity settings
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-21 11:43:19 +01:00
Jakub Jelen
afc6a4e973
tests/config: Verify LogLevel from config is applied
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-21 11:43:19 +01:00
Jakub Jelen
53d84abb17
tests/config: Newly parsed options
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-21 11:43:19 +01:00
Jakub Jelen
dab8985c05
tests/config: Enable and disable authentication methods
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-21 11:43:19 +01:00
Jakub Jelen
0bd6ccc066
tests/config: Verify known_hosts files are applied
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-21 11:43:19 +01:00
Jakub Jelen
5c7b8802f2
tests: HostkeyAlgorithms passed from config to options
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-21 11:43:19 +01:00
Jakub Jelen
b8e301ade3
config: Add CMake check for glob()
2017-12-21 11:43:19 +01:00
NoName115
99c5160cb5
config: glob support for include with test
...
Signed-off-by: NoName115 <robert.kolcun@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-21 11:43:14 +01:00
Jakub Jelen
110da49504
config: support for MACs
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-15 12:00:49 +01:00
Jakub Jelen
f3754dc072
tests/config: Text KexAlgorithms parsing in ssh_config
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-15 12:00:49 +01:00
Jakub Jelen
78a3ab2eaa
tests/options: Verify key exchange algorithms are set properly
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-15 12:00:49 +01:00
Jakub Jelen
4da7985204
config: Set global log level from configuration file
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-15 12:00:49 +01:00
Jakub Jelen
2a66c38efa
options: Typo. The expand character is %d
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-15 12:00:49 +01:00
Jakub Jelen
2e31dffdb7
config: Remove MAC option (SSHv1)
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-15 12:00:49 +01:00
Jakub Jelen
88e43d2502
config: Add configuration options from current OpenSSH 7.5 (and fix typos)
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-15 12:00:49 +01:00
Jakub Jelen
4166bb2a26
options: Document SSH_OPTIONS_GLOBAL_KNOWNHOSTS and set default value
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-15 12:00:49 +01:00
Aris Adamantiadis
f818e63f8f
Add new options
...
Pair-Programmed-With: Jakub Jelen <jjelen@redhat.com >
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-15 12:00:49 +01:00
Jakub Jelen
094aa5eb02
tests: Temporarily build chroot_wrapper
2017-12-15 12:00:49 +01:00
Jakub Jelen
5d3ab421e1
tests: Do not generate pcap file by default
...
pcap file is generated by the processes writing to the sockets,
which is not allowed for privilege-separated process in new
OpenSSH servers (confined by seccomp filter).
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-15 12:00:49 +01:00
Jakub Jelen
f8f7989c3d
tests: Give server more time to start
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-12-15 12:00:49 +01:00
Jakub Jelen
b92c499626
tests: Do not test blowfish ciphers with OpenSSH 7.6 and newer
2017-12-15 11:59:19 +01:00
Andreas Schneider
9fce33a2e3
client: Add missing language tag in disconnect message
...
Fixes T74
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-11-16 12:10:41 +01:00
Andreas Schneider
7a65f7f028
test: ssh_userauth_kbdint_setanswer() does not network interaction
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-11-09 15:35:22 +01:00
Andreas Schneider
f525fdb2e1
sftp: Check for NULL path and give correct error
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-11-09 11:41:58 +01:00
Andreas Schneider
01994ea302
examples: Build server examples on Linux too
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-11-08 16:28:35 +01:00
Jakub Jelen
c4ddf62f7e
pki_crypto: Avoid potential memory leak
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-11-08 16:21:36 +01:00
Andreas Schneider
2ec633f33d
examples: Rename samplessh to ssh-client
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-11-07 15:28:52 +01:00
Jakub Jelen
748d749675
doc: Missing new Host Key algorithms
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-11-07 15:12:27 +01:00
Jakub Jelen
77f632a559
doc: Missing new MAC algorithms in documentation
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-11-07 15:12:27 +01:00
Jakub Jelen
54165a394a
doc: Missing new ECDH algorithms in documentation
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-11-07 15:12:27 +01:00
Jakub Jelen
16818bd0e4
pki_crypto: Avoid segfault with OpenSSL 1.1.0
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-11-07 15:10:32 +01:00
Jon Simons
d29d199592
ecdh: fix build for old libgcrypt
...
Summary:
Fix a typo for old libgcrypt builds `k_length` -> `k_len`.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Test Plan: * Spotted this last-minute typo bug in local testing.
Reviewers: asn
Reviewed By: asn
Differential Revision: https://bugs.libssh.org/D10
2017-10-29 16:28:39 +01:00
Jon Simons
17c03005d8
ecdh: fix build for old libgcrypt
...
Summary:
Fix a typo for old libgcrypt builds `k_length` -> `k_len`.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Test Plan: * Spotted this last-minute typo bug in local testing.
Reviewers: asn
Differential Revision: https://bugs.libssh.org/D10
2017-10-29 16:27:02 +01:00
Andreas Schneider
509fa8a7b2
dh: Don't use deprecated function with newer OpenSSL
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-10-29 16:15:33 +01:00
Andreas Schneider
954da14c15
pki_crypto: Don't use deprecated function with newer OpenSSL
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-10-29 16:06:14 +01:00
Jon Simons
7527876fad
torture_algorithms: deduplicate kex method passes
...
Summary: Signed-off-by: Jon Simons <jon@jonsimons.org >
Test Plan: * Re-ran the `torture_algorithms` test.
Reviewers: asn
Reviewed By: asn
Tags: #libssh
Differential Revision: https://bugs.libssh.org/D8
2017-10-29 15:56:08 +01:00
Jon Simons
9d79b7629c
torture_algorithms: deduplicate kex method passes
...
Summary: Signed-off-by: Jon Simons <jon@jonsimons.org >
Test Plan: * Re-ran the `torture_algorithms` test.
Reviewers: asn
Tags: #libssh
Differential Revision: https://bugs.libssh.org/D8
2017-10-29 15:50:09 +01:00
Jon Simons
538f1bc00e
server: expose 'ssh_server_init_kex' API
...
Expose an API 'ssh_server_init_kex' which allows one to change the set of
key exchange, hostkey, ciphers, MACs, and compression algorithms currently
configured for the ssh_session at hand, after having started the
'ssh_handle_key_exchange' process.
One can use this API from the already-existing 'connect_status_function'
callback to dynamically modify the set of algorithms used after having
received the client banner, but before sending out the initial KEXINIT
message.
For example, one might want to prevent advertising the curve25519 key
exchange algorithm for older OpenSSH clients due to interop bugs.
Fixes T25
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-10-29 15:49:12 +01:00
Andreas Schneider
f0ddde4826
Fix config.h includes
...
We need stdlib.h and string.h in priv.h for free() and memset().
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-10-28 14:31:37 +02:00
Andreas Schneider
d3834f69bc
cmake: Fix parsing the gcrypt version
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-10-12 10:16:23 +02:00
Andreas Schneider
f7b8394127
cmake: Bump version numbers
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-09-12 07:40:45 +02:00
Andreas Schneider
72cf2e3ae2
README.Coding: Add section about pointers
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-09-11 17:14:21 +02:00
DavidWed
164cee66ee
sftp-server: Fix LIBSSH_API
...
Fixes T44
Signed-off-by: DavidWedderwille <davidwe@posteo.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-09-11 16:34:11 +02:00
Jon Simons
9003f92e8f
pkd_daemon.c: force close pkd_state.server_fd upon stop
...
There's a race window between the accept loop's call to
accept(2) and it checking `ctx.keep_going`. Forcefully
close the server socket such that any raced `accept` ends
up failing.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-09-11 16:31:01 +02:00
Jon Simons
8d7563a9c3
pkd_daemon.c: split final close loop; wait for client to close
...
Sometimes, but not always, the pkd tests will fail because they
close the socket at hand a bit too early for the client. The
client in turn may exit non-zero when that happens.
Split up the final close loop so that pkd waits to receive a
channel close from the client, and then socket close, before
finally returning.
With this change I observe that tests are now passing in
environments that would previously tickle the above race
and fail.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-09-11 16:30:54 +02:00
Jon Simons
4c4a03f056
pkd_hello.c: fix return code upon test failure
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-09-11 16:30:45 +02:00
Jon Simons
73d76a2638
auth: fix double-free in ssh_userauth_agent_publickey
...
Fixes T72
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-09-11 16:28:14 +02:00
Jon Simons
1c9eb4dfb9
config: fix memory leak with repeated opcodes
...
Fix a memory leak in the path where parsing returns early due
to seeing a repeated opcode. A testcase is added which
demonstrates the leak and fix with valgrind.
Resolves CID 1374267.
Signed-off-by: Jon Simons <jon@jonsimons.org >
2017-09-11 16:26:41 +02:00
Andreas Schneider
94fa1e382f
match: Add missing return statement
...
This makey the compiler happy.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-25 10:06:00 +02:00
Andreas Schneider
2e70077bbc
examples: Fix fallthrough compiler warnings
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-25 10:06:00 +02:00
Andreas Schneider
2493e962fe
packet: Fix fallthrough compiler warnings
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-25 10:06:00 +02:00
Andreas Schneider
a9846ccc0d
cmake: Add check for fallthrough attribute
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-25 10:06:00 +02:00
Jon Simons
7204d2f485
ecdh: enable ecdh_sha2_nistp{384,521} kex methods
...
Summary:
Based on Dirkjan's original patch series here:
* https://www.libssh.org/archive/libssh/2015-08/0000029.html
Here the changes are adapted for the current master
branch, and expanded to include libgcrypt support.
Co-Authored-By: Dirkjan Bussink <d.bussink@gmail.com >
Signed-off-by: Jon Simons <jon@jonsimons.org >
Test Plan:
* Ran pkd tests for libcrypto and libgcrypt builds.
* Ran client torture_algorithms.c tests for libcrypto and libgcrypt builds.
* Tested across multiple libgcrypts ("1.6.3" and "1.7.6-beta").
Reviewers: aris, asn
Reviewed By: asn
Tags: #libssh
Differential Revision: https://bugs.libssh.org/D7
2017-08-24 18:19:25 +02:00
Jon Simons
6252aab88a
ecdh: enable ecdh_sha2_nistp{384,521} kex methods
...
Summary:
Based on Dirkjan's original patch series here:
* https://www.libssh.org/archive/libssh/2015-08/0000029.html
Here the changes are adapted for the current master
branch, and expanded to include libgcrypt support.
Co-Authored-By: Dirkjan Bussink <d.bussink@gmail.com >
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
Test Plan:
* Ran pkd tests for libcrypto and libgcrypt builds.
* Ran client torture_algorithms.c tests for libcrypto and libgcrypt builds.
* Tested across multiple libgcrypts ("1.6.3" and "1.7.6-beta").
Reviewers: aris, asn
Tags: #libssh
Differential Revision: https://bugs.libssh.org/D7
2017-08-24 18:18:41 +02:00
Andreas Schneider
4c602f2255
options: Use ssh_key_type_e in ssh_options_set_algo()
...
Review with 'git show -b'
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-24 18:01:41 +02:00
Andreas Schneider
6803c2f86d
kex: Use ssh_kex_types_e in ssh_verify_existing_algo()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-24 18:01:41 +02:00
Nikos Mavrogiannopoulos
316ee071cf
torture_options: test the setting of ciphers and MACs
...
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
2017-08-24 18:01:41 +02:00
Nikos Mavrogiannopoulos
895055ab38
ssh_options_set_algo: ensure we only set known algorithms internally
...
That way, we will not fail later on key exchange phase when something
unknown is negotiated.
Fixes T37
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
Reviewed-by: Andreas Schneider <asn@samba.org >
2017-08-24 18:01:34 +02:00
Andreas Schneider
de35212789
priv: Add macro for MAX
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-24 17:27:34 +02:00
Nikos Mavrogiannopoulos
337306600b
INSTALL: mention the way to test
...
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-24 15:58:33 +02:00
Nikos Mavrogiannopoulos
efb7635162
tests: added unit test on including config files
...
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-24 15:57:19 +02:00
Nikos Mavrogiannopoulos
8ecd65bcdb
config: add support for recursive including of files
...
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-24 15:51:07 +02:00
Andreas Schneider
74d17a6531
arcconfig: Add missing comma
2017-08-21 09:12:36 +02:00
Andreas Schneider
b9b89ef7c6
arc: Make the history immutable
...
Under an immutable history the history will not be rewritten.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-18 08:00:42 +02:00
Jon Simons
a4dc74064c
tests: plug leak in torture_bind_options_import_key
...
Summary:
Hello, this is a resend for a quick memory leak fix for one of the unit
tests, originally sent to the mailing list here:
* https://www.libssh.org/archive/libssh/2017-07/0000017.html
Test Plan:
* Before the fix and running the test with valgrind:
```
[simonsj@simonsj-lx5 : unittests] valgrind --leak-check=full ./torture_options >/dev/null
==93134== Memcheck, a memory error detector
==93134== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==93134== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==93134== Command: ./torture_options
==93134==
[ PASSED ] 10 test(s).
[ PASSED ] 1 test(s).
==93134==
==93134== HEAP SUMMARY:
==93134== in use at exit: 80 bytes in 1 blocks
==93134== total heap usage: 977 allocs, 976 frees, 75,029 bytes allocated
==93134==
==93134== 80 bytes in 1 blocks are definitely lost in loss record 1 of 1
==93134== at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==93134== by 0x41BAB0: ssh_key_new (pki.c:107)
==93134== by 0x40DF90: torture_bind_options_import_key (torture_options.c:222)
==93134== by 0x4E3AA3A: cmocka_run_one_test_or_fixture (cmocka.c:2304)
==93134== by 0x4E3ACEA: cmocka_run_one_tests (cmocka.c:2412)
==93134== by 0x4E3B036: _cmocka_run_group_tests (cmocka.c:2517)
==93134== by 0x40E9E3: torture_run_tests (torture_options.c:276)
==93134== by 0x40DE68: main (torture.c:1100)
==93134==
==93134== LEAK SUMMARY:
==93134== definitely lost: 80 bytes in 1 blocks
==93134== indirectly lost: 0 bytes in 0 blocks
==93134== possibly lost: 0 bytes in 0 blocks
==93134== still reachable: 0 bytes in 0 blocks
==93134== suppressed: 0 bytes in 0 blocks
==93134==
==93134== For counts of detected and suppressed errors, rerun with: -v
==93134== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
```
* And after:
```
[simonsj@simonsj-lx5 : unittests] valgrind --leak-check=full ./torture_options >/dev/null
==93294== Memcheck, a memory error detector
==93294== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==93294== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==93294== Command: ./torture_options
==93294==
[ PASSED ] 10 test(s).
[ PASSED ] 1 test(s).
==93294==
==93294== HEAP SUMMARY:
==93294== in use at exit: 0 bytes in 0 blocks
==93294== total heap usage: 977 allocs, 977 frees, 75,029 bytes allocated
==93294==
==93294== All heap blocks were freed -- no leaks are possible
==93294==
==93294== For counts of detected and suppressed errors, rerun with: -v
==93294== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
```
Reviewers: asn
Reviewed By: asn
Differential Revision: https://bugs.libssh.org/D3
2017-08-17 09:33:13 +02:00
Jon Simons
fa86229673
pkd: a few improvements and fixups
...
Summary:
Hello, resending this patch series for the `pkd` tests, originally
sent to the mailing list here:
* https://www.libssh.org/archive/libssh/2017-07/0000011.html
Here are a few improvements and fixups for the `pkd` tests, including
a new flag `-m` that can be used to run only certain subsets of the
test passes.
Jon Simons (5):
pkd: rename AES192 cipher suite -> OPENSSHONLY
pkd_daemon.c: mark `pkd_ready` field as volatile
pkd: fixups for updated CMocka CMUnitTest struct
pkd: refactor -t testname lookup-by-name
pkd: support -m to match multiple tests
tests/pkd/pkd_daemon.c | 2 +-
tests/pkd/pkd_daemon.h | 1 +
tests/pkd/pkd_hello.c | 84 +++++++++++++++++++++++++++++++++-----------------
3 files changed, 58 insertions(+), 29 deletions(-)
--
Test Plan:
* I've been using the new `-m` mode locally for a long time to run
only certain groups of tests.
* The CMocka struct fixes can be seen in the pkd output before and
after: after, there are no more extraneous test output strings.
* The fix for the `pkd_ready` field can be observed when building
the libssh tests with `-Os` on a Debian system (before the fix,
pkd would hang, after the fix, it runs as intended).
Reviewers: asn
Reviewed By: asn
Tags: #libssh
Differential Revision: https://bugs.libssh.org/D2
2017-08-17 09:24:19 +02:00
Jon Simons
c317d95911
libcrypto: add NULL-check for EVP_CIPHER_CTX_cleanup
...
On OpenSSL versions prior to 1.1.0, `EVP_CIPHER_CTX_cleanup` will
dereference its argument regardless of whether it is NULL. This
is not a problem on OpenSSL at or beyond 1.1.0, where
`EVP_CIPHER_CTX_cleanup` (macro to `EVP_CIPHER_CTX_reset`) returns
early upon NULL input.
Move the call to `EVP_CIPHER_CTX_cleanup` under the existing NULL
check in `evp_cipher_cleanup` to avoid the problem.
Introduced with this build-break fix:
* e66f370682
Found in manual testing in an environment with an older OpenSSL.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-20 17:02:44 +02:00
Jon Simons
380390c4b6
misc: relax fatal errors in ssh_analyze_banner
...
Relax the cases where `ssh_analyze_banner` fails to extract a
major and minor version from banners which appear like OpenSSH
banners.
Update the tests to demonstrate that now a banner as might be
sent by `ssh-keyscan(1)` ("SSH-2.0-OpenSSH-keyscan") no longer
returns failure.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-18 09:32:31 +02:00
Jon Simons
e66f370682
wrapper: move EVP_CIPHER_CTX_free call to libcrypto.c
...
With this change, a HAVE_LIBCRYPTO #ifdef is removed from wrapper.c.
Now, the libcrypto-specific logic for EVP_CIPHER_CTX_free is moved
into the ssh_cipher_struct cleanup callback handler for those
ciphers.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-18 09:30:57 +02:00
Jon Simons
a5bc81d406
wrapper: fix gcrypt build error in ssh_cipher_clear
...
Fix a gcrypt build error introduced with
48e7b098f8 .
The ssh_cipher_struct only contains a `ctx` field on
the libcrypto builds, so it can't be referenced unless
within HAVE_LIBCRYPTO.
This build fix preserves the original spirit of the
change in 48e7b098f8 :
only call `EVP_CIPHER_CTX_free` when `cipher->ctx`
is non-NULL.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-18 09:30:19 +02:00
Jon Simons
2f42296edd
wrapper: fix 4-space indentation in ssh_cipher_clear
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-18 09:29:56 +02:00
Andreas Schneider
d9ff44b46e
tests: Fix endif
...
Ups.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-14 08:53:15 +02:00
Andreas Schneider
c480ac8522
tests: Only run ssh_bind test if we build with server support
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-14 08:52:08 +02:00
Jon Simons
a89a67e008
misc: fix error-checking in ssh_analyze_banner
...
Fix error-checking for `strtoul` in `ssh_analyze_banner`, and
enable some tests which demonstrate the fix before-and-after.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-13 19:35:34 +02:00
Jon Simons
a97db12f4f
misc: reindent ssh_analyze_banner, update docs
...
No changes to code, only whitespace indentation and
an update to the function docs.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-13 19:34:57 +02:00
Jon Simons
14d8e940e6
tests: torture-misc: add torture_ssh_analyze_banner
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-13 19:32:58 +02:00
Jon Simons
effd7ba13c
tests: torture-misc: fix 4-space indentation
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-13 19:32:35 +02:00
Jon Simons
a64ddff3fe
libcrypto: fix resource leak in hmac_final
...
Fix a resource leak in `hmac_final`: say `HMAC_CTX_free` instead
of `HMAC_CTX_reset`. This matches the error handling as done in
`hmac_init`. Introduced with cf1e808e2f .
The problem is reproducible running the `pkd_hello` test with:
valgrind --leak-check=full ./pkd_hello -i1 -t torture_pkd_openssh_dsa_rsa_default
Resolves https://red.libssh.org/issues/252 .
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-13 19:29:44 +02:00
Jon Simons
25384e9558
libcrypto-compat: fix HMAC_CTX_free for OpenSSL < 1.1.0
...
On older OpenSSL versions, the EVP_MD_CTX fields within an HMAC_CTX
structure are contained inlined (change here [1]): be sure to not
try to free those fields on those builds.
Found running the `pkd_hello` test with:
valgrind ./pkd_hello -i1 -t torture_pkd_openssh_dsa_rsa_default
^ valgrind will cite "Invalid free() ..." errors which are present
before this fix and absent after, when building with OpenSSL 1.0.1.
[1] 6e59a892db
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-07-13 19:28:59 +02:00
Andreas Schneider
0cb2974bd8
misc: Use strtoul in ssh_analyze_banner()
...
Thanks to Tilo Eckert.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-06-28 12:29:53 +02:00
Andreas Schneider
87527adada
Add config file for arcanist
...
This is for the commanline-client to access https://bugs.libssh.org
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-06-19 09:36:19 +02:00
Aris Adamantiadis
0cffb88b80
config: fix buffer underflow with unrecognized opcodes
2017-06-08 10:45:53 +02:00
Aris Adamantiadis
b0c2ca1b66
tests: fix buffer overflow in testcase
2017-06-07 18:49:56 +02:00
Andreas Schneider
c50f2d1356
misc: Do not fall through and return a value
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-06-06 10:25:15 +02:00
debevv
48e7b098f8
wrapper: Fix possible crash in ssh_handle_key_exchange()
...
If ssh_handle_key_exchange() fails, when ssh_free() is called
cipher->ctx is NULL.
Signed-off-by: debevv <valerio@sonicpengu.in >
2017-06-06 10:21:55 +02:00
Artyom V. Poptsov
5333be5988
config: Bugfix: Don't skip unseen opcodes
...
libssh fails to read the configuration from a config file due to a
wrong check in 'ssh_config_parse_line' procedure in 'config.c'; it's
effectively skipping every opcode (and therefore every option) from
the file. The change fixes that behaviour.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-06-06 10:19:37 +02:00
Andreas Schneider
e4f80bd142
doc: Fix documentation for ssh_userauth_none() usage
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-06-06 10:18:25 +02:00
Andreas Schneider
abbd6e304a
messages: Make sure we always free the answers pointer
...
Found by ozz-fuzz
BUG: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1272
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-26 10:55:25 +02:00
Andreas Schneider
7c79b5c154
messages: Do not leak memory of previously allocated answers
...
Found by ozz-fuzz
BUG: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1222
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-25 16:20:06 +02:00
Andreas Schneider
5eb41492c4
messages: Do not leak memory if answeres had been allocated previously
...
Found by ozz-fuzz
BUG: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1222
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-24 13:27:20 +02:00
Andreas Schneider
c78c6c6542
messages: Do not leak memory if answered had been allocated previously
...
BUG: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1184
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-21 11:12:10 +02:00
Andreas Schneider
d5d8349224
misc: Validate integers converted from the SSH banner
...
BUG: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1181
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-21 11:02:29 +02:00
Andreas Schneider
67a2ba6f99
messages: Fix memory leaks in the ssh_packet_global_request callback
...
BUG: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1208
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-21 10:56:13 +02:00
Andreas Schneider
79437fa0c9
auth: Use calloc in ssh_userauth_agent_pubkey()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-21 10:50:37 +02:00
Peter Volpe
76ba2b0055
session: Free session->kbdint in ssh_free()
...
Makes sure we free pending keyboard auth prompts
so prompts that have not be replied to do not leak.
Signed-off-by: Peter Volpe <pvolpe@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-20 17:04:21 +02:00
Andreas Schneider
68b7ca6e92
buffer: Validate the length before before memory allocation
...
Check if the size the other party sent is a valid size in the
transmitted buffer.
Thanks to Alex Gaynor for finding and reporting the issue.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-13 16:25:40 +02:00
Andreas Schneider
c165c396de
buffer: Create ssh_buffer_validate_length()
...
This functions allows if a given length can be obtained from the buffer.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-13 16:25:29 +02:00
Andreas Schneider
f21ddefedb
Revert "buffer: Create ssh_buffer_validate_length()"
...
This reverts commit 34bdc1ca78 .
2017-04-13 16:19:28 +02:00
Andreas Schneider
0cf1c85542
Revert "buffer: Validate the length before before memory allocation"
...
This reverts commit 57550e6211 .
2017-04-13 16:19:23 +02:00
Andreas Schneider
57550e6211
buffer: Validate the length before before memory allocation
...
Check if the size the other party sent is a valid size in the
transmitted buffer.
Thanks to Alex Gaynor for finding and reporting the issue.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-13 16:12:27 +02:00
Andreas Schneider
34bdc1ca78
buffer: Create ssh_buffer_validate_length()
...
This functions allows if a given length can be obtained from the buffer.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-13 16:12:27 +02:00
Alex Hermann
5f202d7ffa
config: Only use first occurence of each parameter
...
ssh_config's manpage says:
"For each parameter, the first obtained value will be used."
Make libssh adhere to this rule.
BUG: https://red.libssh.org/issues/256
Signed-off-by: Alex Hermann <alex@hexla.nl >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-13 16:08:20 +02:00
Alex Hermann
c3a8b5009f
config: Don't expand Host variable
...
Tokens are not allowed (according to the manpage).
Expansion was introduced by a wrong fix for #127 .
This commit reverts part of 6eea08a9ef
Signed-off-by: Alex Hermann <alex@hexla.nl >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-13 15:58:52 +02:00
Alex Hermann
9ef7e90821
config: Support expansion in the HostName variable
...
BUG: https://red.libssh.org/issues/127
The original "fix" for 127 was expanding the wrong variable: Host instead
of HostName.
Signed-off-by: Alex Hermann <alex@hexla.nl >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-13 15:55:12 +02:00
Yanis Kurganov
38cb19268a
session: Add SSH1 support in ssh_send_debug()
...
Signed-off-by: Yanis Kurganov <ykurganov@ptsecurity.com >
Reviewed-by: Andreas Schneider <asn@samba.org >
2017-04-11 17:40:38 +02:00
Yanis Kurganov
72fdb4867e
session: Add SSH1 support in ssh_send_ignore()
...
Signed-off-by: Yanis Kurganov <ykurganov@ptsecurity.com >
Reviewed-by: Andreas Schneider <asn@samba.org >
2017-04-11 17:40:30 +02:00
Alfredo Mazzinghi
9dc650b7fb
server: Add option SSH_BIND_OPTIONS_IMPORT_KEY to server
...
This sets the bind private key directly from an ssh_key struct instead
of reading a file.
Signed-off-by: Alfredo Mazzinghi <am2419@cl.cam.ac.uk >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-11 10:00:13 +02:00
Max Bachmann
3ec8babfaf
messages: Utilize the message queue for SSH_REQUEST_GLOBAL.
...
Signed-off-by: Max Bachmann <mabahltm@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-11 09:55:22 +02:00
Andreas Schneider
462c7726c3
cmake: Fix GCRYPT_ROOT_DIR and check correct paths
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-04-11 09:42:53 +02:00
Andreas Schneider
e0fa48d2ed
Update SubmittingPatches
2017-02-27 11:49:10 +01:00
Andreas Schneider
73e8277072
libcrypto-compat: Check if EVP_CIPHER_CTX_new is needed
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-02-23 16:59:28 +01:00
Andreas Schneider
c7e9dc2ee3
cmake: Check for EVP_CIPHER_CTX_new
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-02-23 16:54:26 +01:00
Andreas Schneider
166b9f7709
buffer: Use calloc to allocate a zero'ed buffer
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-02-06 09:42:49 +01:00
Andreas Schneider
de369b46b1
pki: Use byte mode for fopen()
...
BUG: https://red.libssh.org/issues/251
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-02-03 13:18:16 +01:00
Justus Winter
043560d7dd
pki_gcrypt: Fix freeing of ECDSA signatures.
...
* src/pki.c (ssh_signature_free): Fix test for ECC using gcrypt.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-09 18:20:40 +01:00
Justus Winter
4b33c6bb97
pki_gcrypt: Fix memory leak.
...
* src/pki_gcrypt.c (pki_key_ecdsa_to_nid): Release 'sexp'.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-09 18:20:19 +01:00
Andreas Schneider
2f6a866373
cmake: Only build libcrypto and libcrypto-compat when needed
...
This also fixes the gcrypt build.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-08 10:31:20 +01:00
Andreas Schneider
f8ef200e76
tests: Fix session management of torture_knownhosts
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-08 08:16:20 +01:00
Andreas Schneider
3daf1760a1
cmake: Use configure check for CRYPTO_ctr128_encrypt
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-07 11:46:47 +01:00
Andreas Schneider
2dff359a33
threads: Use new API call for OpenSSL CRYPTO THREADID
...
BUG: https://red.libssh.org/issues/222
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-07 11:46:47 +01:00
Jakub Jelen
3341f49a49
pki_crypto: Use getters and setters for opaque keys and signatures
...
This is for OpenSSL 1.1.0 support.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-07 11:46:47 +01:00
Jakub Jelen
5d2e9ee66e
libcrypto: Use a pointer for EVP_CIPHER_CTX
...
This has been made opaque and it needs to be a pointer.
This is for OpenSSL 1.1.0 support.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-07 11:46:47 +01:00
Jakub Jelen
607c671f67
libcrypto: Use a pointer for EVP_MD_CTX
...
This is for OpenSSL 1.1.0 support.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-07 11:46:41 +01:00
Jakub Jelen
cf1e808e2f
libcrypto: Use newer API for HMAC
...
This is for OpenSSL 1.1.0 support.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-07 11:45:07 +01:00
Jakub Jelen
b6cfde8987
libcrypto: Introduce a libcrypto compat file
...
This is for OpenSSL 1.1.0 support.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-07 11:42:06 +01:00
Jakub Jelen
d73f665edd
libcrypto: Remove AES_ctr128_encrypt()
...
This is for OpenSSL 1.1.0.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-07 11:42:06 +01:00
Andreas Schneider
52efbc3a23
misc: Use simpler macros for htonll and ntohll
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-07 09:39:19 +01:00
Andreas Schneider
639dc3b5fd
tests: Fix typo in torture_crypto
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-07 07:50:24 +01:00
Andreas Schneider
cff7882391
log: Add missing config.h include
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-06 12:39:45 +01:00
Andreas Schneider
5d1a8cd88b
cmake: Check for io.h on Windows
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-06 11:57:52 +01:00
Andreas Schneider
528b9c5323
cmake: Correctly check for sys/[u]time.h
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-06 11:52:12 +01:00
Andreas Schneider
fab85b495e
cmake: Always check for strtoull
...
This fixes building with different compilers on Windows
BUG: https://red.libssh.org/issues/225
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-06 11:41:48 +01:00
Andreas Schneider
293ab4bd40
doc: Improve documentation for ssh_set_auth_methods()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-06 11:29:02 +01:00
Andreas Schneider
a45db022e9
bcrypt: Fix type of shalen
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-06 11:18:55 +01:00
Andreas Schneider
02be4802d5
pki_ed25519: Do paranoia checks before we allocate memory
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-06 11:15:23 +01:00
Andreas Schneider
5437deed1b
callbacks: Add support for MSVC
...
__typeof__ is GCC specific
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-05 20:00:02 +01:00
Andreas Schneider
422271bd40
connector: Fix build with Visual Studio
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-05 18:03:34 +01:00
Andreas Schneider
801bc29494
options: Fix log level documentation
...
BUG: https://red.libssh.org/issues/210
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-05 17:15:31 +01:00
Stef Walter
857ce2376e
known_hosts: Add ssh_dump_knownhost() function
...
This works similarly to ssh_write_knownhost(), but allows the caller
to get a line with the known_hosts line.
BUG: https://red.libssh.org/issues/207
Signed-off-by: Stef Walter <stefw@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-05 17:12:07 +01:00
Andreas Schneider
1bf6c965e4
cmake: Correctly check for *snprintf functions on Windows
...
BUG: https://red.libssh.org/issues/205
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-05 16:39:37 +01:00
Andreas Schneider
fa2332354b
examples: Reformat usage() function
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-05 15:53:20 +01:00
Andreas Schneider
e9aebb1198
tests: Fix memory leak in torture_auth_cert
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-05 11:13:43 +01:00
Andreas Schneider
fbe8ccdf3b
tests: Fix memory leak in torture_callbacks
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-04 08:33:33 +01:00
Andreas Schneider
34241cbb2b
tests: Reset output buffer in torture_crypto
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-04 08:31:43 +01:00
Andreas Schneider
e9ba2da9e9
tests: Some cleanup for torture_pki
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-04 08:21:39 +01:00
Andreas Schneider
5b84772343
tests: Fix memory leak in torture_auth_cert
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-04 08:15:38 +01:00
Andreas Schneider
d8474207b6
tests: Fix memory leaks in torture_knownhosts
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-04 08:11:50 +01:00
Andreas Schneider
b78f2ed75d
tests: Fix build warning with pkd_hello and cmocka 1.1.0
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-04 07:58:52 +01:00
Andreas Schneider
2af88a679d
bignum: Use const in ssh_print_bignum()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-03 15:22:47 +01:00
Andreas Schneider
ad0ac12c40
tests: Disable x11 test which fails too often
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-03 15:22:00 +01:00
Justus Winter
e3a866b8c1
ecdh: Implement ECDH using libgcrypt
...
* include/libssh/crypto.h (struct ssh_crypto_struct): Provide a
suitable 'ecdh_privkey'.
* include/libssh/ecdh.h: Also define 'HAVE_ECDH' if we do ECC using
libgcrypt.
(ecdh_build_k): New prototype.
* src/CMakeLists.txt (libssh_SRCS): Add backend-specific files.
* src/ecdh.c: Move backend-specific parts to...
* src/ecdh_crypto.c: ... this file.
* src/ecdh_gcrypt.c: New file.
* src/wrapper.c (crypto_free): Free 'ecdh_privkey'.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-03 15:20:36 +01:00
Justus Winter
f62cded9f0
pki_gcrypt: Handle ECDSA keys and signatures
...
* ConfigureChecks.cmake: Set 'HAVE_ECC' and 'HAVE_GCRYPT_ECC' if
applicable.
* include/libssh/pki.h (struct ssh_key_struct): Fix type of field
'ecdsa'.
(struct ssh_signature_struct): Likewise for 'ecdsa_sig'.
* src/pki.c (ssh_pki_key_ecdsa_name): Relax guard now that the used
function is also provided by the gcrypt backend.
(ssh_signature_free): Free ecdsa signature.
* src/pki_gcrypt.c (ECDSA_HEADER_{BEGIN,END}): New macros.
(privatekey_string_to_buffer): Handle ECDSA keys.
(pki_key_ecdsa_to_nid): New function.
(pki_key_ecdsa_nid_to_gcrypt_name): Likewise.
(pki_key_ecdsa_nid_to_name): Likewise.
(pki_key_ecdsa_nid_to_char): Likewise.
(pki_key_ecdsa_nid_from_name): Implement.
(asn1_oi_to_nid): New function.
(b64decode_ecdsa_privatekey): Likewise.
(pki_private_key_from_base64): Handle ECDSA keys.
(pki_pubkey_build_ecdsa): Implement.
(pki_key_dup): Handle ECDSA keys.
(pki_key_generate): Likewise.
(pki_key_generate_ecdsa): Implement.
(pki_key_compare): Handle ECDSA keys.
(pki_publickey_to_blob): Likewise.
(pki_signature_from_blob): Likewise.
(pki_signature_verify): Likewise.
(pki_do_sign): Likewise.
(pki_do_sign_sessionid): Likewise.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-03 15:20:30 +01:00
Justus Winter
7e315629b9
libgcrypt: Implement the 'evp' interface
...
* include/libssh/libgcrypt.h (EVPCTX): Fix type.
(NID_gcrypt_nistp{256,384,521}): New constants.
* src/libgcrypt.c (nid_to_md_algo): New function mapping curves to
digest algorithms.
(evp{,_init,_update,_final}): New functions.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-03 15:20:26 +01:00
Justus Winter
3c2ea78a09
pki_gcrypt: Add a little more ASN1 infrastructure
...
* src/pki_gcrypt.c (ASN1_OCTET_STRING): New macro.
(ASN1_OBJECT_IDENTIFIER): Likewise.
(asn1_check_tag): New function.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-03 15:19:34 +01:00
Justus Winter
85bcfab719
curve25519: Small libgcrypt bignum fix
...
* src/curve25519.c (ssh_client_curve25519_init): Make use of the
gcrypt-variant of 'bignum_bin2bn'.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-11-02 18:53:59 +01:00
Pino Toscano
67ffe26dea
Remove extra newlines from log/error messages
...
Signed-off-by: Pino Toscano <ptoscano@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-10-22 16:05:32 +02:00
Pino Toscano
bc78383fac
sftp: Fix memory leak in sftp_fstat
...
When parsing the result of a successful fstat call, make sure to free
the resulting reply message.
Signed-off-by: Pino Toscano <ptoscano@redhat.com >
Reviewed-by: Andreas Schneider <asn@samba.org >
2016-10-22 16:03:33 +02:00
Andreas Schneider
1ec528b048
tests: Add test for sftp_fsync()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-10-08 13:38:56 +02:00
Andreas Schneider
2a9c396603
torture: Add support to specify verbosity level via env variable
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-10-08 13:38:18 +02:00
Tilo Eckert
4f392ebc7e
session: Add missing ifdef that prevented Windows builds
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-10-08 10:54:36 +02:00
Tilo Eckert
1cc1a352fc
sftp: Add support for append in sftp_open()
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
2016-10-08 10:50:38 +02:00
Tilo Eckert
cfe7065ce1
sftp: Do not always set SSH_FXF_READ
...
Comparison ((flags & O_RDONLY) == O_RDONLY) is always true.
Also, O_RDWR, O_WRONLY and O_RDONLY are mutually exclusive => no need to check all of them
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
2016-10-08 10:45:30 +02:00
Andreas Schneider
f561e6bcb3
sftp: Correctly check for EOF else keep spinning if there is no data
...
This fixes an issue introduced with
dbf72ffba2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-10-07 13:36:58 +02:00
Andreas Schneider
83421c0e8c
gssapi: Use correct return code in ssh_gssapi_auth_mic()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-10-06 18:36:54 +02:00
Andreas Schneider
095733ed9c
gssapi: Print minor stat in error logging function
...
This also releases the memory allocated for the messages.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-10-06 18:22:26 +02:00
Andreas Schneider
155a155d1d
sftp: Add sftp_fsync() function
...
BUG: https://red.libssh.org/issues/141
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-10-06 16:26:52 +02:00
Jeremy Cross
dbf72ffba2
sftp: ensure sftp_packet_read recognizes channel EOF to avoid infinite loop
...
Signed-off-by: Jeremy Cross <jcross@bomgar.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-09-09 11:39:32 +02:00
Andreas Schneider
47d21b6420
sftpserver: Fix SSH_FXP_FSTAT arguments
...
Thanks to Игорь Коваленко <igor.a.kovalenko@gmail.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-10 10:15:05 +02:00
Andreas Schneider
72eb4adbf0
tests: Try to fix the x11 test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-09 15:47:38 +02:00
Andreas Schneider
3f9ce10525
tests: Fix buffer test without NARG macro support
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-09 15:45:45 +02:00
Andreas Schneider
412c501442
sftp: Use calloc() instead of malloc()/memset()
...
This is calloc() is faster then calling memset().
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-04 14:56:22 +02:00
Andreas Schneider
5c70dd8b85
config: Fix build warnings
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-04 14:38:48 +02:00
Andreas Schneider
d5068ed07d
examples: Fix endif()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-04 14:25:46 +02:00
Travers Carter
bc2db86d1c
Make "Host" pattern list handling consistent with OpenSSH
...
https://red.libssh.org/issues/187
Signed-off-by: Travers Carter <tcarter@noggin.com.au >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-03 17:57:12 +02:00
Andreas Schneider
2fe9c2e352
tests: Improve the torture_request_env test
...
This still doesn't work on FreeBSD
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-03 12:52:07 +02:00
Andreas Schneider
d4e3401c23
examples: Fix building on FreeBSD
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-03 12:12:23 +02:00
Andreas Schneider
2bd6501552
torture: Fix a warning
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-03 10:35:11 +02:00
Andreas Schneider
4f7be0dbb2
priv: Fix client banner specification for libssh
...
BUG: https://red.libssh.org/issues/231
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-03 09:41:26 +02:00
Andreas Schneider
1da5c94b44
client: If SSHv1 is disabled send the banner immediately
...
This saves a round-trip with SSHv2 connecting to the server. See RFC
4253 section 5.2 (New Client, Old Server).
Thanks to Yang Yubo <yang@yangyubo.com > for the suggestion.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-03 09:41:26 +02:00
Andreas Schneider
3d1edffe77
client: Fix ssh_send_banner() to confirm with RFC 4253
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-03 09:41:26 +02:00
Andreas Schneider
cb52ed7b12
client: Fix maximum banner length
...
According to RFC 4253 the max banner length is 255.
Thanks to Saju Panikulam <spanikulam@ipswitch.com > for the report.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-03 09:41:26 +02:00
Andreas Schneider
22799b107d
client: Reformat callback_receive_banner()
...
The function is hard to read as the indentation is not correctly
applied.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-03 09:41:26 +02:00
Ken Reister
c3ce3d5cc3
client: Receive the banner correctly
...
Comply with RFC 4253 compliance section 4.2.
Allow data other than "SSH-" to be sent across prior to the actual
version striong.
Signed-off-by: Ken Reister <reister.kenneth@CIMCOR.COM >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-03 09:41:26 +02:00
Aris Adamantiadis
32eea120af
sockets: Fix callback registration bug
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 17:34:09 +02:00
Aris Adamantiadis
8e42d3959c
packet: Improve logging output
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 17:27:16 +02:00
Aris Adamantiadis
f8be4d1b3b
sample: Migrate client to connector API
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:59:18 +02:00
Aris Adamantiadis
9b3648ded0
connector: Implement ssh_connector_except()
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:58:47 +02:00
Aris Adamantiadis
0701745cbc
channels: Move ssh_channel_write_stderr out of server-only
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:57:13 +02:00
Aris Adamantiadis
bbe437dbb1
callbacks: Implement list of callbacks for channels
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:56:54 +02:00
Aris Adamantiadis
5c67530f1e
tests: Add test for ssh_callbacks_iterate()
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:56:50 +02:00
Aris Adamantiadis
e40e6e8686
callback: Add macro to iterate callbacks
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:56:31 +02:00
Aris Adamantiadis
6f3a7d36bb
tests: Add unit test for ssh_callbacks_execute_list
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:56:25 +02:00
Aris Adamantiadis
5dddebd338
callbacks: Add macro for callbacks execute list
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:56:05 +02:00
Aris Adamantiadis
80d88dd3d9
packets: Handle flow control callbacks
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:55:46 +02:00
Andreas Schneider
0faffac020
examples: Do not usre deprecated functions
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:55:29 +02:00
Aris Adamantiadis
5aaae4cb6b
events: Add functions for poll objects
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:40:43 +02:00
Kohei Suzuki
c092101e01
Add id_ed25519 to the default identity list
...
Signed-off-by: Kohei Suzuki <eagletmt@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 15:34:01 +02:00
David Kedves
d7df4429eb
channels: Bugfix for a possible invalid pointer usage (channel->session) in various places
...
BUG: https://red.libssh.org/issues/230
Signed-off-by: David Kedves <kedazo@severalnines.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 15:31:46 +02:00
Stef Walter
ffe8b98cc2
auth: Cleanup memory leak when using SSH agent
...
In Cockpit we've seen this memory leak:
at 0x4C2A9C7: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5B76B03: ssh_userauth_agent (auth.c:778)
by 0x40DD5A: cockpit_ssh_authenticate (cockpitsshtransport.c:327)
BUG: https://red.libssh.org/issues/208
Signed-off-by: Stef Walter <stefw@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 15:28:24 +02:00
Aris Adamantiadis
aa5c7c3b0c
Doc: we don't support publickey v2 subsystem
2016-05-02 14:45:47 +02:00
Aris Adamantiadis
886fdc8bc2
osx: fix compilation
2016-05-02 13:33:34 +02:00
Andreas Schneider
33ecaaac01
auth1: Fix non-blocking SSHv1 auth
...
BUG: https://red.libssh.org/issues/232
Thanks to Fengyu Gao.
TODO: Add SSHv1 tests to our testsuite.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 12:19:00 +02:00
Justus Winter
3c69092cde
pki_gcrypt: Add primitive to read ASN.1 bit strings
...
* src/pki_gcrypt.c (ASN1_BIT_STRING): New macro.
(asn1_get_bit_string): New function.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 12:07:07 +02:00
Andreas Schneider
e8b28f978e
Update the README
2016-05-02 11:55:39 +02:00
Justus Winter
92fdf31d29
pki: Fix debug message
...
* src/pki.c (ssh_pki_signature_verify_blob): Fix debug message.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 11:55:39 +02:00
Justus Winter
878a650c7a
dh: Print hexadecimal data to stderr
...
* src/dh.c (ssh_print_hexa): Print to stderr.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 11:55:38 +02:00
Justus Winter
e518ec1cb7
pki_gcrypt: Rework 'pki_export_pubkey_rsa1'
...
* src/pki_gcrypt.c (pki_export_pubkey_rsa1): Rework to be more
idiomatic. Fix leaking MPIs.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 11:55:38 +02:00
Justus Winter
ed34425306
pki_gcrypt: Rework 'pki_publickey_to_blob'
...
* src/pki_gcrypt.c (pki_publickey_to_blob): Rework using the new
helper 'ssh_sexp_extract_mpi'.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 11:55:38 +02:00
Justus Winter
1d7f87fc0e
pki_gcrypt: Rework 'pki_key_dup'
...
* src/pki_gcrypt.c (pki_key_dup): Rework to be more idiomatic.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 11:55:38 +02:00
Justus Winter
735e34f932
libgcrypt: Add helper to extract MPIs into ssh_strings
...
* include/libssh/libgcrypt.h (ssh_sexp_extract_mpi): New prototype.
* src/libgcrypt.c (ssh_sexp_extract_mpi): New function.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 11:55:38 +02:00
Justus Winter
fea9e3050c
options: Check if a port has been given
...
* src/options.c (ssh_options_getopt): Only call 'ssh_options_set' if
a port has been given.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 11:55:38 +02:00
Andreas Schneider
bbd0522026
dh: Rename ssh_get_publickey() to ssh_get_server_publickey()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 11:55:38 +02:00
Justus Winter
e37fd83254
tests: Make test suite work out of the box on Debian
...
* tests/torture.c (torture_setup_create_sshd_config): Rework how the
location of the sftp server is discovered, and add the Debian-specific
location.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-21 20:06:04 +01:00
Justus Winter
926b9e937b
pki: Mention relevant RFC for EC key encoding
...
* src/pki.c (ssh_pki_export_pubkey_blob): Mention relevant RFC for EC
key encoding.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-21 18:39:46 +01:00
Justus Winter
fc9434465c
pki_gcrypt: Fix memory leak
...
* src/pki_gcrypt.c (_bignum_cmp): Fix memory leak.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-21 18:39:39 +01:00
Justus Winter
ba3ee9f007
pki_gcrypt: Burn key material
...
* src/pki_gcrypt.c (b64decode_rsa_privatekey): Burn key material.
(b64decode_dsa_privatekey): Likewise.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-21 18:39:31 +01:00
Justus Winter
38d8befcd0
pki_gcrypt: Generalize asn1_get_int
...
* src/pki_gcrypt.c (asn1_get): Generalize from 'asn1_get_int'.
(asn1_get_int): New function simply calling 'asn1_get'.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-21 18:39:23 +01:00
Justus Winter
e1d36314a2
pki_gcrypt: Fix memory leak
...
* src/pki_gcrypt.c (b64decode_rsa_privatekey): Free 'v' on version
mismatch.
(b64decode_dsa_privatekey): Likewise.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-21 18:39:13 +01:00
Justus Winter
9a54f91bb7
torture: Fix guard
...
* tests/unittests/torture_pki.c (setup_ecdsa_key*): Check for
'HAVE_ECC' instead of 'HAVE_OPENSSL_ECC'.
Signed-off-by: Justus Winter <justus@g10code.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-21 18:38:57 +01:00
Andreas Schneider
16d58e93af
cmake: Fix torture build
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-17 10:45:40 +01:00
Andreas Schneider
2384236849
cmake: Try to fix FindArgp module
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-17 10:42:52 +01:00
Axel Eppe
252cd6eae9
torture_auth: Add tests for client side certificate authentication
...
- enabled TrustedUserCAKeys option in torture.c
- adds a new set of (signed) keys for bob in a separate dir
The private key used to generate the certs is included, but not required.
Signed-off-by: Axel Eppe <aeppe@google.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-15 08:38:13 +01:00
Axel Eppe
8fe8dbb378
agent: Add cert auth support to ssh_agent_get_next_ident()
...
Signed-off-by: Axel Eppe <aeppe@google.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-15 08:37:57 +01:00
Axel Eppe
8923a01264
auth: Add cert auth support to ssh_userauth_publickey()
...
Signed-off-by: Axel Eppe <aeppe@google.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-15 08:36:27 +01:00
Axel Eppe
6cbab4936d
pki_gcrypt: Add cert auth support to pki_publickey_to_blob()
...
Signed-off-by: Axel Eppe <aeppe@google.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-15 08:36:09 +01:00
Axel Eppe
0310cba2b6
pki_crypto: Add cert auth support to pki_publickey_to_blob()
...
Signed-off-by: Axel Eppe <aeppe@google.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-15 08:35:47 +01:00
Aris Adamantiadis
0b9804a95b
server: handle keepalive@openssh.com global requests
2016-03-14 22:28:03 +01:00
Aris Adamantiadis
7c2db045a8
cmake: detect MIT gssapi shim on osx
2016-03-14 22:27:38 +01:00
Aris Adamantiadis
5027627344
cmake: detect argp.h on osx
2016-03-14 22:27:06 +01:00
Andreas Schneider
4d43fbfb50
options: Document SSH_OPTIONS_ADD_IDENTITY
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-03-03 20:07:16 +01:00
Aris Adamantiadis
4e6ff36a9a
dh: Fix CVE-2016-0739
...
Due to a byte/bit confusion, the DH secret was too short. This file was
completely reworked and will be commited in a future version.
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-02-23 08:16:10 +01:00
Hani Benhabiles
f8bde7156f
options: Fix documentation typo
...
Signed-off-by: Hani Benhabiles <hani@linux.com >
Reviewed-by: Andreas Schneider <asn@samba.org >
2016-02-23 08:14:29 +01:00
Younes Serraj
66c6ae1a55
pki: Fixed documentation about return value.
...
Documentation now is congruent with the code:
- SSH_OK is returned on success,
- SSH_ERROR is returned on error.
Signed-off-by: Younes Serraj <younes.serraj@gmail.com >
Reviewed-by: Andreas Schneider <asn@samba.org >
2016-02-23 08:12:34 +01:00
Andreas Schneider
1bc4176d65
torture: Use ECDSA key for x11 test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-02-08 18:46:22 +01:00
Andreas Schneider
de309c51a7
torture: Fix ssh version detection
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-02-08 18:38:24 +01:00
Andreas Schneider
f128ffd88b
tests: Fix running ssh-agent
...
ssh-agent needs to be executed as the local user and not a fake user or
we will not be able to add identies.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-02-03 09:01:29 +01:00
Andreas Schneider
063430744d
torture: Set sshd debug level to DEBUG3
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-02-03 09:01:27 +01:00
Andreas Schneider
cbd75c3e35
tests: Switch to user bob in setup
...
This makes sure we can apply options correctly.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-02-03 09:01:24 +01:00
Andreas Schneider
1729d4a168
tests: Always start tests as root so we can switch to a user
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-02-03 09:01:22 +01:00
Andreas Schneider
773771659e
tests: Use different uids and gids for testing
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-02-03 09:01:17 +01:00
Andreas Schneider
c365ff3d05
torture: Also write stderr to a file
...
This allows to capture debug information of the wrappers.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-21 14:11:26 +01:00
Andreas Schneider
1bbfe058f9
torture: Add additional sftp-server path for BSD
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-21 12:21:58 +01:00
Andreas Schneider
02d9b05f54
torture: Give sshd more time to start
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-21 09:07:02 +01:00
Fabiano Fidêncio
5c5b1aaaa7
buffer: expose ssh_buffer_get()
...
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:08 +01:00
Fabiano Fidêncio
6953c8ec91
buffer: expose ssh_buffer_{add,get}_data()
...
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:08 +01:00
Fabiano Fidêncio
58aff4495e
buffer: expose ssh_buffer_reinit()
...
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:08 +01:00
Fabiano Fidêncio
3e2a61cc47
libssh.h: move LIBSSH_API buffer' functions to libssh.h
...
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:08 +01:00
Fabiano Fidêncio
120d2b5333
buffer: remove ssh_buffer_get_begin()
...
Note that removing ssh_buffer_get_begin() doesn't break API
compatibility, as this functions has never been exposed (it only
has the LIBSSH_API prefix).
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:08 +01:00
Fabiano Fidêncio
d1d003c232
buffer: use ssh_buffer_get() instead of ssh_buffer_get_begin()
...
This commit is a preparatory stage for removing ssh_buffer_get_begin().
Note that removing ssh_buffer_get_begin() doesn't break API
compatibility, as this functions has never been exposed (it only has the
LIBSSH_API prefix).
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:08 +01:00
Fabiano Fidêncio
3cf72e5258
buffer: remove ssh_buffer_get_rest_len()
...
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:08 +01:00
Fabiano Fidêncio
05fd0acf45
buffer: do not use ssh_buffer_get_rest_len()
...
As ssh_buffer_get_len() actually calls ssh_buffer_get_rest_len(), let's
just use the first one. This is a preparatory step for removing
ssh_buffer_get_rest_len().
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:08 +01:00
Fabiano Fidêncio
25707e9752
pki_gcrypt: adapt to the new behavior of ssh_buffer_get_len()
...
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:08 +01:00
Fabiano Fidêncio
9774b1062d
buffer: make ssh_buffer_get_len() call ssh_buffer_get_rest_len()
...
This is a preparatory step for having the behavior of
ssh_buffer_get_rest_len() in the ssh_buffer_get_len() and then remove
the ssh_buffer_rest_len()
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
954341dd1f
buffer: rename ssh_buffer_get_rest() to ssh_buffer_get()
...
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
56d0e91e10
buffer: cosmetic change in ssh_buffer_get_u8() documentation
...
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
d7349d04d0
buffer: fix documentation for ssh_buffer_get_u32()
...
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
1226add976
tests: Fix warning about expected format for printf
...
/home/ffidenci/src/upstream/libssh/tests/benchmarks/bench_scp.c: In
function ‘benchmarks_scp_down’:
/home/ffidenci/src/upstream/libssh/tests/benchmarks/bench_scp.c:112:14:
warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has
type ‘size_t {aka long unsigned int}’ [-Wformat=]
printf("Only %d bytes available (on %lu requested).\n",size,bytes);
^
/home/ffidenci/src/upstream/libssh/tests/benchmarks/bench_scp.c:116:14:
warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has
type ‘size_t {aka long unsigned int}’ [-Wformat=]
printf("File is %d bytes (on %lu requested). Will cut the end\n"
,size,bytes);
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
234b05708c
pki_gcrypt: Fix warning about not handled values in switch
...
/home/ffidenci/src/upstream/libssh/src/pki_gcrypt.c: In function
‘pki_key_compare’:
/home/ffidenci/src/upstream/libssh/src/pki_gcrypt.c:1082:5: warning:
enumeration value ‘SSH_KEYTYPE_DSS_CERT01’ not handled in switch
[-Wswitch]
switch (k1->type) {
^
/home/ffidenci/src/upstream/libssh/src/pki_gcrypt.c:1082:5: warning:
enumeration value ‘SSH_KEYTYPE_RSA_CERT01’ not handled in switch
[-Wswitch]
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
e368d01385
cleanup: use ssh_ prefix in the packet (non-static) functions
...
Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
310c41a89a
cleanup: use ssh_ prefix in the gcrypt missing functions
...
Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
1102ea4c55
cleanup: use ssh_ prefix in the kex (non-static) functions
...
Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
c487f5db5b
cleanup: use ssh_ prefix in the dh (non-static) functions
...
Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
501faacf8e
cleanup: use ssh_ prefix in the channels (non-static) functions
...
Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
adc8c20ac1
cleanup: use ssh_ prefix in the buffer (non-static) functions
...
Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
63e52afd5b
cleanup: use ssh_ prefix in the blf (non-static) functions
...
Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
6f60449e18
cleanup: use ssh_ prefix in the bignum (non-static) functions
...
Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
77052d3a1e
cleanup: use ssh_ prefix in the agent (non-static) functions
...
Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Younes Serraj
898be61fc6
auth: Remove references to ssh_userauth_pubkey in documentation
...
- replaced references to ssh_userauth_pubkey (legacy function) by ssh_userauth_publickey.
- added missing \n in a couple of Returns sections.
This patch is an answer to this discussion:
http://www.libssh.org/archive/libssh/2016-01/0000009.html
Signed-off-by: Younes Serraj <younes.serraj@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:20:46 +01:00
Andreas Schneider
9ccb6864be
tests: Initialize output and iv in torture_crypto
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:15:42 +01:00
Andreas Schneider
2379ddff17
pki: Make sure checkint1 and checkint2 are not used uninitialized
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:11:29 +01:00
Andreas Schneider
41a10699e6
buffer: Make sure we do not use u32len uninitialized
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:09:06 +01:00
Andreas Schneider
b1c0121507
valgrind: Add suppression for glibc dlopen issue
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:03:52 +01:00
Andreas Schneider
f6bea8d061
torture: Fix a memory leak
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:02:13 +01:00
Andreas Schneider
9bb7e68b86
torture: Add missing include for AF_INET
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-18 15:19:20 +01:00
Andreas Schneider
20718ec52b
tests: Require pam_wrapper 1.0.1
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-18 12:02:45 +01:00
Andreas Schneider
a3557b81de
tests: Wait for sshd to start before connecting
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-18 12:01:56 +01:00
Andreas Schneider
485d78d768
tests: Turn on kbdint tests in torture_auth
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
7aa84318ae
tests: Turn on PAM support in sshd with pam_wrapper
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
0e98f1214d
torture: Improve process termination function
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
6e7eae968a
tests: Support other openssh versions ...
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
5bb9b570f4
tests: Rename torture_sftp_static to torture_sftp_ext
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
571f547556
tests: Migrate torture_sftp_read to a cwrap test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
af3de262b6
tests: Migrate torture_sftp_dir to cwrap test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
bd4a0aa705
torture: Add sftp session pointer to torture_state
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
4bc6af6c17
tests: Migrate torture_request_env to cwrap test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
27834cce2c
tests: Migrate torture_session to cwrap test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
a30d16c48a
torture: Start sshd as root
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
e4653b82bd
tests: Migrate torture_proxycommand to new cwrap test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
b65dcb3a35
tests: Migrate torture_knownhosts to new cwrap test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
c1fb948397
torture: Enable old host key algos for testing
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
be25b58380
tests: Migrate torture_forward to a cwrap test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
66f51df9df
torture: Fix torture_ssh_session() for cwrap testing
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
3014e3c458
tests: Migrate torture_algorithms to a cwrap test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
dd0d04ae8d
torture: Enable old cipher and kex algos in sshd
...
We need to test them, so enable them in the sshd.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
112d4cc7e6
tests: Migrate torture_auth as a cwrap test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
ee8664418a
tests: Add public keys for bob
...
This also allows bob to auth as alice.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
ae89b6c078
torture: Create a torture_terminate_process() function
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
d403c01a30
tests: Convert torture_connect to a cwrap test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
14f1ce2e5b
torture: Add torture_teardown_sshd_server().
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
62b0f58d24
torture: Restrict files to we write to our user.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
c3f963e71e
torture: Add function to setup sshd server
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
fd09c4cb29
torture: Add torture_teardown_socket_dir().
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
13f68fc2d5
torture: Add torture_setup_socket_dir().
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
7a523597ad
torture: Add server to get address and port.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
c2d636270c
tests: Add ssh host keys for test environment.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
21b0d29e38
cmake: Configure nss_wrapper and uid_wrapper
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
6596d27e19
cmake: Search for cwrap and sshd.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
ed6294b4bb
examples: Do not include internal headers in ssh_server_fork
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:49 +01:00
Andreas Schneider
12da51ac5a
doc: Update documentation of ssh_userauth_try_publickey()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-14 08:04:27 +01:00
pouete
b3ad6a015b
cmake: use check_symbol for (v)snprintf
...
Updated how snprintf and vsnprintf are discovered by cmake. Visual studio
2015 now include it in the file stdio.h.
More information here :
https://msdn.microsoft.com/en-us/library/bb531344.aspx
Reviewed-By: Aris Adamantiadis <aris@0xbadc0de.be >
2015-12-30 19:51:11 +01:00
Sebastián Peyrott
be36586d74
CMake: include CheckIncludeFiles for calls to check_include_files.
2015-12-24 13:01:37 +01:00
Fabiano Fidêncio
0d7da3207f
Fix a bunch of -Wmaybe-uninitialized
...
Reviewed-By: Aris Adamantiadis <aris@0xbadc0de.be >
2015-12-17 15:01:05 +01:00
Dirk Neukirchen
71ce6592e4
headers: fix missing mode_t (2nd)
...
Reviewed-By: Aris Adamantiadis <aris@0xbadc0de.be >
2015-11-10 18:38:16 +01:00
Aris Adamantiadis
a5d6ccdc2c
Revert "headers: fix missing mode_t"
...
I commited a patch file *headdesk*
This reverts commit 378fcccc0a .
2015-11-10 18:34:39 +01:00
Dirk Neukirchen
378fcccc0a
headers: fix missing mode_t
...
Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2015-11-10 18:27:31 +01:00
Andreas Schneider
3ed3833a38
Ignore all build and obj* directories
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-10-28 09:28:33 +01:00
Aris Adamantiadis
5450b478f5
Doc: remove mentions of des-cbc-ssh1
2015-10-27 10:19:46 +01:00
Andreas Schneider
94d00009cc
libcrypto: Fix build with DEBUG_CRYPTO turned on
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-10-22 08:17:01 +02:00
Andreas Schneider
21bf499bb4
agent: Fix agent auth on big endian machines
...
BUG: https://red.libssh.org/issues/204
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-10-20 17:16:38 +02:00
Aris Adamantiadis
8ec46cbd42
crypto: fix broken ifdef
2015-09-25 12:01:36 +02:00
Aris Adamantiadis
0409a302bb
cmake: fix EVP detection with gcc
2015-09-25 12:00:25 +02:00
Aris Adamantiadis
84a85803b4
crypto: old-fashioned aes_ctr when evp_aes_ctr is missing
2015-09-25 11:51:45 +02:00
Aris Adamantiadis
d46fe6a51c
SSH1: fix duplicate identifier
2015-09-25 08:52:38 +02:00
Aris Adamantiadis
e83b4e8129
libcrypto: clean up EVP functions
2015-09-25 00:05:10 +02:00
Aris Adamantiadis
392e09e3de
moved libcrypto structs to c99 notation
2015-09-24 21:57:44 +02:00
Aris Adamantiadis
06b9901e64
crypto: move key setup in newkeys handler
2015-09-24 16:46:12 +02:00
Aris Adamantiadis
677fa8ced2
tests: add test for cipher.(de|en)crypt
2015-09-23 15:09:23 +02:00
Aris Adamantiadis
3c333aa9b4
libcrypto: refactor EVP_(de|en)crypt
2015-09-23 15:09:23 +02:00
Aris Adamantiadis
73d8c919b7
crypto: fix potential memory leak in ECDH
2015-09-21 15:01:37 +02:00
Andreas Schneider
747e7d05db
kex: Fix zlib compression
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-16 08:34:28 +02:00
Andreas Schneider
1f3a9105ff
cmake: Use tar.xz source package generator
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-15 15:16:06 +02:00
Andreas Schneider
b0f22fde62
kex: Prefer sha2 over sha1
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-15 15:09:03 +02:00
Andreas Schneider
11f43df873
pki: Fix a memory leak on error in ssh_pki_copy_cert_to_privkey()
...
CID 1323516
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-09 09:34:22 +02:00
Andreas Schneider
1254ed1833
pki: Fix a memory leak in pki_import_cert_buffer()
...
CID #1323517
2015-09-09 09:32:40 +02:00
Andreas Schneider
f55b10e4ed
tests: Fix return code of torture_init
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-09 09:17:46 +02:00
Axel Eppe
d8be35de7f
tests: Add tests for the new ssh_pki cert functions
...
Signed-off-by: Axel Eppe <aeppe@google.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-07 13:30:34 +02:00
Axel Eppe
bdfe6870f6
pki: Add certificate loading functions
...
- ssh_pki_import_cert_base64()
- ssh_pki_import_cert_file()
- ssh_pki_import_cert_blob()
Those functions are currently simple wrappers around their pubkey counterpart.
- ssh_pki_copy_cert_to_privkey()
This function copies the cert-specific data to a private key.
Signed-off-by: Axel Eppe <aeppe@google.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-07 13:30:14 +02:00
Axel Eppe
9775f78ab2
pki: Add Add new pki_import_cert_buffer function
...
Signed-off-by: Axel Eppe <aeppe@google.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-07 13:29:52 +02:00
Axel Eppe
6da4e21065
pki: Add rsa, dss certificate key type definitions
...
- Add rsa/dsa (ssh-{rsa,dss}-cert-v01@openssh.com ) as key types.
- Add a cert_type member in the ssh_key struct.
Signed-off-by: Axel Eppe <aeppe@google.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-07 13:29:23 +02:00
Andreas Schneider
7bfe8d2f03
tests: Migrate pkd_hello to new cmocka API
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-07 12:44:23 +02:00
Andreas Schneider
3b0b1c3ee3
pki: Use the standard logging function
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-07 10:57:34 +02:00
Andreas Schneider
82a80b205b
tests: Migrate to new cmocka API
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-07 10:40:12 +02:00
Andreas Schneider
5b586fdfec
cmake: Handle libssh threas library correctly
...
This should fix the build on Windows and would not install pkg files.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-09-07 07:46:11 +02:00
Michael Wilder
2f193b5cbb
bignum: Fix OpenSSL crash in SAFE_FREE
...
Signed-off-by: Michael Wilder <wilder.michael@cimcor.com >
Reviewed-by: Andreas Schneider <asn@samba.org >
2015-09-07 07:45:02 +02:00
Michael Wilder
e6f93c887b
crypto: Add OpenSSL EVP functions for FIPS compatibility
...
Signed-off-by: Michael Wilder <wilder.michael@cimcor.com >
2015-09-07 07:45:01 +02:00
Andreas Schneider
36d9b62f1f
server: Fix return code check of ssh_buffer_pack()
...
Thanks to Andreas Gutschick <andreas.gutschick@mitel.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-08-18 09:09:31 +02:00
Andreas Schneider
da4bebbe1e
doc: Fix typos in sftp tutorial
...
Thanks to Anthony Baker <AnthonyBaker@fico.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-08-18 09:04:16 +02:00
Andreas Schneider
d54a1ab798
tests: Add checks for ssh_key_is_private()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-08-10 13:57:47 +02:00
Andreas Schneider
e1081796af
pki: Fix return values of ssh_key_is_(public|private)
...
Thanks to Kevin Haake <khaake@red-cocoa.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-08-10 13:57:28 +02:00
Tilo Eckert
672c3be9ed
sftp: Fix incorrect handling of received length fields
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
2015-08-01 10:52:57 +03:00
Peter Volpe
dc9c4d22ab
auth: Fix return status for ssh_userauth_agent()
...
BUG: https://red.libssh.org/issues/201
Return SSH_AUTH_DENIED instead of SSH_AUTH_ERROR when the provided agent
offers no public keys.
Signed-off-by: Peter Volpe <pvolpe@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-07-30 10:51:42 +02:00
Tilo Eckert
71d86be42e
define our own platform-independent S_IF macros
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-07-30 10:47:34 +02:00
Tilo Eckert
267fe02088
fix file mode checks in sftp_open()
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-07-30 10:46:34 +02:00
Aris Adamantiadis
52b5258ed4
fix permissions
2015-07-08 16:33:34 +02:00
Fabiano Fidêncio
2bf6e66ffe
client: handle agent forward open requests with callbacks
...
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Aris Adamantiadis <aris@badcode.be >
2015-07-07 13:24:55 +02:00
Andreas Schneider
728c2fbd01
cmake: Fix zlib include directory
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-07-03 12:36:26 +02:00
Andreas Schneider
613b71b385
cmake: Fix OpenSSL detection in non-standard path
...
This should fix the detection on Windows.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-07-03 11:38:58 +02:00
Andreas Schneider
70cc11618a
cmake: Fail if can't find OpenSSL aes and des headers
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-07-03 10:51:36 +02:00
Andreas Schneider
387fd2cf53
include: Add stdarg.h so we can check for va_copy macro
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-06-30 09:58:47 +02:00
Tilo Eckert
0423057424
SSH_AUTH_PARTIAL is now correctly passed to the caller of ssh_userauth_publickey_auto().
...
Implicitly fixed unsafe return code handling that could result in use-after-free.
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-06-29 11:10:45 +02:00
Tilo Eckert
cc25d747d4
available auth_methods must be reset on partial authentication
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-06-29 11:06:20 +02:00
Peter Volpe
7637351065
channels: Fix exit-signal data unpacking
...
Signed-off-by: Peter Volpe <pvolpe@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-06-29 09:50:09 +02:00
Peter Volpe
7aeba71a92
agent: Add ssh_set_agent_socket
...
Allow callers to specify their own socket
for an ssh agent.
Signed-off-by: Peter Volpe <pvolpe@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-06-29 09:47:02 +02:00
Seb Boving
e020dd8d59
Don't allocate a new identity list in the new session's options.
...
The previous list is not freed. Since the new session just got
created, an identity list is already allocated and empty.
Signed-off-by: Sebastien Boving <seb@google.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-06-24 18:28:36 +02:00
Douglas Heriot
a65af1b3b8
cmake: Do not use CMAKE_(SOURCE|BINARY)_DIR
2015-06-24 18:17:05 +02:00
Tiamo Laitakari
5478de1a64
pki: Fix allocation of ed25519 public keys
...
Signed-off-by: Tiamo Laitakari <tiamo.laitakari@cs.helsinki.fi >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-06-24 17:53:22 +02:00
Jordy Moos
fa9fbb1d67
Documentation fix where unsigned is used where signed is expected
...
Signed-off-by: Jordy Moos <jordymoos@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-06-24 17:13:26 +02:00
Andreas Schneider
ef751a26d0
misc: Correctly guard the sys/time.h include
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-06-24 17:13:19 +02:00
Andreas Schneider
30a7229fc5
include: Add support for older MSVC versions
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-06-24 16:23:13 +02:00
Andreas Schneider
1d69e073af
kex: Add comments to #if clauses
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-06-24 16:23:13 +02:00
Aris Adamantiadis
c480a29052
channels: fix exit-status not correctly set
2015-06-03 16:41:05 +02:00
Mike DePaulo
4aef82237d
Comment that ssh_forward_cancel() is deprecated.
...
Signed-off-by: Aris Adamantiadis <aris@badcode.be >
2015-05-29 11:29:49 +02:00
Mike DePaulo
8a4a22d7b7
Reintroduce ssh_forward_listen() ( Fixes : #194 )
...
Signed-off-by: Aris Adamantiadis <aris@badcode.be >
2015-05-29 11:23:31 +02:00
Andreas Schneider
5eb7a6ca38
cpack: Use application version.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-08 13:54:56 +02:00
Andreas Schneider
3f4b5436e5
Bump version to 0.7.0
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-06 11:01:33 +02:00
Andreas Schneider
82cf5ea24c
Update ChangeLog
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-06 11:00:43 +02:00
Andreas Schneider
90e4786523
valgrind: Add suppression for openssl FIPS dlopen leak
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-06 10:27:09 +02:00
Andreas Schneider
f65f41acc2
valgrind: Ignore valgrind free bug on exit
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-06 10:23:27 +02:00
Andreas Schneider
8979150745
tests: Migrate torture_keyfiles to testkey functions
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-06 09:47:37 +02:00
Andreas Schneider
f81d296e54
torture: Move TORTURE_TESTKEY_PASSWORD to header
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-06 09:47:17 +02:00
Andreas Schneider
57afe78167
tests: Fix memory leak in torture_server_x11 test
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-06 09:33:51 +02:00
Jon Simons
ee460dc04b
kex: also compare host keys for 'first_kex_packet_follows'
...
Also consider the host key type at hand when computing whether a
'first_kex_packet_follows' packet matches the current server settings.
Without this change libssh may incorrectly believe that guessed
settings which match by kex algorithm alone fully match: the host
key types must also match. Observed when testing with dropbear
clients.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-05 22:03:47 +02:00
Jon Simons
f134cb3d57
server: return SSH_OK for ignored SSH_MSG_KEXDH_INIT case
...
Return SSH_OK for the case that an incoming SSH_MSG_KEXDH_INIT should be
ignored. That is, for the case that the initial 'first_kex_packet_follows'
guess is incorrect. Before this change sessions served with libssh can be
observed to error out unexpectedly early when testing with dropbear clients
that send an incompatible guess.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-05 22:03:32 +02:00
Andreas Schneider
3eaad77de2
tests: Only link against threading library if available
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-05 19:09:51 +02:00
Andreas Schneider
9244750a63
cmake: Add missing OpenSSL include directory
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-05 19:04:49 +02:00
Andreas Schneider
e8720a30e2
cmake: Add --enable-stdcall-fixup for MinGW builds
...
This fixes warnings for getaddrinfo() and freeaddrinfo().
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-05 18:59:30 +02:00
Andreas Schneider
ad09009201
include: Fix variadic macro issues with MSVC
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-05 18:45:47 +02:00
Andreas Schneider
e4e3b3052f
tests: Apply umask before calling mkstemp()
...
CID: #978660
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-05 11:27:09 +02:00
Andreas Schneider
96882cc58c
example: Fix a use after free in the scp example
...
CID: #1032343
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-05 11:27:09 +02:00
Andreas Schneider
7c79959e94
example: Check return value of ssh_get_fd()
...
CID: #1199454
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-05 11:27:09 +02:00
Andreas Schneider
ca501df8c8
sftp: Fix size check
...
CID: #1296588
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-05 11:26:40 +02:00
Andreas Schneider
a4cecf59d5
external: Fix resetting the state
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-04 18:10:30 +02:00
Andreas Schneider
244881b87d
external: Make sure we burn buffers in bcrypt
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-04 17:54:01 +02:00
Andreas Schneider
cf05e653de
external: Fix a possible buffer overrun in bcrypt_pbkdf
...
CID: #1250106
This fixes a 1 byte output overflow for large key length (not reachable
in libssh). Pulled from OpenBSD BCrypt PBKDF implementation.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-04 17:54:01 +02:00
Andreas Schneider
4b9916136d
sftp: Add bound check for size
...
CID: #1238630
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-04 17:54:01 +02:00
Andreas Schneider
33ecff11dd
buffer: Cleanup vaargs in ssh_buffer_unpack_va()
...
CID: #1267977
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-04 17:54:01 +02:00
Andreas Schneider
83d3ee7fdb
string: Improve ssh_string_len() to avoid tainted variables
...
CID: #1278978
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-04 17:54:01 +02:00
Andreas Schneider
b1a3f4ee33
pki_container: Fix a memory leak
...
CID: #1267980
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-04 17:54:01 +02:00
Andreas Schneider
05498e0e33
pki_container: Add check for return value
...
CID: #1267982
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-04 17:54:01 +02:00
Andreas Schneider
4948fe21cd
tests: Fix ctest default script
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-04 15:52:17 +02:00
Andreas Schneider
fe8fcb805c
cmake: Add support for Address Sanitizer
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-04 15:25:17 +02:00
Andreas Schneider
c4af6fbce3
config: Add missing HAVE_ARPA_INET_H define
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-05-04 10:04:26 +02:00
Aris Adamantiadis
3091025472
buffers: Fix a possible null pointer dereference
...
This is an addition to CVE-2015-3146 to fix the null pointer
dereference. The patch is not required to fix the CVE but prevents
issues in future.
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-23 10:33:52 +02:00
Aris Adamantiadis
bf0c7ae0ae
CVE-2015-3146: Fix state validation in packet handlers
...
The state validation in the packet handlers for SSH_MSG_NEWKEYS and
SSH_MSG_KEXDH_REPLY had a bug which did not raise an error.
The issue has been found and reported by Mariusz Ziule.
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-23 10:15:47 +02:00
Kevin Fan
b5dc8197f7
Fix leak of sftp->ext when sftp_new() fails
...
Signed-off-by: Kevin Fan <kevinfan@google.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-14 20:56:56 +02:00
Andreas Schneider
19e23e6128
cmake: Require cmake 2.8.5
...
I've improved FindOpenSSL and FindZLIB in that version to work well with
Windows and Linux. This was 2011 it should be old enough that most
distributions have at least this version available.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-10 14:35:29 +02:00
Andreas Schneider
195f25cfbd
cmake: Detect network function correctly on Windows
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-10 13:32:09 +02:00
Andreas Schneider
1cb940c44a
socket: Cleanup ssh_socket_close() code.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-10 13:32:09 +02:00
Andreas Schneider
3f04367fb8
bind: Correctly close sockets and invalidate them.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-10 13:32:09 +02:00
Andreas Schneider
6c7e552509
cmake: Require cmake version 2.8.0
2015-04-10 13:32:09 +02:00
Andreas Schneider
b1cb8de385
cmake: Check for sys/param.h header file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-10 13:07:12 +02:00
Andreas Schneider
69c9cd029f
cmake: Check for arpa/inet.h header file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-10 13:02:56 +02:00
Andreas Schneider
c699b9ca94
external: Use standard int types
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-10 13:02:56 +02:00
Andreas Schneider
53586ed4ba
include: Do not make x11 variables const
...
We allocate them and also free them after the callback has been
executed.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-02 16:19:45 +02:00
Andreas Schneider
5236358a48
messages: Don't leak memory after callback execution
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-02 16:13:20 +02:00
Andreas Schneider
d6fe9dc220
unittests: Fix memory leak in torture_pki_ed25519
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-02 15:05:19 +02:00
Andreas Schneider
e0a73d3dbe
poll: Fix compilation with struct ssh_timestamp
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-02 15:02:29 +02:00
Andreas Schneider
dbe7df7571
cmake: Detect __func__ and __FUNCTION__ during configure step
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-02 13:41:02 +02:00
Andreas Schneider
a3357b8920
include: We should use __func__ which is C99
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-04-02 10:58:36 +02:00
Seb Boving
7ec798d3e7
Locally restart ssh_poll() upon EINTR.
...
BUG: https://red.libssh.org/issues/186
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
Signed-off-by: Sebastien Boving <seb@google.com >
2015-02-23 22:05:54 +01:00
xjoaalm
f32e5f2191
Sending EOF on Socket that received a Broken Pipe makes call to poll to hang
...
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
Signed-off-by: Joao Pedro Almeida Pereira <joao.almeida@blue-tc.com >
2015-02-23 22:01:15 +01:00
Andreas Schneider
cd078c7085
cmake: Drop reports via https only.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-20 15:47:22 +01:00
Aris Adamantiadis
2e445d5871
torture: fix includes for freebsd10
2015-02-14 22:09:02 +01:00
Aris Adamantiadis
5c46fbc680
tests: torture-misc: check for NULL return codes
...
Use the LOGNAME environment variable if USER is not set, as it sometimes
happens in cron jobs.
2015-02-12 11:38:21 +01:00
Aris Adamantiadis
2a780afc57
tests: workaround for compiling with older cmocka
2015-02-12 11:19:04 +01:00
Aris Adamantiadis
940cb233ce
buffer: buffer_pack & unpack on non-gnu compilers
2015-02-08 18:49:32 +01:00
Aris Adamantiadis
a653e27a2e
buffer: detect compilers not supporting __VA_ARGS__
2015-02-08 18:49:02 +01:00
Aris Adamantiadis
d3f30da158
buffer: fix use-before-nullcheck (coverity #1267979 )
...
Additionally, the function call was already existing after
the NULL check
2015-02-03 22:21:22 +01:00
Aris Adamantiadis
760d93e87b
Revert "pki_gcrypt: fix warnings for SSH_KEYTYPE_ED25519"
...
This reverts commit 10f71c6769 .
Commit was redundant with ed25519 branch
2015-02-03 09:58:28 +01:00
Aris Adamantiadis
d42a1a35b0
tests: allow conditionnal execution on pattern
...
Option can be used to filter out irrelevant tests
usage: ./torture_pki '*ed25519'
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 17:34:15 +01:00
Aris Adamantiadis
8af829a42a
base64: Use secure buffers
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 17:33:58 +01:00
Andreas Schneider
ad8fa427dd
buffer: Abort if the canary is not intact in ssh_buffer_unpack()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2015-02-02 17:32:34 +01:00
Andreas Schneider
de10a7754b
buffer: buffer: Improve argument checking of in ssh_buffer_pack()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2015-02-02 17:32:31 +01:00
Andreas Schneider
6789170799
buffer: Abort if the canary is not intact in ssh_buffer_unpack()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2015-02-02 17:32:28 +01:00
Andreas Schneider
afc9988c93
buffer: Improve argument checking in ssh_buffer_pack()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2015-02-02 17:32:18 +01:00
Aris Adamantiadis
2490404d45
Move all 3rd-party C files to src/external/
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:53 +01:00
Aris Adamantiadis
fbdb940c46
ed25519: Add test for signatures and verification
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
c8d0b724b3
tests: Add ed25519 encrypted keys export
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
9e4700cdc0
ed25519: Add support for OpenSSH encrypted container export
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
b76d37b341
tests: Add ed25519 encrypted keys import
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
423fa6818b
ed25519: ADd OpenSSH encrypted container import
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
61e2c8f0f7
external: Add OpenSSH bcrypt and blowfish implementation
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
c02b260e7e
server: Add support for ed25519 keys in the server.
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
01a6004171
kex: Add support for ed25519 on client connections.
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
4f5660e081
tests: Add ed25519 OpenSSH key saving
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
46bc11f977
ed25519: Add support to export OpenSSH container keys
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
119840b0a9
tests: Add ed25519 OpenSSH key loading and operations
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
4343ac5b08
libgcrypt: Make the PEM parser ed25519 aware
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
6b9183a20b
libcrypto: Make the PEM parser ed25519 aware
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
3ec3a926e5
ed25519: Add support o import OpenSSH container keys
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
2f7886837f
pki.h: Replace tabs with spaces
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-02-02 14:45:52 +01:00
Aris Adamantiadis
7febad5821
kex: disable des-cbc-ssh1 by default
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-26 08:57:06 +01:00
Andreas Schneider
b235c380f2
packet_cb: Add misssing include for ntohl().
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-21 09:23:43 +01:00
Andreas Schneider
f6a50aff4c
tests: Fix torture_server_x11().
2015-01-21 09:19:30 +01:00
Alan Dunn
6b7f275c32
tests: Add torture_server_x11 test.
...
torture_server_x11 tests whether a libssh server can correctly parse an
X11 request.
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-20 20:23:19 +01:00
Alan Dunn
4bde48bb2e
tests: Add ssh server setup functionality
...
Add the ability to generate a keypair (RSA, but tests that focus on
what occurs over a connection may well not care) and an ssh_bind
easily.
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-20 19:50:52 +01:00
Alan Dunn
f4154c503b
tests: Add port option to torture_ssh_session
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-20 19:41:53 +01:00
Léo Peltier
8db4520d89
cmake: Add libsshpp.hpp to the distributed headers list.
...
BUG: https://red.libssh.org/issues/163
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-20 19:32:48 +01:00
Andreas Schneider
9a7d450098
pki: Make sure sig is not used unintialized.
...
BUG: https://red.libssh.org/issues/167
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-20 19:31:12 +01:00
William Orr
7070117dc3
examples: Use safer names for stdin, stdout, stderr
...
BUG: https://red.libssh.org/issues/168
On some platforms, like OpenBSD, stdin and friends are macros which break
compilation of this struct. I've fixed these names such that it compiles and
runs cleanly on OpenBSD
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-20 19:27:14 +01:00
Andreas Schneider
433f8fd550
threads: Fix building with POSIX threads in MinGW.
...
BUG: https://red.libssh.org/issues/181
Originally written by Patrick von Reth <vonreth () kde ! org>.
This patch is part of the larger patch:
https://projects.kde.org/projects/kdesupport/emerge/repository/revisions/master/changes/portage/win32libs/libssh/0002-add-a-way-to-test-ssh-connections-on-windows.patch
MinGW (in particular, the MinGW-w64 fork) can use either posix threads
or win32 threads. This patch fixes the MinGW build when using posix
threads.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-20 19:01:15 +01:00
Yanis Kurganov
c6590bd189
channels1: Fix pty request state
...
Signed-off-by: Yanis Kurganov <YKurganov@ptsecurity.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-20 18:58:13 +01:00
Andreas Schneider
929868c691
Update README.CodingStyle
2015-01-20 12:08:51 +01:00
Andreas Schneider
06a0d8ff1c
connect: Fix a memory leak.
...
CID: #1238618
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2015-01-14 15:20:52 +01:00
Andreas Schneider
af0dd3fb02
sftp: Fix a possible integer overflow.
...
CID: #1238630
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2015-01-14 15:20:49 +01:00
Andreas Schneider
ce02f6576a
sftp: Use a declared variable for data len.
...
CID: #1238632
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2015-01-14 15:20:46 +01:00
Andreas Schneider
68e720a3da
pkd: Make sure we do not pass -1 to close.
...
CID: #1245696
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2015-01-14 15:20:43 +01:00
Andreas Schneider
c224508bf8
pkd: Check return value of pkd_run_tests().
...
CID: #1245697
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2015-01-14 15:20:34 +01:00
Tobias Klauser
15d71a8c51
sftp: Fix memory leak on realloc failure
...
If realloc of sftp->ext->name or sftp->ext->data fails, the memory
previously allocated for the respective member is leaked. Fix this by
storing the return value of realloc() in a temporary variable which only
gets assigned to the respective sftp->ext member on success.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-14 10:22:55 +01:00
Andreas Schneider
8536cd9808
cmake: Fix ntohll and htonll macro detection.
...
BUG: https://red.libssh.org/issues/164
Thanks to Ryan Schmidt!
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-13 08:53:42 +01:00
Tobias Klauser
353751e3e3
doc: Fix a typo in curve25519-sha256@libssh.org.txt
...
Fix the typo 'stengths' -> 'strengths' and remove the trailing white
space on the same line.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-13 08:45:51 +01:00
Andreas Schneider
159ef828dd
doc: Fix link to curve25519-sha256@libssh.org spec.
2015-01-06 15:24:30 +01:00
Andreas Schneider
3dd069c0c8
doc: Fix a typo, blank lines and trailing spaces.
2015-01-06 15:22:16 +01:00
Andreas Schneider
a198193723
connect: Fix mingw build.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2015-01-06 15:12:17 +01:00
Andreas Schneider
e051135a05
connect: Check that errno is 0 to fix Windows build.
...
Thanks to Viktor Butskih.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-25 12:34:59 +01:00
Andreas Schneider
bb18442fe8
options: Fix setting the port.
...
Make sure we correctly read the port from the config file.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-25 12:32:16 +01:00
Jon Simons
c2aed4ca78
CVE-2014-8132: Fixup error path in ssh_packet_kexinit()
...
Before this change, dangling pointers can be unintentionally left in the
respective next_crypto kex methods slots. Ensure to set all slots to
NULL in the error-out path.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-17 19:45:09 +01:00
Andreas Schneider
b7b535816d
libcrypto: Fix Windows build with ssh_reseed().
...
gettimeofday() is not available on Windows and we need it only in case
of forking.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-17 19:39:18 +01:00
Andreas Schneider
d8e691b58a
cmake: Fix config variable names.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-17 10:38:56 +01:00
William Orr
52968b1a11
config: Also tokenize on equal sign.
...
The ssh config specifies it as a valid separator.
BUG: https://red.libssh.org/issues/166
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-17 10:34:27 +01:00
Jon Simons
b35f1f488c
pki_gcrypt: fix DSA signature extraction
...
Fix DSA signature extraction for the LIBGCRYPT build. Here, the same fix
that was applied to the LIBCRYPTO build for https://red.libssh.org/issues/144
is now adapted for pki_gcrypt. Additionally, ensure to set the resulting
output sig_blob buffer before returning.
Before this fix, one can observe the failure with the pkd test on a LIBGCRYPT
build as so:
# ./pkd_hello -i 1 -t torture_pkd_openssh_dsa_dsa_default
After, runs of 10000 back-to-back iterations of the same test are passing.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-09 19:21:47 +01:00
Jon Simons
10f71c6769
pki_gcrypt: fix warnings for SSH_KEYTYPE_ED25519
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-09 19:21:34 +01:00
Jon Simons
014fde0542
torture: fix warning for SSH_KEYTYPE_ED25519
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-09 19:21:18 +01:00
Jon Simons
ca2acec34a
bignum: no-op make_string_bn_inplace for LIBGCRYPT
...
Disable the 'make_string_bn_inplace' helper function for the LIBGCRYPT
build, rather than using '#error' to fail the build completely.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-09 19:20:46 +01:00
Davide \"FunkyAss\" Del Zompo
bb197de75d
doc: clarify tutorial error section
...
Signed-off-by: Davide "FunkyAss" Del Zompo <davide.delzompo@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-05 11:09:00 +01:00
Hani Benhabiles
03095f1516
Set the correct error in ssh_options_set().
...
Signed-off-by: Hani Benhabiles <hani@linux.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-05 11:03:55 +01:00
Jon Simons
6895d0b727
session: add getter for kexalgo
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-05 10:48:07 +01:00
Jon Simons
4745d652b5
pki_crypto.c: plug ecdsa_sig->[r,s] bignum leaks
...
Per ecdsa(3ssl), ECDSA_SIG_new does allocate its 'r' and 's' bignum fields.
Fix a bug where the initial 'r' and 's' bignums were being overwritten with
newly-allocated bignums, resulting in a memory leak.
BUG: https://red.libssh.org/issues/175
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-12-05 10:42:32 +01:00
Andreas Schneider
a48711ae7e
connect: Do not fail if the connect is in progress.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-15 10:27:55 +02:00
Jon Simons
a25790d343
tests: fix pkd build breakages
...
Fix a build breakage when '-DWITH_SERVER=OFF' is set: skip building the
pkd test for that case. Add some missing includes for the OpenIndiana
and FreeBSD builds.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-15 10:26:24 +02:00
Stef Walter
cd2dc3770a
gssapi: ssh_gssapi_set_creds() is a client side function
...
It should not be guarded by the WITH_SERVER #ifdef
Signed-off-by: Stef Walter <stefw@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-12 15:41:15 +02:00
William Orr
250f506487
Check return code of connect(2).
...
Signed-off-by: William Orr <will@worrbase.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-12 15:39:58 +02:00
Jon Simons
9dc932c02b
tests: introduce pkd_hello
...
Introduce a sample public-key testing daemon to the 'pkd' test directory,
and add support code for cycling through various combinations of different
key exchange, cipher, and MAC algorithms.
The goal of the 'pkd_hello' test is to make it easy to test interactions
between non-libssh clients and a libssh-server, and to provide a starting
point for testing new implementations for key types, ciphers, MACs, and
so on. The thinking is that testing a new algorithm should be as simple
as adding a new line for it in the PKDTESTS_* lists.
Macros are used to generate the tests and helper functions for a couple of
clients -- here, OpenSSH and dropbear are included for the first cut. If
binaries are found for these clients, their test lists will be enabled;
when binaries are not found for a given client, those tests are skipped.
Tests are run in one large batch by default, but can also be run individually
to help with tracking down things like signature bugs that may take many
iterations to reproduce.
Each test logs its stdout and stderr to its own file, which is cleaned up
when a test succeeds. For failures, those logs can be combined with verbose
libssh output from pkd itself to start debugging things.
Some example usages:
pkd_hello
Run all tests with default number of iterations.
pkd_hello --list
List available individual test names.
pkd_hello -i 1000 -t torture_pkd_openssh_ecdsa_256_ecdh_sha2_nistp256
Run only the torture_pkd_openssh_ecdsa_256_ecdh_sha2_nistp256
testcase 1000 times.
pkd_hello -v -v -v -v -e -o
Run all tests with maximum libssh and pkd logging.
Included in the tests are passes for all existing kex, cipher, and MAC
algorithms.
BUG: https://red.libssh.org/issues/144
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-12 15:01:02 +02:00
Artyom V. Poptsov
aaae6cd97d
pki_gcrypt: Initialize 'type_c' in 'pki_do_sign_sessionid'
...
Add missing initialization of 'type_c' field of a SSH signature in
'pki_do_sign_sessionid' procedure.
If libssh is compiled with GCrypt, 'dh_handshake_server' fails with
"Could not sign the session id" error. The change fixes that.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-02 08:30:17 +02:00
Jon Simons
509676e3a4
server: fix auth_interactive_request reply
...
Fix a missing 'buffer_pack' formatter in 'ssh_message_auth_interactive_request'.
With this fix the 'examples/samplesshd-kbdint' program is working again for me.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-02 08:29:22 +02:00
Jon Simons
a6d412f0d7
ed25519: fix leak in pki_ed25519_sign
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-02 08:28:51 +02:00
Jon Simons
59da8dab50
pki: check ssh_buffer_pack return in ssh_pki_do_sign
...
Check the 'ssh_buffer_pack' return in ssh_pki_do_sign for the ED25519 case.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-02 08:28:05 +02:00
Jon Simons
7edbedf0dd
pki: fail when pubkey buffer length is not ED25519_PK_LEN
...
Fail fast in 'pki_import_pubkey_buffer' for the ED25519 case if a buffer
sized ED25519_PK_LEN can not be retrieved. Before, the 'memcpy' could
have read beyond the bounds of 'ssh_string_data(pubkey)'.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-02 08:27:05 +02:00
Jon Simons
af25c5e668
crypto: check malloc return in ssh_mac_ctx_init
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-02 08:25:53 +02:00
Jon Simons
092fe0b727
wrapper: fix z_stream leak
...
Ensure to free the z_stream structures as allocated from
the gzip.c initcompress, initdecompress functions.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-10-02 08:25:10 +02:00
Andreas Schneider
1ddb99c46f
string: Correctly burn the string buffer.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-09-15 20:45:47 +02:00
Aris
93c7b81b4e
ed25519: Generate, sign and verify keys.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-09-07 22:07:34 +02:00
Aris Adamantiadis
93e82fa0c0
crypto: Add ed25519 implementation from OpenSSH.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-09-07 21:35:20 +02:00
Aris Adamantiadis
e9b2d164e0
base64: Use a secure buffer.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-09-07 10:38:23 +02:00
Aris Adamantiadis
86ae6b2251
buffer: Add a secure buffer mechanism to avoid memory spills
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-09-07 10:36:32 +02:00
Aris Adamantiadis
2cb2587b55
buffer: Implement "t" for text in ssh_buffer_pack().
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-09-07 10:27:35 +02:00
Andreas Schneider
86294ad3ea
dh: Fix packing a pointer into the buffer.
...
Thanks to Giovanni Panozzo <giovanni@panozzo.it >.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2014-08-25 12:23:17 +02:00
Andreas Schneider
173994786b
tests: Fix writing the '\0'.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2014-08-18 21:41:36 +02:00
Andreas Schneider
81123d6a91
ec: Fix build on CentOS.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2014-08-18 10:08:00 +02:00
Andreas Schneider
25eb9c4914
tests: Use public testkey passphrase function in pki test.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:32:57 +02:00
Andreas Schneider
c6210f5aef
torture: Add public testkey passphrase function.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:32:54 +02:00
Andreas Schneider
c673543e54
tests: Use public testkeys in pki test.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:32:51 +02:00
Andreas Schneider
edca9d6e96
torture: Add public testkey functions.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:32:47 +02:00
Andreas Schneider
83aed7610c
tests: Make write file a public torture function.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:32:37 +02:00
Andreas Schneider
5fa4721c6e
auth: Fix a memory leak in agent publickey auth.
...
CID: 1230358
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:29:26 +02:00
Andreas Schneider
8b7627efd5
tests: Make sure we null terminate the buffer.
...
CID: 1230359
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:29:23 +02:00
Andreas Schneider
662217f409
packet: Check return value of ssh_buffer_unpack().
...
CID: 1230357
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:29:20 +02:00
Andreas Schneider
19433dca00
messages: Check return value of ssh_buffer_unpack().
...
CID: 1230356
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:29:16 +02:00
Andreas Schneider
6961dd79ad
tests: Fix memory leak in buffer test.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:29:13 +02:00
Andreas Schneider
1b6375ce89
buffer: Make sure rc is initialized.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:29:11 +02:00
Andreas Schneider
64f6abead7
libgcrypt: Fix initializer name.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:29:07 +02:00
Andreas Schneider
f20a6d0a82
bignum: Add missing include.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:29:00 +02:00
Andreas Schneider
97c6b76863
messages: Fix two ssh_buffer_unpack().
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-07 17:28:42 +02:00
Aris Adamantiadis
6019cf1bed
Fix sftp endianess bugs
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 10:08:25 +02:00
Aris Adamantiadis
228dc08038
bignums: detach bignum-related functions from dh.c.
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 10:07:36 +02:00
Aris Adamantiadis
33cd594f1f
crypto: fix secure burning, structure members naming
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 10:05:19 +02:00
Aris Adamantiadis
0cd0f685c9
torture_pki: avoid generating keys with ssh-keygen
...
ssh-keygen makes the tests very slow because new keys are generated
at the start of every test.
ssh-keygen on OSX doesn't support ecdsa keys, even if libcrypto does.
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 10:04:57 +02:00
Aris Adamantiadis
664b94d1c5
tests: test the canary feature in buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 10:00:07 +02:00
Aris Adamantiadis
3b4b0f01ec
buffer: add a hidden canary to detect format errors
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:58:52 +02:00
Aris Adamantiadis
7bd62dd652
buffers: adapt sftpserver.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:52:29 +02:00
Aris Adamantiadis
c341da03d3
buffers: adapt sftp.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:51:00 +02:00
Aris Adamantiadis
c238136010
buffers: adapt session.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:47:35 +02:00
Aris Adamantiadis
5a08ddcff2
buffers: adapt server.c to ssh_buffer_(un)pack()
...
Signed-off-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:46:14 +02:00
Aris Adamantiadis
a182926024
buffers: adapt pcap.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:46:14 +02:00
Aris Adamantiadis
9457685320
buffers: adapt ecdh.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:46:14 +02:00
Aris Adamantiadis
e9fd14c7f0
buffers: adapt packet.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:46:14 +02:00
Aris Adamantiadis
cfd2e4894e
buffers: adapt messages.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:46:14 +02:00
Aris Adamantiadis
3703389feb
buffers: adapt gssapi.c to ssh_buffer_(un)pack()
2014-08-06 09:46:14 +02:00
Aris Adamantiadis
673990f568
buffers: adapt curve25519.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:33:32 +02:00
Aris Adamantiadis
97638a1465
buffers: adapt client.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:33:07 +02:00
Aris Adamantiadis
506e11fa8b
buffers: adapt channels.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:33:03 +02:00
Aris Adamantiadis
1dd95675df
buffer: adapt dh.c to new ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:20:49 +02:00
Aris Adamantiadis
cb10ad0c84
buffer: adapt kex.c to new ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:20:49 +02:00
Aris Adamantiadis
1f2c61d6ad
buffer: adapt auth.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-08-06 09:20:49 +02:00
Aris Adamantiadis
1d97f75b0a
tests: test for ssh_buffer_(un)pack
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:20:45 +02:00
Aris Adamantiadis
835e34d1eb
Buffer: add ssh_buffer_(un)pack()
...
That function permits chaining of buffer values to minimize buffer handling
in packet sending code.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-08-06 09:04:34 +02:00
Aris Adamantiadis
13c42bff3f
examples: cast arguments of connect(2)
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-07-06 20:36:49 +02:00
Andreas Schneider
59a1799501
log: Add check for return value.
...
For some reason I got a segfault in gdb here. Make sure it works
correctly.
2014-06-10 13:52:38 +02:00
Andreas Schneider
d9c47a8cfa
tests: Add test for the logging function.
2014-06-10 13:52:20 +02:00
Jon Simons
987991a3f2
session: fix ssh_session->srv.ecdsa_key leak
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-05-28 10:23:46 +02:00
Andreas Schneider
a738507ad2
cmake: Fix the build on Windows.
2014-05-27 15:42:53 +02:00
Andreas Schneider
142b2e4ede
cmake: Fix libssh cmake-config files.
2014-05-22 14:52:52 +02:00
Hani Benhabiles
517a01b7ad
Set the correct version in CMakeLists.txt
...
Signed-off-by: Hani Benhabiles <hani@linux.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-05-20 09:41:20 +02:00
Andreas Schneider
83633d539e
pki: Fix build without ECC support.
...
Signed-off-by: Andreas Schneider <asn@samba.org >
2014-05-09 08:55:49 +02:00
Andreas Schneider
c2ee63431b
pki: Add missing semi-colon.
2014-05-07 09:30:29 +02:00
Jon Simons
9e4bc10525
kex: NULL checks for 'first_kex_packet_follows'
...
Add NULL checks to 'is_first_kex_packet_follows_guess_wrong'
to ensure that a 'strdup(NULL)' path can not be taken.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-05-06 09:04:07 +02:00
Alan Dunn
f37c844bf7
messages: Add missing ntohl on X11 request screen number
...
BUG: https://red.libssh.org/issues/160
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-05-06 08:56:44 +02:00
Hani Benhabiles
2c7dfb02a8
Small documentation fix.
...
Signed-off-by: Hani Benhabiles <hani@linux.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-05-06 08:52:55 +02:00
Andreas Schneider
2884bbf5b1
pki: Correctly update the ECDSA keytype.
2014-04-23 11:16:28 +02:00
Andreas Schneider
f48a99b97c
pki: Move ssh_pki_key_ecdsa_name() to the correct file.
2014-04-23 11:15:05 +02:00
Andreas Schneider
11cfb2903e
pki: Make pki_key_ecdsa_nid_to_name() a shared function.
2014-04-23 11:12:08 +02:00
Dirkjan Bussink
c520d97dd9
Add tests for SHA2 HMAC algorithms
...
BUG: https://red.libssh.org/issues/91
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-22 10:57:35 +02:00
Dirkjan Bussink
6c74d6f891
Add options support for setting and getting HMAC algorithms
...
BUG: https://red.libssh.org/issues/91
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-22 10:57:18 +02:00
Dirkjan Bussink
262c82ac06
Add negotiation for SHA2 HMAC algorithms
...
BUG: https://red.libssh.org/issues/91
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-22 10:57:00 +02:00
Dirkjan Bussink
164b8e99cc
Add logic to support SHA2 HMAC algorithms
...
BUG: https://red.libssh.org/issues/91
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-22 10:56:46 +02:00
Dirkjan Bussink
4a08902664
Add SHA2 algorithms for HMAC
...
BUG: https://red.libssh.org/issues/91
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-22 10:55:59 +02:00
Gangadhar Sandrani
d6e6a453fc
log: Fix log levels.
...
Signed-off-by: Gangadhar Sandrani <gangadhar.sandrani@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-22 09:35:33 +02:00
Jon Simons
eb86fd8cdf
kex: server fix for first_kex_packet_follows
...
Ensure to honor the 'first_kex_packet_follow' field when processing
KEXINIT messages in the 'ssh_packet_kexinit' callback. Until now
libssh would assume that this field is always unset (zero). But
some clients may set this (dropbear at or beyond version 2013.57),
and it needs to be included when computing the session ID.
Also include logic for handling wrongly-guessed key exchange algorithms.
Save whether a client's guess is wrong in a new field in the session
struct: when set, the next KEX_DHINIT message to be processed will be
ignored per RFC 4253, 7.1.
While here, update both 'ssh_packet_kexinit' and 'make_sessionid' to
use softabs with a 4 space indent level throughout, and also convert
various error-checking to store intermediate values into an explicit
'rc'.
Patch adjusted from original to ensure that client tests remain passing
(ie 'torture_connect'): restrict the changes in 'ssh_packet_kexinit'
only for the 'server_kex' case.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-22 09:26:59 +02:00
Alan Dunn
099e2e8438
build: Do not link against libssl, only libcrypto
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-22 09:24:54 +02:00
Andreas Schneider
291312c5e4
cmake: Install cmake config files to the correct directory.
2014-04-16 15:45:33 +02:00
Andreas Schneider
e2805abbf7
Revert "kex: server fix for first_kex_packet_follows"
...
The patch breaks the client with ECDSA.
This reverts commit 5865b9436f .
2014-04-15 09:49:25 +02:00
Andreas Schneider
79d51099ac
examples: Fix a bad shift if ssh_get_fd() returns -1.
...
Found by Coverity.
CID: #1199454
2014-04-14 21:24:28 +02:00
Andreas Schneider
adf23533e0
doc: Improve docs for ssh_channel_get_exit_status().
...
BUG: https://red.libssh.org/issues/154
2014-04-10 08:54:11 +02:00
Andreas Schneider
927cd90dc1
channels: Fix exit-signal request.
...
BUG: https://red.libssh.org/issues/153
2014-04-10 08:54:11 +02:00
Andreas Schneider
b5efbe75cd
session: Fix a memory leak with custom banner.
...
BUG: https://red.libssh.org/issues/152
2014-04-10 08:54:10 +02:00
Andreas Schneider
01311dd419
cmake: Fix doxygen.
2014-04-10 08:54:10 +02:00
Jon Simons
5865b9436f
kex: server fix for first_kex_packet_follows
...
Ensure to honor the 'first_kex_packet_follow' field when processing
KEXINIT messages in the 'ssh_packet_kexinit' callback. Until now
libssh would assume that this field is always unset (zero). But
some clients may set this (dropbear at or beyond version 2013.57),
and it needs to be included when computing the session ID.
Also include logic for handling wrongly-guessed key exchange algorithms.
Save whether a client's guess is wrong in a new field in the session
struct: when set, the next KEX_DHINIT message to be processed will be
ignored per RFC 4253, 7.1.
While here, update both 'ssh_packet_kexinit' and 'make_sessionid' to
use softabs with a 4 space indent level throughout, and also convert
various error-checking to store intermediate values into an explicit
'rc'.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-10 08:54:10 +02:00
Andreas Schneider
ad1313c2e5
Revert "direct-tcpip and forwarded-tcpip callbacks"
...
This reverts commit efe785e711 .
We need a Signed-off version. I didn't have the Certificate of Origin
yet.
2014-04-09 12:49:06 +02:00
Andreas Schneider
0cb9f792b8
cmake: Update doxygen module.
2014-04-09 11:21:29 +02:00
Loïc Michaux
efe785e711
direct-tcpip and forwarded-tcpip callbacks
2014-04-09 11:13:57 +02:00
Jon Simons
48aca98cd5
pki crypto: expose new ssh_pki_key_ecdsa_name API
...
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 >
2014-04-09 11:01:11 +02:00
Petar Koretic
89e154f78c
libsshpp: include required <string> header for std::string
...
Signed-off-by: Petar Koretic <petar.koretic@sartura.hr >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-09 10:59:59 +02:00
Alan Dunn
491b407d17
examples: Update ssh_server_fork for new SSH_BIND_OPTIONS_HOSTKEY
...
Tested by
ssh_server_fork -k <an ecdsa key> -k <an rsa key> ...
and connection succeeded with OpenSSH clients both for ECDSA and RSA
(the latter forced via -o HostKeyAlgorithms=ssh-rsa and some known
hosts clearing was necessary). Also
ssh_server_fork -k <an ecdsa key> -k <another ecdsa key> ...
caused the second key to be used, as expected.
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-09 10:59:21 +02:00
Alan Dunn
2f4589b765
doc: Document new meaning of SSH_BIND_OPTIONS_HOSTKEY
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-09 10:59:10 +02:00
Alan Dunn
acb7161c81
options: Repurpose SSH_BIND_OPTIONS_HOSTKEY to load host keys
...
SSH_BIND_OPTIONS_HOSTKEY will now load host keys of any supported type
rather than set the algorithms that the server permits (which seems
like an unhelpful option anyway; it seems you can always control this
by just loading the right keys).
This option has slightly different semantics than the
SSH_BIND_OPTIONS_<x>KEY options because it requires the key file to
exist immediately rather than on ssh_bind_listen or
ssh_bind_accept_fd. The semantics of this option makes more sense to
me.
We also eliminate ssh_bind_options_set_algo, since it is no longer
used.
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-09 10:57:16 +02:00
Andreas Schneider
437a39c798
cmake: Enable creation of the compile command database by default.
2014-04-04 10:03:43 +02:00
Andreas Schneider
b3e6d5df53
packet: Fix function name.
2014-03-27 11:26:27 +01:00
Luka Perkov
53644a14ac
style: be consistent when iterating over wanted_methods
...
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 11:23:34 +01:00
Jon Simons
aa05248ca8
packet: elide two buffer_prepend calls into one
...
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 >
2014-03-27 11:19:50 +01:00
Andreas Schneider
04543c9dbc
doc: Fix ssh_userauth_none() function signature.
...
Thanks to David Tibbe!
BUG: https://red.libssh.org/issues/151
2014-03-27 11:06:01 +01:00
Alan Dunn
d5aeebe323
socket: Fix style of ssh_socket_pollcallback
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:54:55 +01:00
Alan Dunn
47bd0b6d1f
doc: Improve and consolidate ssh_bind_options_set docs
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:49:08 +01:00
Petar Koretic
8e2590b535
libssh: libhpp: overload read function to support timeout parameter
...
Signed-off-by: Petar Koretic <petar.koretic@sartura.hr >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:48:13 +01:00
Petar Koretic
c51f42a566
libssh: libhpp: avoid unnecessary call to ssh_channel_read
...
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 >
2014-03-27 10:46:21 +01:00
Petar Koretic
00d4fbe753
libssh: libhpp: fix multiple definitions for acceptForward function
...
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 >
2014-03-27 10:45:54 +01:00
Jon Simons
dee8e5688b
channel: check for closed state in waitwindow loops
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:34:22 +01:00
Jon Simons
40d81bb7ca
kex: enable more ECDSA hostkey algos
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:28:06 +01:00
Jon Simons
10bc5ac203
pki_crypto: guard against NULL pubkey->rsa in signature extraction
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:27:23 +01:00
Luka Perkov
8ba9402282
session: fix comment typo
...
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:16:24 +01:00
Luka Perkov
a2fe341da5
messages: use predefined macro for clearing sensitive data
...
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:16:14 +01:00
Luka Perkov
dbb2de272b
client: fix corner case when sockets are manually created
...
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 >
2014-03-27 10:15:54 +01:00
Luka Perkov
9423a3a065
tests: torture_connect: add test for user provided socket
...
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:14:35 +01:00
Luka Perkov
0c5d4954a7
tests: torture_connect: fix coding style
...
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:13:57 +01:00
Petar Koretic
0b8d24f800
pki_crypto: Replace deprecated RSA_generate_key() with RSA_generate_key_ex()
...
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 >
2014-03-27 10:11:24 +01:00
Luka Perkov
48354f56ec
update gitignore file
...
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 >
2014-03-27 10:10:48 +01:00
Alan Dunn
5c0c95bd34
examples: Add ECDSA key option to ssh_server_fork
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:06:36 +01:00
Alan Dunn
c82dd2eb81
examples: Add no default keys options to ssh_server_fork
...
It seems useful to be able to run ssh_server_fork without being
required to load some key of RSA and DSA keytypes. However, with the
current ssh_server_fork, you need to have some keys as some default
value is set by default and you can't unset the value for a keytype
(e.g. by using NULL as an argument). So the "no default keys"
argument turns off the default key assignments.
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:06:11 +01:00
Alan Dunn
f6276fe739
doc: Add ECDSA keys to docs, make key docs consistent
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:05:58 +01:00
Alan Dunn
2a1089d607
options: Allow use of host ECDSA key
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:05:23 +01:00
Andreas Schneider
fbf73ede1e
tests: Check the the ecdsa_nid is the same.
2014-03-27 10:01:12 +01:00
Alan Dunn
577840d7f7
tests: Add test case for bug #147
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:01:01 +01:00
Alan Dunn
3d9b1693eb
pki_crypto: Always copy ecdsa_nid into duplicated ECDSA keys
...
BUG: https://red.libssh.org/issues/147
Signed-off-by: Alan Dunn <amdunn@gmail.com >
2014-03-12 14:14:03 +01:00
Alan Dunn
15f3988bc8
pki: Use SHA-2 for session ID signing with ECDSA keys
...
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 >
2014-03-12 14:13:29 +01:00
Luka Perkov
9c2127b798
server: silence build warning
...
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 >
2014-03-12 14:12:18 +01:00
Jon Simons
0bb779904d
packet: log disconnect code in host byte order
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-12 14:11:09 +01:00
Jon Simons
5eeac3566e
bind: only set bindfd after successful listen
...
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 >
2014-03-12 14:09:35 +01:00
Aris Adamantiadis
e99246246b
security: fix for vulnerability CVE-2014-0017
...
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.
2014-03-04 09:55:28 +01:00
Andreas Schneider
c96e862c08
examples: Add missing include for stderr.
...
This should fix the build on FreeBSD.
2014-02-17 09:20:46 +01:00
Andreas Schneider
7021a46617
cmake: Merge server examples.
2014-02-16 17:59:46 +01:00
Andreas Schneider
c7cb2d0657
examples: Remove old samplesshd-tty.
2014-02-16 17:58:55 +01:00
Andreas Schneider
fd50a4dd9f
examples: Remove old samplesshd.
2014-02-16 17:57:09 +01:00
Audrius Butkevicius
afe97d6cab
examples: Add ssh_server_fork example
...
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-16 17:52:50 +01:00
Audrius Butkevicius
00949383f4
config: Add missing HAVE_LIBUTIL_H define in config.h
...
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-16 17:45:47 +01:00
Andreas Schneider
2a1cb323f7
examples: Add missing include on FreeBSD.
2014-02-14 10:33:07 +01:00
Andreas Schneider
4463d89a4a
cmake: Check for libutil.h on FreeBSD.
2014-02-14 10:33:07 +01:00
Andreas Schneider
9e0fb9f29b
pki: Fix build warning about unused variables.
2014-02-14 10:33:07 +01:00
Audrius Butkevicius
a277dd9277
Add session/channel byte/packet counters
...
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@elastichosts.com >
2014-02-12 18:21:16 +01:00
Andreas Schneider
370d4b014d
pki: Fix the build on OpenSolaris.
2014-02-12 09:39:49 +01:00
Andreas Schneider
7bd5e4101c
pki: Fix memory leak with ecdsa signatures.
2014-02-11 10:32:50 +01:00
Andreas Schneider
352c7381a8
cpack: Ignore obj directory.
2014-02-10 10:16:38 +01:00
Andreas Schneider
3e57b54688
packet: Improve readablity of packet decrypt.
...
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 >
2014-02-06 20:30:29 +01:00
Alan Dunn
2a183440c7
packet_crypt: Make packet_{en,de}crypt fail consistently on len == 0
...
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 >
2014-02-06 19:41:01 +01:00
Alan Dunn
bb0023b7c7
packet: Do not decrypt zero length rest of buffer
...
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 >
2014-02-06 19:41:00 +01:00
Raphael Kubo da Costa
398e8d50b5
build: Use Threads_FOUND to decide whether to build ssh_threads.
...
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 >
2014-02-06 11:12:50 +01:00
Jon Simons
fa34d11749
session: skip timestamp init for non-blocking case
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-06 10:21:57 +01:00
Jon Simons
93370d61ba
session: add getters for session cipher names
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-06 10:21:07 +01:00
Aris Adamantiadis
22d6c36800
Revert f2c2687ca6
...
Fix bug #142
The mode does need to be an octal numeric string. Mode 0600 now gets sent on the wire as 0384, triggering a "scp: protocol error: bad mode" response, and an "scp status code 1d not valid" message from libssh.
2014-02-05 22:29:22 +01:00
Aris Adamantiadis
c28ad814d0
knownhosts: resolve leaks found by coverity
2014-02-05 08:07:45 +01:00
Aris Adamantiadis
fdc660f313
knownhosts: detect variations of ecdsa
2014-02-04 22:28:30 +01:00
Audrius Butkevicius
57418dd2cc
server: use custom server banners
...
Value of session->serverbanner never gets used
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@gmail.com >
2014-02-04 15:54:20 +01:00
Raphael Kubo da Costa
4e04ec8bf5
threads: Be less strict when deciding whether to build libssh_threads.
...
As mentioned in the previous commit, there are cases where
CMAKE_HAVE_THREADS_LIBRARY is not set and pthreads _is_ being used: one can
pass -DTHREADS_HAVE_PTHREAD_ARG=1 to CMake directly so that it just passes
-pthread to the compiler/linker and does not set CMAKE_HAVE_THREADS_LIBRARY.
Since we are only interested in knowing whether any threading library has
been found, we should use CMAKE_THREAD_LIBS_INIT instead (Threads_FOUND
would also work).
Note that, at the moment, there is only a pthreads backend available in
threads/, so if it is not found configuration will fail because CMake will
try to create a library from an empty set of source files.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-03 14:38:39 +01:00
Raphael Kubo da Costa
79a80cdc77
ConfigureChecks: Stop checking for CMAKE_HAVE_THREADS_LIBRARY.
...
libssh is primarily interested in whether pthreads is present and can be
used. Checking for CMAKE_HAVE_THREADS_LIBRARY is not the same thing, as
there are cases where pthread exists but CMAKE_HAVE_THREADS_LIBRARY is not
set (for example, FreeBSD passes -DTHREADS_HAVE_PTHREAD_ARG=1 to CMake by
default as a way to skip the checks for -lpthread, -lpthreads and others and
tell the build system that -pthread is the one expected to be used).
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-03 14:36:56 +01:00
Jon Simons
95782ada1f
socket: fix read of non-connected socket
...
Ensure to check whether the socket at hand is indeed still connected
throughout POLLIN processing in ssh_socket_pollcallback.
Before this change, the POLLIN block in ssh_socket_pollcallback is
predicated against the condition (s->state == SSH_SOCKET_CONNECTED).
Once entered, data from the socket is consumed through the data
callback in this loop:
do {
r = s->callbacks->data(buffer_get_rest(s->in_buffer),
buffer_get_rest_len(s->in_buffer),
s->callbacks->userdata);
buffer_pass_bytes(s->in_buffer,r);
} while (r > 0);
However, it is possible for the socket data callback to change the
state of the socket (closing it, for example). Fix the loop to only
continue so long as the socket remains connected: this also entails
setting the ssh_socket state to SSH_SOCKET_CLOSED upon close.
The bug can be observed before the change by sending a bogus banner
to the server: 'echo -e "A\r\nB\r\n" | nc localhost 22'. Each of
'A' and 'B' will be processed by 'callback_receive_banner', even
though the client socket is closed after rejection of 'A'.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-02 22:19:46 +01:00
Jon Simons
f7b61bf557
doc: correct ssh_channel_read_timeout units
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-02 22:19:46 +01:00
Audrius Butkevicius
adf4d4f147
doc: Document expected return value of channel data callback
...
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-02 22:19:46 +01:00
Audrius Butkevicius
dc93edc932
src: Fix argument order in ssh_channel_pty_window_change_callback
...
So that it would match ssh_channel_pty_request_callback as well as the documentation
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-02 22:19:46 +01:00
Joseph Southwell
6bbdaceaca
src: Define MAX_BUF_SIZE globally and use it.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-02 22:19:46 +01:00
Joseph Southwell
eedecd0269
client: Fix EOF session error reporting.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-02 22:19:46 +01:00
Oleksandr Shneyder
d904784489
Make function ssh_channel_accept() nonblocking if timeout is 0.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-02 22:19:45 +01:00
Aris Adamantiadis
31fb4e1e69
build: remove OSX deprecated warnings for openssl
2014-02-02 21:41:32 +01:00
Aris Adamantiadis
3bdc2b1d4f
build: fix cmake bug introduced yesterday
...
Compilation failed on OSX because of the missing OR OSX
2014-02-02 20:56:21 +01:00
Aris Adamantiadis
1e37430dbe
Kex: fix coverity warning + edge case
2014-02-02 20:50:36 +01:00
Aris Adamantiadis
671f1979a6
server: allow custom server banners (bug #83 )
2014-02-01 18:00:01 +01:00
Aris Adamantiadis
fdaa42da1a
Knownhosts: implement hostkey with knownhosts heuristic
2014-02-01 17:34:16 +01:00
Aris Adamantiadis
8d450ef81a
knownhosts: add test case for bug #138
2014-02-01 16:48:36 +01:00
Aris Adamantiadis
c433ac02bd
known_hosts: add ssh_knownhosts_algorithms()
...
Goal of that function is to test the preferred key exchange methods
based on what's available in the known_hosts file
2014-02-01 16:42:29 +01:00
Aris Adamantiadis
1c24a0508f
Added known host test cases
2014-02-01 15:33:15 +01:00
Aris Adamantiadis
f0d6ce8958
tests: fix compilation on OSX (libargp detection)
2014-02-01 14:49:57 +01:00
Andreas Schneider
75be42df75
pki_crypto: Fix memory leak with EC_KEY_set_public_key().
...
BUG: https://red.libssh.org/issues/146
2014-01-28 11:56:59 +01:00
Andreas Schneider
3224506fe0
doc: Document the unit for ssh_select() timeout.
...
BUG: https://red.libssh.org/issues/143
2014-01-23 11:29:39 +01:00
Rod Vagg
d4d30d0375
dh: Fix NULL check for p_group14.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-01-23 11:21:51 +01:00
Jon Simons
7ff6b3537f
pki_crypto: fix DSA signature extraction
...
Fix the DSA portion of 'pki_signature_to_blob': before this change, it
is possible to sometimes observe DSA signature validation failure when
testing with OpenSSH clients. The problem ended up being the following
snippet which did not account for the case when 'ssh_string_len(x)' may
be less than 20:
r = make_bignum_string(sig->dsa_sig->r);
...
memcpy(buffer,
((char *) ssh_string_data(r)) + ssh_string_len(r) - 20,
20);
Above consider the case that ssh_string_len(r) is 19; in that case the
memcpy unintentionally starts in the wrong place. The same situation
can happen for value 's' in this code.
To fix, adjust the offsets used for the input and output pointers, taking
into account that the lengths of 'r' and 's' can be less than 20. With
the fix I am no longer able to reproduce the original failure mode.
BUG: https://red.libssh.org/issues/144
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-01-23 11:17:13 +01:00
Andreas Schneider
368509f5d1
pki: Use ssh_buffer_add_data() in pki_gcrypt..
2014-01-22 16:12:31 +01:00
Alan Dunn
7eff889384
doc: Fix description of error parameter for ssh_get_error*
...
ssh_get_error can actually work on anything with an ssh_common_struct
as its first member. It is already used in examples in the
distribution with ssh_sessions and ssh_binds.
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-01-22 09:45:45 +01:00
Jon Simons
465816f4a0
pki_crypto: pad RSA signature blobs
...
Pad RSA signature blobs to the expected RSA signature length
when processing via 'pki_signature_to_blob'.
Some clients, notably PuTTY, may send unpadded RSA signatures
during the public key exchange: before this change, one can
sometimes observe failure in signature validation when using
PuTTY's 'plink' client, along these lines:
ssh_packet_process: ssh_packet_process: Dispatching handler for packet type 50
ssh_packet_userauth_request: ssh_packet_userauth_request: Auth request for service ssh-connection, method publickey for user 'foo'
ssh_pki_signature_verify_blob: ssh_pki_signature_verify_blob: Going to verify a ssh-rsa type signature
pki_signature_verify: pki_signature_verify: RSA error: error:04091077:rsa routines:INT_RSA_VERIFY:wrong signature length
ssh_packet_userauth_request: ssh_packet_userauth_request: Received an invalid signature from peer
For cross-reference this issue once also existed between
PuTTY and OpenSSH:
http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/rsa-verify-failed.html
http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/ssh-rsa.c?rev=1.19;content-type=text%2Fx-cvsweb-markup
With the fix I am unable to reproduce the above failure mode when
testing with 'plink'.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-01-21 16:11:12 +01:00
Alan Dunn
9fff70fa41
Test change to ssh_bind_accept_fd
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-01-21 16:07:09 +01:00
Alan Dunn
d3e081ba44
Import keys during ssh_bind_accept_fd
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-01-21 16:07:04 +01:00
Alan Dunn
086847f997
Separate out key import functionality from ssh_bind_listen
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-01-21 16:06:53 +01:00
Andreas Schneider
cb9786b3ae
src: Rename buffer_add_data() to ssh_buffer_add_data().
2014-01-19 20:55:55 +01:00
Andreas Schneider
9c4144689d
src: Rename buffer_init to ssh_buffer_init().
2014-01-19 20:43:29 +01:00
Andreas Schneider
e745236ae5
doc: Fix channel documentation.
2014-01-17 11:08:49 +01:00
Andreas Schneider
13eef19000
pki: Do not use deprecated string functions.
2014-01-17 09:29:24 +01:00
Andreas Schneider
2fe59071b2
src: Do not use deprecated functions.
2014-01-16 15:27:46 +01:00
Andreas Schneider
a7157b7907
include: Mark functions as deprecated!
2014-01-16 15:27:23 +01:00
Jon Simons
6007c3c43f
bind: fix possible double-frees in ssh_bind_free
...
Make sure to explicitly set key pointers to NULL following the use
of 'ssh_key_free' throughout bind.c.
Before this change, a double free can happen via 'ssh_bind_free'
as in this example callpath:
// create an ssh_bind
ssh_bind b = ssh_bind_new();
// provide a path to a wrong key-type
ssh_bind_options_set(b, SSH_BIND_OPTIONS_DSAKEY, path_to_rsa_key);
// initialize set key-type
ssh_bind_listen(b);
-> error path "The DSA host key has the wrong type: %d",
ssh_key_free(sshbind->dsa)
-> ssh_key_clean(key) // OK
-> SAFE_FREE(key) // OK, but, sshbind->dsa is *not* set to NULL
// ssh_bind_listen failed, so clean up ssh_bind
ssh_bind_free(b);
-> ssh_key_free(sshbind->dsa) // double-free here
To fix, set pointers to NULL that have been free'd with 'ssh_key_free'.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-01-16 09:27:41 +01:00
Andreas Schneider
9d1ddd0547
doc: Add changes to the forwarding tutorial.
2014-01-16 09:13:06 +01:00
Andreas Schneider
5229253f86
channel: Fix the name scheme of the forward functions.
2014-01-16 09:13:06 +01:00
Oleksandr Shneyder
a1c4fc07d4
channel: Add ssh_channel_accept_forward().
...
This works same way as ssh_forward_accept() but can return a destination
port of the channel (useful if SSH connection forwarding several TCP/IP
ports).
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-01-16 09:12:03 +01:00
Andreas Schneider
6d09104ad3
Rename build directory to obj.
...
Some buildsystem use build in the pathname and so we will filter out
e.g. docs generation.
2014-01-16 08:53:32 +01:00
Aris Adamantiadis
57ef959aa3
threads: support libgcrypt 1.6 hack
...
Not 100% satisfied of this patch, but the way libgcrypt handles
threading in 1.6 is not compatible with custom handlers. The
new code basicaly uses pthreads in every case. This will probably
not work on windows.
2014-01-08 18:57:31 +01:00
Andreas Schneider
b617d7fa29
include: Remove warning cause VSC doesn't know about it.
2014-01-08 10:55:20 +01:00
Andreas Schneider
4b3363ecf2
include: Fix building if we do not have asm volatile.
2014-01-08 10:52:29 +01:00
Andreas Schneider
6fe51b13fb
src: Update my mail address.
2014-01-07 16:08:23 +01:00
Andreas Schneider
8bcbfb1642
cmake: Remove unused macro modules.
2014-01-07 16:07:00 +01:00
Aris Adamantiadis
aecd952d18
update copyright information
2014-01-07 15:18:15 +01:00
Aris Adamantiadis
fedb1b3def
tests: avoid reading uninitialized bytes
2014-01-07 14:43:46 +01:00
Aris Adamantiadis
8fdfa13227
pki: fix gcrypt signature process
2014-01-07 14:20:49 +01:00
Andreas Schneider
9d90d15e91
examples: Make sure buffer is initialized.
2014-01-07 09:19:02 +01:00
Andreas Schneider
09a715b147
example: Add missing include for forkpty().
2014-01-07 09:03:53 +01:00
Aris Adamantiadis
42ad55377f
test: fixed torture_auth_none condition
2014-01-06 22:09:43 +01:00
Aris Adamantiadis
d771dafe04
test: test case for async auth_none
...
This test currently fails
2014-01-06 16:52:44 +01:00
Aris Adamantiadis
09af855b6f
tests: auth_agent_nonblocking should run in nonblocking
2014-01-06 16:52:44 +01:00
Aris Adamantiadis
0571360f37
tests: use LC_LIBSSH instead of LANG for env tests.
...
LANG is stripped and replaced on many distros and LC_* is accepted
by default on debian
2014-01-06 16:17:16 +01:00
Andreas Schneider
f3e3700063
session: Fix a possible memory leak.
2014-01-05 23:05:13 +01:00
Aris Adamantiadis
41fe03e0d6
poll: fix poll_handles ownerships
2014-01-05 22:33:45 +01:00
Aris Adamantiadis
b514957af7
socket: don't attempt reading a non-connected socket
2014-01-05 21:54:08 +01:00
Andreas Schneider
d9c5d0767c
examples: Fix building samplesshd-tty on FreeBSD.
2013-12-26 09:42:32 +01:00
Andreas Schneider
8f162e3b13
poll: Correctly free ssh_event_fd_wrapper.
...
This is allocated by ssh_event_add_fd.
2013-12-22 22:08:45 +01:00
Andreas Schneider
32ba84dac7
config: Support expansion in the Host variable too.
...
BUG: https://red.libssh.org/issues/127
2013-12-21 12:30:32 +01:00
Andreas Schneider
7f806b7c68
tests: Fix non-blocking auth tests.
...
The ssh_userauth_none() call should already be non-blocking. However
this this function is broken in non-blocking mode. It should reveal the
existing bug.
2013-12-15 21:03:00 +01:00
Andreas Schneider
a6107f7432
tests: Fix blocking mode in password auth test.
2013-12-15 20:42:18 +01:00
Andreas Schneider
9829aa2236
tests: Use new auth API in the torture_session test.
2013-12-15 20:29:30 +01:00
Andreas Schneider
f8debe9a19
tests: Use new auth API in the torture_auth test.
2013-12-15 20:26:17 +01:00
Andreas Schneider
8b407f1ca2
tests: Fix pki test with gcrypt.
2013-12-11 21:11:49 +01:00
Jon Simons
20b5734649
channel: fix setting of channel->flags
...
Fix the setting of 'channel->flags' to use '|='. Before this
change, one bug symptom can be that channels are never fully
free'd via ssh_channel_free, resulting in memory leaks.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-12-11 21:02:47 +01:00
Jon Simons
0557f57c63
client: use ssh_channel_do_free in ssh_disconnect
...
Ensure to use 'ssh_channel_do_free' in 'ssh_disconnect', when removing and
free'ing up a session's channels. This matches the behavior in 'ssh_free',
and is necessary to fully free any channel which may not have been closed
completely (see usage of flags SSH_CHANNEL_FLAG_CLOSED_REMOTE,
SSH_CHANNEL_FLAG_FREED_LOCAL).
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-12-11 21:02:05 +01:00
Andreas Schneider
4f4e917187
bind: Correctly free all memory in ssh_bind_free().
...
Thanks to Jacob Baines.
2013-12-09 19:49:54 +01:00
Jon Simons
a1f0b2acfc
session: Add ssh_get_clientbanner().
2013-12-07 16:24:33 +01:00
Andreas Schneider
d65777b570
channels: Add a ssh_channel_read_timeout function.
2013-12-04 20:34:13 +01:00
Andreas Schneider
2df00fd84c
tests: Try to fix torture_forward.
2013-12-04 14:21:52 +01:00
Andreas Schneider
d1d3beac33
tests: Fix memory leaks.
2013-11-28 14:40:11 +01:00
Andreas Schneider
ad0abff8b3
tests: Add missing line breaks.
2013-11-28 11:49:11 +01:00
Andreas Schneider
cdd7a6cb8d
pki: Fix a memory leak.
...
CID #1132819
2013-11-28 09:09:45 +01:00
Andreas Schneider
004240af48
tests: Add torture_pki_write_privkey_ecdsa test.
2013-11-27 22:54:13 +01:00
Andreas Schneider
4e3d16e291
tests: Add torture_pki_write_privkey_dsa test.
2013-11-27 22:54:13 +01:00
Andreas Schneider
7933aef747
tests: Add torture_pki_write_privkey_rsa test.
2013-11-27 22:54:13 +01:00
Andreas Schneider
136efd6ed5
pki: Add ssh_pki_import_privkey_file().
2013-11-27 22:54:13 +01:00
Andreas Schneider
94969cf263
pki_crypto: Add pki_private_key_to_pem().
2013-11-27 22:54:13 +01:00
Andreas Schneider
68c3c26029
pki_gcrypt: Add pki_private_key_to_pem() stub.
2013-11-27 22:54:13 +01:00
Andreas Schneider
fd185acbea
curve25519: Fix memory leaks in ssh_server_curve25519_init().
...
CID #1125255
2013-11-27 20:26:14 +01:00
Andreas Schneider
7a4e8e58f0
curve25519: Do not leak q_s_string.
...
CID #1125256
2013-11-27 20:20:07 +01:00
Andreas Schneider
cbeb2a9de7
curve25519: Fix a memory leak.
...
CID #1125257
2013-11-27 20:18:25 +01:00
Andreas Schneider
d61fcbf7b2
examples: Fix else branch.
...
CID #1127816
2013-11-27 20:16:09 +01:00
Andreas Schneider
75e61f498b
packet: Remove logically dead code.
...
CID #1128796
2013-11-27 20:14:02 +01:00
Andreas Schneider
09edee123a
tests: Try to fix valgrind warnings.
2013-11-27 18:04:44 +01:00
Andreas Schneider
060171028c
tests: Fix a valgrind warning.
2013-11-27 17:55:48 +01:00
Andreas Schneider
7ecdc3e0d5
ecdh: Check if we have ECC support.
2013-11-27 17:38:21 +01:00
Andreas Schneider
67a080874b
ecdh: Use bignum_bin2bn.
2013-11-27 17:35:36 +01:00
Nicolas Viennot
7b63fe2f22
server: Add a ssh_send_keepalive() function.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-24 23:21:04 +01:00
Jon Simons
3d934f3ddc
channel: fix infinite loop in channel_write_common
...
BUG: https://red.libssh.org/issues/130
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-22 10:34:23 +01:00
Rod Vagg
06cc94eecf
flush channel after EOF and CLOSE
2013-11-18 17:22:30 +01:00
Aris Adamantiadis
f6443b725a
logging: fix server-side logging
2013-11-18 15:29:27 +01:00
Aris Adamantiadis
d8ead516de
gssapi: fix logging
2013-11-18 15:11:26 +01:00
Aris Adamantiadis
ccdc0f1805
sockets: null pointer check
2013-11-18 14:42:40 +01:00
Simo Sorce
66e7e7023b
gssapi: Fix support of delegated credentials
...
In a previous refactoring patch, the code underpinning the
ssh_gssapi_set_creds() API was inadvertently removed. This patch
fixes the problem.
Also clarify what variable holds which credentials and insure that
credentials created within the library are propelry freed.
Signed-off-by: Simo Sorce <simo@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-15 23:32:20 -05:00
Simo Sorce
b4fc5d9524
gssapi: Add support for GSSAPIDelegateCredentials config option.
...
Signed-off-by: Simo Sorce <simo@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-15 16:53:59 -05:00
Simo Sorce
811c645f2a
options: Add SSH_OPTIONS_GSSAPI_DELEGATE_CREDENTIALS option.
...
Signed-off-by: Simo Sorce <simo@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-15 16:10:29 -05:00
Andreas Schneider
c2312f9dda
gssapi: Add error checks and cleanup the code in ssh_gssapi_auth_mic().
2013-11-15 16:28:49 +01:00
Simo Sorce
440d2ec0ea
gssapi: Use GSSAPIClientIdentity to acquire creds
...
Signed-off-by: Simo Sorce <simo@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-15 16:19:28 +01:00
Andreas Schneider
47e53deebd
gssapi: Add support for GSSAPIClientIdentity config option.
2013-11-15 15:50:09 +01:00
Andreas Schneider
095a01b70c
options: Add SSH_OPTIONS_GSSAPI_CLIENT_IDENTITY option.
2013-11-15 15:50:09 +01:00
Andreas Schneider
503c729bb0
gssapi: Add support for GSSAPIServerIdentity config option.
2013-11-15 15:50:09 +01:00
Andreas Schneider
41d99d32e8
gssapi: Add suppport to set GSSAPI server identity.
2013-11-15 15:50:09 +01:00
Simo Sorce
c481f9dafd
Fix gssapi credential handling.
...
- Properly acquire and inquitre credentials to get the list of available
credentials.
- Avoid enforcing a specific username it breaks some use cases (k5login).
- Remove confusing references to delegated credentials as there is no code
that actually uses delegated credentials in the initialization case.
Signed-off-by: Siom Sorce <simo@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-15 14:49:29 +01:00
Andreas Schneider
f240ecf328
socket: Fix connect if we pass in a fd.
...
BUG: https://red.libssh.org/issues/106
Thanks to Saju Panikulam.
2013-11-15 08:47:58 +01:00
Andreas Schneider
1972a27fe0
packet: Remove dead code.
2013-11-14 11:43:49 +01:00
Andreas Schneider
097760db17
packet: Set the packet to the processed data position.
...
Else we could end up with packet - current_macsize if to_be_read is 0.
2013-11-14 11:42:21 +01:00
Andreas Schneider
b3a08ba8d3
dh: Fix wrong assignment.
...
Ups, sorry.
2013-11-14 08:08:49 +01:00
Andreas Schneider
fef7e1dffe
poll: Fix realloc in ssh_poll_ctx_resize().
2013-11-09 13:27:59 +01:00
Andreas Schneider
6d7bbe63fe
dh: Avoid possible memory leaks with realloc.
2013-11-09 13:20:13 +01:00
Andreas Schneider
387e26c837
packet: Refactor ssh_packet_socket_callback().
...
Make error checking more readable and add additional NULL checks.
2013-11-09 13:10:41 +01:00
Andreas Schneider
e8e99ec6de
server: Fix malloc call.
2013-11-09 12:47:02 +01:00
Colin Walters
13c4499449
session: Always request POLLIN
...
The assumption is that if libssh functions are being invoked, we want
to read data.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-09 12:29:07 +01:00
Colin Walters
4cc7f4ad03
Add ssh_get_poll_flags()
...
For integration with an external mainloop, we need to know how to
replicate libssh's internal poll() calls. We originally through
ssh_get_status() was that API, but it's not really - those flags only
get updated from the *result* of a poll(), where what we really need
is to know how libssh would *start* a poll().
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-09 12:26:19 +01:00
Colin Walters
a8dc67ded8
client: If we have a pre-connected FD, set state to SOCKET_CONNECTED
...
Otherwise applications providing their own fd end up tripping an
assertion, since the session is just in _CONNECTING.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-09 12:25:41 +01:00
Andreas Schneider
aa33d18930
example: Use ssh_get_publickey_hash().
2013-11-06 17:10:41 +01:00
Andreas Schneider
8c5777554a
dh: Move ssh_get_hexa() and ssh_print_hexa() down.
...
This way they are in the documentation block for the session and we get
documentation for them.
2013-11-06 17:10:41 +01:00
Andreas Schneider
06cd9bc4dc
dh: Add new ssh_get_publickey_hash() function.
2013-11-06 17:10:35 +01:00
Andreas Schneider
0c8984ba9f
doc: Add curve25519 to features list.
2013-11-05 13:15:11 +01:00
Andreas Schneider
6f0f1ef292
doc: Fix doxygen warnings.
2013-11-04 21:55:29 +01:00
Aris Adamantiadis
b12f3f38c7
Fix cast warnings on 64bits
2013-11-04 10:49:32 +01:00
Aris Adamantiadis
cb165df64e
remove warnings on OSX (workaround)
2013-11-04 10:47:22 +01:00
Aris Adamantiadis
e4c4f57f05
logging: fix wording
2013-11-04 10:31:10 +01:00
Aris Adamantiadis
c5ef5ed18f
curve25519: include reference implementation
2013-11-03 14:58:10 +01:00
Aris Adamantiadis
ebf4a03908
examples: fix forktty() warning on OSX
2013-11-03 14:10:04 +01:00
Aris Adamantiadis
4f3ee2fc7e
Fix examples compilation on OSX (libargp)
2013-11-03 13:49:27 +01:00
Aris Adamantiadis
f565aeebfa
Compile libssh with nacl if possible
...
Conflicts:
DefineOptions.cmake
2013-11-03 13:18:26 +01:00
Aris Adamantiadis
04cb94a2dd
socket: Fix check for pending data.
...
BUG: https://red.libssh.org/issues/119
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-03 12:46:27 +01:00
Nicolas Viennot
754152aa22
server: Fix ssh_execute_server_callbacks() client execution
...
When the public key auth handler is executed and returns SSH_OK,
ssh_execute_server_callbacks() still runs some client callbacks,
which may set rc to SSH_AGAIN, which triggers a default reply on
auth, denying auth.
Signed-off-by: Nicolas Viennot <nicolas@viennot.biz >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-03 10:52:38 +01:00
Nicolas Viennot
1ef00045dd
server kex: enable delayed compression
...
The code is careful to reenable compression when rekeying.
Signed-off-by: Nicolas Viennot <nicolas@viennot.biz >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-03 10:48:59 +01:00
Andreas Schneider
a466a624e2
session: Make sure we correctly burn the buffer.
2013-11-03 10:45:02 +01:00
Andreas Schneider
643a3b7cc3
wrapper: Make sure we really burn the buffer.
2013-11-03 10:39:31 +01:00
Andreas Schneider
d2dea8dc2e
priv: Fix brackets of burn macros.
2013-11-03 10:24:47 +01:00
Andreas Schneider
6edb6bcca1
doc: Add missing RFCs.
2013-11-03 09:35:35 +01:00
Jon Simons
d4f5a0e6ab
server: fix pubkey reply for key probes
...
Per RFC 4252, it is required to send back only one of either
SSH_MSG_USERAUTH_PK_OK or SSH_MSG_USERAUTH_FAILURE for public
key probes.
Update the handling of 'auth_pubkey_function' to send back PK_OK
instead of SSH_MSG_USERAUTH_SUCCESS for the case that the state
of the message at hand is SSH_PUBLICKEY_STATE_NONE.
With this change, it is now possible to process an initial key probe
and then subsequent signature validation using the server callbacks.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-02 21:02:56 +01:00
William Orr
ce1d73e0f0
ssh_options_get can now return ProxyCommand
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-02 21:02:56 +01:00
Jon Simons
20caa68b84
connect: fix memory leak in ssh_select
...
Balance 'ssh_event_add_fd' with 'ssh_event_remove_fd' in 'ssh_select'.
BUG: https://red.libssh.org/issues/128
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-10-31 12:45:21 +01:00
Andreas Schneider
b00a6e3885
tests: Add a test for ssh_channel().
2013-10-31 12:44:48 +01:00
Jon Simons
ffc33ca28c
poll: fix leak in ssh_poll_ctx_free
...
Fix a memory leak in 'ssh_poll_ctx_free': issue 'ssh_poll_free'
to remove the poll handle from its context and free it.
BUG: https://red.libssh.org/issues/128
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-10-31 11:55:09 +01:00
Alan Dunn
ee95c05c08
SSH_AUTH_OK -> SSH_AUTH_SUCCESS in comments
...
A few callback descriptions refer to a non-existent value SSH_AUTH_OK,
which should be SSH_AUTH_SUCCESS. This commit fixes these.
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-10-31 08:18:55 +01:00
Andreas Schneider
cfea381307
cmake: Check for isblank().
2013-10-30 17:30:07 +01:00
Jon Simons
099b914fd9
bind: fix leak in ssh_bind_accept error path
...
Use 'ssh_socket_free' to cleanup if 'ssh_bind_accept_fd'
fails, to be sure to free the ssh_socket in/out buffers.
2013-10-24 10:37:37 +02:00
Andreas Schneider
afd35fa98c
tests: Add a sftp_read blocking test.
2013-10-23 15:49:07 +02:00
Colin Walters
f02bc4768e
auth: docs: Fix typo optoins -> options
...
I'm just getting my feet wet with this codebase.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-10-23 09:55:09 +02:00
Andreas Schneider
bcb162816e
doc: Improve sftp_read_sync() example.
2013-10-23 09:53:16 +02:00
Andreas Schneider
5baa6aed6b
include: Fix build on platforms without ECC.
2013-10-21 07:15:59 +02:00
Andreas Schneider
6a6e85752e
tests: Add a test for ssh_channel_request_env().
2013-10-20 17:05:35 +02:00
Andreas Schneider
4421540b7b
tests: We can't test the accept right now.
2013-10-20 13:28:53 +02:00
Andreas Schneider
d3c186b04c
tests: Fix torture_forward.
2013-10-20 13:23:31 +02:00
Andreas Schneider
e30acdb58a
channel: Reinit the buffer and reset the state on error.
...
BUG: https://red.libssh.org/issues/126
2013-10-20 12:46:57 +02:00
Andreas Schneider
b0cbe88b0b
channel: Fix ssh_global_request_termination().
...
BUG: https://red.libssh.org/issues/126
2013-10-20 12:46:17 +02:00
Andreas Schneider
3afba83134
tests: Add torture forward test.
2013-10-20 12:46:17 +02:00
Andreas Schneider
b8d47a438c
pki: Don't leak a buffer.
2013-10-19 10:41:57 +02:00
Andreas Schneider
5201c5850e
wrapper: Fix compilation with gcrypt.
2013-10-19 10:39:00 +02:00
Andreas Schneider
bd8ab422d0
pki_crpypto: Fix ecdsa signature to blob.
...
BUG: https://red.libssh.org/issues/118
2013-10-18 23:48:21 +02:00
Andreas Schneider
33890daf41
pki: Add support for ECDSA private key signing.
2013-10-18 23:22:24 +02:00
Andreas Schneider
ac4c5699b1
pki: Add the type as a char pointer.
2013-10-18 23:22:24 +02:00
Andreas Schneider
15e31eb464
wrapper: Add more evp functions.
2013-10-18 23:22:24 +02:00
Andreas Schneider
2e81dd61dd
client: Fix the build.
2013-10-18 21:18:36 +02:00
Oliver Stöneberg
f2c2687ca6
scp: Fixed result of ssh_scp_string_mode() to get SCP working.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-10-18 14:58:47 +02:00
Oliver Stöneberg
4c300313c3
client: Added a missing NULL pointer check.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-10-18 14:57:33 +02:00
Andreas Schneider
bec13a6ac0
doc: Make sure we have the defines to build all docs.
2013-10-14 15:39:33 +02:00
Andreas Schneider
423d8c9b6a
channel: Fix packets termination timeout in global_request().
...
BUG: https://red.libssh.org/issues/126
2013-10-01 14:50:56 +02:00
Andreas Schneider
685fe1d0b6
session: Try the ecdsa default key first.
2013-10-01 14:45:01 +02:00
Tristan CACQUERAY
e588e2325d
callbacks: add support for auth_none_function
2013-09-27 15:34:45 +02:00
Aris Adamantiadis
04fd756c49
doc: Documentation of curve25519-sha256@libssh.org
2013-09-27 15:32:52 +02:00
Aris Adamantiadis
4cb6afcbd4
kex: implement curve25519-sha256@libssh.org
2013-09-27 15:32:44 +02:00
Andreas Schneider
4eae4d592c
channels: Correctly handle timeouts in channel functions.
2013-09-17 11:23:56 +02:00
Andreas Schneider
566d842405
channel: Use the correct timeout option in channel_open().
...
BUG: https://red.libssh.org/issues/124
2013-09-17 11:19:49 +02:00
Andreas Schneider
5e2fbbc202
callbacks: Improve the documentation of ssh_threads_set_callbacks().
...
BUG: https://red.libssh.org/issues/123
2013-09-16 10:54:30 +02:00
Andreas Schneider
8e703b9974
callbacks: Improve the documentation of ssh_threads_get_noop().
...
BUG: https://red.libssh.org/issues/123
2013-09-16 10:50:25 +02:00
Andreas Schneider
89853607c5
session: Document return value of ssh_get_serverbanner().
...
BUG: https://red.libssh.org/issues/122
2013-09-16 10:38:14 +02:00
Andreas Schneider
20658abc78
session: Remove obsolete status variables.
...
BUG: https://red.libssh.org/issues/121
2013-09-16 10:38:14 +02:00
Andreas Schneider
8823dee51a
client: Add example code for ssh_get_openssh_version().
...
BUG: https://red.libssh.org/issues/120
2013-09-16 10:38:14 +02:00
Andreas Schneider
3e07359a35
channels: Correctly decrement timeout value in ssh_channel_accept().
...
BUG: https://red.libssh.org/issues/116
2013-09-16 10:38:14 +02:00
Andreas Schneider
e9242a7a31
channel: Document SSH_AGAIN in ssh_channel_read().
...
BUG: https://red.libssh.org/issues/115
2013-09-16 10:38:14 +02:00
Andreas Schneider
b9ada25296
cmake: Allow to build without examples.
...
BUG: https://red.libssh.org/issues/114
2013-09-16 10:38:14 +02:00
Andreas Schneider
33cb1bc08b
doc: Improve the PKI documentation a bit.
2013-09-10 06:59:25 +02:00
Andreas Schneider
6da54688eb
doc: Update documentation of ssh_set_blocking().
...
This should work correctly in libssh 0.6.0. If not then you hit a bug.
2013-09-09 16:43:46 +02:00
Andreas Schneider
ef6d19fbb1
clang_complete: Update definitons.
2013-08-13 12:09:59 +02:00
Andreas Schneider
acbca6a562
ecdh: Refactor ecdh_build_k to check errors codes.
2013-08-13 12:09:36 +02:00
Andreas Schneider
fc8081cd06
channel: Refactor channel_write_common() code.
...
This makes it easier to read and easier to debug.
2013-08-13 08:22:28 +02:00
Andreas Schneider
7a64dd1b9a
channel: Make channel_write_common() static.
2013-08-13 08:17:15 +02:00
Andreas Schneider
5045133dc2
channel: Use MIN macro in channel_write_common().
2013-08-13 08:15:37 +02:00
Andreas Schneider
7f2049b0d5
include: Add a MIN macro.
2013-08-13 08:15:16 +02:00
Andreas Schneider
aa3eeb38f9
scp: Document more scp functionts.
2013-08-12 11:24:38 +02:00
Nicolas Viennot
af99a4dc05
server kex: Fix server side compression typo
...
The original code had a typo (COMP was CRYPT). This fixes the zlib compression
method.
Signed-off-by: Nicolas Viennot <nicolas@viennot.biz >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-08-05 18:27:23 +02:00
Andreas Schneider
e800269013
INSTALL: Fix source directory.
2013-08-05 18:27:23 +02:00
Andreas Schneider
ad709edadb
Update INSTALL.
2013-08-05 15:07:21 +02:00
Andreas Schneider
0774da3c40
Update ChangeLog.
2013-08-05 11:07:27 +02:00
Andreas Schneider
f1ec4f11e3
cmake: Add CMOCKA_ROOT_DIR with hints and paths.
2013-08-01 16:55:40 +02:00
Andreas Schneider
3eb66cba37
doc: Update Features section.
2013-08-01 14:19:25 +02:00
Andreas Schneider
514a01f3df
doc: Remove obsolete Trac header and footer.
2013-08-01 14:12:33 +02:00
Andreas Schneider
9156b8c068
doc: Better explain LIBSSH_STATIC.
2013-08-01 14:12:19 +02:00
Andreas Schneider
1067591480
cmake: Fix configure check for ntohll and htonll.
2013-07-27 11:27:09 +02:00
Andreas Schneider
7375de0b05
include: Fix a build warning in MinGW.
2013-07-27 10:55:53 +02:00
Andreas Schneider
51296a0237
tests: Add suppression for getdelim with selinux.
2013-07-26 08:04:03 +02:00
Andreas Schneider
6efa55d154
session: Add parentheses to fix a build warning.
2013-07-26 07:50:37 +02:00
Andreas Schneider
f9b8395122
session: Handle session state in ssh_get_status().
...
BUG: https://red.libssh.org/issues/109
2013-07-25 22:43:09 +02:00
Nicolas Viennot
cdf193d8b5
session: ssh_handle_packets_termination() SSH_AGAIN bug fix
...
ssh_handle_packets_termination() must not return SSH_OK when exiting due to
a timeout while the termination function still returns 1.
Signed-off-by: Nicolas Viennot <nicolas@viennot.biz >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-25 22:35:03 +02:00
Nicolas Viennot
2f674aeec1
channels: allow channel_open() to return SSH_AGAIN
...
Signed-off-by: Nicolas Viennot <nicolas@viennot.biz >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-25 22:34:51 +02:00
Andreas Schneider
74bbcf7e29
doc: Don't generate latex documentation.
2013-07-25 12:29:07 +02:00
Andreas Schneider
26c118890f
cmake: Only build with _FORTIFY_SOURCE on release builds.
2013-07-25 10:02:01 +02:00
Andreas Schneider
38420bff76
gssapi: Fix a build warning if we build without server support.
2013-07-25 10:01:38 +02:00
Andreas Schneider
1444d62d96
cmake: Document GSSAPI_FLAVOR_MIT and GSSAPI_FLAVOR_HEIMDAL.
2013-07-24 20:52:39 +02:00
Andreas Schneider
5ba88f01e8
cmake: Rewrote FindGSSAPI.cmake.
2013-07-24 20:48:14 +02:00
Andreas Schneider
6a83f9a044
gssapi: Fix include with Heimdal.
2013-07-24 20:41:41 +02:00
Andreas Schneider
61084b76f6
example: Fix a memory leak on error in tty server.
...
CID: #1032746
2013-07-24 17:38:27 +02:00
Andreas Schneider
c55ab44caf
cmake: Update FindNSIS module.
2013-07-24 11:17:30 +02:00
Andreas Schneider
90e5ce3c3e
cmake: Set HAVE_GETADDRINFO if we have libsocket.
...
This fixes the build on Solaris.
2013-07-24 07:54:11 +02:00
Andreas Schneider
448738eb00
cmake: Change start time to UTC.
2013-07-24 07:49:27 +02:00
Andreas Schneider
e1280ce153
gssapi: Fix a memory leak in ssh_gssapi_auth_mic().
...
CID: 1046708
2013-07-23 12:27:55 +02:00
Andreas Schneider
11c45b0f55
callbacks: Fix value assigning.
...
CID: 1046709
2013-07-23 12:25:18 +02:00
Andreas Schneider
e1576ef55a
cmake: Don't build examples on Windows but on Unix.
2013-07-23 10:44:51 +02:00
Andreas Schneider
df81a05505
cmake: Check for unistd.h.
2013-07-23 10:44:51 +02:00
Andreas Schneider
7d07e1f1bd
cmake: If we don't have gssapi libs, disable it.
2013-07-23 10:44:51 +02:00
Andreas Schneider
1829e9981b
cmake: Check for HAVE_GCC_VOLATILE_MEMORY_PROTECTION.
...
This ensures that the memset call is not optimized out by the compiler
(works works with gcc and clang).
2013-07-23 10:44:39 +02:00
Andreas Schneider
5145daba69
cmake: Define HAVE_NTOHLL and HAVE_HTONLL on Windows.
2013-07-22 13:01:36 +02:00
Andreas Schneider
729a586027
cmake: Make sure we check some functions on all platforms.
2013-07-22 13:01:36 +02:00
Andreas Schneider
8ff6a7a850
cmake: Check for _strtoui64() on Windows.
2013-07-22 13:01:36 +02:00
Andreas Schneider
dbf3cdecda
auth: Fix build warning if we don't build with gssapi.
2013-07-22 13:01:36 +02:00
Andreas Schneider
35d0c3a860
connect: Fix a build warning on Windows.
2013-07-22 13:01:36 +02:00
Andreas Schneider
229ef082c1
scp: Cast return value from uint64_t to size_t.
2013-07-22 13:01:36 +02:00
Andreas Schneider
da1eaea51a
gassapi: Fix check if it is enabled.
2013-07-22 10:42:30 +02:00
Andreas Schneider
329f4da1e1
options: Fix compiler warning on Windows.
2013-07-22 10:42:30 +02:00
Andreas Schneider
2c9808daf8
example: Fix location of port definition.
...
It shouldn't be inside #ifdef HAVE_ARGP.
2013-07-22 10:42:30 +02:00
Andreas Schneider
5e7b15e2c1
pki: Fix declaration of ssh_pki_convert functions.
2013-07-22 10:20:14 +02:00
Andreas Schneider
20312e23b7
log: Make _ssh_log() public.
2013-07-21 11:53:55 +02:00
Andreas Schneider
2106db3efa
tests: Don't leak memory in torture_channel_read_error().
2013-07-21 11:27:30 +02:00
Andreas Schneider
08c31ccf31
error: Fix logging in ssh_set_error().
2013-07-21 11:26:55 +02:00
Andreas Schneider
f3e09612b3
options: Set log level through options too.
2013-07-21 11:26:32 +02:00
Andreas Schneider
7ed5512145
clang: Add missing defines.
2013-07-21 11:03:16 +02:00
Andreas Schneider
d1bbc35f33
gssapi: Add brackets in ssh_packet_userauth_gssapi_mic().
2013-07-21 11:03:00 +02:00
Andreas Schneider
f458055e9c
gssapi: Cleanup ssh_gssapi_set_creds().
2013-07-21 10:58:30 +02:00
Andreas Schneider
4103358daa
gssapi: Replace printf with SSH_LOG.
2013-07-21 10:56:47 +02:00
Andreas Schneider
1ab4b28b00
messages: Split ssh_execute_server_callbacks() in small functions.
2013-07-21 10:53:18 +02:00
Andreas Schneider
461988b153
session: Add brackets to ssh_handle_packets_termination().
2013-07-21 10:35:18 +02:00
Andreas Schneider
c4937cedea
misc: Use the szPath variable instead of calling getenv.
2013-07-16 13:36:52 +02:00
Andreas Schneider
11c82a26a6
channels: Fix a SSH_LOG call.
2013-07-15 08:07:34 +02:00
Andreas Schneider
351e4107ed
examples: Check return value of fstat().
...
CID #743297
2013-07-14 15:02:11 +02:00
Andreas Schneider
776ff528df
examples: Make sure we have a valid scp pointer.
...
CID #1032343
2013-07-14 15:02:11 +02:00
Andreas Schneider
22e8858134
agent: Fix possible segfaults due to NULL pointer deref.
...
CID #1035578
2013-07-14 15:02:11 +02:00
Andreas Schneider
483ba8100f
examples: Check return value of ssh_event_dopoll().
...
CID #0
2013-07-14 15:02:08 +02:00
Andreas Schneider
0138c9fd59
gssapi: Refactor ssh_gssapi_send_mic() to not leak memory.
...
CID #0
2013-07-14 15:02:05 +02:00
Andreas Schneider
831ed08a56
gssapi: Check return values of buffer functions.
...
CID #0
2013-07-14 15:02:02 +02:00
Andreas Schneider
1467e0782e
gssapi: Remove dead code.
...
CID #0
2013-07-14 15:01:59 +02:00
Andreas Schneider
ecec2abfc7
gssapi: Refactor ssh_gssapi_build_mic() to avoid memory leaks.
...
CID #0
2013-07-14 15:01:57 +02:00
Andreas Schneider
8f0b6ccd66
gssapi: Fix a possible memory leak.
...
CID #0
2013-07-14 15:01:55 +02:00
Andreas Schneider
b4790fbdd2
gssapi: Fix a memory leak.
...
CID #0
2013-07-14 15:01:52 +02:00
Andreas Schneider
df373efc56
callbacks: Still support the legacy callback.
2013-07-14 14:12:08 +02:00
Andreas Schneider
e3b4f27aa9
examples: Remove ssh_log from ssh client example.
2013-07-14 13:35:25 +02:00
Andreas Schneider
c64ec43eef
src: Remove enter_function() and leave_function().
2013-07-14 13:31:24 +02:00
Andreas Schneider
0d3deeec10
options: Use the new function to use the log level.
2013-07-14 12:53:01 +02:00
Andreas Schneider
c28efb8cbc
include: Mark ssh_log as depcrecated.
2013-07-14 12:44:32 +02:00
Andreas Schneider
ebdd0c6ac1
src: Migrate to SSH_LOG.
2013-07-14 12:44:26 +02:00
Andreas Schneider
dcd94de076
error: Use new logging function.
2013-07-14 12:37:12 +02:00
Andreas Schneider
a73557053e
doc: Document public functions.
2013-07-14 12:37:12 +02:00
Andreas Schneider
2c91efcc68
log: Implment new logging functions.
2013-07-14 12:36:59 +02:00
Andreas Schneider
73309f19e5
cmake: Check if we have Thread Local Storage support.
2013-07-14 12:36:35 +02:00
Aris Adamantiadis
6ad80bb4b2
examples: fix warning
2013-07-14 11:18:13 +02:00
Aris Adamantiadis
365a3bba6e
auth: fix warnings with missing switch() params
2013-07-14 09:35:30 +02:00
Aris Adamantiadis
e95e3b5736
examples: fix compilation warnings
2013-07-14 09:32:19 +02:00
Aris Adamantiadis
ad92740dc3
server: Fix compilation without WITH_SERVER
2013-07-14 09:30:59 +02:00
Aris Adamantiadis
bf5e5eebd7
pki: fix comments
2013-07-13 23:01:30 +02:00
Aris Adamantiadis
9d88dcab3e
Server: disallow channel opening till authenticated
2013-07-13 22:56:32 +02:00
Aris Adamantiadis
dd6a0b51ac
Server: fix rekeying
2013-07-13 22:56:07 +02:00
Aris Adamantiadis
3b81da21c2
DH: fix rekeying when using aes256 and bigger
2013-07-13 18:12:10 +02:00
Andreas Schneider
ed7e3c936b
cmake: Don't make GSSAPI a hard requirement.
2013-07-13 15:50:57 +02:00
Andreas Schneider
1663917f71
cmake: Make GSSAPI optional.
2013-07-13 15:48:49 +02:00
Andreas Schneider
9bbbccc0e7
auth: Remove unused code.
2013-07-13 15:29:53 +02:00
Aris Adamantiadis
c44029e5ce
gssapi: Fix indentation.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 15:23:33 +02:00
Aris Adamantiadis
c231029be3
gssapi: Fix ticket forwarding bug
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 15:23:33 +02:00
Aris Adamantiadis
2ab7f2be75
server: add pubkey auth callback
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 15:23:33 +02:00
Aris Adamantiadis
47a4eea827
examples: fix with new gssapi cb API
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 15:23:33 +02:00
Aris Adamantiadis
0d1ec1fa48
gssapi: Add user parameter to gssapi auth callback
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 15:03:18 +02:00
Aris Adamantiadis
0356b78ede
gssapi: remove dead code
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 15:02:52 +02:00
Aris Adamantiadis
b0ab39a6f1
gssapi: gssapi callbacks serverside
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 15:02:03 +02:00
Aris Adamantiadis
31a129ee9e
sftp: more flexibility on channels
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 15:01:17 +02:00
Aris Adamantiadis
7e7910a1ca
sftp: added useful server APIs
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 15:00:52 +02:00
Aris Adamantiadis
55ddc3932e
gssapi: more debug info
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:59:56 +02:00
Aris Adamantiadis
2a0c1e917f
server: callback for channel_request_subsystem
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:59:46 +02:00
Aris Adamantiadis
db20a22e51
server: added 2 missing channel callbacks
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:59:21 +02:00
Aris Adamantiadis
560b508771
events: don't poll handles busy handling callbacks
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:58:47 +02:00
Aris Adamantiadis
f528f71920
agent: the valid request is auth-agent@openssh.com
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:58:18 +02:00
Aris Adamantiadis
458e4c07c7
server: export ssh_channel_open_x11()
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:58:06 +02:00
Aris Adamantiadis
7555f3235e
client: call client callback even in non-server mode
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:57:48 +02:00
Aris Adamantiadis
3e7bd72f76
client: handle x11 channel open requests with callbacks
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:57:13 +02:00
Aris Adamantiadis
f457080d62
server: Implement X11 requests and window-change
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:56:37 +02:00
Aris Adamantiadis
37cce98f7e
Doc: fix a few broken parameters
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:56:14 +02:00
Aris Adamantiadis
7e306a9ec6
server: implement server-side of agent forwarding
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:55:58 +02:00
Aris Adamantiadis
81e769ec6a
channels: implement callback for agent forwarding request
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:55:47 +02:00
Aris Adamantiadis
e809fa881e
examples: adapt samplesshd-cb to new callback
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:54:15 +02:00
Aris Adamantiadis
52d9e15c25
examples: adapt to the new callback format
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:51:00 +02:00
Aris Adamantiadis
e933d1e1b1
callbacks: make the channel accept callback more logical
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:51:00 +02:00
Aris Adamantiadis
e76442b650
ssh-agent: implement the clientside for agent forwarding auth.
...
This can only be used to authenticate the client, not to allow the
connected server to transfer agent requests
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:51:00 +02:00
Aris Adamantiadis
9bdb546852
Examples: Exemple of an SSH proxy
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:51:00 +02:00
Aris Adamantiadis
86ae29b30d
gssapi: implement ticket delegation
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:51:00 +02:00
Aris Adamantiadis
65eccf1969
gssapi: retrieve forwarded (delegated) tickets
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:50:56 +02:00
Aris Adamantiadis
d944310412
auth: store client's credentials
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:41:28 +02:00
Aris Adamantiadis
7cb6b15aaa
auth: implement client-side gssapi
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:41:20 +02:00
Aris Adamantiadis
212261bb10
examples:Compile samplessh on bsd too
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:25:32 +02:00
Aris Adamantiadis
fadbe80c43
options: Fix null ptr deference introduced in earlier fix.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:24:57 +02:00
Aris Adamantiadis
7fef6e817e
auth: implement gssapi-with-mic server side
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:21:36 +02:00
Aris Adamantiadis
1246ad812c
server: move message-specific call to ssh_*
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:21:36 +02:00
Aris Adamantiadis
3b52e38a33
auth: adapt libssh to gssapi-with-mic server
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:21:36 +02:00
Aris Adamantiadis
6bb5063046
example: adapt example for gssapi callback
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:19:23 +02:00
Aris Adamantiadis
950d8e89a9
callbacks: new callbacks for gssapi
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:19:23 +02:00
Aris Adamantiadis
6c26a23cf4
build: build with gssapi if detected
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:19:23 +02:00
Aris Adamantiadis
b69c26ad72
build: detect gssapi.h
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:19:23 +02:00
Aris Adamantiadis
cb0f886a5c
cmake: Add FindGSSAPI.cmake
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:19:23 +02:00
Aris Adamantiadis
3d7b24c534
gssapi: added SSH constants
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:12:06 +02:00
Aris Adamantiadis
4c99f5de4d
GSSAPI: added stub
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:11:26 +02:00
Aris Adamantiadis
a34ad5825b
Added server example with callbacks impl
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:10:03 +02:00
Aris Adamantiadis
4497cd9b43
Make examples more BSD friendly
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:08:44 +02:00
Aris Adamantiadis
2b54db7603
Try to find ARGP on solaris, BSD
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:07:46 +02:00
Aris Adamantiadis
ff30a8feb0
Implement callbacks for servers in the message queue
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:06:57 +02:00
Aris Adamantiadis
82b4cffe66
bind: ssh_pki functions also return SSH_EOF error code
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:03:55 +02:00
Aris Adamantiadis
66b37c856c
session: Introduce SSH_TIMEOUT_DEFAULT
...
The default timeout of 30seconds is very nice when connecting to a new SSH
session, however it completely breaks the synchronous blocking API.
Use SSH_TIMEOUT_DEFAULT when in blocking mode so channel reads&write are blocking
as expected
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:03:42 +02:00
Aris Adamantiadis
6bc64c368d
server: added channel callbacks
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:00:18 +02:00
Aris Adamantiadis
ab2e641b4a
Defined SSH server callbacks interface
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 13:59:58 +02:00
Andreas Schneider
48b715cce0
tests: Use fstat() after the open().
2013-07-13 13:59:58 +02:00
Andreas Schneider
97e7c95d21
cmake: Pass _FORTIFY_SOURCE directly to the preprocessor.
2013-07-13 13:54:00 +02:00
Andreas Schneider
e52cc613e4
BUG 103: Disable proxy command if set to 'none'.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-11 15:34:50 +02:00
Andreas Schneider
89be6d0309
examples: Check return value of fileno().
2013-06-19 12:32:10 +02:00
Andreas Schneider
36e4c2e5bc
messages: Fix a possible memory leak.
2013-06-19 12:29:54 +02:00
Andreas Schneider
aed9d7a84d
agent: Fix a possible memory leak.
2013-06-19 12:24:00 +02:00
Andreas Schneider
f0a362fdbe
agent: Fix possible memory leak.
2013-06-19 12:19:05 +02:00
Andreas Schneider
de4cb811a0
examples: Fix a possible memory leak.
2013-06-19 12:16:57 +02:00
Andreas Schneider
abb25861e5
examples: Fix a possible memory leak.
2013-06-19 12:14:25 +02:00
Andreas Schneider
b698f6361c
kex1: Fix a possible null pointer dereference.
2013-06-19 12:06:43 +02:00
Andreas Schneider
e6be005236
ecdh: Add missing return in ssh_client_ecdh_init().
2013-06-19 12:04:38 +02:00
Andreas Schneider
8a4364a99b
ecdh: Avoid memory leaks in ssh_server_ecdh_init().
2013-06-19 11:19:08 +02:00
Andreas Schneider
6dae8baefc
src: Add fall trough comments.
2013-06-18 17:17:23 +02:00
Andreas Schneider
94a8c30feb
pki: Fix switch statement of pki_key_generate_ecdsa().
2013-06-18 17:16:59 +02:00
Andreas Schneider
68be73ec0d
tests: Check return value of stat.
2013-06-18 17:11:34 +02:00
Andreas Schneider
485e3b4014
tests: Check return values of buffer functions.
2013-06-18 17:10:00 +02:00
Andreas Schneider
1deb3412bb
connect: Use the correct close function.
2013-06-18 17:06:58 +02:00
Andreas Schneider
aaae3c4ec1
connect: Correctly fail in ssh_connect_host_nonblocking().
2013-06-18 17:05:57 +02:00
Andreas Schneider
b31efd9ff1
ecdh: Make sure we don't leak memory in ssh_client_ecdh_init().
...
This also adds more checks for return values.
2013-06-18 17:02:40 +02:00
Andreas Schneider
5d05aec2ef
auth: Cleanup the agent return code.
2013-06-18 16:42:33 +02:00
Nicolas Viennot
6306bee86c
auth: If the agent fails, fall back to regular path
...
It's causing issues on MacOSX when ssh_agent_get_ident_count()
reports "Agent count: 0".
2013-06-18 16:39:31 +02:00
Andreas Schneider
59dcebd604
sample: Fix a possible buffer overrun.
2013-06-17 13:27:40 +02:00
Andreas Schneider
7ceaea479e
kex1: Fix null check of hostkey.
2013-06-17 13:21:51 +02:00
Andreas Schneider
2b68728552
socket: Check if socket (non)blocking is working.
2013-06-17 13:18:55 +02:00
Andreas Schneider
42c7bc5a21
socket: Check return value of getsockopt().
2013-06-17 13:09:50 +02:00
Andreas Schneider
ee47cab548
packet: Fix a possible segfault.
2013-06-17 13:04:27 +02:00
Andreas Schneider
a65029da5d
messages: Fix a possible segfault.
2013-06-17 13:02:49 +02:00
Andreas Schneider
f31c33bb31
ecdh: Check return values of buffer_add_* functions.
2013-06-17 12:59:22 +02:00
Andreas Schneider
4255a7223c
dh: Check return value of buffer_add_ssh_string().
2013-06-17 12:53:26 +02:00
Andreas Schneider
9ee45a18d7
connect: Check return value of getsockopt().
2013-06-17 12:47:21 +02:00
Andreas Schneider
0ba075e9ce
channels1: Check return value of buffer_add_u8().
2013-06-17 12:40:35 +02:00
Andreas Schneider
d93e38bbfe
examples: Check return value of ssh_channel_read.
2013-06-17 12:35:42 +02:00
Andreas Schneider
e4bcd063b7
packet1: Don't free an invalid address.
2013-06-17 12:10:55 +02:00
Andreas Schneider
d83b3d9ebe
pki: Limit privkey to 4M for now.
2013-06-17 12:07:32 +02:00
Andreas Schneider
6f8b5ed679
pki: Fix a resource leak on error.
2013-06-17 11:49:13 +02:00
Andreas Schneider
d255d1bf32
tests: Use memory assert functions.
2013-06-17 11:44:28 +02:00
Andreas Schneider
33e95792ce
pki: Fix resource leak on error.
2013-06-13 15:46:53 +02:00
Andreas Schneider
a38c56370c
torture: Fix a resource leak on error.
2013-06-13 15:43:50 +02:00
Andreas Schneider
01493b8d47
tests: Don't leak memory.
2013-06-13 15:42:13 +02:00
Andreas Schneider
1a894e2cf2
client: Fix possible NULL pointer dereference.
2013-06-13 11:46:17 +02:00
Andreas Schneider
b8a3e5ffe3
known_hosts: Fix readablity.
2013-06-13 11:08:37 +02:00
Andreas Schneider
09663692dd
pki: Use fstat() after opening the file.
2013-06-13 11:04:59 +02:00
Andreas Schneider
a03d8f49fb
examples: Fix a use after free in scp example.
2013-06-13 10:55:12 +02:00
Andreas Schneider
abd6b8004e
kex: Fix a double free.
2013-06-13 10:51:12 +02:00
Andreas Schneider
e3c5096fcf
server: Fix a double free.
2013-06-13 10:48:50 +02:00
Andreas Schneider
51a531f4a7
tests: Check the return value of write.
2013-06-11 09:59:22 +02:00
Andreas Schneider
fcf8af20f8
BUG 103: Fix ProxyCommand parsing.
2013-06-02 19:29:28 +02:00
Andreas Schneider
2d28ee7d22
config: Rename ssh_config_get_str().
2013-06-02 18:54:16 +02:00
Andreas Schneider
e41482fec4
opts: Fix segfault in option parser.
2013-06-02 18:34:39 +02:00
Andreas Schneider
992f00b145
getpass: Don't fail if stdin is not a tty.
...
We don't need to manipulate the tty state (such as turning off echo)
when prompting for passwords if we're not reading from a tty.
2013-04-05 14:14:22 +02:00
Andreas Schneider
24e94d53e9
cmake: Fix installation path for some strange platforms.
2013-03-20 09:38:03 +01:00
Andreas Schneider
8455d79bb6
priv: Make really sure memset doesn't get optimzed out.
2013-03-13 15:37:51 +01:00
Aris Adamantiadis
222a0d78ca
poll: return error on poll() when pollset is empty
2013-02-26 23:52:25 +01:00
Andreas Schneider
e471aa4e0b
cmake: Fix config include dir variable name.
2013-02-13 15:30:23 +01:00
Andreas Schneider
5d6cab4b14
cmake: Add cmake config files for new find_package() mode.
2013-02-12 13:32:34 +01:00
Andreas Schneider
afe4c92bbf
cmake: Fix setting -D_FORTIFY_SOURCE=2.
2013-02-07 17:02:51 +01:00
Johannes Krude
186116f34a
socket: Call data handler as long as handler takes data.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-01-29 10:56:49 +01:00
Andreas Schneider
b2f52799c2
include: Fix the LGPL header.
...
This has been reported by rpmlint:
libssh-devel.x86_64: W: incorrect-fsf-address libssh.h
2013-01-23 00:22:46 +01:00
Andreas Schneider
915781381e
BUG 99: Fix string function if no build type is set.
2013-01-22 16:28:25 +01:00
Andreas Schneider
21a45e89c5
options: Fix a free crash bug if we parse unknown options.
...
Thanks to Yong Chuan Koh, X-Force Research <kohyc@sg.ibm.com >
2013-01-22 11:32:47 +01:00
Aris Adamantiadis
de096910b3
Report according status when errors are detected
2012-12-27 22:01:37 +01:00
Aris Adamantiadis
ce33633bcb
Test for bug #64 , ssh_channel_read doesn't detect errors
2012-12-27 22:01:08 +01:00
Andreas Schneider
fb3f649c76
cmake: Only set -D_FORTIFY_SOURCE=2 if we have optimizations.
2012-12-25 17:35:07 +01:00
Aris Adamantiadis
5dfc474fa8
Benchmarks: parse config files
2012-12-23 23:10:52 +01:00
Aris Adamantiadis
6d61c3ce4a
Fix channel_write to wait during key reexchanges
2012-12-23 23:10:29 +01:00
Aris Adamantiadis
63c3f0e736
Implement key re-exchange
2012-12-23 23:09:50 +01:00
Andreas Schneider
e934ab0816
BUG 82: Fix function names of ssh_forward_*.
2012-12-19 18:15:54 +01:00
Andreas Schneider
9fa53cd932
doc: Fix forward function names.
2012-12-19 18:10:16 +01:00
Andrew Collins
5cd7942801
Fix an invalid strlen comparison in ssh_message_auth_reply_default
...
During the transition to strncat in ssh_message_auth_reply_default,
an invalid strlen comparison was added which causes the function
to fail whenever it's called.
Signed-off-by: Andrew Collins <bsderandrew@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2012-12-19 16:03:49 +01:00
Andreas Schneider
de9bc1fa41
string: Fix memory leak in ssh_string_to_char().
...
This was probably a mistake by me fixing up a patch after merging.
2012-12-13 19:29:46 +01:00
Andreas Schneider
b14df297fa
BUG 97: Fix strtoull() detection on serveral platforms.
2012-12-03 14:00:06 +01:00
Andreas Schneider
3896aa43ff
BUG 96: Guard ntohll() and htonll prototypes correctly.
2012-12-03 13:44:02 +01:00
Andreas Schneider
da8d44ccba
BUG 98: Use __attribute__ ((packed)) only with GCC.
2012-12-03 13:19:29 +01:00
Andreas Schneider
c6fc69fbdd
BUG 97: Remove obsolete hsterror().
...
This function is pretty much obsolete on most platforms. The standard
errno should be used. If it is not enough on Windows we should use
WSAGetLastError() in future.
2012-12-03 13:08:17 +01:00
Andreas Schneider
ab8c7de6f8
BUG 94: Fix big endian issue.
2012-12-03 12:35:36 +01:00
Aris Adamantiadis
cd4e28e7c8
test: Try to fetch wrong values in buffer.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2012-11-27 19:10:41 +01:00
Andreas Schneider
ea0e858de0
priv: Add BURN_BUFFER macro and make sure it isn't optimzed out.
2012-11-23 11:56:21 +01:00
Andreas Schneider
e403596d98
pki: Add a size limit for pubkey files.
2012-11-21 12:44:00 +01:00
Andreas Schneider
571dc42335
CVE-2012-4559: Make sure we don't free name and longname twice on error.
2012-11-14 17:36:24 +01:00
Andreas Schneider
68d04c8e47
CVE-2012-4559: Ensure that we don't free req twice.
2012-11-14 17:36:24 +01:00
Andreas Schneider
bd3acae4f3
CVE-2012-4560: Fix a write one past the end of 'buf'.
2012-11-14 17:36:24 +01:00
Andreas Schneider
894bbf3137
CVE-2012-4560: Fix a write one past the end of the 'u' buffer.
2012-11-14 17:36:24 +01:00
Andreas Schneider
f61813eaea
CVE-2012-4562: Fix a possible infinite loop in buffer_reinit().
...
If needed is bigger than the highest power of two or a which fits in an
integer we will loop forever.
2012-11-14 17:36:22 +01:00
Xi Wang
ad5f306884
CVE-2012-4562: Fix multiple integer overflows in buffer-related functions.
2012-11-14 17:36:19 +01:00
Xi Wang
5ffb8c7cde
CVE-2012-4562: Fix possible integer overflows.
2012-11-14 17:36:16 +01:00
Xi Wang
efaebad323
CVE-2012-4562: Fix possible integer overflow in ssh_get_hexa().
...
No exploit known, but it is better to check the string length.
2012-11-14 17:36:11 +01:00
Xi Wang
cab00c3bfc
pki: Fix integer overflow in ssh_pki_import_privkey_file().
...
If the file size is ULONG_MAX, the call to malloc() may allocate a
small buffer, leading to a memory corruption.
2012-10-22 21:00:08 +02:00
Xi Wang
d404ad7152
channels: Fix integer overflow in generate_cookie().
...
Since the type of rnd[i] is signed char, (rnd[i] >> 4), which is
considered as arithmetic shift by gcc, could be negative, leading
to out-of-bounds read.
2012-10-22 21:00:08 +02:00
Andreas Schneider
a4ffaff550
channels1: Add missing request_state and set it to accepted.
...
This fixes bug #88 .
2012-10-22 18:05:06 +02:00
Andreas Schneider
e164b236c6
auth1: Reset error state to no error.
...
This fixes bug #89 .
2012-10-22 18:01:39 +02:00
Andreas Schneider
166ccef8dc
session: Fix a possible use after free in ssh_free().
...
We need to cleanup the channels first cause we call ssh_channel_close()
on the channels which still require a working socket and poll context.
Thanks to sh4rm4!
2012-10-22 17:37:32 +02:00
Andreas Schneider
f2e498c7db
cmake: Set GNU compiler flags also for clang.
2012-10-22 16:05:39 +02:00
Andreas Schneider
dde0404dfb
cmake: Add message if we build with static library.
2012-10-15 11:55:42 +02:00
Andreas Schneider
f86b2bf743
doc: Update copyright policy.
2012-10-14 19:58:07 +02:00
Andreas Schneider
13c26f0733
options: Fix documentation of ssh_options_get_port().
2012-10-14 19:53:51 +02:00
Andreas Schneider
f5d8bdf946
doc: Update doxygen config.
2012-10-14 19:52:28 +02:00
Andreas Schneider
f4f2237263
doc: Use the correct channel functions.
2012-10-14 19:44:02 +02:00
Andreas Schneider
7e93edc722
cmake: Add better check to detect -fvisibility=hidden.
2012-10-14 18:40:05 +02:00
Andreas Schneider
95ab34696b
kex: Use getter functions to access kex arrays.
...
This should fix the build on OpenIndiana.
2012-10-12 17:46:37 +02:00
Andreas Schneider
82711acd39
cmake: Fix building with gcrypt support.
2012-10-12 17:07:20 +02:00
Andreas Schneider
e8118c5be4
tests: Add a valgrind suppression for getaddrino leak.
...
https://bugzilla.redhat.com/show_bug.cgi?id=859717
2012-10-12 14:45:54 +02:00
Andreas Schneider
a59a379ce4
tests: Add a valgrind suppression for OPENSSL_cleanse().
2012-10-12 14:45:54 +02:00
Andreas Schneider
0bd2bbefa7
scp: Make sure buffer is initialzed.
...
Found by Coverity.
2012-10-12 14:45:54 +02:00
Andreas Schneider
3d390cf6ff
pki: Make sure the key_buf is null terminated.
...
Found by Coverity.
2012-10-12 14:45:54 +02:00
Andreas Schneider
e04dc45f20
misc: Use a fixed buffer for getenv().
2012-10-12 14:45:54 +02:00
Andreas Schneider
de34a64895
poll: Fix sizeof in ssh_poll_ctx_resize().
...
sizeof(ssh_poll_handle *) is to be equal to sizeof(ssh_poll_handle), but
this is not a portable assumption.
Found by Coverity.
2012-10-12 14:45:54 +02:00
Andreas Schneider
46f22576b0
legacy: Use snprintf instead of sprintf.
...
Found by Coverity.
2012-10-12 14:45:54 +02:00
Andreas Schneider
2f8ddc6e65
dh: Don't use strcat for ssh_get_hexa().
...
This is just hardening the code.
Found by Coverity.
2012-10-12 14:45:54 +02:00
Andreas Schneider
b1287cd946
server: Use strncat instead of strcat.
...
This is just hardening the code.
Found by Coverity.
2012-10-12 14:45:54 +02:00
Andreas Schneider
a660177a6e
misc: Use strncpy instead of strcat.
...
This is just hardening the code.
Found by Coverity.
2012-10-12 14:45:36 +02:00
Andreas Schneider
0a4ea19982
pki: Fix a possible null pointer dereference.
...
Found by Coverity.
2012-10-12 08:07:02 +02:00
Andreas Schneider
0bf2dd81e6
messages: Fix memory leaks in user request callback.
2012-10-12 08:07:02 +02:00
Andreas Schneider
ecb6cfd053
connect: Don't leak the addressinfo on error.
2012-10-12 08:07:02 +02:00
Andreas Schneider
ba220adb84
connect: Don't leak the file descriptor on error.
...
Found by Coverity.
2012-10-12 08:07:02 +02:00
Andreas Schneider
802e4133cb
session: Don't leak memory in ssh_send_debug().
...
Found by Coverity.
2012-10-12 08:07:02 +02:00
Andreas Schneider
dde3deb9ea
channels: Don't leak memory in channel_rcv_request callback.
...
Found by Coverity.
2012-10-12 08:07:02 +02:00
Andreas Schneider
66045054f4
auth: Don't leak memory on error in info request callback.
...
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
96e0301b58
dh: Don't leak 'f' on error.
...
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
029d165b61
legacy: Don't leak the key struct on error.
...
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
4e7736444f
server: Don't leak memory on calling ssh_string_from_char().
...
Also check the return values.
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
7254390ac2
pki: Don't leak the signature on error paths.
...
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
188c596803
sftp: Don't leak owner and group in sftp_parse_attr_4.
2012-10-12 08:07:01 +02:00
Andreas Schneider
0295301928
known_hosts: Don't leak memory in ssh_write_knownhost error paths.
...
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
a6e7d1f255
agent: Fix some memory leaks in error paths.
...
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
f2c183b413
include: Fix an include recursion.
...
It includes itself: libssh.h -> legacy.h -> libssh.h.
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
5e8e21d106
options: Check return code of ssh_iterator_value.
...
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
bcc00eec9b
kex: Don't compare an array to null.
...
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
53008fb5d4
string: Don't compare an array to null.
...
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
9338fb8e5e
message: Set correct request type.
...
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
ec5b4d377f
sftpserver: Add missing break statement.
...
Found by Coverity.
2012-10-12 08:07:01 +02:00
Andreas Schneider
6352b3d93a
server: Fix for loop to free server methods.
...
Found by Coverity.
2012-10-12 08:06:55 +02:00
Andreas Schneider
b8de9e75d0
client: If session is NULL we can't set an error.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
ec56d1d453
match: Don't dereference 's' directly.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
87036839f9
example: Simplify auth_callback of the client.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
131a0de32e
auth: Make error handling code reachable again.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
3e93836e8b
pki: Make error handling code reachable again.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
21db70888a
socket: Check return value of buffer function.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
bb2848de5a
channels: Check return values of buffer functions.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
6acce40a28
scp: Check return value of ssh_channel_poll.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
41269874f5
packet: Check return values of buffer functions.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
9abe591843
client: Check return value of ssh_handle_packets_termination.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
114cc51a10
pcap: Check return codes of buffer_add_* functions.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
9fe47da903
torture: Fix keyboard interactive authentication.
2012-10-09 10:11:55 +02:00
Andreas Schneider
362be13156
tests: Make sure the array is null terminated.
2012-10-07 23:23:33 +02:00
Andreas Schneider
e17fcd70f9
torture: Use new userauth functions.
2012-10-07 23:21:17 +02:00
Andreas Schneider
5f0f334d1c
pki: Don't leak memory in pubkey to blob.
2012-10-07 22:36:06 +02:00
Andreas Schneider
996b7cae26
pki: Make sure we don't double free pointers.
2012-10-07 22:35:33 +02:00
Andreas Schneider
b219d1890c
tests: Don't leak memory in options test.
2012-10-07 22:15:20 +02:00
Andreas Schneider
bfa568e448
pki: Check for no memory available calling ssh_key_new().
2012-10-07 22:04:58 +02:00
Andreas Schneider
ff53664f54
sftp: Fix a possible null pointer dereference in sftp_async_read.
2012-10-07 22:03:35 +02:00
Andreas Schneider
b811b89f57
channels1: Fix severa possible null pointer dereferences.
2012-10-07 22:01:48 +02:00
Andreas Schneider
3db2ac41eb
pki: Handle error of pki_import_pubkey_buffer() correctly.
2012-10-07 21:53:37 +02:00
Andreas Schneider
ca74d91d50
example: Clear the password.
2012-10-07 21:49:45 +02:00
Andreas Schneider
956cf94f70
server: Removed unused variable keytype in the ecdsa case.
2012-10-07 21:31:49 +02:00
Andreas Schneider
191faea325
misc: Use size_t for len.
2012-10-07 18:06:33 +02:00
Andreas Schneider
0493c1fea9
tests: Don't run ecdh tests if not supported by crypto lib.
2012-10-07 12:04:58 +02:00
Andreas Schneider
ecd2ee95e7
kex: Fix supported methods index.
2012-10-07 12:03:54 +02:00
Andreas Schneider
c81010e2f7
test: Use cmocka instead of cmockery.
...
cmocka is the successor of cmockery.
http://git.cryptomilk.org/projects/cmocka.git/
2012-10-07 11:10:27 +02:00
Andreas Schneider
c078e36219
example: Fix a build warning.
2012-10-07 10:56:10 +02:00
Andreas Schneider
c5782b7486
session: Make sure we don't segfault on freeing id.
2012-10-07 10:52:54 +02:00
Dmitriy Kuznetsov
1e836a03d2
gcrypt: Fix simple DES support.
2012-10-05 11:22:15 +02:00
Andreas Schneider
ceb8072b34
channel: Fix a possible null pointer dereference.
2012-10-05 11:17:06 +02:00
Andreas Schneider
656fd60110
channels: Fix a possible null pointer dereference.
2012-10-05 11:16:03 +02:00
Andreas Schneider
6092596199
getpass: Fix a memory leak in ssh_gets() on error.
2012-10-05 11:12:14 +02:00
Andreas Schneider
22f607649d
sftp: Harden sftp_extension_supported() against null pointers.
2012-10-05 11:12:14 +02:00
Andreas Schneider
b5c4b090da
sftp: Fix a memory on error in sftp_opendir().
2012-10-05 11:12:13 +02:00
Andreas Schneider
fd2064d0b4
messages: Fix error path of ssh_packet_userauth_info_response.
...
This fixes a memory leak on error.
2012-10-05 11:12:13 +02:00
Andreas Schneider
8567fc8d8c
messages: Fix a possible null pointer dereference.
2012-10-05 11:12:13 +02:00
Andreas Schneider
61d032fc03
misc: Don't leak memory on ssh_path_expand_escape() on error.
2012-10-05 11:12:13 +02:00
Andreas Schneider
dc8103925c
packet: Fix a possible segfault.
2012-10-05 11:12:13 +02:00
Andreas Schneider
280ce3fe93
session: Fix a memory leak in ssh_new() on error.
2012-10-05 11:12:13 +02:00
Andreas Schneider
332f1a2a51
channels: Fix a memory leak in ssh_channel_select().
2012-10-05 11:12:13 +02:00
Andreas Schneider
213321d706
options: Fix a memory in ssh_options_copy() on error.
2012-10-05 11:12:13 +02:00
Andreas Schneider
cddfe602cc
options: Fix a memory leak if we can't add an idenity.
2012-10-05 11:08:51 +02:00
Andreas Schneider
d0889dd9ea
kex: Fix simpledes with gcrypt.
2012-09-25 15:29:38 +02:00
Andreas Schneider
3c5235fdc0
dh: Fix dh_generate_e() with gcrypt.
2012-09-25 15:25:52 +02:00
Andreas Schneider
ed94e7f8a8
messages: Fix a possible null pointer dereference.
2012-09-24 20:57:40 +02:00
Christophe Baribaud
9460c5906f
MSVC Windows and winsock2.h
...
With Microsoft Visual Studio, winsock2.h shall be included before
ws2tcpip.h
Signed-off-by: Christophe Baribaud <christophe.baribaud@gmail.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2012-09-21 09:45:03 +02:00
Christophe Baribaud
160da5810f
Finds zlib in a debug only build (windows)
...
Signed-off-by: Christophe Baribaud <christophe.baribaud@gmail.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2012-09-21 09:44:19 +02:00
Dmitriy Kuznetsov
a18106d3af
channels: Fix channel_request_pty_size1 always returning an error.
...
Fixes bug #88 .
2012-09-07 12:23:55 +02:00
Andreas Schneider
3739bd99c5
channels: Fix return value of ssh_channel_request_pty_size with SSHv1.
...
Thanks to Dmitriy Kuznetsov <dk@yandex.ru >.
2012-09-07 12:21:28 +02:00
Dmitriy Kuznetsov
320951f42f
kex: Add simple DES support for SSHv1.
2012-09-07 12:19:43 +02:00
Andreas Schneider
a3f83e7274
changelog: Update features.
2012-09-05 17:03:26 +02:00
Dmitriy Kuznetsov
e689375e45
dh: Add support for diffie-hellman-group14-sha1.
2012-09-04 16:17:46 +02:00
Andreas Schneider
977951e96a
pki: Open privkey file in binary mode.
...
This is needed to correctly detect carriage return.
2012-09-04 11:28:33 +02:00
Andreas Schneider
782b2e37c6
build: Fix missing struct in_addr warning.
2012-07-17 18:16:07 +02:00
Andreas Schneider
a92c97b2e1
sftp: Fix bug in sftp_mkdir not returning on error.
...
resolves : #84
2012-07-17 18:12:44 +02:00
Andreas Schneider
43e3a8e497
socket: Add a SSH_WRITE_PENDING socket status.
2012-07-17 18:05:51 +02:00
Andreas Schneider
8ef45e00c7
auth: Improve ssh_userauth_kbdint_setanswer() documentation.
...
Thanks to Arto Karppinen.
2012-07-17 18:04:55 +02:00
Andreas Schneider
e8cebc2a37
auth: Fix ssh_userauth_kbdint*() documentation.
...
Thanks to Arto Karppinen.
2012-07-17 18:04:55 +02:00
Andreas Schneider
8624651de3
auth: Fix ssh_userauth_password() documentation.
2012-07-17 18:04:55 +02:00
Andreas Schneider
8b8d9dc83a
connect: Fix a build warning.
2012-07-17 17:34:27 +02:00
Oliver Gasser
ad24427f03
options: Add option to specify host keys string.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2012-07-06 11:04:05 +02:00
Andreas Schneider
2ed9d2160d
dh: Add a doc hint to ssh_string_free_char() for ssh_get_hexa().
2012-06-11 23:14:25 +02:00
Andreas Schneider
9bac67a05a
bind: Fix build.
2012-05-09 09:04:32 +02:00
Andreas Schneider
a3cb5b0707
server: Add ecdsa hostkey support.
2012-05-08 11:34:24 +02:00
Andreas Schneider
88d6e6253c
agent: Do not fail reads with EPIPE if there is not enough data to read.
2012-04-10 12:04:44 +02:00
Andreas Schneider
a3cf1e4acc
Fix typo.
2012-03-09 18:14:13 +01:00
Andreas Schneider
62657d5f87
auth: Fix build warning.
2012-02-20 09:44:36 +01:00
Andreas Schneider
1973e833f2
server: Add ecdsa hostkey support.
2012-02-19 18:49:07 +01:00
Andreas Schneider
387d9e4855
examples: Fix sparse warnings in sshd examples.
2012-02-19 13:26:03 +01:00
Andreas Schneider
2ca0a9cdb2
examples: Make variabes static in client sample.
...
Fixes sparse warnings.
2012-02-19 13:26:03 +01:00
Andreas Schneider
29ad0d19f9
examples: Make variables static in scp example.
...
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
c31004442a
examples: Make variables static in scp example.
...
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
e68b763a67
threads: Make libcrypto_mutexes static.
...
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
72db38b31d
threads: Fix function defintions.
...
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
300caf9ff3
pcap: Fix definition of ssh_pcap_file_new().
...
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
3888a050f8
packet: Make default_packet_handlers static.
...
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
66aaa6f573
misc: Improve byte swapping of ntohll().
...
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
3582e386b7
misc: Fix definitions of ssh_list_new().
...
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
72001ff8cc
auth: Improve doc of ssh_userauth_kbdint_getprompt().
2012-02-19 13:25:22 +01:00
Andreas Schneider
b7507fc85e
cmake: Update FindCMokery.
2012-02-08 20:10:45 +01:00
Andreas Schneider
f558c66e78
doc: Add a note about makefile generators on Windows.
2012-02-08 19:10:41 +01:00
Andreas Schneider
3bb381fad7
doc: Add more infor about Windows binaries.
2012-02-08 19:07:43 +01:00
zhengfish
88964cb541
Fixed a compiling error in src/log.c on Win32 with MSVC
2012-02-07 09:59:33 +01:00
Andreas Schneider
8fea5c7a28
tests: Fix known_hosts test.
2012-02-07 09:54:54 +01:00
Andreas Schneider
19090c5cd8
SubmittingPatches: Fix version number and typo.
2012-02-06 16:21:32 +01:00
Andreas Schneider
f0589a2caf
Add SubmittingPatches document.
2012-02-06 16:12:06 +01:00
Andreas Schneider
50e9608dcd
auth: Fix SSHv1 build.
2012-02-06 09:54:59 +01:00
Andreas Schneider
ee774479de
session: Use a struct for all options.
2012-02-05 11:50:49 +01:00
Andreas Schneider
840f75f10c
tests: Turn debug crypto on in ctest.
2012-02-05 10:53:43 +01:00
Andreas Schneider
c0a7a84e92
dh: Fix build with DEBUG_CRYPTO.
2012-02-05 10:52:39 +01:00
Andreas Schneider
4019dbed85
pki: Add ecdsa support for signature verification.
2012-02-04 23:45:01 +01:00
Andreas Schneider
216cb8b1aa
crypto: Add evp hashing function.
2012-02-04 23:44:55 +01:00
Andreas Schneider
fb6855a821
pki: Fix openssl ecdsa signature from blob.
2012-02-04 23:04:26 +01:00
Andreas Schneider
0770843309
pki: Fix ssh_pki_log function.
2012-02-04 23:03:53 +01:00
Andreas Schneider
f639b8ec1f
pki: Make a strcmp better readable.
2012-02-04 22:09:43 +01:00
Andreas Schneider
c209c6d5ac
kex: Add support for ecdsa hostkeys.
2012-02-04 22:08:55 +01:00
Andreas Schneider
b136a986a0
kex: Add a define for the kex method size.
2012-02-04 22:08:08 +01:00
Andreas Schneider
e93f17cad8
pki: Don't free a const key!
2012-02-04 22:07:03 +01:00
Andreas Schneider
47226d9d44
sftp: Fix memory leak in sftp_free() on server.
...
Thanks to Tom Judge for the report.
2012-02-04 21:06:37 +01:00
Andreas Schneider
a311ec32b1
ecdh: Fix a memory leak in ecdh_build_k().
...
Thanks to Tom Judge for the report.
2012-02-04 21:06:33 +01:00
Andreas Schneider
4223c8a116
ecdh: Fix a memory leak in ssh_server_ecdh_init().
...
Thanks to Tom Judge for the report.
2012-02-04 21:06:11 +01:00
Andreas Schneider
e4d0ac7ba1
pki: Update copyright.
2012-02-04 20:37:29 +01:00
Andreas Schneider
84dfa13fe8
cmake: Disable gcrypt ECC.
2012-02-04 20:35:27 +01:00
Andreas Schneider
19f7458ed3
pki: Add ecdsa gcrypt stubs.
2012-02-04 20:25:24 +01:00
Andreas Schneider
3e83bc665f
cmake: Enable ECC support for GCrypt 1.5.0 or newer.
2012-02-04 20:25:07 +01:00
Andreas Schneider
ddcfe95bbd
cmake: Update GCrypt module.
2012-02-04 20:09:51 +01:00
Andreas Schneider
679cd9efd8
pki: Fix build if you don't have ECC support.
2012-02-04 18:37:05 +01:00
Andreas Schneider
ae59049347
tests: Test ecdsa key generation and signing.
2012-02-04 18:37:05 +01:00
Andreas Schneider
b1434fd09b
pki: Add ecdsa support to do_sign_sessionid.
2012-02-04 18:37:04 +01:00
Andreas Schneider
79383cf8ee
pki: Add ecdsa support to do_sign.
2012-02-04 18:37:04 +01:00
Andreas Schneider
33b0cfc199
pki: Add ecdsa support for signature_verify.
2012-02-04 18:37:04 +01:00
Andreas Schneider
e9f5c7421e
pki: Add ecdsa support for signature_from_blob.
2012-02-04 18:37:04 +01:00
Andreas Schneider
9070b04184
pki: Add ecdsa support for signature_to_blob.
2012-02-04 18:37:04 +01:00
Andreas Schneider
b309dd8fb7
pki: Add support to generate ecdsa keys.
2012-02-04 18:37:04 +01:00
Andreas Schneider
91372e298d
tests: Add duplicate ecdsa key test.
2012-02-04 18:37:04 +01:00
Andreas Schneider
14bb23ae3b
tests: Add ecdsa pubkey_from_privkey test.
2012-02-04 18:37:04 +01:00
Andreas Schneider
0e1992a9cc
tests: Add ecdsa publickey_from_privatekey test.
2012-02-04 18:37:04 +01:00
Andreas Schneider
ecbdc589f4
pki: Fix ecdsa key dup.
2012-02-04 18:37:04 +01:00
Andreas Schneider
fc8a182823
tests: Add a testing of importing ecdsa pubkeys.
2012-02-04 18:37:04 +01:00
Andreas Schneider
f35c284761
pki: Add support to import ecdsa pubkeys.
2012-02-04 18:37:04 +01:00
Andreas Schneider
fa37965ab0
cmake: Add a define to see if we have ecc support.
2012-02-04 18:37:04 +01:00
Andreas Schneider
3c7571e61b
pki: Add support for export ecdsa pubkeys.
2012-02-04 18:37:04 +01:00
Andreas Schneider
d44a79da9b
tests: Add test for reading ecdsa privkey.
2012-02-04 18:37:04 +01:00
Andreas Schneider
ea74a12b70
pki: Add support to import ecdsa private keys.
2012-02-04 18:37:03 +01:00
Andreas Schneider
b4823252ca
pki: Add ECDSA for key compare.
2012-02-04 18:37:03 +01:00
Andreas Schneider
244fa0474b
pki: Fix typo in error message.
2012-02-04 18:37:03 +01:00
Anthony VEREZ
9e5b3914de
examples: Fix PTY allocation error.
2012-01-30 09:48:01 +01:00
Martin Drasar
31727bf33a
Ignore and debug messages can be sent using public API
...
Signed-off-by: Martin Drasar <drasar@ics.muni.cz >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2012-01-05 11:26:53 +01:00
Lee Hambley
a15399992e
Fix logic erorr with brace-less conditional statement
2012-01-03 19:41:28 +01:00
rofl0r
89733e697f
patch pki_gcrypt.c to be compilable without CMake
2012-01-02 16:41:52 +01:00
rofl0r
2ffbdb0492
commit a7e14524c4f7903f607cdcd02b83782e89f0a82c
2012-01-02 16:31:37 +01:00
rofl0r
4305da29a1
session: Cleanup timeout functions.
...
It is possible that we get unrelated packets while waiting for
termination, thus waiting indefinitely. As a workaround we have to
check the user-supplied timeout.
2012-01-02 12:39:43 +01:00
Andreas Schneider
2f861a858b
message: Fix compiler warning.
2012-01-02 09:31:40 +01:00
Andreas Schneider
74f5f43409
auth: Fix public key authentication so we can continue.
2012-01-01 23:53:21 +01:00
Andreas Schneider
0b7b699ced
auth: Fix a possible double free.
2012-01-01 23:53:14 +01:00
rofl0r
c08bdf5917
message: Handle all unknown global messages.
...
Reply to unknown global messages as required by the RFC. Therefore
keepalive@openssh.com style messages should get treated in a sane way.
2012-01-01 20:53:13 +01:00
Andreas Schneider
7d26f7ceab
torture: Fix compilation with cmockery.
2011-12-27 07:14:08 +01:00
Andreas Schneider
90893fd1a3
options: Fix typo in ssh_options_get() docs.
2011-12-14 13:45:19 +01:00
Andreas Schneider
76fad364cd
sftp: Add references to sftp_get_error() to docs.
2011-11-17 19:12:31 +01:00
Andreas Schneider
ba4f10dc46
agent: Improve logging.
2011-11-16 11:32:06 +01:00
Andreas Schneider
ce0324770d
kex: Fix some build warnings.
2011-11-10 14:46:22 +01:00
Andreas Schneider
bc2ab9b414
bind: Add more error messages.
2011-11-09 10:21:51 +01:00
Andreas Schneider
ce26b8d777
packet: Use a define for the macsize.
2011-11-09 10:13:26 +01:00
Andreas Schneider
99d2cf02a6
options: Add missing argument check.
2011-11-03 18:24:52 +01:00
Lee Hambley
17f396ffab
Improve ssh_options_get(ssh_session, enum ssh_options_e, char**).
...
* Use SSH_ERROR and SSH_OK instead of `-1` and `0`.
* Re-factor for code duplication
* No longer call `ssh_set_error_invalid(ssh_session)` when the
ssh_session is NULL.
2011-11-03 18:24:02 +01:00
Andreas Schneider
2c04994443
pki: Add a ssh_key_cmp() function.
2011-10-29 19:58:28 +02:00
Andreas Schneider
e799c0ce7d
dh: Add ssh_get_publickey().
2011-10-29 19:58:28 +02:00
Andreas Schneider
2cc48db673
tests: Fix build warning.
2011-10-29 19:58:10 +02:00
Lee Hambley
e797781bb5
Implement ssh_options_get_port(ssh_session, unsigned int*).
2011-10-28 12:15:12 +02:00
Lee Hambley
6bd95b50f5
Implement ssh_options_get(ssh_session, enum ssh_options_e, char**).
2011-10-28 12:14:34 +02:00
Andreas Schneider
d8d9755b7d
bind: Fix ssh_bind_listen in normal case.
2011-10-17 19:27:29 +02:00
Aris Adamantiadis
1fcddebadc
server: use app-provided bind socket when available
2011-10-13 22:30:27 +02:00
Aris Adamantiadis
551a0c855b
server: ssh_bind_accept_fd
...
This function will not call accept() but use function parameter
instead
2011-10-13 22:23:48 +02:00
Andreas Schneider
85cc582d4a
doc: Improve doc of ssh_get_pubkey_hash().
2011-10-04 10:47:05 +02:00
Aris Adamantiadis
c340192144
packet: cleaner logs with less redundant info
2011-10-03 13:52:19 +03:00
Aris Adamantiadis
b6d0b531f8
server: pubkey auth doesn't work with ecdh
2011-09-25 23:47:55 +02:00
Aris Adamantiadis
5c19cda280
Fix warning
2011-09-24 14:08:52 +02:00
Aris Adamantiadis
e38f2f933b
pki: ssh_pki_generate
...
for both gcrypt and openssl
2011-09-24 01:36:58 +02:00
Aris Adamantiadis
21d68112b8
Torture: test new ssh_pki_generate function
2011-09-24 01:36:39 +02:00
Aris Adamantiadis
3fa5293aec
pki: DO actually verify signatures
...
Would have been an embarrassing bug...
2011-09-24 00:25:44 +02:00
Andreas Schneider
6859e4f4ec
build: Fix zlib support.
2011-09-23 22:57:21 +02:00
Aris Adamantiadis
43fc7553f8
torture_algorithm: follow verbosity
2011-09-23 22:57:05 +02:00
Aris Adamantiadis
717840fc09
torture: check for presence of ssh agent
2011-09-23 22:33:21 +02:00
Aris Adamantiadis
046aa02f39
Fix bugs found by clang
2011-09-23 22:27:46 +02:00
Andreas Schneider
8a3b02f68d
cmake: Fix library linking.
2011-09-23 08:00:58 +02:00
Aris Adamantiadis
dad35304b6
channels: fix embarrasing channel_read_nonblocking bug
2011-09-22 13:48:21 +03:00
Andreas Schneider
744b7720af
build: Fix SSHv1 build.
2011-09-22 12:07:09 +02:00
Andreas Schneider
5083742192
packet: Move packet callbacks to packet_cb.c.
2011-09-18 21:37:18 +02:00
Andreas Schneider
dc42a1757f
gzip: Fix zlib support.
2011-09-18 21:37:18 +02:00
Andreas Schneider
7202a26b6c
priv: Remove dead prototype.
2011-09-18 21:37:17 +02:00
Andreas Schneider
b785014a15
crypt: Rename to packet_crypt.
2011-09-18 21:37:17 +02:00
Andreas Schneider
acfc8ea83f
priv: Remove crypto.h and add correct includes to src files.
2011-09-18 21:37:17 +02:00
Andreas Schneider
c2686b8feb
socket: Move socket function to right location.
2011-09-18 21:37:17 +02:00
Andreas Schneider
e7009fe8f3
priv: Create crc32.h.
...
As crc32 is only needed by SSHv1, build it only with SSHv1.
2011-09-18 21:37:17 +02:00
Andreas Schneider
ffb827b539
priv: Move gcrypt functions to gcrypt header.
2011-09-18 21:37:17 +02:00
Andreas Schneider
33754c391f
priv: Start to remove enter_function.
2011-09-18 21:37:17 +02:00
Andreas Schneider
d7fa15df83
priv: Move kex functions to kex header.
2011-09-18 21:37:17 +02:00
Andreas Schneider
519291558d
priv: Move options and config prototypes to own header.
2011-09-18 21:37:17 +02:00
Andreas Schneider
abd9856c6a
priv: Move defines to the top.
2011-09-18 21:37:17 +02:00
Andreas Schneider
4a6a0987a8
client: Remove unused variable.
2011-09-18 21:36:40 +02:00
Andreas Schneider
3622ac83f6
legacy: Fix possible segfault with publickey_from_file().
...
This function is obsolete.
2011-09-18 21:36:23 +02:00
Aris Adamantiadis
f61269a2ef
ECDH key exchange working
2011-09-18 20:34:16 +02:00
Aris Adamantiadis
d24e353e38
pki: null ptr check
2011-09-18 20:34:16 +02:00
Aris Adamantiadis
09b33b1b6e
server: split dh_handsake_server
2011-09-18 20:34:16 +02:00
Aris Adamantiadis
af09313eac
crypto: rename crypto_struct -> ssh_cipher_struct
2011-09-18 20:34:16 +02:00
Aris Adamantiadis
ac41a083ef
kex: moved KEX structures to ssh_crypto_struct
2011-09-18 20:34:16 +02:00
Aris Adamantiadis
48980573c1
wrapper.c: cleanup
2011-09-18 20:34:15 +02:00
Aris Adamantiadis
22668bcdae
kex: have server_kex use the elected methods
2011-09-18 20:34:15 +02:00
Aris Adamantiadis
07abc3406d
kex: split key selection and sending
2011-09-18 20:34:15 +02:00
Aris Adamantiadis
1b10b175fc
dh: fix segfault in server
2011-09-18 20:34:15 +02:00
Aris Adamantiadis
8f1161f649
scp: introduce a 64bits getter to respect ABI
2011-09-18 20:34:15 +02:00
Andreas Schneider
2cc95e1e08
doc: Fix threading documentation.
2011-09-17 21:32:29 +02:00
Andreas Schneider
fa7798833a
pki: Use ssh_log_function() for ssh_pki_log().
2011-09-17 11:09:19 +02:00
Andreas Schneider
b96943e861
log: Split do_ssh_log().
2011-09-17 11:05:17 +02:00
Andreas Schneider
569312f7bd
log: Remove unneeded ssh_log_function().
2011-09-17 11:00:33 +02:00
Andreas Schneider
c2883c1f37
auth: Use the new SSH_LOG function.
2011-09-17 10:38:08 +02:00
Andreas Schneider
c19c638d74
error: Use macros for error functions.
2011-09-17 10:38:08 +02:00
Andreas Schneider
afa56e0102
session: Use defines for ssh_handle_packets().
2011-09-17 10:38:08 +02:00
Andreas Schneider
544747d02c
crypt: Fix function definition.
2011-09-15 11:04:00 +02:00
Aris Adamantiadis
68bab2a490
SSH1: handle exit-status message (channels would not close)
2011-09-14 22:53:01 +02:00
Aris Adamantiadis
c4701a34d3
channels1: made channel_write1 nonblocking
2011-09-14 22:39:05 +02:00
Aris Adamantiadis
36ec488663
channels: don't send SSH2 packets on SSH1 !
2011-09-14 22:35:12 +02:00
Aris Adamantiadis
714aeca91f
SSH1: fix kex bugs introduced in refactoring
2011-09-14 22:21:43 +02:00
Aris Adamantiadis
af225e68cb
SSH1: make authentication nonblocking
2011-09-14 21:55:54 +02:00
Aris Adamantiadis
ebfb2a5cdb
auth: fix spelling in error message
2011-09-14 20:37:30 +02:00
Aris Adamantiadis
33cf16488b
Revert "auth: Check if we have any prompts."
...
This reverts commit 3b5bdc5db4 .
It's perfectly legit to have only zero prompts.
2011-09-14 20:36:23 +02:00
Aris Adamantiadis
0fa88fdcfe
Auth: fix possible off-by-one
...
No security impact, only triggable by specific API call
2011-09-14 17:28:41 +03:00
Andreas Schneider
49ae226b90
log: Fixed a typo.
2011-09-12 10:46:32 +02:00
Aris Adamantiadis
f3d00e4bc3
tests: nonblocking keyboard-interactive
2011-09-11 17:39:20 +02:00
Aris Adamantiadis
fa68d91869
log: remove the annoying \n between date and message
2011-09-11 17:39:20 +02:00
Aris Adamantiadis
1f31415760
auth: made keyboard-interactive nonblocking
2011-09-11 17:39:20 +02:00
Aris Adamantiadis
27dea35608
Test: added torture_auth_autopubkey_nonblocking
2011-09-11 17:22:27 +02:00
Aris Adamantiadis
ff5bf51af1
Auth: nonblocking ssh_userauth_pubkey_auto
2011-09-11 17:22:27 +02:00
Aris Adamantiadis
7b663df185
Tests: unit test for agent authentication
2011-09-11 17:22:27 +02:00
Aris Adamantiadis
33bd3d6cd9
auth: Implement nonblocking ssh_auth_agent
2011-09-11 17:22:26 +02:00
Aris Adamantiadis
28bfc7645c
auth: different code for auth_agent
2011-09-11 17:22:26 +02:00
Aris Adamantiadis
ae89dfd6f2
Auth: made ssh_userauth_get_response respect timeout
2011-09-11 17:22:26 +02:00
Andreas Schneider
06e0305100
server: Fix some build warnings.
2011-09-11 15:32:39 +02:00
Andreas Schneider
3b5bdc5db4
auth: Check if we have any prompts.
2011-09-11 15:29:27 +02:00
Andreas Schneider
95ec57f2fd
server: Fix compiler warning.
2011-09-11 15:12:35 +02:00
Andreas Schneider
a5d89624d5
log: Add missing include.
2011-09-11 14:38:44 +02:00
Andreas Schneider
04faa33259
kex: Fix includes.
2011-09-11 08:24:33 +02:00
Andreas Schneider
35dce7e8d1
priv: Remove obsolete ssh_keys_struct.
2011-09-10 12:47:47 +02:00
Andreas Schneider
c8f48a2478
log: Improve the logging function.
2011-09-10 12:38:42 +02:00
Andreas Schneider
08129002de
log: Add new debug log levels.
...
These should be used in future!
2011-09-10 12:31:54 +02:00
Andreas Schneider
b3d62ecba8
agent: Add missing config.h include.
2011-09-10 11:55:50 +02:00
Andreas Schneider
bf72440eff
kex: Split out SSHv1 functions to kex1.c.
2011-09-10 11:03:46 +02:00
Andreas Schneider
77e71ae3b5
dh: Use ssh_string_new() in make_bignum_string().
2011-09-08 19:58:59 +02:00
Andreas Schneider
81017b0fc2
string: Make sure we always have the right byte order.
2011-09-08 19:57:34 +02:00
Andreas Schneider
4a5b72a535
pki: Use ssh_string_get_char().
2011-09-08 16:14:35 +02:00
Andreas Schneider
c1f8b38b78
string: Add ssh_string_get_char().
2011-09-08 16:14:35 +02:00
Andreas Schneider
5581323c2c
string: Use the struct and array for allocating the struct.
2011-09-08 15:50:39 +02:00
Andreas Schneider
55c758d079
auth1: Fix ssh_string usage.
2011-09-08 15:29:05 +02:00
Andreas Schneider
09da9418cc
known_hosts: Fix a free before last use.
2011-09-08 13:42:30 +02:00
Andreas Schneider
6d3d5a446e
known_hosts: Fix a memleak.
2011-09-07 17:51:43 +02:00
Andreas Schneider
11f3b0e684
pki: Add missing ECC ifdef.
2011-09-06 09:44:45 +02:00
Andreas Schneider
ae1f87e37a
options: Fix NULL value handling.
2011-09-06 09:16:54 +02:00
Andreas Schneider
3105b3c205
options: Fix the ssh_options_set() function.
...
This is a refactor so that we check if the values are sane the user
wants to set. If not return an error.
2011-09-05 20:15:34 +02:00
Andreas Schneider
2e83cc925d
known_hosts: Migrate ssh_write_knownhost() to new pki.
2011-09-05 11:28:19 +02:00
Andreas Schneider
808c7a9be4
pki: Add ssh_pki_export_pubkey_rsa1().
2011-09-05 11:28:19 +02:00
Andreas Schneider
6901e25085
pki_crypto: Add ecdsa support for key duplication.
2011-09-02 23:10:23 +02:00
Andreas Schneider
a0e3facac7
pki: Add ecdsa key support.
2011-09-02 23:10:23 +02:00
Andreas Schneider
6dc7ddde3f
channels: Export ssh_channel_poll_timeout().
2011-09-02 22:40:32 +02:00
Aris Adamantiadis
7e5f1edcb4
auth: fix things broken during merge
2011-09-02 14:09:12 +03:00
Aris Adamantiadis
20f8e73e3e
Update libssh to ssh_handle_packets_termination
...
cherry-picked from 0cb5248
Should resolve all timeout problems
Conflicts:
src/auth.c
src/channels.c
2011-09-02 13:58:37 +03:00
Aris Adamantiadis
ef5701a535
Channels: fix the "server specified invalid channel" bug
...
Resolved by introducing a flag entry in channel structure.
2011-09-02 13:50:06 +03:00
Aris Adamantiadis
7d347aa6f4
channel: ssh_channel_read is nonblocking, + docfixes
...
cherry-picked from 6091147
Conflicts:
src/channels.c
2011-09-02 13:49:05 +03:00
Aris Adamantiadis
6d8bb956c5
channels: replaced bugged lists with ssh_list
...
cherry-picked from 0aef5f
Conflicts:
src/session.c
2011-09-02 13:46:10 +03:00
Aris Adamantiadis
3eece8ac0b
SSH1: fix build
2011-09-02 11:43:12 +03:00
Aris Adamantiadis
92c8a71abb
ssh_select converted to ssh_event, and bugfix to ssh_channel_select
2011-09-02 11:43:12 +03:00
Aris Adamantiadis
b5351f2809
poll: resolve use-after-free + inconsistent callbacks call
...
This code was weird in the first place. I suspect my change will break something else
(probably the appcode that needed it). ssh_poll_ctx_free is not a good
place to send exception callbacks imho.
2011-09-02 11:43:12 +03:00
Aris Adamantiadis
d1ebc4697a
channels: ssh_channel_select implemented with ssh_poll
...
Should fix #56
2011-09-02 11:43:11 +03:00
Aris Adamantiadis
7f5206b8ac
sample: fix ssh_channel_read
2011-09-02 11:43:11 +03:00
Aris Adamantiadis
cb2a111fa1
channel: implement ssh_channel_poll_timeout
...
Resolves bug #57
2011-09-02 11:43:11 +03:00
Aris Adamantiadis
555d1a4347
benchmarks: fix some bugs
2011-09-02 11:43:07 +03:00
Aris Adamantiadis
17ae216340
Channels: increase window size x10
...
Provides me a 3x performance boost for async sftp, 5x for sync sftp
(on localhost)
2011-09-02 11:43:07 +03:00
Aris Adamantiadis
3a5cc18b32
benchmarks: sftp_async + few changes
2011-09-02 11:43:07 +03:00
Aris Adamantiadis
b11567ed9b
benchmarks: refactoring + sync sftp tests
...
no surprise, sync sftp is much slower, even for localhost,
especially for download.
2011-09-02 11:43:07 +03:00
Aris Adamantiadis
faaf334aa3
benchmarks: added "data" option
2011-09-02 11:43:05 +03:00
Aris Adamantiadis
5d9cd8bf39
benchmarks: added raw_download test
2011-09-02 11:43:05 +03:00
Aris Adamantiadis
a2c94abb92
channels: made the remaining calls nonblocking + fix #52
2011-09-02 11:42:59 +03:00
Aris Adamantiadis
510c741229
channels: use hard random for the X11 cookie
...
We are in a security library or we are not.
2011-09-02 11:42:59 +03:00
Aris Adamantiadis
f9dad9ad68
channels: made all channel requests nonblocking
2011-09-02 11:42:59 +03:00
Aris Adamantiadis
7363b29427
unittests:make sftp_dir pass on my laptop
2011-09-02 11:41:04 +03:00
Aris Adamantiadis
99e6fde751
scp: Fixed documentation bug #9
2011-09-02 11:40:52 +03:00
Andreas Schneider
5c48438dcb
doc: Improve doc of ssh_message_auth_pubkey().
2011-08-30 23:11:32 +02:00
Andreas Schneider
b5b3db6c90
pki: Check the type of the key blob earlier.
2011-08-30 22:35:01 +02:00
Andreas Schneider
e5a39a3ae9
keys: Remove keys.h where it is obsolete.
2011-08-30 12:15:20 +02:00
Andreas Schneider
fedfbf9563
keys: Remove obsolete keys.c.
2011-08-30 12:15:20 +02:00
Andreas Schneider
7093ac986d
keys: Remove dead prototypes.
2011-08-30 12:15:20 +02:00
Andreas Schneider
64de14f51e
keys: Move publickey_from_privatekey() to legacy.c.
2011-08-30 12:15:20 +02:00
Andreas Schneider
fe246db27d
keys: Move publickey_free() to legacy.c.
2011-08-30 12:15:20 +02:00
milo
0cbbe39e4f
Include stdio.h for snprintf
2011-08-30 11:39:14 +02:00
Andreas Schneider
822c68eb8e
pki: Use consistent API for ssh_pki_export_privkey_to_pubkey().
2011-08-30 10:28:57 +02:00
Andreas Schneider
60b92e458e
pki: Use consistent API for ssh_pki_export_pubkey_blob().
2011-08-30 10:16:53 +02:00
Andreas Schneider
e236577503
tests: Enable ecdh_sha2_nistp256 test only with openssl.
2011-08-30 09:34:23 +02:00
Andreas Schneider
85d12f6774
cmake: Add ec.h and ecdsa.h checks.
2011-08-30 00:44:46 +02:00
Andreas Schneider
6bf8dfa073
pki: Fix session_id hashing.
...
I don't understand why this code worked before. It was completly wrong.
2011-08-29 22:39:47 +02:00
rofl0r
66188f1af8
channels: Fix possible infinite loop in channel_read().
2011-08-29 21:47:01 +02:00
Jonas Jonsson
d1df255df4
sftp: Handle short reads of sftp_async_read().
...
sftp_async_read() and sftp_async_read_begin() assume that the whole read
will be successful but when this is not the case, the offset will be
wrong.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-08-29 10:05:26 +02:00
Andreas Schneider
a060a235a4
pki: string_* -> ssh_string_*
2011-08-28 22:51:00 +02:00
Andreas Schneider
7a9f65dd94
pki: Refactor ssh_pki_do_sign().
2011-08-28 22:25:33 +02:00
Andreas Schneider
246d20ef23
pki: Refactor _RSA_do_sign().
2011-08-28 22:25:33 +02:00
Andreas Schneider
f803538d21
doc: Fix authentication docs.
2011-08-28 20:08:36 +02:00
Andreas Schneider
292ed71f09
doc: Fix a check in the doc code.
2011-08-28 20:02:27 +02:00
Andreas Schneider
2d9cd48b1d
pki: Cleanup crypto includes.
2011-08-28 14:50:43 +02:00
Andreas Schneider
10d3d73039
pki: Fix gcrypt includes and update copyright.
2011-08-28 14:50:43 +02:00
Andreas Schneider
f02f889111
pki: Get rid of the string.h include in pki_gcrypt.c.
2011-08-28 14:50:43 +02:00
Andreas Schneider
a9eb0020b8
legacy: Move ssh_private_key and ssh_public_key typedefs.
2011-08-28 14:50:43 +02:00
Andreas Schneider
fb4f1412ba
build: Fix the build of keyfiles torture test.
2011-08-28 14:50:28 +02:00
Andreas Schneider
561441105f
pki: Add Windows defines.
2011-08-28 14:29:44 +02:00
Andreas Schneider
7c28d0ce6d
pki: Compile pki_gcrypt.c only if we need it.
2011-08-28 14:29:17 +02:00
Andreas Schneider
5cf23522de
keyfiles: Remove keyfiles.h.
2011-08-28 14:26:40 +02:00
Andreas Schneider
be660e801a
keyfiles: Remove try_publickey_from_file().
2011-08-28 14:24:23 +02:00
Andreas Schneider
bce2c22e45
keyfiles: Make ssh_try_publickey_from_file() legacy.
2011-08-28 14:21:56 +02:00
Andreas Schneider
29ecccb96d
keyfiles: Make ssh_try_publickey_from_file() legacy.
2011-08-28 14:19:07 +02:00
Andreas Schneider
16b47496c1
sftp: Don't create file page.
2011-08-28 13:20:58 +02:00
Andreas Schneider
9379a93c98
doc: Fix some doxygen latex warnings.
2011-08-28 13:17:39 +02:00
Andreas Schneider
21875bc71e
sftp: Improve documentation.
2011-08-28 13:17:27 +02:00
Andreas Schneider
0f41f21227
auth: Refactor and rename kbdauth_send().
2011-08-28 12:54:49 +02:00
Andreas Schneider
98ada12f66
libsshpp: Remove type argument from doc.
2011-08-27 13:58:53 +02:00
Andreas Schneider
0bd99b3773
auth: Fix doc typos.
2011-08-27 13:58:08 +02:00
Andreas Schneider
e5e673bafe
auth: Handle request service timeout in blocking mode.
2011-08-26 23:56:49 +02:00
Andreas Schneider
79ed1bc601
pki: Handle hash correctly.
...
Looks like only DSA in grypt needs a leading zero to mark the has as
positive. See
http://lists.gnupg.org/pipermail/gcrypt-devel/2005-February/000754.html
2011-08-26 23:13:57 +02:00
milo
228e2edac5
Quick fix for gcrypt DSA signature
2011-08-26 22:18:04 +02:00
Andreas Schneider
1d734f16cf
legacy: Remove privatekey_from_base64().
...
This function has been introduced for libssh 0.6. So we can remove it
completely.
2011-08-26 21:46:56 +02:00
Andreas Schneider
5a0735d1e8
messages: Fix ssh_packet_userauth_request().
...
Remove useless ssh_pki_import_signature_blob().
2011-08-26 21:19:49 +02:00
milo
f1634d33da
Free sig_blob if an error occurs
2011-08-26 18:17:14 +02:00
milo
4bdd831d7f
Fix double free in ssh_packet_userauth_request
2011-08-26 15:49:12 +02:00
Andreas Schneider
d4424b2767
auth: Refactor and fix ssh_userauth_kbdint().
2011-08-26 13:44:00 +02:00
Andreas Schneider
f2e08e8d7b
auth: Fix ssh_userauth_agent_publickey pending state.
2011-08-26 13:34:40 +02:00
Andreas Schneider
26e624c1b7
auth: Don't fail in publickey_auto if we can't read the key.
...
We should go on and try the next one as it was before. Also make sure we
don't leak memory ;)
2011-08-26 13:34:40 +02:00
Andreas Schneider
f8c987d1d4
auth: Fix ssh_userauth_publickey() pending_call_state.
2011-08-26 13:32:08 +02:00
Andreas Schneider
696f574a56
keys: Remove obsolete signatue functions.
2011-08-26 10:48:37 +02:00
Andreas Schneider
ab1a66ca7b
pki: Fix build with DEBUG_CRYPTO.
2011-08-26 10:44:43 +02:00
Andreas Schneider
7457937bab
pki: Migrate ssh_pki_do_sign to new pki.
2011-08-26 09:51:02 +02:00
Andreas Schneider
b5db04003d
auth: Fix a segfault in ssh_userauth_kbdint_init().
2011-08-26 09:00:39 +02:00
Andreas Schneider
a51d377afe
auth: Refactor kbdauth_init().
...
Rename it to ssh_userauth_kbdint_init.
2011-08-25 16:41:14 +02:00
Andreas Schneider
892cb92f57
auth: Prefix kbdint functions.
2011-08-25 16:26:12 +02:00
Andreas Schneider
c59939d4a2
auth: Make ssh_userauth_privatekey_file() legacy.
2011-08-25 16:14:29 +02:00
Andreas Schneider
5c601115c3
auth: Refactor ssh_userauth_password().
2011-08-25 16:14:21 +02:00
Andreas Schneider
89253fd22a
auth: Make ssh_userauth_autopubkey legacy.
2011-08-25 10:19:09 +02:00
Andreas Schneider
21261270e5
auth: Add ssh_userauth_publickey_auto().
2011-08-25 10:13:23 +02:00
Andreas Schneider
1a56892e9f
keys: Remove obsolete ssh_do_sign().
2011-08-25 10:13:23 +02:00
Andreas Schneider
c5643c0967
agent: Remove obsolete agent_sign_data().
2011-08-25 10:13:23 +02:00
Andreas Schneider
c5837a6c63
keys: Remove obsolete ssh_do_sign_with_agent().
2011-08-25 10:13:23 +02:00
Andreas Schneider
c221db0f36
auth: Add ssh_userauth_agent().
...
This commit is pretty big cause several functions have been refactored.
2011-08-25 10:13:23 +02:00
Andreas Schneider
4c1d3b708c
auth: Make ssh_userauth_pubkey legacy.
2011-08-23 21:54:02 +02:00
Andreas Schneider
379d65eaaf
auth: Add ssh_userauth_publickey().
2011-08-23 21:54:02 +02:00
Andreas Schneider
aa018c1484
auth: Make ssh_userauth_try_publickey() legacy.
2011-08-23 21:54:02 +02:00
Andreas Schneider
37df5e17c3
auth: Update copyright.
2011-08-23 21:54:02 +02:00
Andreas Schneider
609f8fbb7a
auth: Add ssh_userauth_try_publickey().
2011-08-23 21:54:01 +02:00
Andreas Schneider
5b706c7ab6
auth: Refactor ssh_userauth_none().
2011-08-23 21:54:01 +02:00
Andreas Schneider
a15dab6c00
auth: Rename wait_auth_status.
2011-08-23 21:54:01 +02:00
Andreas Schneider
5695f92e22
auth: Update ssh_userauth_list().
2011-08-23 21:54:01 +02:00
Andreas Schneider
2e577cecb4
auth: Move ssh_auth_list to legacy functions.
2011-08-23 21:54:01 +02:00
Andreas Schneider
058bb04396
auth: Rename ask_userauth.
2011-08-23 21:54:01 +02:00
Andreas Schneider
dc9feec005
pki: Add more return values for file importing functions.
2011-08-23 21:54:01 +02:00
Andreas Schneider
fa4378d47e
poll: Just make the code a bit more readable.
...
Maybe this fixes a cppcheck false positive.
(cherry picked from commit 45c1a23769b63e72e895158bcab83aad31d483dd)
2011-08-23 21:52:21 +02:00
Andreas Schneider
e94b0f8c08
server: Fix a build warning.
...
Thanks to Tom Judge.
2011-08-23 15:15:28 +02:00
Andreas Schneider
149be78ee0
pki: We need only one signature verify blob function.
...
This fixes the build without server.
2011-08-23 08:19:53 +02:00
Andreas Schneider
8fb8ad0151
agent: Fix memory leak.
2011-08-22 21:57:00 +02:00
Andreas Schneider
93c4a8e427
pki: Fix memleak in gcrypt pki_publickey_to_blob().
2011-08-22 21:56:44 +02:00
Andreas Schneider
9da331e79b
dh: Remove obsolete signature functions.
2011-08-22 18:47:15 +02:00
Andreas Schneider
8edf57fbf2
client: Migrate to new signature pki.
2011-08-22 18:41:47 +02:00
Andreas Schneider
8c8a91a9b7
server: Migrate more functions to new pki.
2011-08-22 18:41:47 +02:00
Andreas Schneider
bf2f553fc3
pki: Improve pki gcrypt error reports.
2011-08-22 18:41:47 +02:00
Andreas Schneider
82ca6a6c53
pki: Add ssh_srv_pki_signature_verify_blob().
2011-08-22 18:41:47 +02:00
Andreas Schneider
5cc98ed720
pki: Add ssh_pki_signature_verify_blob().
2011-08-22 18:39:56 +02:00
Andreas Schneider
bcc0a6d0e0
pki: Fix gcrypt pki_signature_from_blob().
2011-08-22 18:22:28 +02:00
Andreas Schneider
6c03b7a9c9
misc: Add ssh_match_group().
2011-08-22 16:16:34 +02:00
Andreas Schneider
90167f09d3
server: Migrate hostkey check to new pki.
2011-08-22 15:22:58 +02:00
Andreas Schneider
9c376dd913
auth: Fix ssh_auth_list() documentation.
...
The server will not return SSH_AUTH_METHOD_NONE.
2011-08-22 15:03:25 +02:00
Andreas Schneider
1e019fee43
keys: Remove unused obsolete ssh_sign_session_id().
2011-08-22 14:30:08 +02:00
Andreas Schneider
4de4520559
server: Use new pki infrastructure.
2011-08-22 14:29:39 +02:00
Andreas Schneider
245a354187
pki: Fix switch in crypto pki_signature_to_blob().
2011-08-22 14:28:46 +02:00
Andreas Schneider
d6829d073c
kex: Move ssh_encrypt_rsa1 to SSHv1 kex code.
2011-08-22 13:58:02 +02:00
Andreas Schneider
79ffd49940
pki: Add ssh_srv_pki_do_sign_sessionid().
2011-08-22 13:48:25 +02:00
Andreas Schneider
a2e08697b1
messages: Move ssh_userauth_build_digest() and make it static.
2011-08-22 12:57:01 +02:00
Andreas Schneider
ca9b01af99
pki: Migrate signature functions to legacy code.
2011-08-22 11:23:33 +02:00
Andreas Schneider
d0d9e62611
tests: Fix torture test with zlib support.
2011-08-22 08:26:02 +02:00
Andreas Schneider
a86ac461fd
pki: Ensure sig_blob isn't used uninitialized.
2011-08-22 08:04:22 +02:00
Andreas Schneider
859ed8583c
ctest: Fix the ctest build script.
2011-08-21 14:08:40 +02:00
Andreas Schneider
1b57445f6b
pki: Add ssh_pki_do_sign_agent().
2011-08-21 13:43:20 +02:00
Andreas Schneider
af82d8dfab
agent: Add ssh_agent_sign_data().
2011-08-21 13:42:49 +02:00
Andreas Schneider
a98301d2b0
tests: Add pki signature test.
2011-08-21 13:17:30 +02:00
Andreas Schneider
9c9199e05f
pki: Fix possible segfault in ssh_key_type_from_name().
2011-08-21 13:13:53 +02:00
Andreas Schneider
fa4f2d8bc1
tests: Add pki torture tests for keytypes.
2011-08-21 13:13:21 +02:00
Andreas Schneider
42cea1f2f1
pki: Fix ssh_key_dup() with gcrypt.
2011-08-21 12:59:55 +02:00
Andreas Schneider
c8d06b6b1c
tests: Fix memleak in torture_pki.
2011-08-21 12:41:42 +02:00
Andreas Schneider
948400ed92
cmake: Support WITH_ZLIB and WITH_LIBZ)
2011-08-21 12:39:16 +02:00
Andreas Schneider
eb65f031af
pki: Fix setting flags in ssh_key_dup().
2011-08-21 12:31:16 +02:00
Andreas Schneider
c041261921
pki: Create a pki private header file.
2011-08-21 11:15:29 +02:00
Andreas Schneider
a4b2518761
pki: Add ssh_pki_import_signature_blob().
2011-08-21 11:03:53 +02:00
Andreas Schneider
4f19a304d1
pki: Add ssh_pki_export_signature_blob().
2011-08-21 10:11:05 +02:00
Andreas Schneider
ab0354dbb6
priv: Add discard_const macros.
2011-08-21 10:10:27 +02:00
Andreas Schneider
ce41747fae
pki: Introduce ssh_signature.
2011-08-20 18:37:43 +02:00
Andreas Schneider
8acc3dd3af
pki: Add _RSA_do_sign to pki_crypto.
2011-08-20 18:08:16 +02:00
Andreas Schneider
79029854f6
tests: Added more pki tests.
2011-08-20 12:59:19 +02:00
Andreas Schneider
743a00dad4
pki: Fix build warnings.
2011-08-20 11:07:54 +02:00
Andreas Schneider
bb509ce4f7
pki: Remove unused variables.
2011-08-20 10:55:22 +02:00
Andreas Schneider
bac5f62eaf
tests: Fix build warning.
2011-08-20 10:54:43 +02:00
Andreas Schneider
e3bd018465
tests: Fix the torture_pki test.
2011-08-20 10:48:34 +02:00
Andreas Schneider
5bcf36f098
session: Fix ssh_free() with NULL argument.
2011-08-20 10:47:59 +02:00
Andreas Schneider
c575de17a8
pki: Use a consistent naming scheme.
2011-08-19 11:14:23 +02:00
Andreas Schneider
3e56ac650c
tests: Fix torture_pki build warnings.
2011-08-19 11:14:06 +02:00
Andreas Schneider
765b42e68a
tests: Improve pki_import_privkey_base64 test.
2011-08-19 11:03:31 +02:00
Andreas Schneider
2615f8bc94
tests: Added test for pubkey from privkey.
2011-08-16 23:06:13 +02:00
Andreas Schneider
c39181437b
pki: Add ssh_pki_export_publickey_file().
2011-08-16 23:04:25 +02:00
Andreas Schneider
ddcb88070b
misc: Remove session from ssh_get_local_username().
2011-08-16 23:04:25 +02:00
Andreas Schneider
1a0fbedc2e
pki: Fix and rename ssh_pki_publickey_to_base64().
...
Rename it to ssh_pki_export_publickey_base64().
2011-08-16 23:04:25 +02:00
Andreas Schneider
254c30be2e
pki: Remove session from ssh_pki_import_pubkey_* functions.
2011-08-16 19:33:24 +02:00
Andreas Schneider
25a2108809
pki: Remove session from ssh_pki_import_privkey_* functions.
2011-08-16 18:53:18 +02:00
Andreas Schneider
9b84464748
pki: Make publickey_to_string a legacy function.
2011-08-16 17:54:10 +02:00
Andreas Schneider
a40f1d8597
pki: Make publickey_from_string a legacy function.
2011-08-16 17:47:29 +02:00
Andreas Schneider
c940918821
pki: Fix memleak in privatekey_from_file().
2011-08-16 09:23:57 +02:00
Andreas Schneider
f7a7bf071d
torture: Fix memleak in pubkey base64 tests.
2011-08-16 09:23:53 +02:00
Andreas Schneider
c5028e76ad
pki: Fix memleak in pki_import_pubkey_buffer().
2011-08-16 09:15:29 +02:00
Andreas Schneider
df29df6e35
pki: Add ssh_pki_log function.
...
The plan is to get rid of the session as a parameter to ssh pki key
functions. We don't need a session for it and probably don't want it.
2011-08-16 01:18:36 +02:00
Andreas Schneider
330c713fdb
pki: Add test torture_pki_publickey_dsa_base64().
2011-08-16 01:17:24 +02:00
Andreas Schneider
42dda7b958
pki: Fix ssh_pki_publickey_to_base64() warnings.
2011-08-16 00:58:20 +02:00
Andreas Schneider
614ad97c12
pki: Make ssh_type_from_name() a legacy function.
2011-08-16 00:55:47 +02:00
Andreas Schneider
04ce7967b8
pki: Make ssh_type_to_char() a legacy function.
2011-08-16 00:54:00 +02:00
Andreas Schneider
19a3f5a61d
pki: Make publickey_from_file() a legacy function.
2011-08-16 00:47:43 +02:00
Andreas Schneider
9dfef44fd8
pki: Add ssh_pki_publickey_to_base64().
2011-08-16 00:47:43 +02:00
Andreas Schneider
c085892802
pki: Add ssh_pki_import_pubkey_file().
2011-08-16 00:47:43 +02:00
Andreas Schneider
47ebcac4cd
torture: Add torture_pki_publickey_rsa_base64 test.
2011-08-16 00:47:43 +02:00
Andreas Schneider
977d6fc089
pki: Fix pki_publickey_to_string() rsa checks.
2011-08-16 00:47:43 +02:00
Andreas Schneider
3c3673d1b8
build: Add missing path to .clan_complete
2011-08-16 00:47:43 +02:00
Andreas Schneider
3f70bce373
pki: Rename ssh_pki_publickey_to_string and make it public.
2011-08-16 00:47:43 +02:00
Andreas Schneider
6c1b508efd
pki: Rename ssh_pki_import_pubkey_string and make it public.
...
It should be named ssh_pki_import_pubkey_blob().
2011-08-16 00:47:43 +02:00
Andreas Schneider
714fa8960d
pki: Move ssh_privatekey_type and privatekey_free to legacy.
2011-08-16 00:47:43 +02:00
Andreas Schneider
54a2b8a303
pki: Fix ssh_pki_import_pubkey_base64().
2011-08-16 00:47:43 +02:00
milo
96e338ba56
Fixed typos in ssh_pki_publickey_to_string
2011-08-15 18:58:27 +02:00
Andreas Schneider
6ffee22448
pki: Add ssh_pki_publickey_to_string().
2011-08-15 18:48:08 +02:00
Andreas Schneider
fe375132c3
bind: Add checks around key functions.
2011-08-15 18:48:08 +02:00
Andreas Schneider
2780f76247
pki: Flags are a bit mask so use hex.
2011-08-15 18:48:08 +02:00
Andreas Schneider
a983512678
pki: Fix ssh_key_dup().
2011-08-15 18:48:08 +02:00
Andreas Schneider
c77b23b32a
pki: Cleanup pki header.
2011-08-15 18:48:08 +02:00
milo
962bdb1eea
Fixed missing include for FILE
2011-08-15 17:37:01 +02:00
Andreas Schneider
e06b3dba0d
bind: Read only once in ssh_bind_listen() (bug #11 ).
2011-08-15 16:50:30 +02:00
Andreas Schneider
190ae27463
pki: Added ssh_key_dup().
2011-08-15 16:26:58 +02:00
Andreas Schneider
481522cf63
agent: Use new pki functions.
2011-08-13 12:21:23 +02:00
Andreas Schneider
0523adf95c
pki: Add ssh_pki_import_pubkey_string().
2011-08-13 12:13:09 +02:00
Andreas Schneider
74d755873d
pki: Use const.
2011-08-13 11:26:03 +02:00
Andreas Schneider
30ec1e0b05
pki: Document public key function.
2011-08-13 11:19:37 +02:00
Andreas Schneider
f421c05913
cmake: Check for argp library only on bsd and solaris.
2011-08-13 11:07:57 +02:00
Andreas Schneider
e92787395a
pki: Fix doc of ssh_pki_import_privkey_base64().
2011-08-12 11:04:30 +02:00
Andreas Schneider
a4a1af5bbf
options: Allocate dest in ssh_options_copy().
2011-08-11 12:53:02 +02:00
Andreas Schneider
1c30c2a510
pki: Fix a resource leak.
2011-08-11 12:36:01 +02:00
Andreas Schneider
8bf8a7ef49
Fix typo.
2011-08-10 19:07:42 +02:00
Andreas Schneider
37a38d4959
Added CodingStyle file.
2011-08-10 19:05:15 +02:00
Andreas Schneider
13227714f2
channels: Fix incorrect return values in ssh_channel_write().
2011-08-10 16:58:10 +02:00
rofl0r
7949f2cdc6
session: Fix an infinite loop in the termination callback.
...
This happened due to the use of the buggy and obsolete timeout
funtions.
2011-08-10 15:41:36 +02:00
Andreas Schneider
2f87873642
channels: Handle SSH_AGAIN in channel_open().
2011-08-09 22:59:17 +02:00
Mark Riordan
6c45d6dc01
Fix "status -5 inflating zlib packet"
...
Signed-off-by: Mark Riordan <mriordan@ipswitch.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-08-09 20:13:20 +02:00
Andreas Schneider
9c0af42dd8
pki: Use a consistent name scheme.
...
Rename ssh_key_import_private to ssh_pki_import_privkey_file.
2011-08-09 18:05:47 +02:00
Andreas Schneider
bec483bc18
pki: Add ssh_pki_import_pubkey_base64().
2011-08-08 15:28:31 +02:00
Andreas Schneider
f81444bd57
pki: Add pki_do_sign().
2011-08-08 15:28:31 +02:00
Andreas Schneider
38d00c0e7a
bind: Use ssh_key_import_private().
2011-08-08 15:28:31 +02:00
Andreas Schneider
9bed334da3
pki: Add ssh_pki_convert_key_to_privatekey().
2011-08-08 15:28:31 +02:00
Andreas Schneider
7c302d376c
pki: Move _privatekey_from_file to legacy.c.
2011-08-08 15:28:31 +02:00
Andreas Schneider
36ee2d3332
pki: Create pki_publickey_from_privatekey().
2011-08-08 15:28:31 +02:00
Andreas Schneider
f55cd7de43
pki: Improve ssh_key_import_private().
2011-08-08 15:28:31 +02:00
Andreas Schneider
9569d053d8
pki: Improve ssh_pki_import_privkey_base64().
2011-08-08 15:28:31 +02:00
Andreas Schneider
028888719a
pki: Add pki_privatekey_type_from_string().
2011-08-08 15:28:31 +02:00
Andreas Schneider
d8b41bcac3
pki: Add placeholder for ecdsa and certs.
2011-08-08 15:28:31 +02:00
Andreas Schneider
6ccb3f7a82
pki: Add pki_crypto.c.
2011-08-08 15:28:31 +02:00
Andreas Schneider
37b80e9261
pki: Move keyfiles to pki_gcrypt.c.
2011-08-08 15:28:31 +02:00
Einar Floystad Dorum
01c4b713dc
Fixed ssh_scp_write so it works when doing recursive copy
...
There where two issues with ssh_scp_write:
1) It did not write a status message after the last write and OpenSSH
would then give up after the write finished.
2) OpenSSH would sometimes write a status message, after near ends write.
If scp_write didn't handle it, and subsequent status message. The remote
window would shrink to zero and ssh_channel_write would start returning 0.
Signed-off-by: Einar Floystad Dorum <einarfd@mailthief.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-08-08 15:27:23 +02:00
rofl0r
35686b4822
client: Fix another source of endless wait.
2011-08-06 11:12:02 +02:00
rofl0r
7ccd9c31b3
channels: Fix an endless loop in case of a channel_open error.
2011-08-06 11:12:02 +02:00
rofl0r
af85337f5f
session: Fix timeout handling.
...
-2 now means to use the timeout specified in options. It wasn't used
earlier and poll only knows -1 and 0 anyway for special meanings.
2011-08-06 11:12:02 +02:00
rofl0r
563fbe4de8
channels: Fix checking for fatal errors.
...
We need this that we don't end up in and infinite poll loop.
2011-08-06 11:11:12 +02:00
rofl0r
39f962c91e
channels: Fix ssh_channel_from_local()
...
It only worked if the first channel in the list was equivalent to we
were looking for.
2011-08-06 11:08:55 +02:00
rofl0r
c31cac93f3
misc: Fix ssh_timeout_update().
2011-08-06 11:08:38 +02:00
rofl0r
a290fe33c1
gitignore: ignore object files
2011-08-06 10:53:08 +02:00
Andreas Schneider
15ebbad146
examples: Fix permissions of the file we copy.
...
Thanks to Baptiste Marchand.
2011-08-03 22:21:43 +02:00
Andreas Schneider
790b62bca5
channels: Set the max packet size to 32768.
2011-08-03 20:49:57 +02:00
Andreas Schneider
ca47c9b46e
cmake: Make CHECK_C_COMPILER_FLAG_SSP a function.
2011-07-29 11:37:52 +02:00
Aris Adamantiadis
0943ce3a4a
Fixed build on openssl
2011-07-20 09:56:43 +02:00
Aris Adamantiadis
da954c2c5e
Fixes the ssh_log issue on ssh_bind handles.
2011-07-19 22:16:28 +02:00
Andreas Schneider
dc9ac022f5
doc: Add OpenSSH pub certkey auth.
2011-07-19 12:20:36 +02:00
Aris Adamantiadis
54fb43358c
Workaround ssh_get_user_home_dir on LDAP users
2011-07-13 12:04:46 +02:00
Andreas Schneider
cc29fef234
build: Remove broken old Makefile.
2011-06-30 15:47:52 +02:00
Andreas Schneider
f684e76ab2
Merge branch 'pki'
2011-06-15 18:27:23 +02:00
Andreas Schneider
c75581fb93
pki: Make ssh_key_is_private() a public function.
2011-06-15 18:27:05 +02:00
Andreas Schneider
27cedaa0b6
pki: Make ssh_key_is_public() a public function.
2011-06-15 18:27:05 +02:00
Andreas Schneider
2be90be740
known_hosts: Added a log message for key type mismatch.
2011-06-15 18:27:05 +02:00
Andreas Schneider
3ba44badb0
build: Fix libssh_threads pkg-config.
2011-06-15 18:26:51 +02:00
Aris Adamantiadis
bcec7eeddc
[crypto] fix pubkey authentication with ecdh
2011-06-14 23:13:20 +02:00
Aris Adamantiadis
ce03d26e03
Fix memory leak with session_id
2011-06-14 22:57:43 +02:00
Aris Adamantiadis
db2d0ebc44
Fix build with missing openssl/ecdh.h
2011-06-14 22:57:43 +02:00
Andreas Schneider
583a7f933a
cmake: Added pkg-config support for libssh_treads.
2011-06-14 13:47:04 +02:00
Aris Adamantiadis
2653b31af0
[crypto] Removed ugly ifdefs on gcrypt/libcrypto
2011-06-13 14:47:17 +02:00
Aris Adamantiadis
a3c28f2558
Fix memory leak
2011-06-13 14:06:30 +02:00
Aris Adamantiadis
c5a998f47a
[crypto] initial support for ecdh-sha2-nistp256
...
Works with openssl
Still requires work for libgcrypt and other modes
2011-06-13 13:46:34 +02:00
Aris Adamantiadis
3b72bf0880
Moved DH specific code to dh.h
2011-06-12 20:55:58 +02:00
Aris Adamantiadis
113de13543
Test for ecdh and dh-group1
2011-06-12 20:54:33 +02:00
Aris Adamantiadis
b54e8cdae5
Check for ecdsa with openssl, added log_warning
2011-06-12 19:38:42 +02:00
Andreas Schneider
fb0f125351
packet: Don't (de)compress empty buffers.
...
This fixes bug #50 .
2011-06-11 13:15:46 +02:00
Andreas Schneider
981190f8d3
pki: Add ssh_key_type_to_char() and ssh_key_type_from_name().
2011-06-11 13:04:22 +02:00
Andreas Schneider
88e2f17b97
pki: Make ssh_key_type a public function.
2011-06-11 13:04:22 +02:00
Andreas Schneider
29fa4b6b35
pki: Add SSH_KEYTYPE_ECDSA.
2011-06-11 13:04:22 +02:00
Aris Adamantiadis
7ff69d9c48
packet: Abort session on fatal errors on packets
2011-06-09 23:27:41 +02:00
Andreas Schneider
640e3830f2
build: Check for ntohll().
...
This function is available on AIX.
2011-06-06 18:56:30 +02:00
Andreas Schneider
3fa801a929
string: Added missing include.
2011-06-06 18:56:15 +02:00
Andreas Schneider
d536cc4f39
string: Added missing errno.
2011-06-06 18:50:39 +02:00
Andreas Schneider
ee83301eb3
build: Update ChangeLog.
2011-06-01 17:55:26 +02:00
Andreas Schneider
1880ef54d2
cmake: Fix static .lib overwriting on Windows.
2011-06-01 14:52:27 +02:00
Andreas Schneider
94ca5ed3df
cmake: Set next version.
2011-05-30 12:38:17 +02:00
Andreas Schneider
693425afab
tests: Check error of ssh_userauth_kbdint().
2011-05-28 13:31:17 +02:00
Andreas Schneider
82798035fc
tests: Remove superfluous closedir().
2011-05-28 13:28:49 +02:00
Andreas Schneider
3c21281bf0
session: Fix return code of ssh_blocking_flush().
2011-05-28 13:27:14 +02:00
Aris Adamantiadis
3bc46c3bf0
remove "0.5.0 is dev" in the doc
2011-05-27 13:37:52 +02:00
Aris Adamantiadis
ac167c9077
Forgot a cast to remove warnings
2011-05-27 13:36:55 +02:00
Aris Adamantiadis
c84380bad5
Fix documentation bug about threading
2011-05-27 13:26:15 +02:00
Aris Adamantiadis
17454caf64
Fix bug #5 , channel_read_nonblocking that blocks
2011-05-27 13:13:02 +02:00
Mark Riordan
dcea8db6b2
Fix memory leak when compression is used
...
Signed-off-by: Mark Riordan <mriordan@ipswitch.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-05-27 11:45:45 +02:00
Aris Adamantiadis
809b3adeba
Fix compilation without server and sftp modes
2011-05-26 21:56:42 +02:00
Aris Adamantiadis
34b05fd2dc
Fix memory leaks in pki and testcase
2011-05-26 21:33:36 +02:00
Andreas Schneider
c483418b82
sftp: Reset eof on seek operations.
...
This fixes bug #48 .
2011-05-26 11:22:11 +02:00
Andreas Schneider
ba03388031
misc: Fix compilation on Windows.
2011-05-26 11:20:04 +02:00
Andreas Schneider
8b73609e47
cmake: Remove unused regcomp check.
2011-05-25 22:09:41 +02:00
Andreas Schneider
07fb895fe9
cmake: Fix detection of clock_gettime.
2011-05-25 22:08:31 +02:00
Aris Adamantiadis
65282841e2
Replace clock_gettime with gettimeofday when missing
2011-05-25 21:27:48 +02:00
Aris Adamantiadis
59f7647cd9
Introduced ssh_timeout_elapsed functions
...
Functions to mesure elapsed time before and after a serie of
calls. Introduces a dependancy to clock_gettime() and librt,
hope this doesn't break anything. Porting to gettimeofday() should
not be too hard.
2011-05-24 23:26:18 +02:00
Aris Adamantiadis
4d6b1aa2c7
Added testcase for the timeout connecting problem
2011-05-24 23:25:40 +02:00
Aris Adamantiadis
79434649d0
Fix "connecting to closed port" on MacosX
2011-05-20 15:13:45 +02:00
Aris Adamantiadis
a053d819a3
Fixed warnings on MacosX with Xcode4
2011-05-20 14:31:13 +02:00
Aris Adamantiadis
837896e72d
scp: Fixed documentation bugs. bug #8
2011-05-20 13:42:24 +02:00
Oliver Stöneberg
12b61a6266
doc: Small update to auth.c documentation.
2011-05-17 14:22:11 +02:00
Oliver Stöneberg
f4f4ce37f0
poll: Removed WSAPoll() support.
...
It was causing too many issues and the poll emulation is quite stable.
2011-05-17 14:21:17 +02:00
Oliver Stöneberg
671a982739
connect: Set timeout on connect
...
This also fixes error handling in ssh_poll_ctx_dopoll() and
ssh_handle_packets(), so it won't loop forever on an actual timeout.
2011-05-17 14:21:04 +02:00
Oliver Stöneberg
4e153aed8a
channel: Fixed potential use-after-free in ssh_channel_get_exit_status().
...
If ssh_channel_get_exit_status() is called more than once and the
connection closed.
2011-05-17 14:20:56 +02:00
Oliver Stöneberg
525324b2f9
examples: Use the right cleanup functions.
2011-05-17 14:20:48 +02:00
Oliver Stöneberg
e3311d03db
tests: Fixed some cppcheck warnings.
2011-05-17 14:20:28 +02:00
Oliver Stöneberg
7f0761885c
keyfiles: Fixed compilation without defines.
...
This fixes cppcheck issues.
2011-05-17 14:20:09 +02:00
Oliver Stöneberg
9866763789
socket: Fixed use-after-free.
...
When s->callbacks->exception() was called in ssh_socket_pollcallback()
we had a use after free bug.
2011-05-17 14:19:51 +02:00
Andreas Schneider
32cd45612b
channel: Improve the request signal documentation.
2011-05-15 13:42:38 +02:00
Andreas Schneider
d4838d4dc8
messages: Try to fix the build.
2011-05-03 10:55:14 +02:00
Oliver Stöneberg
daf1c3e0a8
Use BIO* in _privatekey_from_file [Oliver Stöneberg]
...
_privatekey_from_file: moved FILE* into HAVE_LIBGCRYPT code / added missing #ifdef's to default case of switch [Oliver Stöneberg]
(cherry picked from commit dcb50cc0c8 )
2011-05-02 19:19:41 +02:00
milo
32ba5204b7
Delay the check for kbdint->answers in kbdint_send()
2011-05-02 18:02:56 +02:00
milo
b6e712e934
Fix segfault when ssh_userauth_kbdint_setanswer() has not been called
2011-05-02 17:30:43 +02:00
milo
7d2064c289
[socket] fix a segfault at disconnect
...
(cherry picked from commit 56394917b15e41603c641c22a4e29c33b096d673)
2011-05-02 17:02:25 +02:00
milo
eb5fedb685
[event] don't use sessions in event anymore
...
(cherry picked from commit 89d0fdbbde4cf48e783a8ee7c5907c51a83e207b)
2011-05-02 17:01:59 +02:00
milo
1979c14aac
[messages] don't queue messages if callback present
...
(cherry picked from commit 99d0f6d7c77e064b7fd0f0f46c40988de1996f3b)
2011-05-02 16:59:52 +02:00
milo
8092541603
[poll] avoid infinite loop in ssh_poll_ctx_free()
...
(cherry picked from commit eace59d3eaad413fd846d1c8b4c926285f6cd5ab)
2011-05-02 16:58:40 +02:00
milo
7ba0938846
[channels] Added ssh_channel_window_size() and avoided reentrancy in channel_write_common()
...
(cherry picked from commit 27313334578f4acb7ccf0687bba7f76b2febd569)
2011-05-02 16:58:27 +02:00
Oliver Stöneberg
3ae01ff9f5
init: Some initialization fixes.
...
- Check result of ssh_init() in privatekey_from_base64()
- Moved code from ssh_finalize() to appropriate subroutines
- Only initialize sockets once (caused mismatch of WSAStartup() and
WSACleanup() calls and potential usage of bsd_poll when win_poll
should be used)
2011-05-01 19:42:50 +02:00
Oliver Stöneberg
040a543f57
socket: Fixed poll input event.
2011-05-01 19:42:38 +02:00
Oliver Stöneberg
a73459171b
examples: Removed unnecessary \n from ssh_log() calls in samplessh.
2011-05-01 19:33:26 +02:00
Oliver Stöneberg
c3849a3cfd
examples: Fixed memory leak in samplessh when using commands.
2011-05-01 19:33:09 +02:00
milo
91c9d86d45
[keyfiles] Fix two memory leaks
2011-04-18 17:49:54 +02:00
milo
6e58342abc
[pki] remove unused functions
2011-04-18 17:40:27 +02:00
Andreas Schneider
8b95328b1b
poll: Fix poll input events.
...
bug#38
2011-04-15 19:14:15 +02:00
Andreas Schneider
644145a88c
examples: Fix some memory leaks.
2011-04-15 19:05:53 +02:00
Andreas Schneider
ef658b4bef
Fix assertion with Visual Studio because of %zu.
2011-04-15 19:02:21 +02:00
Andreas Schneider
a6c53d51de
scp: More correct fix for snprintf 64-bit format.
2011-04-15 18:56:52 +02:00
Mark Riordan
e7e4f261a6
scp: Fix snprintf format for 64-bit size on SCP push.
...
Signed-off-by: Mark Riordan <mriordan@ipswitch.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-04-15 16:18:26 +02:00
Mark Riordan
96d5f13813
scp: Support huge files by changing size to 64-bit type.
...
Signed-off-by: Mark Riordan <mriordan@ipswitch.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-04-15 16:18:26 +02:00
Aris Adamantiadis
3a77f2aebe
[pki] Fix buffer overflow in pki
2011-04-15 09:11:09 +02:00
Mark Riordan
5939cfe78a
scp: Fix potential infinite loop in ssh_scp_close
...
Signed-off-by: Mark Riordan <mriordan@ipswitch.com >
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-04-14 14:18:45 +02:00
Andreas Schneider
3e7d4534ce
examples: Call correct functions on exit.
2011-04-14 14:16:58 +02:00
milo
cee8ca339b
Use const for x11_auth_* strings
2011-04-14 14:05:44 +02:00
milo
7cc4471168
Implemented X11 server side
2011-04-14 14:05:44 +02:00
milo
3046a50614
Skip \r when reading private keys
2011-04-14 14:05:44 +02:00
milo
23aa58e442
Added some tortures for pki
2011-04-14 14:05:44 +02:00
milo
f8c7ad9c7a
[pki] Added ssh_userauth_pki_pubkey() function
2011-04-14 14:05:44 +02:00
milo
72b53aa11e
Fix error message in privatekey_from_base64()
2011-04-14 14:05:44 +02:00
milo
c96314971c
[pki] Add documentation and check for NULLs
2011-04-14 14:05:44 +02:00
milo
82e3068cb7
Set freed pointers to NULL in ssh_key struct
2011-04-14 14:05:44 +02:00
milo
b308bb9d52
[pki] added ssh_pki_do_sign() function
2011-04-14 14:05:44 +02:00
milo
c1f65492f7
[pki] Added conversion functions to migrate seemlessly to ssh_key
2011-04-14 14:05:44 +02:00
milo
c5db7674ec
[pki] check for NULL and small cosmetic changes
2011-04-14 14:05:44 +02:00
milo
2694853979
[pki] Added ssh_pki_publickey_from_privatekey() function
2011-04-14 14:05:44 +02:00
milo
69d2457762
[pki] Added ssh_pki_import_privkey_base64()
2011-04-14 14:05:44 +02:00
milo
c1d385f6da
[pki] remove non existing function prototype
2011-04-14 14:05:44 +02:00
milo
c20afa75a2
[pki] Fixed a probable bug in privatekey_file_to_buffer()
2011-04-14 14:05:44 +02:00
milo
df3e497dbd
[pki] Added privatekey_from_base64() function...
...
and wrapped it with privatekey_from_file()
2011-04-14 14:05:44 +02:00
milo
9a21093ab8
[pki] Added b64decode_dsa_privatekey() function
2011-04-14 14:05:44 +02:00
milo
5f54eff0be
[pki] Added b64decode_rsa_privatekey() function
2011-04-14 14:05:43 +02:00
milo
43ebdbfe46
[pki] Added privatekey_string_to_buffer() function
2011-04-14 14:05:43 +02:00
milo
2be42922c8
[pki] Make ssh_key_new and ssh_key_free public
2011-04-14 14:05:43 +02:00
milo
a0a3ceeaa0
Semantic fix on malloc
2011-04-14 13:46:40 +02:00
milo
42315772b2
Fix a memleak on event poll contexts
2011-04-14 13:31:24 +02:00
milo
23b28a573c
Fix a 0 bytes malloc in server kbdint implementation
2011-04-14 13:31:11 +02:00
Aris Adamantiadis
934252d6ca
Fixed missing CRYPTO_cleanup_all_ex_data() in ssh_finalize
2011-04-14 13:09:09 +02:00
Andreas Schneider
94e7d345a7
wrapper: Fixed a possible NULL pointer dereference.
2011-04-14 10:17:44 +02:00
Andreas Schneider
7e4916cefc
server: Fixed a possible NULL pointer dereference.
2011-04-14 10:10:19 +02:00
milo
e04d30e083
Bug fix in ssh_poll_ctx_remove()
2011-04-14 00:09:35 +02:00
Oliver Stöneberg
166ee451c5
build: Fixed some VS2010 problems.
2011-04-11 11:18:57 +02:00
Oliver Stöneberg
46475dfa2f
keys: Fixed issues reported by cppcheck.
2011-04-11 11:06:32 +02:00
Andreas Schneider
7150cabafa
cmake: Fixed a typo.
2011-04-08 11:02:25 +02:00
Mark Riordan
29bb718a93
sftp: Fixed double-free in sftp_unlink().
2011-04-08 10:59:05 +02:00
Aris Adamantiadis
1c062b22bf
Fixed doc of ssh_userauth_list()
2011-03-28 12:55:48 +02:00
Aris Adamantiadis
4bc9c96e4e
Change session state after receiving a Disconnect
2011-03-28 12:46:08 +02:00
Andreas Schneider
0ab17a8906
doc: Extremly important README update!
2011-03-25 19:24:42 +01:00
Aris Adamantiadis
1a101a959e
Fix the ssh_message_retrieve problem by anihilation
2011-03-22 12:23:02 +01:00
Aris Adamantiadis
dff4e4e6d3
Implement ssh_blocking_flush()
...
Based on code from Jan Willamowius
2011-03-22 11:49:57 +01:00
Aris Adamantiadis
79b74bdf64
Added a IP address test
2011-03-22 10:45:07 +01:00
Andreas Schneider
633d6532be
example: Use const in auth_password from samplesshd.
2011-03-10 11:23:45 +01:00
Andreas Schneider
7e921b7afb
messages: Make returned strings const.
2011-03-09 19:45:17 +01:00
Andreas Schneider
7420b0fb83
doc: More doc for messaging functions.
2011-03-09 19:39:34 +01:00
Andreas Schneider
52e223dfdd
doc: Added missing doc for common message function.
2011-03-09 19:19:56 +01:00
Andreas Schneider
e2706fe21d
doc: Fixed typos in messaging introduction.
2011-03-09 19:06:59 +01:00
Andreas Schneider
7daa81f3aa
doc: Improve the doc of ssh_bind_set_callbacks.
2011-03-09 18:33:03 +01:00
Andreas Schneider
6754c34711
doc: Improved documentation for server options.
2011-03-06 14:25:21 +01:00
Andreas Schneider
7e9d384ec8
build: Set version to 0.5.90.
2011-03-01 21:28:50 +01:00
Andreas Schneider
d97458d640
messages: Added missing config.h include.
2011-02-25 10:22:19 +01:00
Andreas Schneider
dab8f847e6
legacy: Added missing channel_write_stderr.
2011-02-23 12:38:45 +01:00
Andreas Schneider
8d3823127c
legacy: Fixed the symbol export.
2011-02-23 12:31:29 +01:00
milo
8ee8d4f913
Check for NULL channel pointers
2011-02-22 14:11:19 +01:00
milo
000d659ea2
examples: Added a event context based sshd example.
2011-02-20 14:37:43 +01:00
milo
ddb1c1838f
poll: Added a function to poll the events.
2011-02-20 14:37:43 +01:00
milo
e40261c22c
poll: Added function to remove fd from the event context.
2011-02-20 14:37:34 +01:00
milo
6582da1d67
poll: Added function to add an fd to the events.
2011-02-20 14:37:34 +01:00
milo
0c76156f54
poll: Added function to remove session from event loop.
2011-02-20 14:37:31 +01:00
milo
4b72953c7e
poll: Added function to add session to an event.
2011-02-20 14:36:44 +01:00
milo
4ee4450a6b
poll: Added a function to free an event.
2011-02-20 14:35:11 +01:00
milo
a2634ceea8
poll: Started to add a poll based event loop.
2011-02-20 14:21:45 +01:00
Andreas Schneider
ac8276c70e
server: Fixed logging function name.
2011-02-18 20:57:09 +01:00
Andreas Schneider
5cc2e69d0d
channel: Fixed a possible NULL pointe dereference.
2011-02-18 18:03:37 +01:00
Bernhard R. Link
23b3c46fd6
channel: Improve ssh_channel_open_reverse_forward documentation.
2011-02-18 17:50:50 +01:00
Bernhard R. Link
8a83990c16
channels: set error for new NULL pointer checks
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-02-18 17:45:28 +01:00
Bernhard R. Link
071b0034db
socket: Set errors on return.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-02-14 22:48:53 +01:00
Bernhard R. Link
7ae59c571a
channels: Set errors on return.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-02-14 22:48:53 +01:00
Bernhard R. Link
b1db0e54ad
bind: Set errors on return.
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-02-14 22:48:53 +01:00
milo
4230509e80
Check for NULL pointers in string.c
2011-02-14 20:23:12 +01:00
milo
11e54e8221
Check for NULL pointers in channels.c
2011-02-14 20:02:02 +01:00
Andreas Schneider
eea1df3574
misc: Fixed ssh_is_ipaddr_v4() on Windows.
2011-02-13 17:36:45 +01:00
Andreas Schneider
9baa491b0b
build: Try to fix the build on Solaris.
2011-02-13 13:22:25 +01:00
Andreas Schneider
cd30a1d4b1
misc: Added working ssh_is_ipaddr for Windows.
2011-02-13 11:56:47 +01:00
Andreas Schneider
ca941d6985
tests: Fixed misc and isipaddr test on Windows.
2011-02-13 11:56:47 +01:00
Andreas Schneider
cbcd5668f5
torture: Fixed torture on Windows.
2011-02-13 11:56:47 +01:00
Andreas Schneider
fdd1cb18d0
auth: Fixed a memory leak in kdbint auth.
...
Milo please check!
2011-02-13 11:04:09 +01:00
Andreas Schneider
a0c05c4c4e
tests: Added two asserts to torture_sftp_dir.
2011-02-13 10:44:09 +01:00
Andreas Schneider
499467d362
auth: Fixed a double free error.
2011-02-13 10:43:59 +01:00
Andreas Schneider
d1ddec00d9
misc: Fixed ssh_is_ipaddr on FreeBSD.
2011-02-13 10:32:47 +01:00
Bernhard R. Link
637fc7ea59
always set error when returning error in auth.c
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-02-12 20:11:50 +01:00
Andreas Schneider
622d5a43b3
ctest: Added support for checking out a branch.
2011-02-12 20:08:23 +01:00
Aris Adamantiadis
483cdc2d2c
Added ssh_userauth_[offer_]pubkey nonblocking iface
2011-02-12 19:21:13 +01:00
Andreas Schneider
5d4bd5a21d
tests: Added ipv6 tests.
2011-02-12 19:16:06 +01:00
Andreas Schneider
e8c3f55751
tests: Fixed torture_isipaddr.
2011-02-12 19:12:39 +01:00
Bernhard R. Link
8d9d46ca66
use ssh_log instead of fprintf in ssh_config_parse_file
...
ssh_config_parse_file calls "fprintf(stderr," directly thus ignoring
a set log callback. Replacing the print with a call to ssh_log should
fix this.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-02-12 19:08:59 +01:00
Andreas Schneider
4d38b4c848
srv_sftp: Set error messages in sftp_get_client_message().
2011-02-12 19:08:59 +01:00
Andreas Schneider
768fbdd92e
connect: Use ssh_is_ipaddr instead of regex.
2011-02-12 19:08:59 +01:00
Andreas Schneider
b313fa944a
misc: Added ssh_is_ipaddr() function.
2011-02-12 19:08:59 +01:00
Aris Adamantiadis
7acc2fa607
Connect: Test the new isipaddr() function
2011-02-12 15:07:37 +01:00
Bernhard R. Link
8e0e4d8fb3
ssh_connect_host_nonblocking returns SSH_EINTR, not E_INTR, so update documentation
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-02-12 14:29:03 +01:00
Bernhard R. Link
8b51d29363
proper prototypes
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2011-02-12 12:26:33 +01:00
milo
cc76a192df
New example server for kbdint authentication.
2011-02-10 14:39:58 +01:00
milo
3c0a4781e4
Added the keyboard-interactive authentication method
2011-02-10 14:39:20 +01:00
milo
32e23a25da
Reverse commit 076dfb82 for the server side
2011-02-10 14:37:34 +01:00
milo
3eaf25d989
Fix NULL pointer checks in poll
2011-02-10 14:35:29 +01:00
Andreas Schneider
6f2bf91e29
build: Increased version numbers.
2011-02-10 12:54:33 +01:00
Andreas Schneider
5a8a2a56af
poll: Use WSAPoll() on Windows.
2011-02-09 00:36:16 +01:00
Andreas Schneider
d464b57fa5
Revert "poll: Remove obsolete win_poll functions."
...
This reverts commit c950ed3b4c .
2011-02-09 00:34:36 +01:00
Andreas Schneider
c950ed3b4c
poll: Remove obsolete win_poll functions.
...
Thanks for the hint Milo ;)
2011-02-09 00:13:47 +01:00
Andreas Schneider
5144f390ca
examples: Fixed build warning.
2011-02-08 19:36:44 +01:00
Andreas Schneider
f5e2c94ae3
torture: Fixed memory leak.
2011-02-08 19:08:27 +01:00
Andreas Schneider
8078d4f674
doc: Use fwrite for the command example.
2011-02-08 10:59:50 +01:00
Andreas Schneider
ac785e0aa3
examples: The exec example should be like tutorial one.
2011-02-08 10:54:25 +01:00
Andreas Schneider
541519e563
build: Updated the ChangeLog.
2011-02-07 18:22:34 +01:00
Andreas Schneider
58feb0c983
vim: Added .clang_complete file.
2011-02-07 17:39:06 +01:00
Andreas Schneider
72e08d5dd9
build: Added a --clang option.
2011-02-07 13:34:37 +01:00
Andreas Schneider
f812ace256
tests: Some fixes for sftp_dir.
2011-02-07 13:33:28 +01:00
Andreas Schneider
057704c097
torture: Added more test for correct auth.
2011-02-07 13:31:31 +01:00
Andreas Schneider
92f20ec85a
torture: Fixed the kbdint auth.
2011-02-07 13:31:08 +01:00
Andreas Schneider
a26194ece0
torture: Rename the static auth kbdint function.
2011-02-07 13:30:23 +01:00
Andreas Schneider
22b1e5bc7c
tests: Added test for sftp directory functions.
2011-02-06 16:35:54 +01:00
Andreas Schneider
38d6d38c1f
torture: Added a function to setup a sftp session.
2011-02-06 16:27:43 +01:00
Andreas Schneider
215c41710e
torture: Added torture_isdir().
2011-02-06 15:35:18 +01:00
Andreas Schneider
97d261dc79
torture: Added torture_rmdirs().
2011-02-06 15:35:18 +01:00
Andreas Schneider
892ebf35f1
torture: Added GPL header.
2011-02-06 15:34:32 +01:00
Andreas Schneider
05cd7296ba
tests: Added a torture_ssh_session().
2011-02-06 11:15:05 +01:00
Andreas Schneider
93a2d79459
session: Added ssh_is_connected().
2011-02-06 10:50:14 +01:00
Andreas Schneider
30e4096c66
tests: Fixed missing ;
2011-02-06 08:45:37 +01:00
Andreas Schneider
03b387cf47
Revert "sftp: Added missing break's to server."
...
This reverts commit 131e3b968f .
2011-02-05 18:40:00 +01:00
Andreas Schneider
131e3b968f
sftp: Added missing break's to server.
2011-02-05 18:24:23 +01:00
Andreas Schneider
4bf8ee8032
tests: Check fgets output.
2011-02-05 15:23:19 +01:00
Andreas Schneider
63c42f066f
tests: Fixed checking return values of system().
2011-02-05 15:23:19 +01:00
Andreas Schneider
9e40e60bc4
examples: Check return values of write.
2011-02-05 15:23:19 +01:00
Andreas Schneider
8f850585dd
session: Fixed possible uninitialized return of ret.
2011-02-05 15:23:19 +01:00
Andreas Schneider
4b07157fc6
getpass: Fixed a compiler warning.
2011-02-05 15:23:19 +01:00
milo
867944b939
Respect RFC when sending stderr data
...
http://tools.ietf.org/html/rfc4254#section-5.2
byte SSH_MSG_CHANNEL_EXTENDED_DATA
uint32 recipient channel
*uint32 data_type_code*
string data
2011-02-04 12:46:51 +01:00
Andreas Schneider
b0c2be25a6
doc: Fixed the include dir.
2011-01-28 13:13:08 +01:00
Aris Adamantiadis
c1ecec7cda
SSH1: Update a few fix from 0.4.8-git
2011-01-26 22:50:05 +01:00
Aris Adamantiadis
00d68d63fa
Getpass: fixed loop + indentation
2011-01-26 21:49:58 +01:00
Aris Adamantiadis
5d87ca94a8
Getpass: Fix password clearing
2011-01-26 13:22:29 +01:00
Andreas Schneider
1e827a8e81
getpass: Fixed possible segfault if len is too small.
2011-01-24 17:13:35 +01:00
Andreas Schneider
20e637968a
cmake: Define BSD.
2011-01-24 15:44:11 +01:00
Andreas Schneider
5c581f8a4c
libsshpp: Removed unused variable.
2011-01-24 15:25:50 +01:00
Andreas Schneider
d67cbdc926
examples: Fixed compilation on Windows.
2011-01-24 15:25:50 +01:00
Andreas Schneider
a63dbc07f3
examples: Fixed knownhosts on Windows.
2011-01-24 13:55:05 +01:00
Andreas Schneider
6a3cd6c20f
examples: enable exec and senddata on all plattforms.
2011-01-24 13:55:05 +01:00
Andreas Schneider
8a9ce6239a
examples: Remove unused header file.
2011-01-24 13:55:05 +01:00
Andreas Schneider
f3685f0f73
examples: Use ssh_getpass().
2011-01-24 13:55:05 +01:00
Andreas Schneider
50a119dd0a
misc: Added multiplatform ssh_getpass() fuction.
2011-01-24 13:55:05 +01:00
Andreas Schneider
8abdaa7abf
examples: Start to build examples on more plattforms.
2011-01-23 18:57:35 +01:00
Aris Adamantiadis
80ef7d9304
Fix problem with ssh_connect w/ timeout &fd > 1024
...
Convert that code to ssh_poll
(cherry picked from commit b1a65dd25f )
2011-01-22 16:55:36 +01:00
Aris Adamantiadis
84df46f805
Fix use-after-free when socket is closed in a callback handler
2011-01-19 16:01:21 +01:00
Andreas Schneider
460d43f050
cmake: Fixed ZLIB configure check.
2011-01-18 18:56:24 +01:00
Andreas Schneider
625692f4c5
cmake: Don't use cmake 2.8.3 features.
2011-01-17 09:24:57 +01:00
Aris Adamantiadis
0e2bbdd25b
Fix doxygen warning
2011-01-16 23:42:19 +01:00
Aris Adamantiadis
6b52aaff1c
ssh_auth_password made nonblocking
2011-01-16 23:42:19 +01:00
Aris Adamantiadis
227764a803
Made ssh_userauth_none nonblocking
2011-01-16 23:42:19 +01:00
Aris Adamantiadis
624676b1cc
Made ask_userauth nonblocking
2011-01-16 23:42:19 +01:00
Andreas Schneider
a236a15c6c
modules: Improved the GCrypt module.
2011-01-16 12:47:06 +01:00
Andreas Schneider
cb775092bc
cmake: Fixed NSIS module.
2011-01-16 12:21:58 +01:00
Andreas Schneider
8d7d313498
cmake: Fixed ZLIB path checks.
2011-01-16 12:16:53 +01:00
Andreas Schneider
c6e1792696
cmake: Improved the NSIS module.
2011-01-16 12:12:35 +01:00
Andreas Schneider
90fc5554e1
cmake: Improved the ZLIB find module based on CMake one.
2011-01-16 11:53:37 +01:00
Andreas Schneider
e579dfb342
cmake: Fixed license header of the OpenSSL module.
2011-01-16 11:51:02 +01:00
Andreas Schneider
0c93914948
cmake: Improved FindOpenSSL based on CMake ones.
2011-01-16 11:30:24 +01:00
Aris Adamantiadis
670dd17044
Test double ssh_disconnect
2011-01-15 22:50:34 +01:00
Aris Adamantiadis
b945cbca52
Fix double-connect testcase
2011-01-15 22:43:58 +01:00
Aris Adamantiadis
f8361d324e
Fix torture_connect_double so it tests the right thing
2011-01-14 14:35:44 +01:00
Aris Adamantiadis
0b46f68c5f
Fixed compilation without argp.h available
2011-01-13 21:21:19 +01:00
Aris Adamantiadis
2917e71aad
Replaced argp support for platforms that support it
...
Argp is really useful, but it's not mandatory.
2011-01-13 18:34:04 +01:00
Aris Adamantiadis
551b87b65b
New testcases for nonblocking ssh_connect and double ssh_connect
2011-01-13 18:09:04 +01:00
Aris Adamantiadis
5b6f048197
Use termination functions for event polling
2011-01-12 23:04:43 +01:00
Aris Adamantiadis
a17472ff2b
Fix unit tests for opensolaris
2011-01-11 17:55:12 +01:00
Aris Adamantiadis
7fbb926c0b
Fix getpwuid_r on opensolaris
2011-01-11 17:55:12 +01:00
Andreas Schneider
bb5f5281c0
build: Fixed build on Windows.
2011-01-11 11:07:17 +01:00
Aris Adamantiadis
9140242cbe
Non-blocking mode for ssh_connect
...
This looks ugly. I'll see if we need to revert or change that patch later.
2011-01-10 18:01:35 +01:00
Aris Adamantiadis
bcea8921ba
Change blocking parameter to a flag
2011-01-10 17:39:47 +01:00
Aris Adamantiadis
076dfb8294
Fix connection callbacks called at wrong time
2011-01-10 12:14:26 +01:00
Aris Adamantiadis
d631ce32ed
All error path consistent with ssh_packet_kexinit
2011-01-10 11:24:15 +01:00
Aris Adamantiadis
4439d5c774
Log errors with ssh_log
2011-01-10 11:23:49 +01:00
Aris Adamantiadis
ac6278feb7
Fix leak when key exchange fails.
2011-01-09 22:27:55 +01:00
Andreas Schneider
d1e1103198
examples: Improve the authenticate_kbdint function.
...
The function excepts a predefined password now. It will try to use it if
the prompt is a Password prompt. This works in 80% of the cases.
2011-01-08 10:18:55 +01:00
Aris Adamantiadis
4f83918109
Added interesting link
2011-01-07 13:41:10 +01:00
Andreas Schneider
6b27966c9c
keys: Fixed memory leaks in session signing.
...
Found by cppcheck - http://test.libssh.org/cppcheck-analyzer/
2011-01-06 14:32:39 +01:00
Andreas Schneider
a016d356fa
dh: Fixed a memory leak in ssh_print_hexa.
...
Found by cppcheck - http://test.libssh.org/cppcheck-analyzer/
2011-01-06 14:25:35 +01:00
Andreas Schneider
61852635b5
tests: Moved assert to the write place in torture_keyfiles.
...
Found by clang-analyzer http://test.libssh.org/clang-analyzer/
2011-01-06 11:44:02 +01:00
Andreas Schneider
184f1e1706
tests: Assert if ssh_get_random failed in torture_rand_thread.
...
Found by clang-analyzer http://test.libssh.org/clang-analyzer/
2011-01-06 10:15:01 +01:00
Andreas Schneider
dfa01d0862
examples: Use the src mode in scp do_copy function.
...
Found by clang-analyzer http://test.libssh.org/clang-analyzer/
2011-01-06 10:15:01 +01:00
Andreas Schneider
82547867eb
options: Remove unsused getopt option.
...
Found by clang-analyzer http://test.libssh.org/clang-analyzer/
2011-01-06 10:15:01 +01:00
Andreas Schneider
7d9f889911
tests: Added missing asserts in torture_keyfiles.
...
Found by clang-analyzer http://test.libssh.org/clang-analyzer/
2011-01-06 10:15:01 +01:00
Andreas Schneider
13ece2a2f8
messages: Added missing NULL pointer checks.
...
Found by clang-analyzer http://test.libssh.org/clang-analyzer/
2011-01-06 10:04:12 +01:00
Aris Adamantiadis
e57d5a45b9
Fix the missing returns in C++ wrapper
2011-01-05 21:14:27 +01:00
Andreas Schneider
ec12da273e
tests: Fixed the segfault in torture_knownhosts.
2011-01-04 23:10:01 +01:00
Aris Adamantiadis
fdffa42c02
Fix "SSH_KEXINIT received in wrong state" race
...
Setting the flag before doing any IO
2011-01-04 16:59:54 +01:00
Andreas Schneider
d679d5d7ef
poll: Ensure that the poll handle and ctx is zeroed.
2011-01-03 09:07:02 +01:00
Andreas Schneider
2464a25de7
tests: Fixed a build warning introduced before.
2011-01-03 09:02:34 +01:00
Andreas Schneider
e12253168c
tests: Call init and finalize in client torture tests.
2011-01-03 08:46:14 +01:00
Andreas Schneider
1540dad17f
tests: Added more openssl valgrind suppressions.
2011-01-03 07:51:46 +01:00
Andreas Schneider
350838d1b5
messages: Fixed cast warnings on Windows.
2011-01-02 19:35:54 +01:00
Andreas Schneider
f23880ddee
base64: Added casts to GET macros to fix build warnings.
2011-01-02 19:35:54 +01:00
Andreas Schneider
be3e5c35cf
scp: Fixed a build warning on Windows.
2011-01-02 19:35:54 +01:00
Andreas Schneider
73c0cd050e
poll: Fixed a build warning on Windows.
2011-01-02 19:35:53 +01:00
Andreas Schneider
c54d6b7f8a
bind: Added include file for close function on Windows.
2011-01-02 19:35:53 +01:00
Andreas Schneider
2b6fa19fe5
cmake: Fixed msvc posix warnings and unsecure functions.
2011-01-02 19:35:53 +01:00
Aris Adamantiadis
3f538b3ddd
Call ssh_init()/ssh_finalize bf/af each testcase
2011-01-02 17:25:51 +01:00
Aris Adamantiadis
2faaefade9
Revert "tests: Call ssh_init() and ssh_finalize() before we run the tests."
...
Reason: breaks test_rand, because threading has to be initialized
before ssh_init()
This reverts commit ef1866db76 .
2011-01-02 17:15:03 +01:00
Andreas Schneider
ef1866db76
tests: Call ssh_init() and ssh_finalize() before we run the tests.
2011-01-02 09:19:53 +01:00
Andreas Schneider
d4072082d0
tests: More openssl valgrind suppressions.
2011-01-02 09:10:42 +01:00
Andreas Schneider
a7237e8cea
tests: Updated the valgrind suppressions file.
2011-01-01 22:13:03 +01:00
Andreas Schneider
bc2db562e5
cmake: Added missing OpenSSL directories on Windows.
2011-01-01 20:53:55 +01:00
Andreas Schneider
93ce8e8ffd
cmake: Added looking for zdll on Windows.
2011-01-01 20:53:55 +01:00
Andreas Schneider
98bacf032f
tests: Added torture_auth_autopubkey client test.
2011-01-01 20:53:55 +01:00
Andreas Schneider
e795dae8f2
tests: Added a windows test for torture_path_expand_tilde.
2011-01-01 20:53:55 +01:00
Andreas Schneider
459fa3734f
tests: Fixed includes for torture_list on Windows.
2011-01-01 20:53:54 +01:00
Andreas Schneider
52d6b7b914
tests: Fixed includes of torture_options for windows.
2011-01-01 20:53:54 +01:00
Andreas Schneider
5331489581
tests: Fixed the torture_callbacks test.
...
We should zero the structure else ssh_callback_exists() can't be
working.
2011-01-01 19:14:54 +01:00
Andreas Schneider
2945a42c75
tests: Don't run torture_keyfiles on Windows.
...
This test needs ssh-keygen to be working.
2011-01-01 19:14:54 +01:00
Andreas Schneider
1f47730a82
tests: Fixed Windows build of torture_options.
2011-01-01 19:14:49 +01:00
Andreas Schneider
1b88542fbe
misc: Avoid redefine of _WIN32_IE.
2011-01-01 18:43:37 +01:00
Andreas Schneider
530629c5a7
cmake: Added ssl libraries for OS/2.
2010-12-31 14:55:36 +01:00
Andreas Schneider
98b5f07631
cmake: Fixed a warning on OS/2 if the compiler version is empty.
2010-12-31 14:41:50 +01:00
Andreas Schneider
f46bf41813
libssh: Don't use the visibility flag on OS/2.
2010-12-31 14:35:06 +01:00
Andreas Schneider
8e632b14d1
cmake: Fixed installation path for OS/2.
2010-12-31 14:08:20 +01:00
Andreas Schneider
4728ac54fc
build: Fixed some build warnings.
2010-12-30 12:12:34 +01:00
Andreas Schneider
da86340551
cmake: Improved the ctest file.
2010-12-30 12:12:06 +01:00
Andreas Schneider
fc8fdcb16b
cmake: Only use Profiling on Unix systems.
2010-12-30 11:55:13 +01:00
Andreas Schneider
be68cfe923
cmake: Fixed NSIS detection on Windows.
2010-12-30 11:17:48 +01:00
Andreas Schneider
cb48057098
threads: Fixed ssh_pthread_thread_id with mingw.
2010-12-30 00:39:07 +01:00
Andreas Schneider
ef91ac4ea0
socket: Fixed ssh_socket_fd_set prototype.
2010-12-30 00:30:44 +01:00
Andreas Schneider
1646ce970c
cmake: Fixed find modules on Windows.
2010-12-30 00:26:37 +01:00
Andreas Schneider
08906e0f7f
tests: It is enough to include libssh.h for torture_init.
2010-12-29 21:02:51 +01:00
Andreas Schneider
887d201bd3
server: Added missing include files for getaddrinfo on Windows.
2010-12-29 20:53:28 +01:00
Andreas Schneider
1267240810
connect: Added and improved regex for ip detection.
...
Thanks to Norbert Kiesel, rlo#14.
2010-12-29 20:44:07 +01:00
Andreas Schneider
296767afc4
server: Added include files for getaddrinfo.
2010-12-29 20:36:14 +01:00
Andreas Schneider
13f3679b2f
tests: Fixed torture_get_user_home_dir on Windows.
2010-12-29 20:35:55 +01:00
Andreas Schneider
f3a6c3152c
cmake: Don't build torture_rand on Windows.
2010-12-29 20:33:32 +01:00
Andreas Schneider
80d7ccb522
cmake: Added missing include dirs for libssh.
2010-12-29 20:18:18 +01:00
Andreas Schneider
78abf5a88d
cmake: Added include and library deps to torture.
2010-12-29 20:17:36 +01:00
Andreas Schneider
ad231ccd30
cmake: Fixed test includes and libraries.
2010-12-29 20:11:00 +01:00
Andreas Schneider
d4a6c27a83
cmake: Only set profile GCC flags on UNIX systems.
2010-12-29 20:02:03 +01:00
Andreas Schneider
e7a06ad3b4
cmake: Find cmockery on Windows.
2010-12-29 19:51:46 +01:00
Andreas Schneider
d2bf90c982
build: Fixed include directories for torture lib.
2010-12-29 19:49:07 +01:00
Andreas Schneider
69ac51dfaa
connect: Added missing $ in IPREGEX.
...
Fixes rlo#14.
2010-12-29 19:48:15 +01:00
Andreas Schneider
3e2f714248
tests: Fixed a assert bug in torture_auth.
2010-12-29 09:13:17 +01:00
Aris Adamantiadis
530c17e2ef
First real benchmark : raw SSH speed
2010-12-29 00:19:05 +01:00
Aris Adamantiadis
31043334f4
Export and document timestamp functions
2010-12-29 00:19:05 +01:00
Andreas Schneider
361e37dc66
tests: Added a torture_sftp_static test.
2010-12-28 22:14:47 +01:00
Andreas Schneider
df55918a41
tests: Migrated torture_proxycommand to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
e6329c72d1
tests: Migrated torture_knownhosts to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
8bd29736d2
tests: Migrated torture_auth to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
0b2cf70622
tests: Migrated torture_algorithms to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
b0446ad55d
tests: Migrated torture_rand to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
d04ce30b03
tests: Migrated torture_options to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
512b776245
tests: Migrated torture_misc to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
d44919dfd4
tests: Migrated torture_list to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
99d45c686c
tests: Moved torture_knownhosts to client tests.
2010-12-28 22:14:47 +01:00
Andreas Schneider
2bc03d22a1
tests: Migrated torture_keyfiles to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
fa17f33d2b
tests: Migrated torture_init to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
400fc350a7
tests: Migrated torture_callbacks to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
6f65e6ae67
tests: Migrate torture_buffer to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
635a263f64
tests: Migrate the torture library to cmockery.
2010-12-28 22:14:47 +01:00
Andreas Schneider
17f592d4dd
tests: Start to migrate tests to cmockery.
...
https://code.google.com/p/cmockery/wiki/Cmockery_Unit_Testing_Framework
2010-12-28 22:14:47 +01:00
Aris Adamantiadis
7dc183126a
Set variables in the good order
2010-12-28 13:50:34 +01:00
Aris Adamantiadis
4fe1656cf8
Moved benchmarks to the tests/ directory
2010-12-28 13:17:27 +01:00
Aris Adamantiadis
a883330101
New benchmark framework
...
with pluggable style benchmarks and an original SSH RTT calculator !
2010-12-28 02:19:15 +01:00
Andreas Schneider
f0d811edc6
ctest: Added more valgrind suppressions.
2010-12-28 00:38:11 +01:00
Andreas Schneider
438083542d
connect: Use a better IP regex.
2010-12-28 00:24:47 +01:00
Aris Adamantiadis
4fa2e4dde1
Added compression options and allow "yes/no" setting
...
SSH_OPTION_COMPRESSION and SSH_OPTION_COMPRESSION_LEVEL options have been added. Now, end-level apps may simply choose to enable compression without knowing the relevant algorithms behind it.
2010-12-27 23:28:39 +01:00
Andreas Schneider
32c0e1c99a
test: Added openssh checks to the compression tests.
2010-12-27 22:47:37 +01:00
Andreas Schneider
b4c62ac9ea
server: Replace gethostbyname() with getaddrinfo().
...
Fixes rlo#13.
2010-12-27 21:51:55 +01:00
Andreas Schneider
a0e98f585a
misc: Fixed a possible memory leak.
2010-12-27 18:08:30 +01:00
Andreas Schneider
7c728acd12
sftp: Fixed a memory leak in sftp_xstat.
...
Thanks to dsc for the bug report.
2010-12-27 17:52:24 +01:00
Andreas Schneider
38b87aab08
channels: Fixed a build warning.
2010-12-23 10:18:09 +01:00
Andreas Schneider
33c41074a7
libsshpp: Fixed return of non-void function.
2010-12-23 08:54:39 +01:00
Andreas Schneider
936c65f03e
options: Remove unused variable.
2010-12-21 21:29:22 +01:00
Andreas Schneider
825581d0dc
packet1: Fixed dead assignments.
...
Found by http://test.libssh.org/scan-build/
2010-12-21 16:29:08 +01:00
Aris Adamantiadis
942b993f57
Add log verbosity to some testcases
2010-12-21 16:21:49 +01:00
Andreas Schneider
e6bc4b4ff9
doc: Added samplessh hint to INSTALL.
2010-12-21 16:21:02 +01:00
Andreas Schneider
04e224c3b4
doc: Updated Changelog.
2010-12-21 15:51:07 +01:00
Andreas Schneider
19ab9a015f
doc: Added copyright policy section.
2010-12-21 15:40:36 +01:00
Andreas Schneider
94fe52870b
doc: Update README.
2010-12-21 15:24:38 +01:00
Andreas Schneider
55470aaaf1
doc: Remove the note.
2010-12-21 15:13:18 +01:00
Andreas Schneider
6a26335158
doc: Some fixes for linking howto.
2010-12-21 15:07:42 +01:00
Andreas Schneider
256e88690d
doc: Make the warning bold.
2010-12-21 15:03:13 +01:00
Andreas Schneider
3a94c94f20
doc: More linking details.
2010-12-21 14:55:39 +01:00
Andreas Schneider
473d3e0b3a
ctest: Set the suppression file correctly.
2010-12-21 14:43:14 +01:00
Andreas Schneider
d5df18a14f
build: Fixed build warning on FreeBSD.
2010-12-20 15:49:29 +01:00
Andreas Schneider
bffaa86664
build: Fixed some build warnings on FreeBSD.
2010-12-20 15:45:49 +01:00
Aris Adamantiadis
1922341e2a
New benchmarks directory
2010-12-19 18:56:16 +01:00
Andreas Schneider
bcfab67daf
ctest: Set the memcheck suppression file correctly.
2010-12-19 16:30:23 +01:00
Andreas Schneider
27f170011e
ctest: Set suppression file only in CTestConfig.
2010-12-19 12:54:52 +01:00
Andreas Schneider
5cb4c9451f
ctest: Make sure we have a clean source tree for each build.
2010-12-19 12:54:52 +01:00
Aris Adamantiadis
80408d5357
Fixed memory leak reported by valgrind
2010-12-19 12:37:21 +01:00
Aris Adamantiadis
47d11734e1
Fix free() on uninitialized data on some cases.
2010-12-19 12:33:31 +01:00
Andreas Schneider
14d6b8856f
example: Fixed gcc warning.
2010-12-18 14:05:06 +01:00
Andreas Schneider
48e4df4ac0
TODO server: Fixed server support.
2010-12-18 14:02:53 +01:00
Andreas Schneider
f5d0f232c8
ctest: Fixed git URL.
2010-12-18 12:15:14 +01:00
Andreas Schneider
d6a5e5cb68
test: Fixed the default ctest file.
2010-12-15 19:15:02 +01:00
Andreas Schneider
751f202f56
doc: Follow the current naming convention.
2010-12-10 20:28:59 +01:00
Andreas Schneider
37eeb854e4
doc: Started to write a linking howto.
2010-12-10 20:17:57 +01:00
Andreas Schneider
57d752a1c3
include: Only require LIBSSH_STATIC on Windows.
2010-12-10 20:02:15 +01:00
Andreas Schneider
ef1cfbea70
build: Use the same name for static and shared library.
2010-12-10 20:00:23 +01:00
Andreas Schneider
038c764055
server: Remove channel_write_stderr.
2010-12-08 10:52:15 +01:00
Andreas Schneider
3ea33f9ab6
doc: Some small fixes in server.h.
2010-12-07 21:43:26 +01:00
Andreas Schneider
1758c172a2
doc: Fixed pki doc group.
2010-12-07 21:28:50 +01:00
Andreas Schneider
2a6cbed121
doc: Define a doc group for the callbacks.
2010-12-07 21:25:53 +01:00
Andreas Schneider
92fc2d6993
doc: Added buzzword.
2010-12-07 20:59:08 +01:00
Aris Adamantiadis
2dba4839ad
Fix from Oleksandr Shneyder
...
http://www.libssh.org/archive/libssh/2010-11/0000005.html
2010-12-07 16:13:40 +01:00
Andreas Schneider
0825abd03a
doc: Fixed doc namespace to be able to install manpages.
2010-12-05 10:53:39 +01:00
Aris Adamantiadis
f58441f474
Moved declarations from auth.h to various headers
2010-10-30 22:38:09 +02:00
Aris Adamantiadis
0e82cdeadc
Moved includes from priv.h to bind.h
2010-10-27 23:06:38 +02:00
Aris Adamantiadis
b6901ec4b9
Fix senddata.c for 32bits machines
2010-10-27 22:53:20 +02:00
Aris Adamantiadis
ea4aa26dbb
Split ssh_bind functions in a new .c file
2010-10-20 16:54:22 +02:00
Aris Adamantiadis
98221f4e36
Fixed a bunch of smallish bugs
...
http://linuxtesting.org/upstream-tracker/test_results/libssh/current/test_results.html
for a whole list
2010-10-20 14:47:11 +02:00
Aris Adamantiadis
8e2699e161
start of work to have callbackbased ssh_bind
2010-10-19 23:51:32 +02:00
Andreas Schneider
01eb20e13f
cmake: Fixed a problem with ccache.
2010-10-19 11:50:29 +02:00
Aris Adamantiadis
b129181809
Adapt comments in options to give parameters types
2010-10-15 16:53:18 +02:00
Aris Adamantiadis
3253ece2a2
Oops, libssh.h did not compile anymore
2010-10-15 16:43:38 +02:00
Aris Adamantiadis
4b462449cf
Fix OPTIONS_BINDADDR, PROXYCOMMAND constant change
2010-10-14 11:53:30 +02:00
Aris Adamantiadis
4f8907a524
Removed the global poll ctx in fav. of /session ctx
2010-10-12 17:57:15 +02:00
Aris Adamantiadis
7b1359042c
Add zlib@openssh.com on the list of compression
2010-10-04 16:23:43 +02:00
Aris Adamantiadis
da9cd2e64d
Implemented zlib@openssh.com compression
2010-10-04 16:19:20 +02:00
Aris Adamantiadis
5d1636985b
Resolved the server blocked bug
2010-10-03 21:36:03 +02:00
Aris Adamantiadis
088b86d4fe
Fix doxygen warnings
2010-10-03 16:16:30 +02:00
Aris Adamantiadis
9a89fba332
resolve memory consumption bug
2010-10-03 13:31:02 +02:00
Aris Adamantiadis
0bc032726d
Fix prepend bug
2010-10-03 13:01:21 +02:00
Aris Adamantiadis
b2f571e544
test the buffer_prepend_data function
2010-10-03 12:25:33 +02:00
Aris Adamantiadis
338a3d9b05
Removed references to ssh_buffer_get_begin
2010-10-03 12:07:00 +02:00
Aris Adamantiadis
5687d6e79a
Added buffer test case
2010-10-03 12:06:47 +02:00
Aris Adamantiadis
a9ec8b055f
Fix warnings on testcases
2010-10-02 23:27:26 +02:00
Aris Adamantiadis
5f69d494ad
Fix documentation of ssh_set_message_callback
2010-10-02 23:24:19 +02:00
milo
3d8cfa9973
Don't grow window if there is no space in the buffer
2010-10-02 22:55:53 +02:00
Aris Adamantiadis
0d5cc01f1c
Fix the window not growing problem
...
Fix conflict with patch from milo
Conflicts:
src/channels.c
2010-10-02 22:54:59 +02:00
milo
d7581c4daa
Change path to ../src instead of the old ../libssh
2010-10-02 22:52:24 +02:00
milo
524302ca7e
Added ssh_channel_write_stderr() for the server
2010-10-02 22:52:06 +02:00
milo
2617024136
Added channel features on the server
...
- ssh_channel_request_send_exit_status()
- ssh_channel_request_send_exit_signal()
- enhanced these features client-side
2010-10-02 22:51:49 +02:00
milo
26d40b5354
Handle global requests and reverse forwarding
2010-10-02 22:51:35 +02:00
milo
c4356531f7
Add new callbacks in session and channels
2010-10-02 22:51:14 +02:00
Aris Adamantiadis
873e02fc6a
First step getting rid of ssh_buffer_get_begin
2010-10-01 23:41:04 +02:00
Aris Adamantiadis
985db35173
Rewrote channel_read_buffer to use ssh_channel_read
2010-10-01 23:03:08 +02:00
Aris Adamantiadis
c4e67730a3
Convert sftp.c to ssh_channel_read
2010-10-01 21:41:56 +02:00
Aris Adamantiadis
9f7e2c3252
Update the window *after* effective read
2010-10-01 18:56:57 +02:00
Aris Adamantiadis
5675fbe73e
Fix the behaviour of channel window handling
2010-10-01 18:38:08 +02:00
Aris Adamantiadis
5b1c985a0e
Changed the threads cbks from struct to publ func
2010-09-30 11:10:08 +02:00
Aris Adamantiadis
bedc65313f
Removed the extern char *environ
2010-09-30 10:42:55 +02:00
Aris Adamantiadis
9f53906209
Remove extern environ from the requirements
2010-09-29 17:06:54 +02:00
Andreas Schneider
be837cdbc2
misc: Fixed a typo.
2010-09-29 14:19:07 +02:00
Andreas Schneider
38359672a5
misc: Make sure ssh_analyze_banner has proper length checks.
2010-09-29 12:12:14 +02:00
Andreas Schneider
1b471256d4
misc: Differentiate between client and server in ssh_analyze_banner.
2010-09-29 12:11:43 +02:00
Andreas Schneider
30e22fed6e
misc: Fixed a possible data overread and crash bug.
2010-09-29 11:29:37 +02:00
Andreas Schneider
8b719e51cf
misc: Move ssh_analyze_banner to a common location.
...
Don't duplicate functions!
2010-09-29 11:26:35 +02:00
Andreas Schneider
72b62d3064
build: Fixed the unit test build.
2010-09-29 11:26:16 +02:00
Andreas Schneider
5f24a84298
known_hosts: Added missing include.
...
Thanks miloj ;)
2010-09-29 11:17:46 +02:00
Andreas Schneider
1eaf55c5f6
keyfiles: Fixed unlink warning.
2010-09-28 19:16:42 +02:00
Andreas Schneider
9d3b84c914
threads: Fixed windows build.
...
MSVC isn't C99.
2010-09-28 19:12:01 +02:00
Andreas Schneider
b391a7603a
pki: Create a file for known_hosts functions.
2010-09-28 19:09:29 +02:00
Andreas Schneider
45b551d4f7
build: Remove unneeded include directories.
2010-09-28 19:08:11 +02:00
Andreas Schneider
15e4ec38f2
pki: Added GPL to header file.
2010-09-28 19:07:16 +02:00
Andreas Schneider
8c318fcb21
keyfiles: Fixed the windows defines.
2010-09-28 19:06:49 +02:00
Andreas Schneider
a2fe4b2b2c
options: Rename HOSTKEYCHECK to STRICTHOSTKEYCHECK.
...
Looks like people are confused by the name and think this is normal host
key checking.
2010-09-28 14:13:18 +02:00
Andreas Schneider
e36c9c529b
options: Fixed documentation of SSH_OPTIONS_HOSTKEYCHECK.
2010-09-28 14:10:15 +02:00
Aris Adamantiadis
41c4e1f5c8
Completed senddata example to exit someday
2010-09-26 23:11:07 +02:00
Aris Adamantiadis
75a0281a6b
Fixed outgoing flow control + writes behaviours
2010-09-26 22:33:58 +02:00
Vic Lee
a92545517a
socket.c: Fixed setting max_fd which breaks ssh_select().
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-09-20 19:22:19 +02:00
Andreas Schneider
fe31fcaeef
pki: Fixed a possible crash.
2010-09-18 20:59:29 +02:00
Aris Adamantiadis
f7ea9a3f27
Added documentation for threading
2010-09-12 22:34:38 +02:00
Aris Adamantiadis
b0c03280d1
ssh_threads_init is private
2010-09-12 22:01:21 +02:00
Aris Adamantiadis
5eb7c7b6ec
Added initialisation logs for threading
2010-09-12 21:53:42 +02:00
Aris Adamantiadis
b7af2b2959
Changed callbacks type
2010-09-12 21:45:53 +02:00
Andreas Schneider
9f02a817ff
build: Added -pedantic-errors.
2010-09-10 21:46:36 +02:00
Andreas Schneider
6345afabf8
build: Remove unneeded debug message.
2010-09-09 20:09:44 +02:00
Aris Adamantiadis
899db7cf22
Fix #ifdef'ed erroneous debug code in buffer.c
2010-09-09 10:01:29 +02:00
Andreas Schneider
f45dc29eb2
build: Improve pthread detection.
2010-09-08 16:51:55 +02:00
Andreas Schneider
d2f38da094
build: Make sure LIBSSH_THREADS_LINK_LIBRARIES is in the cache.
2010-09-08 16:43:55 +02:00
Andreas Schneider
697d51cd93
build: Make sure to link against all required thread libraries.
2010-09-08 16:32:54 +02:00
Andreas Schneider
f9b0dca7bd
build: Fixed options parsing.
2010-09-08 16:29:50 +02:00
Andreas Schneider
03087e020c
build: Improve the check for argp.
2010-09-08 11:41:14 +02:00
Andreas Schneider
4f75fdcd14
build: There is no need to check for system libraries on Linux.
2010-09-08 11:20:10 +02:00
Andreas Schneider
031c06419b
build: Added DefinePlatformDefaults cmake file.
2010-09-08 11:20:10 +02:00
Andreas Schneider
254a08f540
build: Cleanup DefineCompilerFlags.
2010-09-08 11:20:10 +02:00
Andreas Schneider
76ead916ce
build: Fixed linking against libssh in thread library.
2010-09-08 10:50:06 +02:00
Andreas Schneider
ab2dafc44a
socket: Make code easier to read and debug.
2010-09-07 18:50:38 +02:00
Andreas Schneider
325cc4e395
session: Fixed a memory leak with session->bindaddr.
2010-09-07 17:30:10 +02:00
Andreas Schneider
c1604eff08
misc: Fixed a memory leak.
2010-09-07 17:26:07 +02:00
Andreas Schneider
77b52a5e69
doc: Added links to the RFCs.
2010-09-07 10:27:46 +02:00
Andreas Schneider
d414c4f500
doc: Fixed doxygen config.
2010-09-07 09:55:15 +02:00
Éric Bischoff
398bc769ce
doc: More work on the tutorial.
2010-09-07 09:54:42 +02:00
Aris Adamantiadis
49f57a8d0d
Implemented the noop and native pointers
2010-09-06 16:52:14 +02:00
Andreas Schneider
fbe102bada
threads: Build a libssh threading library.
2010-09-06 15:17:03 +02:00
Aris Adamantiadis
2cca490076
Moved pthread specific code in src/threads/pthread.c
...
pthread example doesn't compile du to the lack of
libssh_threads_native.so library
2010-09-06 14:51:01 +02:00
Andreas Schneider
f7842e3a4b
misc: Rename libssh/ to src/
2010-09-06 14:28:38 +02:00
Éric Bischoff
38421403d2
doc: Some corrections for shell execution.
2010-09-06 11:03:00 +02:00
Andreas Schneider
461dde231c
build: Fixed a wrong if statement.
2010-09-05 13:11:19 +02:00
Andreas Schneider
0785c522f0
build: Fixed build with gcc 3.4.
...
The -fvisibility=hidden flag is broken in gcc 3.4. This fixes the build
on CentOS, bug #74 .
2010-09-05 12:56:01 +02:00
Andreas Schneider
2656c6b4ac
server: Fixed a shadowed variable.
2010-09-05 12:34:12 +02:00
Andreas Schneider
ed5ebe7458
tests: Fixed cmdline parsing.
2010-09-05 12:34:12 +02:00
Andreas Schneider
d71d6afa34
tests: Disable options parsing if argp isn't available.
2010-09-03 15:44:41 +02:00
Andreas Schneider
2f8f230f61
build: Added support to find argp on BSD.
2010-09-03 15:38:12 +02:00
Aris Adamantiadis
285388409f
Made pthread threading a user macro
2010-09-03 12:03:04 +02:00
Andreas Schneider
aff5786ed3
thread: Fixed detection of thread libraries on Windows.
2010-09-02 12:31:59 +02:00
Andreas Schneider
f97928c740
build: Fixed checking for printf function on Windows.
2010-09-02 11:50:21 +02:00
Andreas Schneider
bca73b8340
poll: Fixed the Windows build on Vista and newer.
2010-09-01 23:31:24 +02:00
Aris Adamantiadis
e67d834156
Fix initialization of threading
2010-09-01 16:05:06 +02:00
Andreas Schneider
a93f2d8bfe
build: Fixed pthread detection.
2010-09-01 15:15:17 +02:00
Aris Adamantiadis
8c55294ea9
Openssl implementation of threading + default imp
2010-09-01 14:07:45 +02:00
Aris Adamantiadis
50d8d75d89
some more work on threading but not complete yet
2010-08-31 16:49:55 +02:00
Aris Adamantiadis
bcc2d8474c
Begin of a solution for threading
2010-08-30 23:44:03 +02:00
Aris Adamantiadis
e34da1b94d
Added "fix" for libgcrypt threading, ...
...
... but it doesn't seem to work. This is however the recommanded
way of initializing threading :
http://lists.gnupg.org/pipermail/gcrypt-devel/2009-February/001452.html
2010-08-30 14:39:35 +02:00
Aris Adamantiadis
717eff71dd
Added test for the openssl threading
2010-08-30 14:08:07 +02:00
Éric Bischoff
ad95cbc542
doc: Added documentation for tunnels.
2010-08-29 16:25:31 +02:00
Aris Adamantiadis
b30aff6d4d
Mark channel_read_buffer as deprecated in doxygen
2010-08-29 00:12:01 +02:00
Aris Adamantiadis
bf9a82ad9a
Limit the size of packets in ssh_channel_write*
2010-08-28 23:59:18 +02:00
Aris Adamantiadis
c1efcd28f5
Fixes bug #99
...
returns error when no cryptographic context is available
2010-08-28 23:35:59 +02:00
Aris Adamantiadis
1fa9409554
ssh_channel_forward_* -> ssh_forward_*
...
Fixes bug #108
2010-08-28 23:31:07 +02:00
Aris Adamantiadis
adcd2e38e9
libsshpp: do not use deprecated functions
2010-08-28 22:53:18 +02:00
Aris Adamantiadis
c19fb5656b
Fixed missing libsshpp methods
2010-08-28 22:51:23 +02:00
Aris Adamantiadis
74939b8b8d
Added missing /** in doxygen @}'s
2010-08-28 21:32:08 +02:00
Aris Adamantiadis
29a229724b
Fix a few documentation issues
2010-08-28 21:05:24 +02:00
Aris Adamantiadis
a9fafc32a8
Near to end of implementation of the C++ wrapper
2010-08-28 13:59:24 +02:00
Andreas Schneider
2de227a88b
doc: Fixed section names.
2010-08-27 16:22:38 +02:00
Éric Bischoff
31ad140d20
doc: More work on the tutorial.
2010-08-27 16:20:17 +02:00
Aris Adamantiadis
bcf4e56fe0
Fix C++ documentation about the exceptions
2010-08-27 12:01:42 +02:00
Aris Adamantiadis
1834ca3820
Added a SSH_NO_CPP_EXCEPTIONS mode to libsshpp.h
2010-08-27 11:53:38 +02:00
Andreas Schneider
ad4a4120b7
doc: Add more details to the mainpage.
2010-08-27 11:45:13 +02:00
Andreas Schneider
0800f7ba56
doc: Added a newline on the mainpage.
2010-08-27 11:33:43 +02:00
Andreas Schneider
36576babe8
doc: Document the server responses.
2010-08-27 11:27:42 +02:00
Éric Bischoff
ba9f5b7d95
doc: Improved the tutorial.
2010-08-27 11:11:08 +02:00
Andreas Schneider
11a5383604
poll: Fixed the ssh_poll_(init/cleanup) functions.
2010-08-25 23:11:54 +02:00
Andreas Schneider
d991606493
poll: Fixed the usage of WSAPoll() on Windows.
...
This should fix ticket #101 .
2010-08-25 23:11:54 +02:00
Aris Adamantiadis
14048354d5
Fix conflicts/ missing /** */ in doxygen
2010-08-23 21:21:57 +02:00
Eric Bischoff
94b689e19d
New update of doxygen documentation
2010-08-23 21:00:35 +02:00
Aris Adamantiadis
8066100f53
Doxygen fixes
2010-08-23 20:48:30 +02:00
Aris Adamantiadis
f60c22628a
lot of C++ wrapper work
2010-08-23 20:34:17 +02:00
Aris Adamantiadis
53e608cbc4
Changed SSH_SUCCESS to SSH_OK
2010-08-20 13:01:12 +02:00
Aris Adamantiadis
d10e73ffd7
Fixed "@deprecated" in doxygen
2010-08-20 13:00:10 +02:00
Aris Adamantiadis
1e75841036
Obsoletes ssh_auth_list, comment ssh_userauth_list
2010-08-19 19:51:18 +02:00
Eric Bischoff
32bf28e7ef
doc: Improve the tutorial.
2010-08-19 15:06:38 +02:00
Aris Adamantiadis
fd5aeba117
Change SOversion to 4.2.0 instead of 5.0.0
2010-08-18 23:18:57 +02:00
Milo Jhoran
24b524040b
server: Added an API entry for the message callback.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-13 11:17:18 +02:00
milo
e533c3f33b
server: Fix missing socket close notification.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-13 11:17:09 +02:00
Aris Adamantiadis
41ab19e1d0
Log Proxycommand command executed
2010-08-10 14:32:03 +02:00
Andreas Schneider
77475bdd55
misc: Added %p for port to ssh_path_expand_escape().
2010-08-10 11:10:26 +02:00
Milo Jhoran
0c70e80d47
Fix typos in port forwarding (server side)
2010-08-10 00:49:24 +02:00
Andreas Schneider
5aa4592f0c
example: Fixed build of samplesshd.
2010-08-10 00:32:51 +02:00
milo
855b73de87
server: Split ssh_bind_accept and create ssh_handle_key_exchange.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-10 00:30:25 +02:00
Aris Adamantiadis
136f4d3b0d
Removed unnecessary headers in samplesshd
2010-08-09 22:08:43 +02:00
Aris Adamantiadis
714edcb8d9
Moved content from deprecated.c to legacy.c
2010-08-09 22:05:33 +02:00
Andreas Schneider
a6b6a61775
server: Make ssh_accept a depreacted function to not break the API.
2010-08-09 21:39:32 +02:00
Andreas Schneider
39c9a6dfed
server: Merge ssh_bind_accept.
2010-08-09 21:28:47 +02:00
Andreas Schneider
561df8d9a2
server: Rename ssh_accept to ssh_bind_accept.
2010-08-09 20:54:43 +02:00
milo
48a20a6137
example: Fixed the sample ssh server implementation.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-09 20:54:40 +02:00
milo
8ef0fbc294
server: Fixed the server implementation.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-09 20:54:32 +02:00
milo
51a21823f9
server: Added a define to set the server status.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-09 20:54:28 +02:00
milo
7a68331fcd
messages: Make sure we pop the message at the beginning.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-09 20:54:23 +02:00
milo
d896d6393b
wrapper: Added a log message if client kex is empty.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-09 20:54:17 +02:00
milo
6d531ed0a6
session: Set needed poll events for handling packets.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-09 20:54:13 +02:00
milo
06df7c1b31
socket: Make sure we only transmit data if we have some.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-09 20:54:06 +02:00
milo
2b108483ce
pcap: Zero the pcap structure.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-09 20:54:01 +02:00
milo
23c745d335
kex: Fixed initialization of server kex.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-09 20:53:56 +02:00
milo
eb361626cb
session: Added callback for the connection per session.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-09 20:53:49 +02:00
milo
b0f8ca556b
session: Fixed the type of the session dh_handshake_state.
...
Signed-off-by: Andreas Schneider <asn@cynapses.org >
2010-08-09 20:53:03 +02:00
Andreas Schneider
e41e28744f
build: Added a check for NSIS.
2010-08-03 18:13:59 +02:00
Andreas Schneider
e862f04527
build: Set a default zlib search path for windows.
2010-08-03 18:13:59 +02:00
Andreas Schneider
42519db55d
build: Set a default openssl search path for windows.
2010-08-03 18:13:59 +02:00
Andreas Schneider
019cb77b84
build: Don't test for big endian on Windows.
...
Visual Studio 2010 has problems running the test.
2010-08-03 18:13:59 +02:00
Andreas Schneider
296f6a9217
build: Fixed the Windows preprocessor macros and defines.
2010-08-03 18:13:59 +02:00
Aris Adamantiadis
d688ed2553
Begining of zlib@openssh.org implementation
2010-07-23 16:49:28 +02:00
Aris Adamantiadis
b4c0b03694
Added the client unit testing information
2010-07-23 11:04:09 +02:00
Aris Adamantiadis
e721c122d3
Continue removing old flushing code
2010-07-23 11:01:06 +02:00
Aris Adamantiadis
8cd0d0040e
Removed obsolete socket functions
2010-07-23 08:27:05 +02:00
Aris Adamantiadis
e5542b027b
State error in server.c
2010-07-23 08:18:37 +02:00
Aris Adamantiadis
5aa9cf2fcf
Add consistency check to ssh_set_callbacks
2010-07-23 08:09:57 +02:00
Aris Adamantiadis
a924869096
Receive and send SSH_MSG_UNIMPLEMENTED
2010-07-18 00:39:51 +02:00
Aris Adamantiadis
8c08b062d0
Fixed channel opening failures (infinite loop)
2010-07-17 23:51:15 +02:00
Aris Adamantiadis
96b06e8bb4
Fixed keepalive problem on older openssh servers
...
Conflicts:
libssh/channels.c
2010-07-16 23:16:04 +02:00
Aris Adamantiadis
a8efffa969
New example for port forwarding
...
Conflicts:
examples/CMakeLists.txt
2010-07-16 23:14:47 +02:00
Andreas Schneider
ef0215fcf2
poll: Added poll constants for Windows.
...
WSAPoll uses different constanst values as the POSIX implementation,
what else ...
2010-07-09 09:49:21 +02:00
Andreas Schneider
82beeea619
options: Added option to bind a client to an ip address.
...
Thanks to Donatello Boccaforno <donatello.boccaforno@gmail.com >.
2010-07-07 12:43:50 +02:00
Aris Adamantiadis
a18a3813fb
Removed dead code in socket.c
2010-07-07 10:19:47 +02:00
Andreas Schneider
b8180f4069
poll: FD_SETSIZE is only for the count value of FD_SET on Windows.
2010-07-06 00:41:00 +02:00
Aris Adamantiadis
94b00cc762
Add ssh_callbacks_exists internal macro + unittest
...
(first commit with eclipse helios, crossing fingers ...)
2010-06-25 16:19:19 +02:00
Andreas Schneider
e4701e7c86
poll: Another attempt to get bsd_poll() working correctly.
2010-06-24 09:19:34 +02:00
Andreas Schneider
fc625b8a8e
poll: Fixed building with poll-emulation on UNIX.
2010-06-24 09:19:26 +02:00
Andreas Schneider
703f125882
agent: Use the our poll typedef.
2010-06-24 09:19:10 +02:00
Andreas Schneider
4581b24b48
poll: Added a comment to the bsd_poll() implementation.
2010-06-22 14:44:35 +02:00
Andreas Schneider
1d84821d93
poll: Handle FD_SETSIZE in bsd_poll().
2010-06-22 14:44:24 +02:00
Andreas Schneider
07f607ec4c
poll: Fixed a comparsion.
2010-06-22 14:43:48 +02:00
Aris Adamantiadis
c3833c6c03
Fix threadsafety issue in zlib code
2010-06-22 12:42:13 +02:00
Aris Adamantiadis
65008e2d3c
Fixes leak reports in valgrind
2010-06-21 15:47:34 +02:00
Andreas Schneider
d33a97b663
poll: Fixed a typo.
2010-06-21 15:41:18 +02:00
Andreas Schneider
6f9fea7fd5
poll: Check if maxfd has been set.
2010-06-20 21:18:46 +02:00
Andreas Schneider
c8d978f4e9
ctest: Update config file for new cdash board.
2010-06-20 10:29:25 +02:00
Andreas Schneider
558f889aae
Fixed more fd checks.
2010-06-17 13:47:29 +02:00
Andreas Schneider
937268eb3e
torture: Fixed fd check.
2010-06-17 13:38:13 +02:00
Andreas Schneider
8be7ece1f5
client: Fixed fd checks.
2010-06-17 13:37:42 +02:00
Andreas Schneider
6127da58f2
server: Fixed types and checks of fd's.
2010-06-17 13:29:14 +02:00
Andreas Schneider
15e4e7e9da
poll: Fixed type of the fd variables and use SSH_INVALID_SOCKET.
2010-06-17 13:25:45 +02:00
Andreas Schneider
d484d4e129
channel: Fixed the type of the max fd variable in ssh_channel_select().
2010-06-17 13:23:03 +02:00
Andreas Schneider
985019ab64
agent: Use ssh_poll in agent code.
2010-06-17 13:21:22 +02:00
Andreas Schneider
870c9a7a08
socket: Rename INVALID_SOCKET_T to SSH_INVALID_SOCKET.
2010-06-17 13:19:24 +02:00
Andreas Schneider
2a6341c08c
socket: Fixed checks for max fd.
2010-06-17 13:13:35 +02:00
Andreas Schneider
78e7873e92
socket: Fixed prototype of ssh_socket_pollcallback().
2010-06-17 13:09:58 +02:00
Andreas Schneider
7ecec3eb94
poll: Fixed brackets.
2010-06-17 12:01:27 +02:00
Andreas Schneider
f4facc4e10
poll: Fixed another wrong invalid fd check in bsd_poll.
2010-06-17 11:47:39 +02:00
Andreas Schneider
edffc2a291
poll: Some code cleanup for easier debugging.
2010-06-17 11:19:05 +02:00
Andreas Schneider
c30a25e64c
poll: Fixed a malfunction with wrong max fd value check.
2010-06-17 11:16:24 +02:00
Andreas Schneider
b9a9f54c45
string: Added a function to delete a char basesd stirng object.
2010-06-11 11:05:37 +02:00
Andreas Schneider
f57d2c3277
build: Fixed building without zlib.
2010-06-11 10:43:02 +02:00
Andreas Schneider
11a1ae59f4
tests: Moved proxycommand test to client tests.
2010-06-03 16:55:45 +02:00
Andreas Schneider
cd1129b9b8
config: Use ssh log and error functions for problems.
2010-06-03 16:45:23 +02:00
Andreas Schneider
216cabc563
tests: Move getpwuid_r to a setup function.
2010-06-03 16:44:47 +02:00
Andreas Schneider
5dd4f7604f
tests: Move client tests to a seperate directory.
...
Tests which require a running sshd should go to tests/client.
2010-06-03 12:36:00 +02:00
Andreas Schneider
94ce1ea451
tests: Fixed the misc torture test.
2010-06-03 12:29:32 +02:00
Andreas Schneider
f3697a0d5c
keyfiles: Move the auth callback inside the HAVE_LIBGCRYPT ifdef.
2010-06-03 12:29:31 +02:00
Andreas Schneider
8f0d40a1dd
cpp: Fixed return value of userauthAutopubkey.
2010-06-02 10:01:46 +02:00
Andreas Schneider
a138a52021
doc: Fixed ssh_path_expand_tilde documentation.
2010-06-01 23:11:00 +02:00
Andreas Schneider
518a9b8d8c
doc: Group the poll functions and add a description.
2010-06-01 23:10:01 +02:00
Andreas Schneider
64ae0525cf
socket: According to execle(2) environ shouldn't be const.
2010-06-01 21:50:03 +02:00
Aris Adamantiadis
dc88a937f0
Fix warning for snprintf
2010-05-31 11:19:27 +02:00
Aris Adamantiadis
ac93e2aea7
Fix unclean null termination in ~ expending
2010-05-31 11:19:10 +02:00
Andreas Schneider
560e938038
misc: Move size check down in ssh_path_expand_escape().
2010-05-31 09:17:54 +02:00
Andreas Schneider
2a5d71971c
misc: Make sure the expanded string is null-terminated.
2010-05-30 10:59:47 +02:00
Andreas Schneider
a59e65336d
session: Fixed setting up default identity files.
2010-05-28 10:46:50 +02:00
Andreas Schneider
55ef7bc012
options: Make sure that we have always have default options set.
2010-05-21 10:23:19 +02:00
Andreas Schneider
d3f1d094f7
options: Set the local username if still not set.
2010-05-21 10:22:27 +02:00
Andreas Schneider
421fb2a829
keyfiles: Fixed possible problem with known_hosts path.
2010-05-21 10:08:26 +02:00
Aris Adamantiadis
517e58d3dc
Fixed keyboard-interactive and unit test
2010-05-19 14:07:40 +02:00
Aris Adamantiadis
0eaa650e32
Fix authentication test
2010-05-19 11:13:47 +02:00
Aris Adamantiadis
4fbe572c02
Added verbosity flag for unit tests
2010-05-18 23:02:41 +02:00
Aris Adamantiadis
7c0ce909ed
Added unit test for kbdint and password auth.
...
The kbdint test still doesn't pass
2010-05-18 22:49:22 +02:00
Aris Adamantiadis
f95157297e
Factorize all the main functions in unit tests
2010-05-18 22:25:06 +02:00
Aris Adamantiadis
89993dd757
Fixed unittest name
2010-05-18 22:11:41 +02:00
Andreas Schneider
75e7c30594
cmake: Fixed doxygen.
2010-05-18 00:33:58 +02:00
Andreas Schneider
5032a9f13c
doxygen: Fixed latex pdf generation.
2010-05-18 00:33:44 +02:00
Andreas Schneider
4f34062623
sftp: Fixed sftp_chown.
2010-05-17 23:37:11 +02:00
Andreas Schneider
255f5bd73f
Install missing legacy header file.
2010-05-17 23:36:39 +02:00
Aris Adamantiadis
0ec847bbe7
Added some other junk test file
2010-05-17 20:08:11 +02:00
Aris Adamantiadis
08bc076a0a
New sample that writes a lot of data on channel
2010-05-17 20:08:10 +02:00
Aris Adamantiadis
2c014256f7
Fix sftp_rename on sftp3
2010-05-17 20:08:10 +02:00
Andreas Schneider
488e822c8d
poll: Added a cleanup function to free the ws2_32 library.
2010-05-17 11:19:31 +02:00
Aris Adamantiadis
2234c115f2
Separation work between openssl and libgcrypt
2010-05-14 01:22:22 +02:00
Aris Adamantiadis
b23b3f1d99
Sanitize libssh namespace + legacy wrappers
2010-05-14 00:51:08 +02:00
Andreas Schneider
46b249f5ce
connect: Fixed signedness warnings from MSVC.
2010-05-12 21:01:18 +02:00
Andreas Schneider
b1b42aeb9c
win: Added missing includes with newer MSCV.
2010-05-12 21:01:18 +02:00
Andreas Schneider
56c867edfa
connect: Don't shadow errno.
2010-05-12 20:30:52 +02:00
Andreas Schneider
40c1a7e91f
connect: Make sure that we use float values for the status.
2010-05-12 20:27:15 +02:00
Andreas Schneider
9739dae794
proxycommand: check the return values of pipe().
2010-05-12 19:29:13 +02:00
Andreas Schneider
81793de030
Fixed building libssh with DEBUG_CRYPTO.
2010-05-12 19:24:22 +02:00
Andreas Schneider
a5157e69b1
Increment the soversion number.
2010-05-12 19:01:25 +02:00
Andreas Schneider
101a65378c
Merge branch 'look'
2010-05-12 18:42:20 +02:00
Andreas Schneider
91ef298e7d
Added runtime detection of WSAPoll().
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2010-05-12 18:22:09 +02:00
Andreas Schneider
739234afb9
Added the possibility to define _OPENSSL_DIR and _ZLIB_DIR.
2010-05-12 13:55:32 +02:00
Andreas Schneider
4ecefb5017
Fixed linking errors on Windows.
2010-05-12 13:53:25 +02:00
Andreas Schneider
444008aabc
Fixed build of ssh_lowercase and ssh_hostport on Windows.
2010-05-12 13:47:28 +02:00
Andreas Schneider
45857bc606
Fixed windows include files in pcap support.
2010-05-12 13:39:44 +02:00
Andreas Schneider
da9b2e25f6
Fixed Windows build warnings.
2010-05-12 13:08:45 +02:00
Andreas Schneider
fc508f9494
Fixed Windows build.
2010-05-12 12:46:50 +02:00
Andreas Schneider
3573bd4d87
Use the new expand functions.
2010-05-11 09:40:33 +02:00
Andreas Schneider
c7ee14e786
Added a torture test for ssh_path_expand_escape().
2010-05-11 02:10:55 +02:00
Andreas Schneider
fac56bae32
Added a function to expand an escaped string.
2010-05-11 02:10:55 +02:00
Andreas Schneider
c5c1698cde
Added a torture test for ssh_path_expand_tilde().
2010-05-11 02:10:55 +02:00
Andreas Schneider
4df7daec82
Added a function to expand the tilde from a path.
2010-05-11 02:10:55 +02:00
Aris Adamantiadis
26d04ff037
Fix style in ssh_poll_ctx_dopoll
...
Also do a rescan of polled events when a poll object has been deleted.
2010-05-10 23:19:39 +02:00
Aris Adamantiadis
5713481838
Fix options copy
2010-05-10 22:46:20 +02:00
Aris Adamantiadis
74c9c1afa9
Added code to test proxycommand
...
Conflicts:
examples/sample.c
2010-05-10 22:44:06 +02:00
Aris Adamantiadis
e159f04df8
make compression not mandatory in options_getopt
2010-05-10 22:17:29 +02:00
Aris Adamantiadis
4a21b6f168
Some grammarnazi things + fix int->socket_t
2010-05-10 22:01:09 +02:00
Aris Adamantiadis
fe16cce405
Fix crash in testcase proxycommand
2010-05-10 21:50:03 +02:00
Andreas Schneider
8ba02b6f4c
Use configure checks to define vsnprintf and strncpy.
2010-05-10 15:32:17 +02:00
Andreas Schneider
f5191ec222
Added configure checks for _vsnprintf_s and strncpy.
2010-05-10 15:27:40 +02:00
Andreas Schneider
144126789c
Added configure checks for vsnprintf and _vsnprintf.
2010-05-10 15:24:52 +02:00
Andreas Schneider
8dcfc9849e
Fixed building libssh with VC9.
2010-05-10 14:40:00 +02:00
Andreas Schneider
b28fb6654c
Fixed a MSVC build error.
2010-05-10 13:18:16 +02:00
Aris Adamantiadis
9294c3284c
Changed test name + test with invalid proxycommand
2010-05-10 11:08:32 +02:00
Andreas Schneider
9278dc0666
Added more defines to use secure VC functions.
2010-05-10 10:41:47 +02:00
Aris Adamantiadis
af519d73ae
Fix doc and actually make the test run :)
2010-05-09 01:05:12 +02:00
Aris Adamantiadis
3a326793fd
Test case for proxycommand
2010-05-09 00:54:37 +02:00
Aris Adamantiadis
f31a14b793
ssh_socket support for 2 fd + Proxyhost command
2010-05-09 00:48:10 +02:00
Aris Adamantiadis
7886326aa8
Fix u_int_x_t -> uint_x_t
2010-05-08 22:23:05 +02:00
Aris Adamantiadis
31cc03f8e6
added test for ntohll
2010-05-08 22:22:06 +02:00
Aris Adamantiadis
cf7449c525
Added tests for ssh_dirname and ssh_basename
2010-05-08 22:13:35 +02:00
Aris Adamantiadis
b0cdbf5b22
Added test for zlib compression method
...
Unfortunately the test doesn't pass. (my host doesn't support zlib, only zlib@openssh.com )
2010-05-07 13:51:10 +02:00
Aris Adamantiadis
231e378157
Added torture_algorithms test case
...
tests for all supported cipher types
2010-05-07 13:39:38 +02:00
Aris Adamantiadis
431d8fe7c7
The actual init test
2010-05-07 13:39:08 +02:00
Aris Adamantiadis
9ee4d6c697
Added torture_ssh_init unit test
2010-05-07 13:16:42 +02:00
Aris Adamantiadis
3f14d7a54a
More detailed tests
2010-05-05 14:57:47 +02:00
Aris Adamantiadis
52acb3fcac
Make unit test spit libssh error messages
2010-05-05 14:26:30 +02:00
Aris Adamantiadis
a8d08a9478
Fixed a typo in tutorial
2010-05-03 21:15:24 +02:00
Aris Adamantiadis
c691aa3e32
Forgot the pki files
2010-05-02 00:03:06 +02:00
Aris Adamantiadis
430e570629
Added pki.[ch] files as a new standard API for PKs
...
Right now it's just a wrapper to the existing calls
but soon it's gona be the effective implementation and
other calls will be wrappers.
2010-05-01 20:32:27 +02:00
Aris Adamantiadis
65dc4f1186
Match hashed [host]:port format knownhosts
2010-05-01 16:52:46 +02:00
Aris Adamantiadis
6b320a00a0
knownhosts writing and unit test
2010-05-01 12:47:44 +02:00
Aris Adamantiadis
22be109956
First implementation of known_hosts with port read
2010-05-01 00:40:10 +02:00
Aris Adamantiadis
4bb790fb5d
Fix uninitialized variable used
2010-04-28 20:22:05 +02:00
Aris Adamantiadis
7d32ec5d28
Fix warnings found with clang analyzer
2010-04-28 19:36:39 +02:00
Aris Adamantiadis
20e7ec96ae
Fix bugs found by clang analyzer
2010-04-28 18:43:41 +02:00
Aris Adamantiadis
2e563e0fa8
Fix documentation of MacroCheckCCompilerFlagSSP
2010-04-28 18:31:07 +02:00
Aris Adamantiadis
cbd0a8f4b5
Change the test file for stackprotector for clang
...
Now compiles with clang !
2010-04-28 18:01:15 +02:00
Aris Adamantiadis
ecbe577be3
Fixed warnings with clang
2010-04-28 17:23:47 +02:00
Aris Adamantiadis
84db436e3b
Fix doc and libgcrypt build
2010-04-28 12:48:47 +02:00
Aris Adamantiadis
904c6ed853
Renamed private type TYPE_RSA to SSH_KEYTYPE_*
...
Also made this enum public
2010-04-28 12:14:03 +02:00
Aris Adamantiadis
186e07b415
Added ssh_privatekey_type public function
2010-04-28 11:51:42 +02:00
Aris Adamantiadis
4ab63d3d8c
Added first unittest-based bug found :)
2010-04-27 23:48:54 +02:00
Aris Adamantiadis
696ef7aecc
Added privatekey_from_file with passphrase test
2010-04-27 23:48:18 +02:00
Aris Adamantiadis
9603f2520b
make torture_keyfiles silent
2010-04-27 23:28:18 +02:00
Aris Adamantiadis
a5a806f7ee
Added test for privatekey_from_file
2010-04-27 23:25:21 +02:00
Aris Adamantiadis
fa294e8603
Fix select loop in sample
2010-04-24 23:22:00 +02:00
Aris Adamantiadis
97d2f755c4
Do not send twice ssh_userauth_none requests
...
Thanks to Xi Wang for the bug report
2010-04-24 23:01:18 +02:00
Aris Adamantiadis
83536ab7d1
Fixes \r in SSH1 banner
...
Thanks to Xi Wang for the patch
WARNING: this may cause backward compatibility
issues with SSH1, revert if there are problems
2010-04-24 22:47:34 +02:00
Aris Adamantiadis
6cdbc01208
Fixes infinite loops
...
Thanks to Xi Wang for the patches
2010-04-24 22:46:19 +02:00
Andreas Schneider
833903e8ec
torture: Fix compiling options test if NSS_BUFLEN_PASSWD isn't defined.
...
Thanks to Xi Wang for the patch.
2010-04-20 13:30:07 +02:00
Andreas Schneider
c53383a316
session: Fixed a memory leak.
...
Thanks to Xi Wang for the patch.
2010-04-20 13:29:50 +02:00
Andreas Schneider
dfc35699ea
packet: Fixed linking if we build without server support.
...
Thanks to Xi Wang for the patch.
2010-04-20 13:28:54 +02:00
Andreas Schneider
b7a7c816df
kex: Fixed a memory leak.
...
Thanks to Xi Wang for the patch.
2010-04-20 13:28:12 +02:00
Andreas Schneider
090f036205
channels: Don't use signal as a name.
...
Thanks to Xi Wang for the patch.
2010-04-20 13:27:12 +02:00
Andreas Schneider
8738e93dc0
cmake: Fixed openssl detection.
...
Thanks to Xi Wang for the patch.
2010-04-20 13:25:46 +02:00
Aris Adamantiadis
ee2bee88ee
Fix warnings
2010-04-14 21:20:42 +02:00
Aris Adamantiadis
6ffd38d25e
Fix doublefree happening after a negociation error
...
Fix the cherry-pick merge
Conflicts:
libssh/client.c
2010-04-14 21:14:32 +02:00
Aris Adamantiadis
250273cf1a
Do not compile aes*-ctr with <=OpenSSL 0.9.7b
2010-04-14 21:11:29 +02:00
Aris Adamantiadis
bc15f7b7aa
Fix missing string_data() in crypto debug code
2010-04-14 21:11:19 +02:00
Aris Adamantiadis
7c3040c624
First experiment at trying to make libssh c89
2010-04-07 13:20:30 +02:00
Andreas Schneider
c584b55488
Added the copyright policy to the README.
2010-04-07 11:29:47 +02:00
Ruben Garcia Azuara
5a2abd34ce
Added support for StrictHostKeyChecking and UserKnownHostsFile parameters.
...
Added OpenSSH parameters to libssh:
- StrictHostKeyChecking
- UserKnownHostsFile
This parameters are useful to avoid checking the fingerprint. Eg:
~/.ssh/config:
Host 192.10.20.30
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
Signed-off-by: Ruben Garcia Azuara <rubenga@tid.es >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2010-04-07 11:29:47 +02:00
Ruben Garcia Azuara
14eb593af3
Fixed solaris compilation warning and ignore case at host parameter.
...
- Suppress compilation warning in solaris caused by a comma at the end of
the last value.
- Ignore case at host parameter in config file
Signed-off-by: Ruben Garcia Azuara <rubenga@tid.es >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2010-04-07 11:29:47 +02:00
Aris Adamantiadis
b2b7bc3b77
Fix building on win32/vs7
2010-04-06 23:24:25 +02:00
Andreas Schneider
fddbf1f94c
Added a select(2) based poll-emulation if poll(2) is not available.
2010-04-04 17:38:50 +02:00
Andreas Schneider
5d5f6cc60c
Fixed the group of the pcap functions.
2010-04-04 17:38:50 +02:00
Andreas Schneider
ae64c19f20
Fixed the group of the server functions.
2010-04-04 17:38:50 +02:00
Andreas Schneider
e5abc065aa
Fixed the documentation of the scp functions.
2010-04-04 17:37:05 +02:00
Andreas Schneider
4ce265b105
Fixed the documentation of the SSH messages.
2010-04-04 17:37:05 +02:00
Andreas Schneider
154e99f2ba
Fixed the documentation of channels.c.
2010-04-04 17:37:05 +02:00
Andreas Schneider
dab450be32
Fixed the doxygen group of the libssh c++ wrapper.
2010-04-04 17:37:05 +02:00
Andreas Schneider
a3db621899
Fixed documentation of socket functions.
2010-04-04 15:51:54 +02:00
Andreas Schneider
e26c6d20fe
Fixed documenation of ssh_select().
2010-04-04 15:51:54 +02:00
Andreas Schneider
a75a2bf533
Fixed documentation of dh functions.
2010-04-04 15:51:54 +02:00
Andreas Schneider
8dcfc3c94a
Fixed the documentation of the client code.
2010-04-04 15:51:54 +02:00
Andreas Schneider
19c4027194
Fixed the group of the options.
2010-04-04 15:51:54 +02:00
Andreas Schneider
0efd50df26
Fixed the documentation of key functions.
2010-04-04 15:51:54 +02:00
Andreas Schneider
a127c8827a
Fixed the documentation of log.c
2010-04-04 15:51:54 +02:00
Andreas Schneider
dcb5a81735
Fixed the documentation of misc.c
2010-04-04 15:51:54 +02:00
Andreas Schneider
4abdf47923
Fixed the documentation of error.c
2010-04-04 15:51:54 +02:00
Andreas Schneider
d39dce85b4
Fixed the documentation of buffer.c
2010-04-04 15:51:54 +02:00
Andreas Schneider
e736725d35
Fixed the documentation of auth.c
2010-04-04 15:51:54 +02:00
Andreas Schneider
d61a699543
Removed the unneeded dependency to doxygen.
2010-04-04 15:51:54 +02:00
Andreas Schneider
320b6c0cd8
Added an improved version of UseDoxygen.cmake which handles trac doc.
2010-04-04 14:10:10 +02:00
Andreas Schneider
7cf05075a0
Added a doxygen configuration for trac.
2010-04-04 14:10:00 +02:00
Andreas Schneider
3e0959fa1b
Fixed config parsing wich has overwritten user specified values.
2010-04-04 14:03:44 +02:00
Andreas Schneider
d87b29b678
Fixed Check cmake module.
2010-03-29 23:20:59 +02:00
Andreas Schneider
2c16a3c0e8
Fixed ZLIB cmake module.
2010-03-29 23:20:43 +02:00
Andreas Schneider
dc3d9bb2ab
Fixed GCrypt find module.
2010-03-29 23:20:22 +02:00
Andreas Schneider
fd4ed3909e
Fixed OpenSSL find module.
2010-03-29 23:14:04 +02:00
Andreas Schneider
3f29a3d4fa
Fixed a build warning in sftp.
2010-03-29 23:13:39 +02:00
Andreas Schneider
1a894b65d4
Fixed build warning in the sshd example.
2010-03-29 22:47:22 +02:00
Andreas Schneider
6e82193175
Fixed build warnings of the scp example.
2010-03-29 22:46:03 +02:00
Andreas Schneider
32ac1e04ec
Fixed build warnings of the ssh client example.
2010-03-29 22:44:20 +02:00
Andreas Schneider
a47a9ecad1
Fixed build warnings in the knownhosts example.
2010-03-29 22:38:38 +02:00
Andreas Schneider
d07aef725e
Fixed build warnings in the exec example.
2010-03-29 22:38:21 +02:00
Andreas Schneider
b5eb08ad09
Fixed the torture_keyfiles test.
2010-03-28 23:46:56 +02:00
Aris Adamantiadis
3ce7d7a28c
Workaround for check linkage on ubuntu amd64
2010-03-28 23:17:13 +02:00
Aris Adamantiadis
9da13d4ff8
Fixes the broken algorithm choice for server
2010-03-28 21:59:11 +02:00
Aris Adamantiadis
7d49e49e74
Fix crash when no callback is defined
2010-03-28 21:58:59 +02:00
Andreas Schneider
0689304cff
Fixed build warnings on Windows.
2010-03-25 16:48:30 +01:00
Andreas Schneider
8dd4972fda
Fixed a build warning.
2010-03-25 15:30:56 +01:00
Andreas Schneider
51436cc3a3
Fixed a build warning in ssh_userauth_autopubkey.
2010-03-25 15:30:23 +01:00
Andreas Schneider
b168b8f03f
Fixed a typo that we don't export all symbols.
2010-03-25 14:04:13 +01:00
Andreas Schneider
9e9e7e95ee
Fixed spelling.
2010-03-25 13:46:09 +01:00
Andreas Schneider
c805f0cdcb
Fix revision.
2010-03-25 13:42:30 +01:00
Andreas Schneider
e4bbba2b15
Added comments to the so version to increment it correctly in future.
2010-03-25 13:26:37 +01:00
Andreas Schneider
3a5af7fb61
Build examples only on the Linux plattform.
2010-03-17 10:12:03 +01:00
Andreas Schneider
34f2d50e29
Require check if testing is enabled.
2010-03-15 16:09:16 +01:00
Andreas Schneider
40d0ca7963
Added options for memcheck and coverage.
...
Disable it by default as only one machine should do this.
2010-03-15 16:09:05 +01:00
Andreas Schneider
095f348172
Added a ctest script for nightly builds.
2010-03-13 21:17:59 +01:00
Andreas Schneider
67c062e45e
Added a valgrind suppression file to ignore check errors.
2010-03-13 17:10:53 +01:00
Andreas Schneider
4516e7bdcb
Fixed a memory leak in the torture_get_user_home_dir test.
2010-03-13 16:59:26 +01:00
Andreas Schneider
90d72c214e
Fixed the torture_pubkey_generate_from_privkey test.
2010-03-13 16:51:52 +01:00
Andreas Schneider
8fd6c8bc02
Fixed a memory leak in keyfile torture test.
2010-03-13 16:38:43 +01:00
Andreas Schneider
863cd6fcba
Added a CTestConfig file to be able to submit to the dashboard.
2010-03-13 14:59:29 +01:00
Andreas Schneider
38fda265e8
Fixed a memory leak in ssh_try_publickey_from_file.
2010-03-13 14:59:02 +01:00
Andreas Schneider
72058bfbcc
Added tests for ssh options.
2010-03-13 14:21:23 +01:00
Andreas Schneider
74e23a7fa2
Added missing SSH_OPTIONS_FD option.
2010-03-13 14:21:01 +01:00
Andreas Schneider
6372f671ed
Remove support for SSHv1 Cipher variable.
2010-03-12 19:01:50 +01:00
Andreas Schneider
8501ca2ea0
Added some tests for ssh_list.
2010-03-06 12:55:56 +01:00
Andreas Schneider
1264557f0e
Added a test for keyfiles.c.
2010-03-04 20:41:21 +01:00
Andreas Schneider
f34cd24f80
Fixed and added support for several identity files.
2010-03-04 20:41:17 +01:00
Andreas Schneider
9cd5e97596
Fixed linking of the tests.
2010-03-04 20:08:04 +01:00
Andreas Schneider
9f59be3224
Rename ssh_list_add to ssh_list_append.
2010-03-04 20:08:04 +01:00
Andreas Schneider
dea644bbd6
Added a prepend function for ssh_list.
2010-03-04 20:08:04 +01:00
Andreas Schneider
8bcb835aa4
Fixed unit testing.
2010-03-02 23:49:21 +01:00
Andreas Schneider
eec3532955
Simplify the build option output.
2010-03-02 23:37:49 +01:00
Andreas Schneider
8424c7a747
Fixed sftp_parse_longname() on Windows.
...
There is no strndup function on Windows.
2010-03-02 14:15:20 +01:00
Andreas Schneider
464176d511
Added unit testing support using check.
2010-03-02 13:54:14 +01:00
Aris Adamantiadis
e8a1d135e2
Fix a race condition bug in ssh_scp_close()
...
Conflicts:
libssh/scp.c
2010-03-01 20:00:02 +01:00
Aris Adamantiadis
b707b5e2a4
Answer to openssh's keepalives
2010-03-01 18:54:52 +01:00
Aris Adamantiadis
c987fd8c53
renamed ssh_list_get_head to ssh_list_pop_head
2010-03-01 18:11:40 +01:00
Aris Adamantiadis
d083554dff
Fixed documentation in scp code
2010-02-26 18:48:38 +01:00
Andreas Schneider
ec3af2c5cb
Added printout of owner and group in the sftp example.
2010-02-24 00:27:02 +01:00
Andreas Schneider
f857d4aff7
Fixed longname parsing, this only workings with readdir.
2010-02-24 00:26:51 +01:00
Andreas Schneider
39d6ef884a
Added owner and group information in sftp attributes.
...
Parse the longname which is the output of 'ls -l' and set the owner and
group if we are talking to an openssh server.
2010-02-23 22:50:43 +01:00
Andreas Schneider
492d1f24c8
Set CFLAGS correctly.
2010-02-13 12:47:28 +01:00
Aris Adamantiadis
60e5a32d27
Small doc fix
2010-02-12 23:29:24 +01:00
Aris Adamantiadis
f8d0055503
More C++ work
2010-02-12 22:17:50 +01:00
Aris Adamantiadis
8baaf64a72
Fix compilation of opensolaris
2010-02-12 10:08:54 +01:00
Andreas Schneider
6ae69e0df0
Try zlib compression and fallback to none if not available.
2010-02-11 23:27:25 +01:00
Aris Adamantiadis
92ca76721a
More C++ wrapper work.
...
Wrote stubs of functions needed in the wrapper
Created an Exception class which greatly simplifies
the use of libssh in C++
2010-02-11 23:08:07 +01:00
Aris Adamantiadis
6af2e3fc10
Fix closesocket() portbug for win32
2010-02-11 22:42:28 +01:00
Aris Adamantiadis
9bec3ee48e
Use closesocket in server.c for win32
...
Resolves #56
2010-02-11 19:56:23 +01:00
Aris Adamantiadis
17ca9d9da7
Make better error messages for SSH1 errors
2010-02-10 18:20:21 +01:00
Aris Adamantiadis
c1711243f0
aes192-ctr and aes256-ctr working on libcrypto
2010-02-09 22:29:43 +01:00
Aris Adamantiadis
fdfd12716e
aes128-ctr aes192-ctr aes256-ctr for libgcrypt
2010-02-09 22:24:04 +01:00
Aris Adamantiadis
dc0d945f28
Added aes128-ctr support for libcrypto (openssl)
2010-02-09 21:21:11 +01:00
Aris Adamantiadis
96465a52ee
KEX bug: client preference should be prioritary
2010-02-09 21:20:17 +01:00
Aris Adamantiadis
512fa6e601
Added summary of build options in Cmake
2010-02-08 16:55:03 +01:00
Andreas Schneider
12d43e2967
Rename the libssh sftp documentation group.
2010-02-07 22:36:03 +01:00
Andreas Schneider
e8648416b8
Describe the main group a bit.
2010-02-07 22:36:03 +01:00
Andreas Schneider
b971834d10
Respect known_hosts file set by the user.
...
Thanks to contact@leblanc-simon.eu for the patch.
2010-02-07 22:35:38 +01:00
Andreas Schneider
94ee9effe6
Improve the SSH string documentation.
2010-02-07 21:50:38 +01:00
Aris Adamantiadis
81bc13e066
Expend macros in doxygen generation
2010-02-06 23:49:41 +01:00
Andreas Schneider
1297da380e
Improve the session documentation.
2010-02-05 18:34:39 +01:00
Andreas Schneider
4ee3b28ecb
Update the doxygen config.
2010-02-05 18:34:13 +01:00
Andreas Schneider
757f8a6323
Set the soversion to 4.1 as we didn't break something.
...
yet?
2010-02-05 12:34:20 +01:00
Andreas Schneider
a25b06ecfc
Increase version number.
2010-02-05 12:07:50 +01:00
Aris Adamantiadis
6b703b8d6a
Update c++ prototypes
2010-02-02 18:30:26 +01:00
Aris Adamantiadis
c97d0d1220
add missing leave_function()
2010-02-02 18:20:23 +01:00
Aris Adamantiadis
7520d9c7b9
Handle timeout correctly
2010-02-02 18:16:46 +01:00
Vic Lee
2577214517
The ssh_message object needs to be freed after processing in channel_accept().
...
Signed-off-by: Vic Lee <llyzs@163.com >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2010-02-01 17:26:50 +01:00
Aris Adamantiadis
8e7bd43016
Fix compilation without WITH_SSH1
2010-01-30 20:36:00 +01:00
Aris Adamantiadis
e7b74c57f3
Hacked SSH1 to get past authentication
...
Also resolved some bugs that may impact 0.4. need to check
2010-01-25 23:23:01 +01:00
Aris Adamantiadis
cfdd4296a8
Fix poll not waking up on connect on win32
...
Under windows, poll does not detect connected socket using
POLLOUT but POLLWRNORM.
"Pending connect requests are indicated in the returned revents member of WSAPOLLFD structure by POLLWRNORM."
http://msdn.microsoft.com/en-us/library/ms741669%28VS.85%29.aspx
However, I did not test that fix. (no windows at hands). I also don't know
if the poll emulation layer works with that too.
2010-01-25 19:48:38 +01:00
Aris Adamantiadis
3407509ed7
Correctly handle channel failures and chan states
2010-01-24 23:03:56 +01:00
Aris Adamantiadis
3ac62dda51
Made packet handlers independant of session buffer
2010-01-24 22:43:52 +01:00
Aris Adamantiadis
3465b592e7
Few function name changes
2010-01-24 22:30:43 +01:00
Aris Adamantiadis
ca499a5495
Made ssh_packet_read asynchronous
...
Normally that's all that was needed into making SSH1 compliant
with the new API.
Beware, I have only implemented it, not actually tested it.
2010-01-24 22:27:44 +01:00
Aris Adamantiadis
8a1d832f80
Removed last calls to packet_read
2010-01-24 22:08:20 +01:00
Aris Adamantiadis
758df26582
Made parts of SSH asynchronous (inc kex1)
2010-01-24 21:03:03 +01:00
Aris Adamantiadis
6ae558b541
Beginning of async solution for SSH1
2010-01-24 01:07:08 +01:00
Aris Adamantiadis
68f53540df
Move SSH-1 specific packet functions in packet1.c
2010-01-23 22:59:10 +01:00
Aris Adamantiadis
48ba9c9bc1
stub of C++ wrapper for libssh
2010-01-21 21:54:20 +01:00
Aris Adamantiadis
245deb2abe
Fixed error message when connection failed
2010-01-16 18:47:32 +01:00
Aris Adamantiadis
549ea0d7ba
Fix SSH1 related warning
2010-01-16 18:38:49 +01:00
Aris Adamantiadis
94d1112c55
SSH-1 cleanup and compile
...
Not tested, probably not working correctly yet
2010-01-10 21:05:46 +01:00
Aris Adamantiadis
0c47227144
Fix typo in build_make script
2010-01-10 20:07:37 +01:00
Aris Adamantiadis
a2505078da
Set socket blocking after connexion
2010-01-08 23:28:55 +01:00
Aris Adamantiadis
35532a63fe
Enforce NULL ptr verification in scp.c
2010-01-08 23:14:10 +01:00
Aris Adamantiadis
514ab6eed2
Fixed blocking bug in channel_poll
2010-01-08 23:05:10 +01:00
Aris Adamantiadis
c41e3a8e68
Cosmetics for packet numbering
2010-01-08 22:49:16 +01:00
Aris Adamantiadis
7d71340241
Oops, forgot the callback for server DH
2010-01-08 22:37:18 +01:00
Aris Adamantiadis
40bcc0bed8
No more packet_read2() !
2010-01-08 22:33:58 +01:00
Aris Adamantiadis
74009e2be5
Prefix message_new with ssh_
2010-01-08 22:28:40 +01:00
Aris Adamantiadis
40871ab1cc
Prefix message_handle_channel_request with ssh_
2010-01-08 22:27:16 +01:00
Aris Adamantiadis
2fc4c7e335
Dequeue the processed messages
2010-01-08 22:25:26 +01:00
Aris Adamantiadis
da8263b3f6
Renamed message_queue to ssh_message_queue
2010-01-08 22:16:00 +01:00
Aris Adamantiadis
12db7c4bc1
Merged the channel_request hdlrs and clean hdlrs
2010-01-08 22:14:31 +01:00
Aris Adamantiadis
db3ef37771
ssh_packet_userauth_request with new system
2010-01-08 21:09:40 +01:00
Aris Adamantiadis
7f32558e08
Converted message handlers to new system
2010-01-07 22:41:38 +01:00
Aris Adamantiadis
228ac78397
Changes to messages for async message handling
2010-01-07 22:02:21 +01:00
Aris Adamantiadis
b6656a1525
Removed packet_wait for SSH2
2010-01-06 22:53:10 +01:00
Aris Adamantiadis
84ec17964e
Made the server DH asynchronous.
...
It still needs testing and cleanup, it was done with less
care than the client-side.
The socket listening and connexion is still synchronous
2010-01-06 22:49:40 +01:00
Aris Adamantiadis
ef5dc6cd2b
Add support for async global requests
...
Normally the infamous packet_wait() synchronous call
is gone in all SSH2 client code.
2010-01-06 21:48:44 +01:00
Aris Adamantiadis
84e6aca5c5
Fixed typos from a* to error.c
2010-01-06 21:12:00 +01:00
Aris Adamantiadis
ebd0987376
Fix build when WITH_SSH1 undefined
2010-01-06 13:34:56 +01:00
Aris Adamantiadis
20baf4f5b6
Part of kex.c is SSH-1 specific
2010-01-03 23:38:37 +01:00
Aris Adamantiadis
335a0fe768
Remove some references to packet_wait()
2010-01-03 23:36:06 +01:00
Aris Adamantiadis
b25ebf4bdb
Removed channel_handle now unused function
2010-01-03 23:23:56 +01:00
Aris Adamantiadis
804bb44eda
Channel requests are asynchronous
...
Exec example also runs perfectly now.
2010-01-03 23:16:14 +01:00
Aris Adamantiadis
1b15896e8b
Fix infinite loop in exec example
2010-01-03 23:15:55 +01:00
Aris Adamantiadis
055fbe1d87
Explicitely use the packet buffer arg in channels
2010-01-03 22:34:48 +01:00
Aris Adamantiadis
648e5d62ba
Some work for async channel requests
2010-01-03 22:14:21 +01:00
Andreas Schneider
49de20aa5c
Fixed cmake warning.
...
There is no CMakeLists.txt in tests and we don't build something
in the root CMakeLists.txt.
2009-12-30 19:08:03 +01:00
Vic Lee
13d534e89a
Add pkg-config file libssh.pc
...
Signed-off-by: Vic Lee <llyzs@163.com >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-12-30 19:05:48 +01:00
Vic Lee
1944dc8b5f
Add new API function ssh_userauth_privatekey_file().
...
Signed-off-by: Vic Lee <llyzs@163.com >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-12-30 19:05:37 +01:00
Vic Lee
f2ca2d50b5
In ssh_userauth_pubkey, if publickey argument is NULL, generate it from privatekey.
...
Signed-off-by: Vic Lee <llyzs@163.com >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-12-30 19:05:29 +01:00
Aris Adamantiadis
b361fb5898
Fix use-without-initialization
2009-12-28 22:29:50 +01:00
Aris Adamantiadis
8d1faa0dbc
Made channel_open_session partially asynchronous
2009-12-27 00:06:34 +01:00
Aris Adamantiadis
77baa2df15
Fix a few log strings and levels in auth.c
2009-12-26 22:12:08 +01:00
Aris Adamantiadis
a229cb4676
Asynchronous authentication works !
2009-12-26 21:59:37 +01:00
Aris Adamantiadis
682ed18123
New packet handler for SSH_USERAUTH_BANNER
2009-12-26 20:24:07 +01:00
Aris Adamantiadis
3aae59c224
Fix tricky bug within packet decoding
2009-12-26 17:03:27 +01:00
Aris Adamantiadis
6f3505bf6b
Asynchronous service request
2009-12-26 16:51:33 +01:00
Aris Adamantiadis
bfdc48e320
Simplification of the "exec" sample
2009-12-24 10:46:46 +01:00
Vic Lee
fcda8beb1c
File handle need to be closed in case of errors in privatekey_from_file
...
Signed-off-by: Vic Lee <llyzs@163.com >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-12-23 09:37:35 +01:00
Andreas Schneider
d0647afae5
Added an example for exec.
2009-12-22 18:34:23 +01:00
Aris Adamantiadis
a6383cec51
Fix typos in doc
2009-12-22 10:20:19 +01:00
Vic Lee
44fd5ff451
Added private key type detection feature in privatekey_from_file
...
Signed-off-by: Vic Lee <llyzs@163.com >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-12-22 09:02:10 +01:00
Andreas Schneider
ea34f37d43
Generate the APPLICATION_VERSION.
2009-12-21 15:56:21 +01:00
Andreas Schneider
23dcc2c7f3
Fixed ssh_get_user_home_dir() to be thread safe.
2009-12-21 12:32:58 +01:00
Aris Adamantiadis
91f7d127ea
Tutorial doxyginized and updated up to auth sect.
2009-12-20 23:21:59 +01:00
Aris Adamantiadis
43c1245396
Some options functions did not show up in doxygen
2009-12-20 20:23:58 +01:00
Aris Adamantiadis
43288bc4f2
added ssh_message_auth_reply_pk_ok_simple
2009-12-20 18:51:37 +01:00
Aris Adamantiadis
2e22d6ef99
Add key validation in server side authentication
2009-12-20 18:05:02 +01:00
Andreas Schneider
6509b6e742
Started to add the tutorial to doxygen.
2009-12-19 00:31:47 +01:00
Aris Adamantiadis
d2ce0042b3
Deleted obsolete doxygen files
2009-12-19 00:10:54 +01:00
Aris Adamantiadis
0dcb63ff5e
Merge branch 'master' of git://git.libssh.org/projects/libssh/libssh
2009-12-19 00:10:13 +01:00
Andreas Schneider
bebbac1bd8
Improved doxygen output of ssh_options_set().
2009-12-19 00:08:54 +01:00
Aris Adamantiadis
a1870a62cf
Documentation callbacks.h + standardization
2009-12-18 23:56:59 +01:00
Andreas Schneider
1ef1a77421
Disabled caller graphs as they are only of internal interest.
2009-12-18 23:54:31 +01:00
Andreas Schneider
98819f92e3
Updated the doxygen file.
2009-12-18 23:41:25 +01:00
Andreas Schneider
ebce70eba1
Fixed documentation of buffer struct.
2009-12-18 23:41:01 +01:00
Andreas Schneider
ed257b982a
Fixed documentation of ssh_options_copy().
2009-12-18 23:38:27 +01:00
Andreas Schneider
1b7877f6ed
Moved the doxygen mainpage to doc/mainpage.dox
2009-12-18 23:35:41 +01:00
Andreas Schneider
7500b0564c
Document the callback structure correctly.
2009-12-18 23:19:37 +01:00
Andreas Schneider
0c992ece3b
Added a mainpage to doxygen.
2009-12-18 23:12:47 +01:00
Andreas Schneider
e124249a8b
Fixed the doxygen documentation.
2009-12-18 23:12:37 +01:00
Aris Adamantiadis
d950d6af52
Optional compilation of developper's doc
2009-12-16 23:19:18 +01:00
Aris Adamantiadis
55abcfeef6
These docs are outdated too
2009-12-15 23:53:28 +01:00
Aris Adamantiadis
49b3712891
Stub for doxygen main documentation
2009-12-15 23:50:16 +01:00
Aris Adamantiadis
b9a8b22728
Doxygen now outputs on stderr, inputs from doc/
2009-12-15 23:48:51 +01:00
Aris Adamantiadis
65f8e86e41
Deleted obsolete documentation draft
2009-12-15 23:37:53 +01:00
Aris Adamantiadis
9780f22866
Made packet_wait issue warnings
2009-12-13 20:49:47 +01:00
Aris Adamantiadis
46b2b99f63
Fix strange error message in sample authentication
2009-12-13 19:53:32 +01:00
Aris Adamantiadis
c92f54102e
Key exchange currently done asynchronously
...
Fixed an important bug in packet buffering (two packets received in the same recv would'nt be processed correctly)
2009-12-13 18:20:05 +01:00
Aris Adamantiadis
964d5f88cc
ssh_poll_handle detaches from context before free
2009-12-13 17:04:23 +01:00
Aris Adamantiadis
ad7e9d88fb
packet SSH_KEXINIT received and parsed
...
Resolved some bugs in the callback mechanism as well
2009-12-12 00:23:53 +01:00
Aris Adamantiadis
3ace7817b4
Async connection + banner fetch is working
2009-12-11 23:26:25 +01:00
Aris Adamantiadis
0de35ca8f0
Fix logging problem in match_known_host
2009-12-11 21:23:52 +01:00
Aris Adamantiadis
80b6cf77b0
Added a global poll context
2009-12-11 21:11:23 +01:00
Andreas Schneider
79b4bf4ac2
Don't install crypto.h which is an internal header file.
2009-12-10 13:55:42 +01:00
Aris Adamantiadis
ab6b510408
More doxygen stuff
2009-12-09 20:27:10 +01:00
Aris Adamantiadis
ab52ca01ad
Resolving doxygen errors in internal mode
2009-12-09 19:53:58 +01:00
Aris Adamantiadis
64b72f8d3a
Fix some doxygen errors
2009-12-09 19:43:16 +01:00
Andreas Schneider
ffc9806e6d
Remove socklen_t definition.
...
Tthe problem is that winsock2.h defines socklen_t as a typedef, not as a
define, so depending on the order of includes you can get errors in
ws2tcpip.h with msvc.
2009-12-09 13:02:48 +01:00
Aris Adamantiadis
984fb41b98
Moved #defines into an enum
2009-12-06 23:47:58 +01:00
Aris Adamantiadis
a1e05c62ae
struct socket -> struct ssh_socket_struct +typedef
2009-12-06 22:48:56 +01:00
Aris Adamantiadis
076e884873
More callback stuff in connection
...
I have coded it, not actually tested it :) It still needs
work to get past the banner exchange.
2009-12-05 15:05:02 +01:00
Aris Adamantiadis
2f6fbbd706
Trying to adapt client.c to use callbacks
2009-12-03 23:55:46 +01:00
Aris Adamantiadis
4924ac8099
Asynchronous sockets work !
...
Still need a bit of tuning but it's stable enough
for our current needs
2009-12-01 23:34:55 +01:00
Andreas Schneider
7962029bdc
Fixed indent.
2009-12-01 16:59:41 +01:00
Andreas Schneider
f83f837de7
Added gettimeofday for Windows.
...
Thanks to Patrick Spendrin.
2009-12-01 16:57:49 +01:00
Andreas Schneider
48b719cf68
Fixed uint* to work on Windows.
...
Thanks to Patrick Spendrin.
2009-12-01 16:15:54 +01:00
Aris Adamantiadis
96afa4530c
More logging
2009-11-30 23:56:21 +01:00
Aris Adamantiadis
270a8a26fa
Fix stupid bug which stops log_verbosity working
2009-11-30 23:55:02 +01:00
Aris Adamantiadis
92a50f731c
Socket connect callback working...
...
Still need to make sure the connect syscall is correctly
called
2009-11-30 23:44:40 +01:00
Aris Adamantiadis
76d6838223
Some brain surgery to add event-based sockets
...
chapter 1- SSH Socket Connections.
I would like to be able to
-Have a ssh_poll_ctx object
-Add a ssh socket over it
-launch the socket connection (using socket functions)
-ssh_poll_ctx_dopoll()
-Wait for the timeout or have the "connected" callback called
2009-11-30 22:35:43 +01:00
Aris Adamantiadis
0bfb9d476c
Standardize callbacks style and add documentation
2009-11-29 22:51:14 +01:00
Aris Adamantiadis
91bb1b2de6
Squashed commit of the following:
...
commit 43fad8dfd977637c31fade76ace2905f6528c3bc
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Fri Nov 27 18:39:06 2009 +0100
adaptation to the new ssh_poll_handle object name
commit 1e5e6ac4605adf10d437d04f0fd4b7e66024853c
Merge: 3fd92a0... 810adad...
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Fri Nov 27 18:33:06 2009 +0100
Merge branch 'master' into badcode/libssh_async
commit 3fd92a08eb74b1447a9ff4ca4e1d137475c62cc6
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Mon Nov 2 14:25:46 2009 +0100
Compiles again
commit 8910d7b9692418c9ccea0234f6d49674d238dc16
Merge: e83f1b5... cce34a6...
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Mon Nov 2 12:47:34 2009 +0100
Merge branch 'master' into libssh_async
Very big merge !
Conflicts:
include/libssh/callbacks.h
include/libssh/priv.h
libssh/channels.c
libssh/messages.c
libssh/packet.c
libssh/server.c
libssh/session.c
libssh/socket.c
commit e83f1b593219e183082b015315f09bfe95a29cfc
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Mon Nov 2 12:07:01 2009 +0100
rename callback.h
commit dffa7b730e8f39e2198de18ab69a8e57bef95e58
Merge: 5a8b748... de8808c...
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Tue Sep 15 10:50:07 2009 +0200
Merge branch 'master' of git://git.libssh.org/projects/libssh/libssh into libssh_async
commit 5a8b7484f36599d28f2c0c14a23b76bfc7257638
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Sun Sep 13 12:55:18 2009 +0200
More updates to callback system
commit 18620c20d5e4e62107093f7fd330e553493253fa
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Sat Sep 12 22:26:52 2009 +0200
Same thing with channel_rcv_data
commit fc4a56f6726e409a5866272923f1cbebfc821af3
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Sat Sep 12 22:17:45 2009 +0200
added a few packet handlers for channels
commit 4b6bb4fd00b10cf1321a764126f277ab204bffe3
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Fri Sep 11 23:15:25 2009 +0300
sample packet handlers + bugfixes
commit 2784d09d6dec0a8f868912d14f90d860233b3f82
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Fri Sep 11 20:30:50 2009 +0300
Packet callbacks nearly finished
Need tests and implementation of some packet callbacks
commit cd3ea43f20c9ae2f54576ca98a0ea75c5d4299d3
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Thu Sep 10 12:46:02 2009 +0300
First step of async packet handling
The socket to packet handler is nearly done (needs testing)
I still need to define the interface for callbacks.
commit 487f4d2a900a5fe3b90ceda4460ab7d38d7ad722
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Tue Sep 8 23:24:09 2009 +0300
Almost complete socket callback system
Finished the callback function so it bufferizes data when
callee does not use it.
Flushes the buffer automaticaly after a ssh_socket_nonblocking_flush
commit 23571f22fac9e40c855dfa99569bba181a39648b
Author: Aris Adamantiadis <aris@0xbadc0de.be >
Date: Tue Sep 8 22:22:32 2009 +0300
First draft of a callback system
2009-11-27 20:42:43 +01:00
Aris Adamantiadis
810adadf2e
Compile with pcap support by default
...
This will permit to get pcap debugging out of the box
2009-11-27 18:18:12 +01:00
Aris Adamantiadis
8da712ea61
Compile in stub for pcap funcs when pcap disabled
...
Avoid that way linking problems
2009-11-27 18:16:10 +01:00
Aris Adamantiadis
56cfb8036f
Build the pcap code into example in all cases
2009-11-27 18:08:53 +01:00
Andreas Schneider
f332dd810e
Added changelog entries for 0.4 rc2.
2009-11-20 16:11:17 +01:00
Andreas Schneider
d1c6fa9261
Build the pcap source only if enabled.
2009-11-19 09:33:06 +01:00
Aris Adamantiadis
b00e2ad40e
Fix compile bug introduced by another bugfix
2009-11-18 20:54:39 +01:00
Aris Adamantiadis
ca9f42a20f
Fix another memleak
...
Use buffer_free instead of SAFE_FREE
2009-11-18 20:53:06 +01:00
Andreas Schneider
e939786836
Fixed possible doulbe free problem found by Bernhard R. Link.
2009-11-18 15:35:15 +01:00
Andreas Schneider
11cc5f5815
Added more error messages and checking to handle_channel_request.
2009-11-18 14:56:12 +01:00
Andreas Schneider
d60b1ec1a2
Fixed a memory leak in channel_new() if we have an error.
2009-11-18 10:30:01 +01:00
Aris Adamantiadis
ae11589205
Pcap: more cleanup and minimalist API
2009-11-16 23:20:16 +01:00
Aris Adamantiadis
70b9475449
Pcap: Fix bug with non-encrypted incoming packets
2009-11-16 22:53:22 +01:00
Aris Adamantiadis
02aecc1278
Improved pcap dumping support
2009-11-16 22:36:31 +01:00
Andreas Schneider
3e90a11599
Improve standard logging.
2009-11-12 12:52:05 +01:00
Andreas Schneider
b4095189d7
Fixed setting the timeout and ssh2 and ssh1 option.
2009-11-12 12:50:31 +01:00
Andreas Schneider
c0b4c4d60c
Fixed setting the log verbosity.
2009-11-12 11:44:36 +01:00
Andreas Schneider
12da24c056
Added an option to set log verbosity as string.
2009-11-10 09:12:07 +01:00
Andreas Schneider
d821117033
Always use the poll-emulation on Windows.
...
Until we we have a solution to use WSAPoll only on Vista and newer.
2009-11-09 20:13:27 +01:00
Aris Adamantiadis
30266f7627
Added explanation in ssh_silent_disconnect doxygen
2009-11-09 13:24:47 +01:00
Aris Adamantiadis
10b625e180
First lines of experimental pcap output support
...
This will serve to debug packets right under wireshark !
2009-11-08 23:42:41 +01:00
Aris Adamantiadis
10f27457d3
Add an other (simplier ?) polling method to sample
2009-11-08 20:00:23 +01:00
Aris Adamantiadis
af1f431364
change buffer size in sample.c
2009-11-07 17:35:24 +01:00
Aris Adamantiadis
272a4d1e45
Refactorize sample.c
2009-11-07 17:23:06 +01:00
Aris Adamantiadis
3a95ecfe74
move authentication out of sampe.c
2009-11-07 03:45:27 +01:00
Aris Adamantiadis
14ae9a7f0c
Moved sftp parts into a new example
2009-11-06 19:21:18 +01:00
Aris Adamantiadis
51f1918109
Update structures name to new convention
...
SSH_POLL* -> ssh_poll_handle,
SSH_POLL_CTX* -> ssh_poll_ctx
2009-11-06 18:52:49 +01:00
Andreas Schneider
fa27956daf
Improve MSVC support. Better binary compatibility.
...
Patch by Patrick Spendrin from KDE.
2009-11-06 09:57:09 +01:00
Aris Adamantiadis
ab0d8a3828
A few test cases for benchmarks
2009-11-05 18:18:35 +01:00
Andreas Schneider
efded18724
Fixed compilation of samplesshd.
2009-11-05 16:38:05 +01:00
Andreas Schneider
f52bc064e9
Merge branch 'master' of git://git.libssh.org/projects/libssh/libssh
2009-11-05 16:08:49 +01:00
Aris Adamantiadis
75f066dfcd
channel_read() won't block until count b. are read
2009-11-05 16:00:05 +01:00
Aris Adamantiadis
535ff07f0f
Forgot to update config.h.cmake
2009-11-05 13:09:42 +01:00
Aris Adamantiadis
5e002635fc
Fix compilation on freebsd 6.0 which lacks argp.h
2009-11-03 21:04:36 +01:00
Aris Adamantiadis
e71c28f6a0
Fix warnings on old gcc's
...
they don't like variable names having type names
2009-11-03 21:04:07 +01:00
Aris Adamantiadis
c0e091a52f
Fix openssl header inclusion
...
caused cbc_encrypt to be redefined by an openssl
macro
2009-11-03 21:03:22 +01:00
Andreas Schneider
8ab0f8e51f
Increase package version.
2009-10-29 20:22:05 +01:00
Andreas Schneider
cce34a6176
Fixed setting knownhosts in ssh_is_server_known().
2009-10-29 12:10:44 +01:00
Andreas Schneider
89f0311927
Fixed a segfault on Windows.
2009-10-29 12:10:22 +01:00
Aris Adamantiadis
e455f6f756
Make libssh_scp a little more consistant
2009-10-29 10:50:47 +01:00
Aris Adamantiadis
17f2645a32
Fix server kex again
2009-10-29 10:36:00 +01:00
Aris Adamantiadis
9f034aca9c
Fix server kex
2009-10-29 10:02:49 +01:00
Bernhard R. Link
22bdfa3886
improve error reporting of sftp.c
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-10-25 11:12:02 +01:00
Bernhard R. Link
ef8246a592
buffer_get_data returns 0 on error, so checking buffer_get_u* for < 0 makes no sense
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-10-25 09:50:06 +01:00
Aris Adamantiadis
110d201e02
fix stupid bug
2009-10-23 12:48:40 +02:00
Aris Adamantiadis
be4f695c5c
Compatibility with (broken) sftp version 2 protocols
2009-10-23 12:19:22 +02:00
Andreas Schneider
792def7a65
Add missing free.
2009-10-23 11:45:44 +02:00
Andreas Schneider
840cecbe0e
Fix memory leaks in ssh_bind_options_set() if called twice.
...
This fixes ticket #36 .
2009-10-22 18:56:02 +02:00
Aris Adamantiadis
27d25752e9
Allow use of SSH_DIR/ when expanding key paths
2009-10-17 18:10:42 +02:00
Aris Adamantiadis
a479b30298
Verify existence of callback before using them
2009-10-17 17:54:39 +02:00
Andreas Schneider
86620fc991
Improve example authentication.
2009-10-15 17:56:03 +02:00
Andreas Schneider
b3dfd5cffc
Added missing documentation for ssh_bind_options_set.
2009-10-15 17:22:04 +02:00
Andreas Schneider
f0858ff6b2
Added option parsing using GNU argp.
2009-10-15 17:17:58 +02:00
Andreas Schneider
7b7280e728
Added option to set log_verbosity in the server.
2009-10-15 17:17:36 +02:00
Andreas Schneider
2523ed0779
Added an option to set the port as string.
2009-10-15 17:02:51 +02:00
Andreas Schneider
e736b1a40e
Fixed ssh_get_user_home_dir on Windows.
2009-10-15 16:37:07 +02:00
Andreas Schneider
cbf012c337
Fixed ssh_get_home_dir and ssh dir to be more portable on UNIX systems.
...
Thanks to Pino Toscano.
2009-10-15 14:53:11 +02:00
Andreas Schneider
c360ed1d9a
Add API changes to README.
2009-10-13 22:23:06 +02:00
Andreas Schneider
22e74e3bab
Remove deprecated functions.
2009-10-13 22:14:23 +02:00
Vic Lee
02b3104215
Fix a memory corruption in parse_status_msg
...
Signed-off-by: Vic Lee <llyzs@163.com >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-10-11 11:11:08 +02:00
Aris Adamantiadis
26a5294116
add logging
2009-10-11 00:20:37 +02:00
Aris Adamantiadis
5e4c78e114
Fix server. Now, it runs
2009-10-11 00:14:21 +02:00
Aris Adamantiadis
e74305c5eb
updated the sftp subsystem to follow the type conv
2009-10-10 20:55:17 +02:00
Aris Adamantiadis
499f9aa707
Add structure cleaning in comment
2009-10-10 20:07:52 +02:00
Andreas Schneider
4dee9a3e68
Document the function to set the callbacks and provide an example.
2009-10-10 19:59:14 +02:00
Aris Adamantiadis
399041180f
resolve callback crash
2009-10-10 16:25:40 +02:00
Aris Adamantiadis
3f55fb5b22
fix typo in header inclusion
2009-10-10 12:04:35 +02:00
Aris Adamantiadis
37a4a65d60
Add ssh_free at the end
2009-10-10 12:04:16 +02:00
Andreas Schneider
ccd886feb4
Added auth callback function to sample to test callback stuff.
2009-10-10 11:55:42 +02:00
Andreas Schneider
b1bc283e9a
Rename callback header file.
2009-10-10 10:52:04 +02:00
Andreas Schneider
be75fac7ff
Add a function to set the callback structure to the session.
2009-10-10 10:51:56 +02:00
Aris Adamantiadis
6ec65c6f9d
ssh_disconnect doesn't free the session anymore
2009-10-09 22:50:48 +02:00
Aris Adamantiadis
71ab0cf6cc
No more SSH_BIND SSH_MESSAGE etc.
2009-10-09 22:37:23 +02:00
Aris Adamantiadis
1e0e8a5493
samplessh uses ssh_options_getopt()
2009-10-09 22:28:03 +02:00
Aris Adamantiadis
4b65aea401
Last nail on SSH_OPTIONS, SSH_SESSION etc.
2009-10-09 22:26:08 +02:00
Aris Adamantiadis
98ff6fbbce
get rid of the option structure
2009-10-09 22:24:23 +02:00
Aris Adamantiadis
43e0d73b63
sample.c compiles now
2009-10-09 22:04:56 +02:00
Aris Adamantiadis
58294442d3
Moved samples into examples directory
2009-10-09 21:44:05 +02:00
Aris Adamantiadis
2e9c13dad0
Modified server API
2009-10-09 21:26:15 +02:00
Andreas Schneider
9c667ebc26
Remove functions to set callbacks.
2009-10-09 15:18:06 +02:00
Andreas Schneider
d1b772f1bc
Added more error messages to config parser.
2009-10-06 15:49:47 +02:00
Andreas Schneider
876f843f23
Update ChangeLog.
2009-10-06 15:44:12 +02:00
Andreas Schneider
0e2e0983f3
Fixed build temporarily.
2009-10-05 10:41:00 +02:00
Vic Lee
6063a8d09c
Fix a segment fault in privatekey_from_file
...
Signed-off-by: Vic Lee <llyzs@163.com >
2009-10-05 10:02:04 +02:00
Aris Adamantiadis
40778d4ba9
Merge branch 'master' of git://git.libssh.org/projects/libssh/libssh
2009-10-05 10:01:24 +02:00
Bernhard R. Link
60d6954b75
samplesshd: allow overriding KEYS_FOLDER by compiler option
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-10-05 00:05:09 +02:00
Bernhard R. Link
bf376b6d4f
do not segfault in ssh_bind_accept if bindaddr is NULL
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-10-05 00:04:38 +02:00
Bernhard R. Link
ff52e3630f
improve error handling in options.c
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-10-05 00:04:02 +02:00
Andreas Schneider
f1f17f18dc
Fix documentation.
2009-10-05 00:03:47 +02:00
Bernhard R. Link
7c759b9615
add ssh_set_error_oom and ssh_set_error_invalid
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-10-05 00:02:43 +02:00
Bernhard R. Link
d54e9550da
proper prototype of ssh_session_new
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-10-05 00:01:50 +02:00
Andreas Schneider
d7c0270c89
Fixed SSHv1 to work with the option changes.
2009-10-04 11:47:26 +02:00
Andreas Schneider
7a37f9faf7
Fixed ssh_options_copy().
2009-10-04 10:10:19 +02:00
Aris Adamantiadis
149a2b4a18
Temporary server fixup for options structure delet
...
server_set_kex needs to be rewritten
2009-10-03 23:06:26 +02:00
Andreas Schneider
ab5b4c7cfe
Get rid of the options structure.
2009-10-02 20:26:14 +02:00
Andreas Schneider
e78334688f
Fixed setting of LFS CFLAGS.
2009-10-02 20:19:48 +02:00
Andreas Schneider
566fda70a5
Fixed LFS support on unix.
2009-10-02 20:17:21 +02:00
Andreas Schneider
62cebe23d9
Fixed build of sample client.
2009-10-02 17:21:59 +02:00
Andreas Schneider
42aacc7106
Remove unused option functions.
2009-10-02 10:18:27 +02:00
Andreas Schneider
8ed9cdce80
Remove --as-needed linker flag.
2009-10-01 10:19:07 +02:00
Aris Adamantiadis
a3a7f17d0f
Missed copying of log verbosity
2009-09-30 13:10:59 +02:00
Aris Adamantiadis
571dd56eca
libcrypto.so is in /lib on opensolaris
2009-09-29 17:57:37 +02:00
Aris Adamantiadis
f6f0988d10
Fix warnings on opensolaris
2009-09-29 17:57:37 +02:00
Aris Adamantiadis
f9d1542542
resolve warning on opensolaris
2009-09-29 11:46:06 +02:00
Aris Adamantiadis
d32fe11da3
Fix build with SSH1
2009-09-28 10:28:52 +02:00
Aris Adamantiadis
cd7f6bea57
more priv.h splitting
2009-09-26 14:05:58 +02:00
Aris Adamantiadis
c3dc60103f
Fix small bug in ssh_options_parse_config
2009-09-26 12:42:47 +02:00
Aris Adamantiadis
2a2616f65c
Fix bug in dir_expand_sub
2009-09-26 12:28:03 +02:00
Bernhard R. Link
f643c34ee8
support in ~/ and SSH_DIR/ in filenames instead of %s/
...
Get rid of snprintf to fixed sized buffers in setting options.
Instead make locations starting with ~/ relative to the
users initial working directory (as libssh does not look into
the home directory but only at the initial home directory).
and starting with SSH_DIR/ relative to the configured ssh directory.
2009-09-26 12:23:30 +02:00
Aris Adamantiadis
0f77578ee2
Fixed doxygen compilation warnings
2009-09-26 01:34:14 +02:00
Aris Adamantiadis
3e314e863c
More include file splitting
2009-09-26 01:15:48 +02:00
Aris Adamantiadis
adbb087221
Removed obsolete options
2009-09-26 00:36:02 +02:00
Aris Adamantiadis
3a8d839e86
More include file movings
2009-09-26 00:29:53 +02:00
Aris Adamantiadis
358647f5d9
More comment
2009-09-25 23:56:28 +02:00
Aris Adamantiadis
5e76118512
fix ssh_callbacks_init() macro + documentation
...
ssh_callbacks_init should not zero' the struct because
it could be used on staticaly declared structures
2009-09-25 23:50:18 +02:00
Aris Adamantiadis
e3bdc393cb
callback.h should use public headers
2009-09-25 23:42:29 +02:00
Aris Adamantiadis
04b49d46c1
Fixed building with Gcrypt and arith with void*
2009-09-25 23:38:09 +02:00
Aris Adamantiadis
74b7fb7bba
Add an option to let users choose libgcrypt
2009-09-25 23:31:48 +02:00
Aris Adamantiadis
c70694c594
Fix memory leaks found by tysonite
2009-09-25 18:49:26 +02:00
Aris Adamantiadis
fef87793a0
Fix openssl version usage, found by tysonite
2009-09-25 18:34:58 +02:00
Andreas Schneider
79c475c917
Fixed including of config.h.
...
If there is some option to modify libc behaviour (like if there was some
off_t usage to be modified by some flag to make that 64 bit) that
needs to be done before the first libc header. one could still do -D
there, though (unless cmake wants to do something automatically and puts
that in config.h)
2009-09-25 10:01:56 +02:00
Andreas Schneider
3dd03fec21
Add missing extern C.
2009-09-25 09:59:25 +02:00
Andreas Schneider
e8e07f7376
Fix typo.
2009-09-25 09:37:56 +02:00
Andreas Schneider
1c5ae7dd97
Install callbacks header file.
2009-09-25 09:33:11 +02:00
Andreas Schneider
f65e3566a2
Fixed typo in config.h.cmake.
...
This closes ticket #24 .
2009-09-24 13:22:43 +02:00
Aris Adamantiadis
6b0a89a288
Get rid of CRYPTO
2009-09-23 23:55:07 +02:00
Aris Adamantiadis
f84ebc2e27
Moved lots of declaration out of priv.h
2009-09-23 23:51:04 +02:00
Aris Adamantiadis
b359229a2e
Change #defines to enums when it makes sense
2009-09-23 22:42:29 +02:00
Aris Adamantiadis
496a8e12d9
Get rid of SSH_MESSAGE
2009-09-23 22:19:11 +02:00
Aris Adamantiadis
0e8e124d20
get rid of SSH_OPTIONS
2009-09-23 22:13:19 +02:00
Aris Adamantiadis
9a8d4cd0fd
get rid of SSH_SESSION
2009-09-23 21:55:54 +02:00
Aris Adamantiadis
ffed8b03bb
remove the broken setters for options,cb init macro
2009-09-23 21:40:58 +02:00
Aris Adamantiadis
5bd38a5f37
Changed the current callback sys to be scalable
2009-09-23 21:30:56 +02:00
Aris Adamantiadis
ab60d1d678
Ordered functions in libssh.h alphabeticaly
2009-09-23 20:42:59 +02:00
Aris Adamantiadis
5223fa5740
Shut up warning in libssh_scp
2009-09-23 11:43:06 +02:00
Aris Adamantiadis
95558d54b0
Fix typos in SSH_OPTIONS
2009-09-23 11:21:12 +02:00
Andreas Schneider
068a7dfc49
Fixed bindport in getop function.
2009-09-22 20:36:57 +02:00
Andreas Schneider
abd8b17a04
Fixed options used in server sample.
2009-09-22 20:34:23 +02:00
Andreas Schneider
343e6e482a
Added handling of bindport in getopt.
2009-09-22 20:33:58 +02:00
Andreas Schneider
aae1df0589
Use new options interface in sample code.
2009-09-22 20:27:53 +02:00
Aris Adamantiadis
0a57ebb3a9
Fix README file which is really obsolete
2009-09-22 16:51:28 +02:00
Bernhard R. Link
9afad28255
fix copy&paste error
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-09-22 14:04:42 +02:00
Andreas Schneider
8b21b51a78
Use new ssh options interface in auth functions.
2009-09-22 13:32:06 +02:00
Andreas Schneider
2003a81b44
Use new ssh options interface in keyfiles.
2009-09-22 13:20:23 +02:00
Andreas Schneider
abe6c7c728
Use new options interface in server code.
2009-09-22 13:17:35 +02:00
Andreas Schneider
f78045dfd3
Use the new options interface in config parser.
2009-09-22 13:14:23 +02:00
Andreas Schneider
39729bd3de
Use the new options function in deprecated functions.
2009-09-22 13:14:23 +02:00
Andreas Schneider
f6d2a66de2
Added a cleaned up interface for setting options.
2009-09-22 13:14:16 +02:00
Andreas Schneider
7de3122b42
Added a userdata generic pointer to the log callback function.
2009-09-22 12:28:07 +02:00
Andreas Schneider
88f4e9ea24
Added more logging output for publickey auth.
2009-09-21 15:54:49 +02:00
Andreas Schneider
4133f484ae
Fixed building libssh with MSVC.
...
Thanks to Carlo Segato for the patch.
2009-09-21 12:23:47 +02:00
Aris Adamantiadis
041aff8060
Fix binding found by Bernhard R. Link
2009-09-19 19:35:55 +02:00
Aris Adamantiadis
7c7096d8f8
Limit the size of acceptable compressed packets
2009-09-16 22:29:22 +02:00
Andreas Schneider
fd7b7bc3b5
Added Solaris support for the build script.
...
Thanks to tysonite.
2009-09-16 14:47:45 +02:00
Andreas Schneider
bb034e8e1d
Set package number to first beta release.
2009-09-15 23:07:24 +02:00
Andreas Schneider
d37a475816
Improve documentation of ssh_options_parse_config().
2009-09-15 18:06:19 +02:00
Andreas Schneider
4845642611
Added support for ~/.ssh/config.
2009-09-15 17:26:13 +02:00
Andreas Schneider
de8808cb47
Fixed build with mingw.
2009-09-15 10:43:09 +02:00
Aris Adamantiadis
ca978a9e81
Merge branch 'master' of git://git.libssh.org/projects/libssh/libssh
2009-09-14 23:19:11 +02:00
Aris Adamantiadis
ffca268bee
Add warning in channel_open_forward documentation
...
Tell users it does not do magic (yet)
2009-09-14 23:18:07 +02:00
Andreas Schneider
6a3d31acb7
Fix a possible stack overflow in agent code.
2009-09-14 19:01:20 +02:00
Aris Adamantiadis
f28352707a
Fix the security bug found by Orange Labs
...
Verify the length of decrypt operation is a multiple of blocksize
2009-09-13 22:07:01 +02:00
Aris Adamantiadis
4b363928f6
SCP warning request
2009-09-13 14:03:35 +03:00
Aris Adamantiadis
929f5ca25b
scp recursive mode
2009-09-13 14:03:34 +03:00
Aris Adamantiadis
7ff80a2666
Add better error detection + EOF request
2009-09-13 14:03:34 +03:00
Aris Adamantiadis
480dfd9050
add scp_download.c example
2009-09-13 14:03:34 +03:00
Aris Adamantiadis
bdb32afa20
Cycle the fetchs, remove the ssh_connect function
2009-09-13 14:03:34 +03:00
Aris Adamantiadis
f90ae73b6d
Refactored the connect_ssh example function
...
into a new file
2009-09-13 14:03:34 +03:00
Aris Adamantiadis
7fed54b1e5
Fix scp pull bug + scp logging
2009-09-13 14:03:34 +03:00
Aris Adamantiadis
d5840aa1f0
add support for local output, scp input
...
Still needs to be debugged and improved but the idea it there
2009-09-13 14:03:34 +03:00
Aris Adamantiadis
6f2225e8fb
fix ssh_scp_string_mode() bug + debug msgs
2009-09-13 14:03:33 +03:00
Aris Adamantiadis
07a9e6b7c6
Change scp API to use integers for perms
2009-09-13 14:03:33 +03:00
Aris Adamantiadis
86e6444656
Begin of scp reading in example
2009-09-13 14:03:33 +03:00
Andreas Schneider
8ef62cf784
Fixed fstatvfs function.
2009-09-10 18:57:58 +02:00
Andreas Schneider
8051ab044c
Reformat lowercase function.
2009-09-10 14:37:09 +02:00
Dmitry V. Krivenok
18bce13617
Fixed possible memory leak in lowercase function.
...
If user passed NULL pointer to lowercase() function, duplicated
string "new" wasn't freed before return.
Signed-off-by: Dmitry V. Krivenok <krivenok@orangesystem.ru >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-09-10 14:35:02 +02:00
Dmitry V. Krivenok
2a10019f82
Fixed "var is uninitialized" bug.
...
gcc-4.4.1 reported:
/home/krivenok/dev_builds/libssh/libssh/sftp.c:2700: warning: 'sftp' is used uninitialized in this function
sftp is NULL-initialized now.
Signed-off-by: Dmitry V. Krivenok <krivenok@orangesystem.ru >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-09-10 12:35:11 +02:00
Dmitry V. Krivenok
df4c62212c
Support for sending signals (RFC 4254, section 6.9).
...
Added function
int channel_request_send_signal(ssh_channel channel, const char *signal);
which implements signals delivery (as described in RFC 4254).
Only SSH-v2 is currently supported.
Signed-off-by: Dmitry V. Krivenok <krivenok@orangesystem.ru >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-09-10 12:34:58 +02:00
Andreas Schneider
97b6036cbf
Add a portable ssh_mkdir function for Windows.
2009-09-09 13:42:00 +02:00
Andreas Schneider
df4f7ed5b8
Fix the free calls and use the safe free macro.
2009-09-03 17:22:34 +02:00
Andreas Schneider
0792c015d6
Add missing NULL pointer checks to crypt_set_algorithms_server.
...
Thanks to Orange Labs for the report.
2009-09-03 17:20:06 +02:00
Andreas Schneider
8344598910
Fix an integer overflow in buffer_get_data().
...
Thanks to Orange Labs for the report.
2009-09-03 17:11:42 +02:00
Andreas Schneider
16870abed7
Add more warnings to gcc.
2009-09-01 11:03:48 +02:00
Aris Adamantiadis
65850a1bad
Fix "void * ptr used in pointer arithmetic" warng
2009-08-29 19:04:53 +02:00
Aris Adamantiadis
1137f0d48c
Change SSH_LOG_RARE to SSH_LOG_PACKET in packet.c
2009-08-29 18:59:13 +02:00
Andreas Schneider
d9a50f04e7
Fix ssh_write_knownhost() if ~/.ssh doesn't exist.
2009-08-26 09:39:21 +02:00
Andreas Schneider
4aa7d73b43
Fix typo.
2009-08-25 15:23:28 +02:00
Andreas Schneider
3804e72e24
Fix linking on solaris.
...
libresolv and librt are required.
2009-08-25 15:07:29 +02:00
Andreas Schneider
b8508020e5
Link shared libraries with --as-needed by default.
2009-08-25 15:06:56 +02:00
Andreas Schneider
324be0eabd
Fix poll sturct, ISO C doesn't allow unnamed unions.
2009-08-25 14:16:41 +02:00
Andreas Schneider
cfe5f83cf8
Fix shadow compiler warning in sample code.
2009-08-25 13:59:40 +02:00
Andreas Schneider
a1ad0deb32
Set gcc to c99 standard and enable pedantic.
2009-08-25 13:58:30 +02:00
Andreas Schneider
7c575a2418
Fix typedef collisons on Solaris.
2009-08-25 13:54:46 +02:00
Aris Adamantiadis
47cac13c0a
Merge branch 'master' of git://git.libssh.org/projects/libssh/libssh
2009-08-24 16:08:17 +02:00
Aris Adamantiadis
16d1ef8933
buffer initialization change
2009-08-24 16:07:45 +02:00
Andreas Schneider
b500d76929
Add Solaris search path for libraries.
2009-08-24 14:49:07 +02:00
Aris Adamantiadis
aef9471217
fix memleak through requests
2009-08-23 23:43:07 +02:00
Aris Adamantiadis
f3454d571e
ssh_scp_request_get_{filename,permissions,size}
2009-08-23 23:40:30 +02:00
Aris Adamantiadis
1df1f86f7e
added ssh_scp_read
2009-08-23 23:24:46 +02:00
Aris Adamantiadis
f9db9c5a9c
added ssh_scp_accept_request
2009-08-23 22:43:57 +02:00
Aris Adamantiadis
96bafeca4c
corrected errors
2009-08-23 22:40:15 +02:00
Aris Adamantiadis
626d8ec637
forgot to set up state
2009-08-23 22:38:29 +02:00
Aris Adamantiadis
f3b36af50e
added ssh_scp_deny_request
2009-08-23 22:36:32 +02:00
Aris Adamantiadis
385b640d1d
Implementation of ssh_scp_pull_request
...
Still needed: code in ssh_scp_init,
implementation of ssh_scp_read
ssh_scp_request_get_filename,
ssh_scp_request_get_size,
ssh_scp_request_get_mode,
ssh_scp_deny_request
ssh_scp_accept_request
!!
2009-08-23 22:04:51 +02:00
Aris Adamantiadis
d4bc6fa954
Merge branch 'master' of git://git.libssh.org/projects/libssh/libssh
...
Conflicts:
include/libssh/priv.h
2009-08-23 16:41:29 +02:00
Aris Adamantiadis
8bae43876f
experimental callback system
2009-08-23 16:33:59 +02:00
Aris Adamantiadis
fbfea94559
Pending work
2009-08-23 16:29:31 +02:00
Aris Adamantiadis
6a04b43a45
added ssh_scp_request_new,ssh_scp_request_struct
2009-08-23 15:23:48 +02:00
Aris Adamantiadis
049c62098c
add ssh_scp_push_directory,ssh_scp_leave_directory
...
Not yet carefully tested
2009-08-23 14:57:03 +02:00
Aris Adamantiadis
6801959989
Use ssh_basename on ssh_scp_file_push'ed files
2009-08-23 14:28:38 +02:00
Andreas Schneider
8463d9d7c6
Improve header checks on windows.
2009-08-21 15:15:49 +02:00
Andreas Schneider
c497f057a0
Improve detection for required libraries on Solaris.
2009-08-21 15:15:18 +02:00
Andreas Schneider
fc0af0f0d8
Add openssl include dir on Solaris.
2009-08-21 14:54:24 +02:00
Andreas Schneider
330c2004a1
Make the functions public.
2009-08-21 10:17:58 +02:00
Andreas Schneider
0b10493e90
Added ssh_basename() and ssh_dirname().
2009-08-21 10:16:36 +02:00
Andreas Schneider
d23e64fc52
Add a warning if wspiapi.h doesn't exist.
2009-08-20 12:32:35 +02:00
Andreas Schneider
fd83d69440
Improve the configure checks.
2009-08-20 11:50:49 +02:00
Andreas Schneider
461e46b814
Improve checks for Windows version and wspiapi.h.
2009-08-20 11:43:37 +02:00
Andreas Schneider
4f95146151
Fix build warnings on Windows.
2009-08-20 10:50:02 +02:00
Andreas Schneider
3eb21053d0
Add a portable define to print size_t.
2009-08-20 10:49:27 +02:00
Andreas Schneider
92db6f8c6d
Remove DEBUG_CRYPTO variable.
...
You can enable it with cmake -DWITH_DEBUG_CRYPTO:BOOL=TRUE.
2009-08-20 10:44:31 +02:00
Andreas Schneider
0fd0c6d293
Don't shadow global vairables.
2009-08-19 10:52:30 +02:00
Andreas Schneider
b49973f17b
Fix compile warnings.
2009-08-17 08:56:43 +02:00
Andreas Schneider
978d265da8
Build channel_accept() on Windows too.
2009-08-16 19:01:13 +02:00
Vic Lee
cf6dddce34
Fix double free pointer crash in dsa_public_to_string
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-08-16 14:40:19 +02:00
Vic Lee
2c4bbe51dd
Fix return code from packet_wait in channel_request
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-08-16 14:40:18 +02:00
Andreas Schneider
756d441f8c
Fix channel_accept_x11 on Windows.
2009-08-16 14:40:18 +02:00
Vic Lee
db6aa88bc4
Add forward listening feature
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-08-16 14:40:18 +02:00
Aris Adamantiadis
e707af1cd7
Fix channel_get_exit_status bug reported by VicLee
...
It would return -1 if the channel received the exit status
and the close message at same time.
2009-08-16 13:51:55 +02:00
Aris Adamantiadis
380a70d650
fix ssh_finalize which didn't clear the flag
2009-08-13 23:26:17 +02:00
Andreas Schneider
2dc3b5c675
Add sftp_extension_supported() function.
2009-08-12 17:13:42 +02:00
Andreas Schneider
63011c29a0
Implement an example for statvfs.
2009-08-12 17:13:42 +02:00
Andreas Schneider
e68c3b09a6
Add support for OpenSSH's statvfs and fstatvfs calls.
2009-08-12 17:13:42 +02:00
Andreas Schneider
0793bf5aa6
Set version number to 0.4.0.
2009-08-12 17:13:04 +02:00
Andreas Schneider
d9b7e4cb7a
Fix compilation with visibility flags with mingw.
...
Thanks to Patrick Spendrin.
2009-08-12 14:05:17 +02:00
Andreas Schneider
8e6ab1809f
Enable the debug calltrace by default.
2009-08-12 10:08:20 +02:00
Aris Adamantiadis
86418bfbbe
Merge branch 'master' of git://git.libssh.org/projects/libssh/libssh
2009-08-12 00:04:30 +02:00
Aris Adamantiadis
1e1c13f756
some tweaks of scp example
2009-08-12 00:04:04 +02:00
Aris Adamantiadis
8dae851836
Make the calltrace logging optional
2009-08-12 00:03:36 +02:00
Andreas Schneider
db284d60b9
Fix static build.
...
If you want to link against the static library you have to define
LIBSSH_STATIC and link against ssh_static.
gcc -static -DLIBSSH_STATIC -lssh_static foo.c -o foo
2009-08-11 18:16:43 +02:00
Andreas Schneider
bfc6c7e606
Remove the map file from the sources.
2009-08-11 17:11:44 +02:00
Andreas Schneider
9b13390ad0
Use gcc visibility attribute to get rid of the map file.
2009-08-11 17:10:00 +02:00
Andreas Schneider
81fe4299f7
Fix linking of the static library on Windows.
2009-08-11 16:12:53 +02:00
Andreas Schneider
5e4bc6ec79
Fix compilation with MSVC and use declspec to export functions.
...
Thanks to Patrick Spendrin <ps_ml@gmx.de > for all the MSVC fixes.
2009-08-11 15:38:49 +02:00
Andreas Schneider
f3612879a8
Remove InstallRequiredSystemLibraries from CPack.
2009-08-11 15:37:52 +02:00
Andreas Schneider
57088c4375
Fix libssh build and installation on MSVC.
2009-08-11 15:37:10 +02:00
Andreas Schneider
011ab7c8fe
Suppress warning about "deprecated" functions in MSVC.
2009-08-11 15:36:37 +02:00
Aris Adamantiadis
e4422d6605
Fix memory leak introduced by previous bugfix
2009-08-11 13:15:23 +02:00
Andreas Schneider
14e1d015ee
Fix uint8_t.
2009-08-11 09:41:52 +02:00
Andreas Schneider
3da1c17acb
Add a NULL check for strdup memory allocation.
2009-08-11 09:41:07 +02:00
Aris Adamantiadis
7e9f0803c5
Latest scp code
...
The sample is now able to scp a file
2009-08-10 22:59:35 +02:00
Aris Adamantiadis
f989452b3e
Fixed stupid "can't parse known host key" bug
...
due to a dangling \n in the base64 ...
2009-08-10 22:50:16 +02:00
Aris Adamantiadis
a2780d1dd4
I really really broke it
...
excuse me !
2009-08-10 14:34:04 +02:00
Aris Adamantiadis
ddca45804b
oops I broke libssh.map
2009-08-10 14:32:50 +02:00
Aris Adamantiadis
f92e12c7b0
ssh_scp_push_file and ssh_scp_write
...
still needs tests
2009-08-09 22:51:03 +02:00
Aris Adamantiadis
e4da8b99fe
Initial scp implementation in source tree
2009-08-09 02:01:54 +02:00
Aris Adamantiadis
b993579079
Got the scp sample to work
...
Problem was that the terminal was not needed, and some nul bytes were to be read.
2009-08-09 00:25:09 +02:00
Aris Adamantiadis
807cb635c1
Fixed channel_poll broken when delayed EOF recvd
...
Previous code returned SSH_EOF even if data was left in buffer
2009-08-09 00:20:42 +02:00
milo
3ad559cc23
Fix buffer overflow in generate_cookie()
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-08-07 12:49:55 +02:00
milo
ec02ce0ec2
Fix a typo: CHANNEL * -> ssh_channel
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-08-07 11:40:07 +02:00
milo
1b9676a0cc
Fix possible memory corruption ( #14 )
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-08-06 10:29:36 +02:00
Andreas Schneider
f4b3ef7604
Remove ssh_fd_poll from map file.
2009-08-05 18:20:32 +02:00
Andreas Schneider
e9974c2053
Remove ssh_fd_poll which is gone.
2009-08-05 17:38:43 +02:00
Andreas Schneider
de532ee550
Move extension structure to the end.
2009-08-01 11:15:53 +02:00
Andreas Schneider
67b44e4417
Don't use the map file if the build type is debug.
2009-08-01 11:05:19 +02:00
Andreas Schneider
83f65031c0
Fixed libssh compilation without server support.
2009-07-31 12:31:46 +02:00
Vic Lee
63053541e6
Add x11 forwarding support for ssh client
...
Signed-off-by: Vic Lee <llyzs@163.com >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-07-31 11:17:51 +02:00
Andreas Schneider
a040e2e3db
Cleanup the map file and oder it alphabetically.
2009-07-30 12:02:05 +02:00
Andreas Schneider
678d445075
Export public functions on Windows.
2009-07-30 12:01:39 +02:00
Andreas Schneider
3558b9e6b6
Fix Windows build.
2009-07-30 11:40:28 +02:00
Andreas Schneider
590c3e2f51
Add strange names for Windows.
2009-07-30 11:38:38 +02:00
Andreas Schneider
28a7343320
Fix project name in examples.
2009-07-30 11:11:00 +02:00
Andreas Schneider
766bae9d76
Fix build with MSVC.
2009-07-30 10:45:58 +02:00
Andreas Schneider
94a57df0c9
Compile the library with the map file again.
2009-07-30 00:46:57 +02:00
Andreas Schneider
5f93742c5e
Add missing functions to map file.
2009-07-30 00:46:45 +02:00
Andreas Schneider
9457c770df
Change the library so version.
2009-07-30 00:46:07 +02:00
Andreas Schneider
bccb9b16a5
Move channel_write_stderr to server.c.
2009-07-29 23:21:01 +02:00
Andreas Schneider
1355029ec9
Fix indent.
2009-07-29 23:02:12 +02:00
Andreas Schneider
5dc8d6069d
Update map file and introduce a new version.
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-07-29 18:42:16 +02:00
Andreas Schneider
60837b1538
Add channel_write_stderr prototype to the right header file.
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-07-29 18:42:10 +02:00
Andreas Schneider
debfd1f3a3
Fix build errors in new messages functions.
...
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-07-29 18:42:05 +02:00
Preston A. Elder
4f70cc13e2
Fleshed out server interface
...
- Enables channel_request_open types of DIRECT_TCPIP, FORWARDED_TCPIP and X11 (ie. implemented the handling of those channel_request_open types).
- Adds functions to retrieve the extra information relating to channel_request_open messages and channel_request messages.
- Adds a channel_write_stderr method (obviously for writing to the STDERR channel from server side) - well, technically just converted the exiting channel_write to take an extra argument and created two wrapper functions.
- Actually does the invoking of message_handle() from channel_recv_request.
- Implemented the handling of the window-change and env channel_requests.
- Implemented a few functions in server.h that were declared but not defined (eg. ssh_message_channel_request_channel).
Signed-off-by: Preston A. Elder <prez@neuromancy.net >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-07-29 18:41:48 +02:00
Andreas Schneider
b4111c5c18
Add functions to get the extension count, name and data.
2009-07-28 14:13:22 +02:00
Andreas Schneider
b9b7174d85
Add support to read and store sftp extensions.
2009-07-28 13:25:35 +02:00
Andreas Schneider
69ceaae9a9
Check for OpenSSH and implement sftp_symlink correct.
...
When OpenSSH's sftp-server was implemented, the order of the arguments
to the SSH_FXP_SYMLINK method was inadvertently reversed. Unfortunately,
the reversal was not noticed until the server was widely deployed.
Since fixing this to follow the specification would cause
incompatibility, the current order was retained.
2009-07-28 13:25:26 +02:00
Andreas Schneider
1abdb28995
Fix SSH1 compilation.
2009-07-27 23:17:35 +02:00
Andreas Schneider
81dab99afc
Fix stdint type.
2009-07-27 23:14:04 +02:00
Andreas Schneider
291522772d
Fix SSH1 and stdint in SSH1 code.
2009-07-27 23:13:24 +02:00
milo
26d1ac325b
Fix potential memory corruption bug
2009-07-27 20:53:01 +02:00
milo
1311d03415
Fix typo orignator_port -> originator_port
2009-07-27 20:52:36 +02:00
Andreas Schneider
549fd32574
Fix compile errors in keyfiles.
2009-07-27 20:49:38 +02:00
Andreas Schneider
9f14bbd6ad
Remove double SSH2_MSG_USERAUTH_PK_OK.
2009-07-27 20:30:27 +02:00
milo
e8f7801540
Public key authentication server side
2009-07-27 20:27:07 +02:00
Andreas Schneider
cdde79418a
Add ssh_file_readaccess_ok to check read access on a file.
2009-07-27 14:20:32 +02:00
Andreas Schneider
9b97da65e6
Add a function to close the socket.
...
This fixes ssh_connect on Windows.
2009-07-27 14:19:06 +02:00
Andreas Schneider
1dcaebe1ce
Fix a typo.
2009-07-27 13:20:29 +02:00
Andreas Schneider
28b5d0f875
Switch completly to stdint types.
2009-07-25 23:19:41 +02:00
Aris Adamantiadis
ba217dec1c
First implementation of a scp transfer tool
...
Doesn't work yet. I've got a headache and debugging doesn't help.
2009-07-25 22:29:12 +02:00
Andreas Schneider
3b8c4dc750
Fix conflicting declarations of ssh_session and ssh_kbdint.
2009-07-25 20:26:56 +02:00
Andreas Schneider
5d1fa1be24
Fix return value of sftp_tell64().
2009-07-25 19:52:07 +02:00
Andreas Schneider
c8e82528fc
Update map file for ssh_clean_pubkey_hash;
2009-07-25 18:00:36 +02:00
Andreas Schneider
104e6d39ab
Add a sftp_tel64() function.
2009-07-25 17:55:58 +02:00
Andreas Schneider
3f778d9a31
Add ssh_clean_pubkey_hash() which is needed on Windows.
2009-07-25 17:52:00 +02:00
Aris Adamantiadis
a935ad1857
New example directory with the begining of a scp
2009-07-25 17:03:01 +02:00
Aris Adamantiadis
7abb3941c8
Bumped the version numbers to 0.4.0 in HEAD
2009-07-25 16:32:10 +02:00
Andreas Schneider
194880b869
Update map file.
2009-07-25 11:56:59 +02:00
Andreas Schneider
737f588b3b
Fix a typo.
2009-07-25 11:55:42 +02:00
Andreas Schneider
6d5b36fb79
Add symlink and readlink test to sample.
2009-07-25 11:55:42 +02:00
Andreas Schneider
8ce6bd3459
Add sftp_readlink function.
2009-07-25 11:55:42 +02:00
Andreas Schneider
5b8338d115
Add sftp_symlink function.
2009-07-25 11:55:33 +02:00
Aris Adamantiadis
e73cbbe18c
Added a threading + sftp stress testcase
2009-07-24 22:52:10 +02:00
Aris Adamantiadis
69a01b3657
move all u32,u16,u8 and u64 declarations in priv.h
...
And fix all headers which need u32,u8,u64
2009-07-24 22:31:39 +02:00
Aris Adamantiadis
e406b81d34
Missed something in channel_select for CHANNEL
2009-07-24 22:24:10 +02:00
Aris Adamantiadis
fdc2751952
Make the SSH_SAFE_NAMESPACE flag active
2009-07-24 22:20:41 +02:00
Aris Adamantiadis
fa11083fcb
Change refs from AGENT * to ssh_agent
...
Fixes also a typo in ssh_agent declaration
2009-07-24 22:19:40 +02:00
Aris Adamantiadis
2bc8819e8f
Changes all CHANNEL * to ssh_channel
2009-07-24 22:15:33 +02:00
Aris Adamantiadis
23b6c95e04
Change PRIVATE_KEY * to ssh_private_key
2009-07-24 22:08:04 +02:00
Aris Adamantiadis
c041bcc6d9
Forgot sample* in previous BUFFER change
2009-07-24 22:03:36 +02:00
Aris Adamantiadis
fc5dd23afa
Changed all PUBLIC_KEY * to ssh_public_key
2009-07-24 22:02:32 +02:00
Aris Adamantiadis
91d0660cc3
Changed all occurences of BUFFER * to ssh_buffer
2009-07-24 21:56:11 +02:00
Aris Adamantiadis
fb5769b4be
You always forget SSH1 ...
2009-07-24 21:47:23 +02:00
Aris Adamantiadis
56ee212641
Change all occurences of STRING * to ssh_string
2009-07-24 21:45:41 +02:00
Aris Adamantiadis
8f3891e968
moved try_publickey_from_file in priv.h
...
Had nothing to do in libssh.h. 100% sure nobody
used it since one of the structure declaration
was not public.
2009-07-24 21:23:07 +02:00
Aris Adamantiadis
958a775afa
replacing keys_struct with ssh_keys_struct
2009-07-24 21:18:15 +02:00
Aris Adamantiadis
e776dc16c9
Fixed namespace problem in public structures
...
changed
struct string_struct to ssh_string_struct
buffer_struct to ssh_buffer_struct
and so on.
Should not break apps using the caps version of these
2009-07-24 20:49:46 +02:00
Andreas Schneider
9450a3c987
Fix a possible segfault in sftp_canonicalize_path().
2009-07-23 18:34:25 +02:00
Andreas Schneider
1939a55c3c
Fix getaddrinfo and gethostbyname build problems on Solaris.
2009-07-23 11:57:17 +02:00
Andreas Schneider
2a116bb291
Fix OpenSSL include file checks on Solaris.
2009-07-23 11:54:32 +02:00
Andreas Schneider
d01c7320f9
Fix finding OpenSSL on Solaris.
2009-07-23 09:30:14 +02:00
Andreas Schneider
ea0315ed88
Add cmake check for big endian.
2009-07-23 09:25:36 +02:00
Andreas Schneider
85a5eb9499
Fix a segfault if a NULL pointer is passed to ssh_disconnect().
2009-07-22 16:04:41 +02:00
Andreas Schneider
3cd06a1f26
Don't segfault if the session or the answer is NULL.
2009-07-22 12:18:34 +02:00
Andreas Schneider
19c3d02805
Merge branch 'master' of git://git.libssh.org/projects/libssh/libssh
2009-07-21 14:12:25 +02:00
Andreas Schneider
b534bfc520
Fix ssh_write_knownhost() which always returned -1.
...
fwrite() return the the number of items written not the size of the
buffer.
2009-07-21 14:07:23 +02:00
Andreas Schneider
ef2c8d66f1
Add compile flags and test for compiler options only if we use gcc.
2009-07-21 11:14:54 +02:00
Andreas Schneider
1a6038baa5
Only add additional warnings if we have a GNU compiler.
2009-07-21 11:10:09 +02:00
Andreas Schneider
41a8fb5810
Make the ssh_userauth_kbdint functions to get the prompts const.
...
They shouldn't be modified or free'd by a user.
2009-07-21 10:34:21 +02:00
Andreas Schneider
8843d8b68d
Fix sol8 + ss11 compile errors.
...
Thanks to tysonite@gmail.com .
2009-07-20 22:50:45 +02:00
Andreas Schneider
2aec79ce36
Add missing changelog entries.
2009-07-14 11:10:22 +02:00
Aris Adamantiadis
bbcbc8425c
Fix doxygen to match SSH_SERVER_FILE_NOT_FOUND fix
2009-07-14 10:09:18 +02:00
Andreas Schneider
ed8178f3c3
Fix build on windows, missing include.
2009-07-13 13:33:52 +02:00
Aris Adamantiadis
933527fc77
Put #ifdef around AI_NUMERICSERV which doesn't seem std
2009-07-13 13:29:00 +02:00
Aris Adamantiadis
bf8d139b2d
Enable conditional compiling for IP regex code.
2009-07-13 12:32:06 +02:00
Aris Adamantiadis
093983b804
forgot init.c in copyright updates
2009-07-13 00:25:04 +02:00
Aris Adamantiadis
103292dd99
Fixed copyright notices
2009-07-13 00:23:42 +02:00
Aris Adamantiadis
76b6b1c694
typo in sample.c
2009-07-13 00:19:47 +02:00
Aris Adamantiadis
1301864f92
Reflect the SSH_SERVER_NOT_KNOWN add-on in sample
2009-07-12 23:17:12 +02:00
Aris Adamantiadis
d5b6f6cc37
Added return code SSH_SERVER_FILE_NOT_FOUND
...
This error is returned by ssh_is_server_known when known_hosts
file does not exist and gives more action to the developer.
2009-07-12 23:13:21 +02:00
Aris Adamantiadis
052073c36d
Set correct hint when connecting to an IP address
...
libssh now uses a regular expression against destination
hostnames to match numerical IP addresses and set the
appropriate hint.
Patches also add init and finalize code to compile the regexp
2009-07-12 23:01:43 +02:00
Aris Adamantiadis
60c778ad7f
fix int -> socket_t in SSH_POLL
2009-07-04 14:16:13 +02:00
Aris Adamantiadis
71100dadcd
Temporary move of ssh_poll_* back to priv.h
...
We'll see later what needs to be put back in public
functions
2009-07-04 13:52:34 +02:00
Aris Adamantiadis
5ba33438f3
Move doxygen tags into C files
2009-07-04 13:47:57 +02:00
Aris Adamantiadis
708c0d32a2
Put back the poll declarations into priv.h
...
That are, poll constants.
2009-07-04 13:41:16 +02:00
Aleksandar Kanchev
3659e8c04a
Add a generic way to handle sockets asynchronously.
...
It's based on poll objects, each of which store a socket, it's events and a callback,
which gets called whenever an event is set. The poll objects are attached to a poll
context, which should be allocated on per thread basis.
Polling the poll context will poll all the attached poll objects and call their
callbacks (handlers) if any of the socket events are set. This should be done within
the main loop of an application.
This is intended as a ground work for making libssh asynchronous.
Signed-off-by: Aleksandar Kanchev <aleksandar.kanchev@googlemail.com >
2009-07-03 21:53:53 +02:00
Aris Adamantiadis
c4cf349729
Add logging of the sftp flags used to open a file
...
Should be used to debug weird behaviour when using libssh on windows with different compiler chains.
2009-06-30 22:35:01 +02:00
Aris Adamantiadis
2c99566697
Fixed Could not write as much data as expected msg
...
Bug caused by verifying the size of the buffer in the wrong place
2009-06-30 22:17:35 +02:00
Aleksandar Kanchev
42470857e2
Fixed make condition in build_make.sh.
...
Signed-off-by: Aleksandar Kanchev <aleksandar.kanchev@googlemail.com >
Signed-off-by: Andreas Schneider <mail@cynapses.org >
2009-06-25 18:02:57 +02:00
Aris Adamantiadis
8724f97a19
Fixed memory leak in ssh_is_server_known()
2009-06-22 23:30:50 +02:00
Aris Adamantiadis
8960992267
Fixed yet another read-after-free bug
...
read of a buffer len after free in sftp_write()
2009-06-21 22:30:28 +02:00
Aris Adamantiadis
730af24de8
Fixed a use-after-free in match_hashed_host()
2009-06-21 22:09:19 +02:00
Aris Adamantiadis
a3fa6f3099
fix stupid "use unallocated memory" code in sample
...
it confused valgrind and wasted 2 precious hours of my life
2009-06-21 21:53:12 +02:00
Aris Adamantiadis
4dafc25927
Added a macro to test buffer_struct integrity
...
Nothing yet in cmake and config.h.in for this
2009-06-21 20:29:29 +02:00
Aris Adamantiadis
e671ebcd99
Modified the sftp test case so it creates 0700 fil
2009-06-21 20:14:10 +02:00
Aris Adamantiadis
bab8508eba
Fix doublefree bug found by Cyril
2009-06-21 19:25:51 +02:00
Andreas Schneider
77cd4795c5
Remove unneeded printf.
2009-06-19 22:46:41 +02:00
Andreas Schneider
dc83f36a00
Add a git ignore file.
2009-06-19 10:25:51 +02:00
Aris Adamantiadis
8336c91e9c
Verify memory return codes in ssh_list functions
2009-06-19 10:18:24 +02:00
Aris Adamantiadis
1bea53375b
added ssh_message_callback support.
...
Not fully working yet. User can set his ssh_message_callback, and the function ssh_execute_message_callbacks will call them when appropriate. Messages are correctly stacked (in packet_parse) but no call to ssh_execute_callbacks exists yet.
2009-06-18 23:48:55 +02:00
Aris Adamantiadis
3af55a4f49
Created general singlelinked list implementation
2009-06-18 23:01:05 +02:00
Aris Adamantiadis
cf482ae3bf
Begin of asynchronous SSH message parsing
2009-06-17 23:53:00 +02:00
Aris Adamantiadis
916958a2bb
Fixed potential format string attacks
...
Potential format string attacks on error reporting in channels.c
2009-06-17 23:42:07 +02:00
Aris Adamantiadis
e2af94289f
ssh_message_retrieve + memoryleak fixed in ssh_message_free
...
ssh_message_retrieve parses a specific SSH message and returns a pointer to it.
Hacked ssh_message_get to use it. This is the first step to have asynchronous ssh messages callbacks.
2009-06-17 23:28:05 +02:00
Aris Adamantiadis
fa4c81cfb9
Url change in README
2009-06-16 16:45:39 +02:00
Aris Adamantiadis
7dbc66e4a3
ssh_init()
...
fixes in client.c and server.c for this
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@778 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-06-15 15:31:23 +00:00
Andreas Schneider
3873489688
Simply leave the function, this should prevent a segfault.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@777 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-06-10 16:05:39 +00:00
Andreas Schneider
d14a492019
Fix a infinite loop on error.
...
Thanks to Milo for the pointer.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@776 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-06-10 15:29:11 +00:00
Andreas Schneider
848984f25f
Fix a possible crash bug.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@775 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-06-09 12:03:24 +00:00
Andreas Schneider
5a755a8219
Fix build warnings.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@774 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-06-09 12:03:00 +00:00
Andreas Schneider
910689126a
Fix cmake on BSD.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@773 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-06-09 10:54:48 +00:00
Andreas Schneider
87995db8fe
Make use of poll() and add a poll-emulation for win32.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@772 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-06-04 07:23:55 +00:00
Laurent Bigonville
70c9da4fb0
Drop debian directory, new location: git://git.debian.org/collab-maint/libssh.git
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@771 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-06-01 16:49:46 +00:00
Andreas Schneider
1ac654ec6c
Fix compilation of SSHv1.
...
Patch by Norbert Kiesel.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@770 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-05-23 08:27:31 +00:00