1
1
Граф коммитов

3398 Коммитов

Автор SHA1 Сообщение Дата
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