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
dbf72ffba2ad5b5694cd55aa1a7ca99053d20386
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