Commit graph

35 commits

Author SHA1 Message Date
kemal 1a444750d6 ssh: use RSA/SHA-256 instead of RSA/SHA-1 as the public key algorithm
openssh now disables RSA/SHA-1 by default, so using RSA/SHA-1 will
eventually cause us problems:

https://undeadly.org/cgi?action=article;sid=20210830113413

in addition, github will disable RSA/SHA-1 for recently added RSA keys:

https://github.blog/2021-09-01-improving-git-protocol-security-github/

this patch modifies ssh.c to use RSA/SHA-256 (aka rsa-sha2-256)
instead of RSA/SHA-1 (aka ssh-rsa) as the public key algorithm.

NOTE: public rsa keys and thumbprints are ***NOT AFFECTED***
by this patch.

while we're here, remove the workaround for github.com. it seems
that github has fixed their implementation, and does not look into
macalgs when we're using an aead cipher.
---
2021-09-02 13:28:48 +00:00
Jacob Moody 28057f67a0 ssh: fix typo (thanks izaki) 2021-07-21 16:16:29 +00:00
Ori Bernstein b68b3a6e19 vt, ssh: don't send interrupts on window resize
When resizing windows, vt would signal ssh by updating
the window size and sending an interrupt. Ssh reacted
by forwarding both the winch and an interrupt.

This change adds a WINCH generation counter so that
ssh can differentiate between resizes and interrupts.
If an interrupt comes in, and the WINCH generation
changes, then the interrupt is taken as signalling a
WINCH.
2021-06-26 17:29:27 +00:00
cinap_lenrek 57d95c7325 libsec: move zero check to curve25519_dh_finish()
As checking for all zero has to be done in a timing-safe
way to avoid a side channel, it is best todo this here
instead of letting the caller deal with it.

This adds a return type of int to curve25519_dh_finish()
where returning 0 means we got a all zero shared key.

RFC7748 states:

The check for the all-zero value results from the fact
that the X25519 function produces that value if it
operates on an input corresponding to a point with small
order, where the order divides the cofactor of the curve.
2021-06-20 14:41:26 +00:00
cinap_lenrek ed3a3c4dd4 ssh: work around github.com's broken cipher negotiation code (thanks Ori_B)
key exchange with git@github.com fails as they appear to try to
negotiate a mac algorithm even tho we use an AEAD cipher which
does not use a mac algorithm.

the work around is to supply a dummy mac algorithm that they
can negotiate to make them happy.
2019-05-27 02:11:16 +02:00
cinap_lenrek 6d429cf9e8 ssh: print usage for unknown flags, cleanup 2019-04-02 19:22:19 +02:00
cinap_lenrek 38c2cdf164 ssh: add experimental mux mode
in mux mode, ssh relays raw MSG_CHANNEL_*
messages on standard input and output while
still handling authentication and key exchange
internally.

the intend is to use the mux mode to implement
something like the old sshnet ontop of ssh.
2019-04-02 11:18:50 +02:00
cinap_lenrek 47ec5de29e ssh: implement -W option for making remote tcp connections 2019-04-02 09:03:35 +02:00
cinap_lenrek 05227960c6 ssh: don't assume error messages are ASCII. format number of complete runes, not bytes. 2019-02-25 01:19:44 +01:00
cinap_lenrek 8c097ae84a ssh: handle unknown MSG_CHANNE_REQUEST messages 2018-11-08 22:35:45 +01:00
cinap_lenrek 2a266430e3 ssh: handle MSG_GOBAL_REQUEST
respond to MSG_GLOBAL_REQUEST with MSG_REQUEST_FAILURE
as stated by rfc4254 when server wants a reply.

