1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-18 15:20:56 +03:00
Commit Graph

271 Commits

Author SHA1 Message Date
Will Cosgrove
f0417cb196 openssh_fixture.c: fix warning (#621)
File: openssh_fixture.c

Notes:
Fix `portable_sleep` return type warning

Credit:
Will Cosgrove
2021-09-02 13:14:46 -07:00
Laurent Stacul
a4fc97bf0a Makefile.am: Add missing key in case openssl > 1.1.0 (#617)
File: Makefile.am

Notes: fix missing test keys

Credit: 
Laurent Stacul
2021-08-30 09:59:27 -07:00
Laurent Stacul
a88a727c2a [tests] Try several times to connect the ssh server
Sometimes, as the OCI container is run in detached mode, it is possible
the actual server is not ready yet to handle SSH traffic. The goal of
this PR is to try several times (max 3). The mechanism is the same as
for the connection to the docker machine.
2021-05-30 12:33:05 +02:00
Laurent Stacul
3709037b26 Remove openssh_server container on test exit 2021-05-30 11:41:52 +02:00
Laurent Stacul
718bcb03d2 Allow the tests to run inside a container
The current tests suite starts SSH server as OCI container. This commit
add the possibility to run the tests in a container provided that:

* the docker client is installed builder container
* the host docker daemon unix socket has been mounted in the builder
  container (with, if needed, the DOCKER_HOST environment variable
  accordingly set, and the permission to write on this socket)
* the builder container is run on the default bridge network, or the
  host network. This PR does not handle the case where the builder
  container is on another network.
2021-05-29 12:01:51 +02:00
Marc Hoersken
fee3125b3b CI/appveyor: run SSH server for tests on GitHub Actions (#607)
No longer rely on DigitalOcean to host the Docker container.

Unfortunately we require a small dispatcher script that has
access to a GitHub access token with scope repo in order to
trigger the daemon workflow on GitHub Actions also for PRs.

This script is hosted by myself for the time being until GitHub
provides a tighter scope to trigger the workflow_dispatch event.
2021-05-28 08:52:27 +02:00
Laurent Stacul
f1f47ef79b tests: Makefile.am: Add missing tests client keys in distribution tarball (#604)
Notes:
Added missing test keys.

Credit:
Laurent Stacul
2021-05-18 08:18:06 -07:00
Laurent Stacul
62bc25c987 Makefile.am: Add missing test keys in the distribution tarball (#601)
Notes: 
Fix tests missing key to build the OCI image

Credit:
Laurent Stacul
2021-05-17 09:11:10 -07:00
kkoenig
3f9d505353 Support ECDSA certificate authentication (#570)
Files: hostkey.c, userauth.c, test_public_key_auth_succeeds_with_correct_ecdsa_key.c

Notes:
Support ECDSA certificate authentication

Add a test for:
  - Existing ecdsa basic public key authentication
  - ecdsa public key authentication with a signed public key

Credit:
kkoenig
2021-05-12 09:13:19 -07:00
Gabriel Smith
b5c071d180 openssh_fixture.c: Fix potential overwrite of buffer when reading stdout of command (#580)
File:
openssh_fixture.c 
Notes:
If reading the full output from the executed command took multiple
passes (such as when reading multiple lines) the old code would read
into the buffer starting at the some position (the start) every time.
The old code only works if fgets updated p or had an offset parameter,
both of which are not true.

Credit:
Gabriel Smith
2021-05-03 14:41:25 -07:00
Gabriel Smith
ee199144fe ci: Swap from Travis to Github Actions (#581)
Files: ci files

Notes:
Move Linux CI using Github Actions

Credit:
Gabriel Smith, Marc Hörsken
2021-04-30 16:10:52 -07:00
Laurent Stacul
5627b82be6 Tests: Fix unused variables warning (#561)
file: test_public_key_auth_succeeds_with_correct_ed25519_key_from_mem.c

notes: fixed unused vars

credit:
Laurent Stacul
2021-03-04 14:17:00 -08:00
Will Cosgrove
8ae21cad83 ssh2_client_fuzzer.cc: fixed building
The GitHub web editor did some funky things
2021-02-05 10:05:52 -08:00
Will Cosgrove
384a50e0e4 ssh_client_fuzzer.cc: set blocking mode on (#553)
file: ssh_client_fuzzer.cc

notes: the session needs blocking mode turned on to avoid EAGAIN being returned from libssh2_session_handshake()

credit:
Will Cosgrove, reviewed by Michael Buckley
2021-02-04 09:56:16 -08:00
Etienne Samson
1adb24fd07 Add a LINT option to CMake (#372)
* ci: make style-checking available locally

* cmake: add a linting target

* tests: check test suite syntax with checksrc.pl
2021-02-02 10:28:28 -08:00
Daniel Stenberg
ecd6a74e44 Makefile.am: include all test files in the dist #379
File:
Makefile.am

Notes:
No longer conditionally include OpenSSL specific test files, they aren't run if we're not building against OpenSSL 1.1.x anyway.

Credit:
Daniel Stenberg
2020-09-01 16:40:48 -07:00
Max Dymond
7a4b051ba4 Add support for an OSS Fuzzer fuzzing target (#392)
Files:
.travis.yml, configure.ac, ossfuzz 

Notes:
This adds support for an OSS-Fuzz fuzzing target in ssh2_client_fuzzer,
which is a cut down example of ssh2.c. Future enhancements can improve
coverage.

Credit:
Max Dymond
2020-09-01 14:20:52 -07:00
Marc Hoersken
984d008106 tests: avoid use of deprecated function _sleep (#490) 2020-06-22 21:08:57 +02:00
Marc Hoersken
ac13b70a89 tests: avoid use of banned function strncat (#489) 2020-06-22 21:08:11 +02:00
Marc Hoersken
36d87a17a8 tests: satisfy checksrc regarding max line length of 79 chars
Follow up to 2764bc8e06
2020-06-20 21:48:30 +02:00
Marc Hoersken
2764bc8e06 tests: satisfy checksrc with whitespace only fixes
checksrc.pl -i4 -m79 -ASIZEOFNOPAREN -ASNPRINTF
            -ACOPYRIGHT -AFOPENMODE tests/*.[ch]
2020-06-20 20:47:56 +02:00
Marc Hoersken
ec53d55cc0 tests: add support for ports published via Docker for Windows 2020-06-20 18:47:49 +02:00
Marc Hoersken
b78e57a2d7 tests: restore retry behaviour for docker-machine ip command 2020-06-20 18:44:30 +02:00
Marc Hoersken
0f6d3b68db tests: fix mix of declarations and code failing C89 compliance 2020-06-20 18:42:24 +02:00
Panos
378ffa9ba8 Add agent forwarding implementation (#219)
files: channel.c, test_agent_forward_succeeds.c, libssh2_priv.h, libssh2.h, ssh2_agent_forwarding.c

notes:
* Adding SSH agent forwarding.
* Fix agent forwarding message, updated example.
Added integration test code and cmake target. Added example to cmake list.

credit: 
pkittenis
2019-08-12 14:23:19 -07:00
Pedro Monreal
f4663f9f12 Spelling corrections (#380)
Files : 
libssh2.h, libssh2_sftp.h, bcrypt_pbkdf.c, mbedtls.c, sftp.c, ssh2.c

Notes :
* Fixed misspellings

Credit :
Pedro Monreal
2019-07-01 10:00:09 -07:00
Will Cosgrove
4ac1ba7181 Silence unused var warnings (#329)
Silence warnings about unused variables in this test
2019-03-19 14:14:34 -07:00
Will Cosgrove
0309229259 ED25519 Key Support #39 (#248)
OpenSSH Key and ED25519 support #39
Added _libssh2_explicit_zero() to explicitly zero sensitive data in memory #120

* ED25519 Key file support - Requires OpenSSL 1.1.1 or later
* OpenSSH Key format reading support - Supports RSA/DSA/ECDSA/ED25519 types
* New string buffer reading functions - These add build-in bounds checking and convenance methods. Used for OpenSSL PEM file reading.
* Added new tests for OpenSSH formatted Keys
2018-08-02 14:00:25 -07:00
Will Cosgrove
62b825c8af ECDSA key types are now explicit (#251)
* ECDSA key types are now explicit

Issue was brough up in pull request #248
2018-05-04 13:03:15 -07:00
Etienne Samson
54bef4c5da A collection of small fixes (#198)
* tests: Remove if-pyramids

* tests: Switch run_command arguments

* tests: Make run_command a vararg function

* tests: Xcode doesn't obey CMake's test working directory

* openssl: move manual AES-CTR cipher into crypto init

* cmake: Move our include dir before all other include paths
2018-03-20 16:58:13 -07:00
Viktor Szakats
42cf29101e tests: fix checksrc warnings
Also:
* add 'static' qualifier to file-wide const buffers
* fix a non-ANSI C89 comment
* silence a mismatched fprintf() mask warning by adding a cast
2018-03-13 21:32:41 +00:00
Will Cosgrove
aba34f5f56 Add support for ECDSA keys and host keys (#41)
This commit lands full ECDSA key support when using the OpenSSL
backend. Which includes:

New KEX methods:
ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521

Can now read OpenSSL formatted ECDSA key files.

Now supports known host keys of type ecdsa-sha2-nistp256.

New curve types:
NID_X9_62_prime256v1, NID_secp384r1, NID_secp521r1

Default host key preferred ordering is now nistp256, nistp384,
nistp521, rsa, dss.

Ref: https://github.com/libssh2/libssh2/issues/41

Closes https://github.com/libssh2/libssh2/pull/206
2018-03-09 19:28:38 +00:00
Marc Hoersken
323aa08f01 tests/openssh_server/authorized_keys: add key_rsa_encrypted.pub 2017-03-02 22:29:14 +01:00
Marc Hoersken
20a545d37d tests: add simple test for passphrase-protected PEM file support 2017-03-02 00:51:37 +01:00
Alex Arslan
8dc9f4c156 Check for netinet/in.h in the tests cmake file (#148) 2016-11-16 08:45:38 +00:00
Tony Kelman
e83bbc48ab Build mbedtls from source on Travis (#133)
* Revert "Revert "travis: Test mbedtls too""

This reverts commit c4c60eac5c.

* travis: Build mbedtls from source on Travis

Use TOOLCHAIN_OPTION when calling cmake on mbedtls

* tests: only run DSA tests for non-mbedtls

crypto backends
2016-11-12 10:41:48 +00:00
Antenore Gatta
32d0965ca4 tests: HAVE_NETINET_IN_H was not defined correctly (#127)
Fixes #125
2016-09-04 00:44:24 +02:00
Alexander Lamaison
cf80f2f4b5 Basic dockerised test suite.
This introduces a test suite for libssh2. It runs OpenSSH in a Docker
container because that works well on Windows (via docker-machine) as
well as Linux. Presumably it works on Mac too with docker-machine, but
I've not tested that.

Because the test suite is docker-machine aware, you can also run it
against a cloud provider, for more realistic network testing, by setting
your cloud provider as your active docker machine. The Appveyor CI setup
in this commit does that because Appveyor doesn't support docker
locally.
2016-08-14 16:03:25 +01:00
Kamil Dudka
d48d7c3a87 cmake: include CMake files in the release tarballs
Despite we announced the CMake support in libssh2-1.6.0 release notes,
the files required by the CMake build system were not included in the
release tarballs.  Hence, the only way to use CMake for build was the
upstream git repository.

This commit makes CMake actually supported in the release tarballs.
2015-07-02 13:09:49 +02:00
Kamil Dudka
13f8addd1b tests/mansyntax.sh: fix 'make distcheck' with recent autotools
Do not create symbolic links off the build directory.  Recent autotools
verify that out-of-source build works even if the source directory tree
is not writable.
2015-07-02 12:42:55 +02:00
Alexander Lamaison
bbbdf946a7 Prevent collisions between CMake and Autotools in examples/ and tests/. 2015-03-13 07:47:41 +00:00
Alexander Lamaison
6bf8983368 CMake build system.
Tested:
 - Windows:
    - Visual C++ 2005/2008/2010/2012/2013/MinGW-w64
    - static/shared
    - 32/64-bit
    - OpenSSL/WinCNG
    - Without zlib
 - Linux:
    - GCC 4.6.3/Clang 3.4
    - static/shared
    - 32/64-bit
    - OpenSSL/Libgcrypt
    - With/Without zlib
 - MacOS X
    - AppleClang 6.0.0
    - static
    - 64-bit
    - OpenSSL
    - Without zlib

Conflicts:
	README
2015-03-12 22:48:38 +00:00
Alexander Lamaison
523a552258 Man man syntax tests fail gracefully if man version is not suitable. 2015-03-12 22:11:47 +00:00
Alexander Lamaison
d73e0ec260 Return valid code from test fixture on failure.
The sshd test fixture was returning -1 if an error occurred, but negative error codes aren't technically valid (google it).  Bash on Windows converted them to 0 which made setup failure look as though all tests were passing.
2015-03-12 21:50:11 +00:00
Alexander Lamaison
1fa5fe6059 Let mansyntax.sh work regardless of where it is called from. 2015-03-12 21:48:59 +00:00
Marc Hoersken
f89bed9571 tests on Windows: check for WSAStartup return code
Fixes VS2012 code analysis warning C6031:
return value ignored: <function> could return unexpected value
2014-12-15 01:00:36 +01:00
Mikhail Gusarov
8d3709f57a Add manpage syntax checker to 'check' target
In virtually every libssh2 release Debian's lintian catches syntax errors in
manpages. Prevent it by checking manpages as a part of testsuite.
2011-09-12 15:38:00 +02:00
Daniel Stenberg
79ee2f339e make it C90 compliant 2010-04-12 22:09:38 +02:00
Simon Josefsson
fa4017c613 Fix init/exit logic. Add self-test of it. 2010-03-19 09:27:19 +01:00
Peter Stuge
6df87e64b7 Use LIBSSH2_HOSTKEY_HASH_SHA1 instead of _MD5 in examples and tests
MD5 support is optional and may not always be available, while SHA1 is both
required and recommended.
2010-01-29 23:06:31 +01:00