aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-06-29Rest in Peace SSHv1Andreas Schneider56-3148/+337
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2018-06-29gitlab: Fix build on FreeBSDAndreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29kex: Enable chacha20-poly1304 KEX with mbedtlsAndreas Schneider6-17/+20
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29cmake: Disable torture_packet on WindowsAndreas Schneider1-1/+3
The test uses socketpair(). Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29gitlab: Disable client testing on freebsdAndreas Schneider1-1/+1
The host doesn't have cwrap installed. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29gitlab: Remove the debian aarch64 buildAndreas Schneider1-16/+0
This doesn't work anymore Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29gitlab: Add SERVER_TESTING and updates for cmakeAndreas Schneider1-39/+52
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29cmake: Add SERVER_TESTING optionAndreas Schneider2-2/+3
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29cmake: Rename WITH_CLIENT_TESTING option to CLIENT_TESTINGAndreas Schneider5-15/+15
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29cmake: Rename WITH_TESTING option to UNIT_TESTINGAndreas Schneider6-25/+25
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29tests: Fix key parsing in torture_pki_dsa_publickey_base64Andreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29tests: Remove system includes from torture_packetAndreas Schneider1-2/+1
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-29pki: Fix random memory corruptionAndreas Schneider3-4/+23
Fixes T78 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29tests: Move CHACHA20 define out of HAVE_DSA ifdefAndreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28gitlab: Do not build with SSHv1 supportAndreas Schneider1-6/+6
This will be removed soon. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28chacha: fix build for mbedTLSJon Simons4-2/+16
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-28packet_crypt: remove `set_decrypt_key` upon `ssh_packet_decrypt_len`Jon Simons1-8/+0
In 06b9901e64f1ea2a1141115e5645552034d25850, 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-28chacha: use a cipher cleanup callbackJon Simons2-4/+6
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-28packet_crypt: fix unused variable compiler warningJon Simons1-1/+0
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-28tests: fix torture_packet.c `test_data`Jon Simons1-1/+4
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-28pkd: move chacha20-poly1305@openssh.com tests to OPENSSHONLY sectionJon Simons1-9/+13
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-28pkd: add passes for chacha20-poly1305@openssh.com cipherJon Simons1-1/+7
Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28torture_packet: Set encryption/decryption keysAlberto Aguirre1-0/+14
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28packet_crypt: Avoid setting keys every timeAlberto Aguirre1-13/+0
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-28tests: send more packets of various sizesAris Adamantiadis1-1/+18
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28tests: packet encryption unit testingAris Adamantiadis2-0/+194
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-28tests: test for chacha20-poly1305@openssh.comAris Adamantiadis1-0/+13
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28libgcrypt: make it compatible with chacha20Aris Adamantiadis3-0/+23
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28chacha: packet decryptionAris Adamantiadis7-104/+276
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28chacha: packet encryptionAris Adamantiadis11-62/+288
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28cmake: detect "bounded" compiler attributeAris Adamantiadis4-4/+23
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28external: Add ChaCha and Poly1305 implementations from OpenSSHAris Adamantiadis7-0/+430
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28gitlab: Disable SSHv1 supportAndreas Schneider1-8/+8
This will be removed soon. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28torture: Remove unused variableAndreas Schneider1-2/+0
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28Remove vim modelines from all filesAndreas Schneider40-72/+0
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-28tests: Disable ssh_is_ipaddr("255.255.255") on Win32Andreas Schneider1-4/+3
Till we get the issue fixed in Wine. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28tests: Workaround for a Wine bugAndreas Schneider1-33/+43
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-27pkd: log but ignore ungraceful client disconnectsJon Simons1-2/+6
Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-27pkd: move `hmac-sha2-256` to OpenSSH-only listsJon Simons1-2/+16
Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-27pkd: omit `-v` for `dbclient` by defaultJon Simons1-1/+0
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-27pkd: remove `blowfish-cbc` cipher passesJon Simons1-11/+2
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-27pkd: emit error message for OpenSSH clients < 7.0Jon Simons1-2/+61
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-27pkd: specify PubkeyAcceptedTypes for OpenSSH clientJon Simons1-1/+14
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-27pkd: specify HostKeyAlgorithms for OpenSSH clientJon Simons1-7/+30
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-27pkd: run with SOCKET_WRAPPER_LIBRARYJon Simons3-2/+105
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-27pkd: add_test pkd_hello_i1 for `make test`Jon Simons1-0/+8
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-27pkd: fix missing config.h #includeJon Simons1-0/+2
Ensure to include config.h so that the `HAVE_DSA` value is properly set when building the pkd tests. Introduced with 778652460f7cceb3e760964a890ffd99ec8230e7, 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-27dh: fix two leaks in `ssh_get_pubkey_hash`Jon Simons1-2/+7
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 16217454d576511f37f39c3169963629f9d5082f. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-27dh: fix `ssh_get_pubkey_hash` indentationJon Simons1-38/+37
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-27tests: fix -Wunused-function warning in torture_pki_ecdsa.cJon Simons1-0/+2
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>