failing todo so breaks some proprietary keep-alive schemes.
2018-11-08 22:00:07 +01:00
cinap_lenrek 06abb1098a ssh: fix spinning due to sticky intr flag on connection timeout 2018-10-12 19:28:39 +02:00
cinap_lenrek 2d6f9f4700 ssh: fix nil dereference when TERM isnt set and -r is requested 2018-07-18 09:48:45 +02:00
cinap_lenrek 899ec4d0b5 ssh: wait for remote channel close (thanks piroko) 2018-06-28 20:10:11 +02:00
spew 9360415d56 ssh:add -r for extra raw mode 2018-05-18 21:36:33 -04:00
cinap_lenrek 8fdf22d5fb ssh: remove extern declarations for pkcs1padbuf() and asn1encodedigest() (now in libsec.h) 2017-10-06 21:00:08 +02:00
cinap_lenrek bc54898807 ssh: issue "winchon" ctl request to /dev/consctl to get interrupt on window size change from vt(1) 2017-08-20 19:17:46 +02:00
cinap_lenrek 74b6d9bda3 ssh: add -h flag to pass host (for compatibility) 2017-05-05 21:04:31 +02:00
cinap_lenrek 710d4982b7 ssh: quote cmd arguments with unix shell single quotes, request tty even with TERM=dumb 2017-05-03 20:55:32 +02:00
aiju 2a920e7361 ssh: add support for subsystems 2017-04-28 15:41:39 +00:00
aiju 042f98784a ssh: make number of retries configurable 2017-04-24 23:26:43 +00:00
aiju ef7b428832 ssh: loop keyboard-interactive on failure 2017-04-24 23:16:59 +00:00
aiju fbf64184df ssh: fix typo 2017-04-24 16:07:34 +00:00
aiju f8eb5a1d13 ssh: add "none" method to find out list of acceptable methods 2017-04-24 16:04:09 +00:00
cinap_lenrek 42f449b9ce ssh: print the whole ssh-rsa hostkey in base64 when thumb check fails
in addition to the thumbprint, also print the whole
hostkey in base64 (same format as openssh uses) to
make verification easier.
2017-04-24 01:46:22 +02:00
cinap_lenrek 346f5828e0 libsec: sha256 support for thumbprint files, use it in ssh as well
initThumbprints() now takes an application tag argument
so x509 and ssh can coexist.

the thumbprint entries can now hold both sha1 and sha256
hashes. okThumbprint() now takes a len argument for the
hash length used.

the new function okCertificate() hashes the certificate
with both and checks for any matches.

on failure, okCertificate() returns 0 and sets error string.

we also check for include loops now in thumbfiles, limiting
the number of includes to 8.
2017-04-23 19:00:08 +02:00
cinap_lenrek da0a7ac387 ssh: implement primitive hostkey verification
this checks $home/lib/sshthumbs for the sha256 hash
of the hosts rsa public key. if its not there, it
prints the rc command to add it and exits.
2017-04-23 02:54:41 +02:00
cinap_lenrek a944c37d68 ssh: actually handle flow control and channel id's 2017-04-21 19:23:56 +02:00
cinap_lenrek 99825e22ed ssh: increase initial window size for better throughput 2017-04-21 01:45:11 +02:00
cinap_lenrek 882f1c492e ssh: cleanup debug messages 2017-04-21 00:09:30 +02:00
cinap_lenrek 9c50712d64 ssh: do not try authentication methods that we know are not possible 2017-04-20 23:45:56 +02:00
cinap_lenrek 2e714ffe7c ssh: implement password and keyboard-interactive authentication methods 2017-04-20 22:28:21 +02:00
cinap_lenrek d566a5ca6b ssh: fix locking, and key reexchange handling
when we initiate re-key exchange we data packets can still
come in. so instead we have everything that can come in all
the time in dispatch() function (including KEXINIT) and have
the receiver process just call that in a loop. exclude dispatch
and the sender proc from corrupting each others sendpkt() calls
with the QLock sl.
2017-04-19 21:03:26 +02:00
cinap_lenrek d4cc35f387 ssh: close the channel when vt hangs up 2017-04-18 03:06:39 +02:00
cinap_lenrek 33991ab9cc ssh: weekend project
manpage should follow...
2017-04-17 05:22:16 +02:00