Commit Graph

1576 Commits

Author SHA1 Message Date
Matt Johnston
e9f2815144 Refer to libtom license files 2020-06-25 23:18:16 +08:00
Matt Johnston
2771fab0fa merge 2020-06-23 22:25:57 +08:00
Matt Johnston
a7a67585cb move GNU_SOURCE earlier 2020-06-23 22:24:58 +08:00
Ilya
366f01252e
fix trace messages (#105) 2020-06-23 22:20:05 +08:00
Matt Johnston
1490c0c3a6 check for poly1305_init in other libtomcrypt configure test 2020-06-23 21:47:54 +08:00
Matt Johnston
3f5c106a88 _GNU_SOURCE for random 2020-06-23 21:38:46 +08:00
Matt Johnston
10e119f638 Disable toom and karatsuba for new libtommath 2020-06-18 19:12:07 +08:00
Matt Johnston
5b68d117c2 Added signature for changeset 4877afd51e04 2020-06-15 23:51:45 +08:00
Matt Johnston
58106b1615 Added tag DROPBEAR_2020.79 for changeset e2e4929d057b 2020-06-15 23:51:39 +08:00
Matt Johnston
1e10af850b can't call "make lint" without configure 2020-06-15 23:38:08 +08:00
Matt Johnston
ee4b4db816 changelog for 2020.79 2020-06-15 23:36:14 +08:00
Gabor Z. Papp
ab9cfce00d Fix "make install" for manpages in out-of-tree builds 2020-06-15 23:17:27 +08:00
Matt Johnston
2b8106b14e Add DEVELOPING.md 2020-06-15 22:30:28 +08:00
Matt Johnston
78c5daee52 Delay seedrandom until connections 2020-06-15 22:24:34 +08:00
Vladislav Grishenko
2301b6ac0b
Disallow leading lines before the ident for server (#102)
Per RFC4253 4.2 clients must be able to process other lines of data
before the version string, server behavior is not defined neither
with MUST/SHOULD nor with MAY.
If server process up to 50 lines too - it may cause too long hanging
session with invalid/evil client that consume host resources and
potentially may lead to DDoS on poor embedded boxes.
Let's require first line from client to be version string and fail
early if it's not - matches both RFC and real OpenSSH behavior.
2020-06-15 21:22:18 +08:00
Matt Johnston
a27e8b053e Disable by default 3des, cbc, hmac-sha1-96, x11 forwarding 2020-06-11 00:09:15 +08:00
Matt Johnston
6145289e0d Remove blowfish 2020-06-10 23:42:42 +08:00
Matt Johnston
d14ebdbf0e avoid zero length array in base64_decode 2020-06-10 23:26:05 +08:00
Matt Johnston
4b305c5721 Merge libtomcrypt v1.18.2 2020-06-10 23:16:13 +08:00
Matt Johnston
615885be01 Fix whitespace changes vs upstream libtomcrypt 2020-06-10 23:01:33 +08:00
Vladislav Grishenko
6b823d617c Sync curve25519 license 2020-06-10 22:13:53 +08:00
Kazuo Kuroi
ec993dbdbc Set IOV_MAX for IRIX 2020-06-10 22:09:29 +08:00
Matt Johnston
ad1e9b7e3c void return types for curve25519 2020-05-30 00:05:49 +08:00
Matt Johnston
846b8cdbf7 Remove unused DEBUG_FORKGPROF 2020-05-29 23:32:19 +08:00
Vladislav Grishenko
b0243b0e7b
Fix ChaCha20 on 32-bit platforms (#99)
* Fix ChaCha20 on 32-bit platforms

On 32-bit platforms with old compiler STORE64H() parameter is
not auto-expanded to 64-bit value, causing wrong IV data.
Spotted on BCM4706 MIPS32r2 with GCC 4.2.4:
	Exit before auth: Integrity error (bad packet size 2065808956)

* Fix Chacha20-Poly1305 and AES-GCM debug messages

Functions were renamed earlier and trace messages - not.
2020-05-29 21:26:22 +08:00
Matt Johnston
4faf06aae7 Don't warn when SO_PRIORITY fails 2020-05-28 23:26:34 +08:00
Matt Johnston
07d46f9907 Fix typo DROPBEAR_NORMAL_DH 2020-05-28 23:23:54 +08:00
Vladislav Grishenko
413eaf1ba1
Allow DH to be completely disabled (#97)
Reduces binary size by ~2kB by default and by 21kB with no other
libtommath functions users, ex. with curve25519 kex and ed25519
key only.
2020-05-28 23:01:48 +08:00
Matt Johnston
3b359050b4 Fix warning for unused prngd branch 2020-05-28 23:01:15 +08:00
Matt Johnston
a015cc7594 Fix indentation and add braces 2020-05-28 22:55:49 +08:00
Matt Johnston
dc12be0cfe merge 2020-05-28 22:52:01 +08:00
Matt Johnston
89e98a2f83 Use Linux getrandom() to ensure random device is initialised
Remove old code warning about random device being not ready,
/dev/random isn't used by default anyway.
2020-05-28 22:50:41 +08:00
Matt Johnston
5027bc4db1 set up early logging name 2020-05-28 22:02:33 +08:00
Matt Johnston
630f6aa6b9 initialise variable to stop warning 2020-05-28 22:02:03 +08:00
Matt Johnston
8048473eb9 Avoid oss-fuzz $SANITIZER causing wrong build
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22608
2020-05-27 20:33:45 +08:00
Matt Johnston
4216c984ae Mention libtom version requirements, check for poly1305 in libtomcrypt 2020-05-27 00:05:15 +08:00
Matt Johnston
6abf756e51 Bring back -Werror and improve travis tests 2020-05-26 23:53:50 +08:00
Steffen Jaeckel
b4bd23b4d2
Update LibTomMath to 1.2.0 (#84)
* update C files

* update other files

* update headers

* update makefiles

* remove mp_set/get_double()

* use ltm 1.2.0 API

* update ltm_desc

* use bundled tommath if system-tommath is too old

* XMALLOC etc. were changed to MP_MALLOC etc.
2020-05-26 23:36:47 +08:00
Matt Johnston
724e61f8ae try rearrange travis build matrix 2020-05-26 23:27:26 +08:00
Matt Johnston
49667a82de .travis.yml needs spaces not tabs 2020-05-26 23:16:11 +08:00
Matt Johnston
a57114e7fa update travis to Ubuntu focal to provide chacha20 2020-05-26 23:13:48 +08:00
Matt Johnston
cfe90bc6bd Fix untested rsa-sha256 change to fuzzer-verify 2020-05-26 23:13:23 +08:00
Matt Johnston
0aefec6c89 Make "dbclient -m help -c help" work 2020-05-26 20:15:39 +08:00
Matt Johnston
6a3bc73a78 fix typo 2020-05-26 20:15:00 +08:00
Matt Johnston
73aa4f0de9 Get rid of unused "none" cipher option 2020-05-26 20:05:31 +08:00
Matt Johnston
9e25854b41 cast to fix warning 2020-05-26 19:57:28 +08:00
Matt Johnston
d277f140ba merge rsa-sha256 2020-05-26 00:24:02 +08:00
Vladislav Grishenko
61267f8503
CBC mode cleanup (#95)
* Fix CBC mode can't be fully disabled

* Fix CBC mode can't be the only mode
2020-05-25 23:55:13 +08:00
Vladislav Grishenko
d3d0d60076
Add Chacha20-Poly1305, AES128-GCM and AES256-GCM support (#93)
* Add Chacha20-Poly1305 authenticated encryption

* Add general AEAD approach.
* Add chacha20-poly1305@openssh.com algo using LibTomCrypt chacha and
  poly1305 routines.

Chacha20-Poly1305 is generally faster than AES256 on CPU w/o dedicated
AES instructions, having the same key size.
Compiling in will add ~5,5kB to binary size on x86-64.

function                                             old     new   delta
chacha_crypt                                           -    1397   +1397
_poly1305_block                                        -     608    +608
poly1305_done                                          -     595    +595
dropbear_chachapoly_crypt                              -     457    +457
.rodata                                            26976   27392    +416
poly1305_process                                       -     290    +290
poly1305_init                                          -     221    +221
chacha_setup                                           -     218    +218
encrypt_packet                                      1068    1270    +202
dropbear_chachapoly_getlength                          -     147    +147
decrypt_packet                                       756     897    +141
chacha_ivctr64                                         -     137    +137
read_packet                                          543     637     +94
dropbear_chachapoly_start                              -      94     +94
read_kex_algos                                       792     880     +88
chacha_keystream                                       -      69     +69
dropbear_mode_chachapoly                               -      48     +48
sshciphers                                           280     320     +40
dropbear_mode_none                                    24      48     +24
dropbear_mode_ctr                                     24      48     +24
dropbear_mode_cbc                                     24      48     +24
dropbear_chachapoly_mac                                -      24     +24
dropbear_chachapoly                                    -      24     +24
gen_new_keys                                         848     854      +6
------------------------------------------------------------------------------
(add/remove: 14/0 grow/shrink: 10/0 up/down: 5388/0)         Total: 5388 bytes

* Add AES128-GCM and AES256-GCM authenticated encryption

* Add general AES-GCM mode.
* Add aes128-gcm@openssh.com and aes256-gcm@openssh.com algo using
  LibTomCrypt gcm routines.

AES-GCM is combination of AES CTR mode and GHASH, slower than AES-CTR on
CPU w/o dedicated AES/GHASH instructions therefore disabled by default.
Compiling in will add ~6kB to binary size on x86-64.

function                                             old     new   delta
gcm_process                                            -    1060   +1060
.rodata                                            26976   27808    +832
gcm_gf_mult                                            -     820    +820
gcm_add_aad                                            -     660    +660
gcm_shift_table                                        -     512    +512
gcm_done                                               -     471    +471
gcm_add_iv                                             -     384    +384
gcm_init                                               -     347    +347
dropbear_gcm_crypt                                     -     309    +309
encrypt_packet                                      1068    1270    +202
decrypt_packet                                       756     897    +141
gcm_reset                                              -     118    +118
read_packet                                          543     637     +94
read_kex_algos                                       792     880     +88
sshciphers                                           280     360     +80
gcm_mult_h                                             -      80     +80
dropbear_gcm_start                                     -      62     +62
dropbear_mode_gcm                                      -      48     +48
dropbear_mode_none                                    24      48     +24
dropbear_mode_ctr                                     24      48     +24
dropbear_mode_cbc                                     24      48     +24
dropbear_ghash                                         -      24     +24
dropbear_gcm_getlength                                 -      24     +24
gen_new_keys                                         848     854      +6
------------------------------------------------------------------------------
(add/remove: 14/0 grow/shrink: 10/0 up/down: 6434/0)         Total: 6434 bytes
2020-05-25 23:50:25 +08:00
Vladislav Grishenko
91e537e427
Mention Ed25519 in dropbearkey man (#94) 2020-05-25 21:28:27 +08:00