beb2a9779c
This fixes the following vulnerability scenario: * Victim logs into SAFE-HOST on SAFE-IP-ADDRESS regularly. * Victim is cajoled into connecting to attacker controlled ATTACK-HOST, on ATTACK-IP-ADDRESS. ATTACK-HOST uses a different host key type (e.g. Ed25519 vs RSA). The new key is added at the end of known_hosts. * Attacker makes DNS system return ATTACK-IP-ADDRESS for SAFE-HOST. * Victim logs into SAFE-HOST, but is not warned because the host key matches ATTACK-IP-ADDRESS. For this attack to work, the key type has to be different, because knownhosts gives precedence to the first key found for each type. Add a test that asserts this behavior. The new semantics simplify the code, but callers that modify .ssh/known_host interactviely must now take an extra step to remain OpenSSH compatible: on successful login, the IP address must be checked without hostname, and if it is not known, added separately to the known_hosts file, so future logins that use an IP address only will be protected too. Thanks to Daniel Parks <security@demonhorse.net> for finding this vulnerability. Change-Id: I62b1b60ceb02e2f583a4657213feac1a8885dd42 Reviewed-on: https://go-review.googlesource.com/104939 Reviewed-by: Adam Langley <agl@golang.org> Run-TryBot: Han-Wen Nienhuys <hanwen@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> |
||
---|---|---|
acme | ||
argon2 | ||
bcrypt | ||
blake2b | ||
blake2s | ||
blowfish | ||
bn256 | ||
cast5 | ||
chacha20poly1305 | ||
cryptobyte | ||
curve25519 | ||
ed25519 | ||
hkdf | ||
internal/chacha20 | ||
md4 | ||
nacl | ||
ocsp | ||
openpgp | ||
otr | ||
pbkdf2 | ||
pkcs12 | ||
poly1305 | ||
ripemd160 | ||
salsa20 | ||
scrypt | ||
sha3 | ||
ssh | ||
tea | ||
twofish | ||
xtea | ||
xts | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
LICENSE | ||
PATENTS | ||
README.md | ||
codereview.cfg |
README.md
Go Cryptography
This repository holds supplementary Go cryptography libraries.
Download/Install
The easiest way to install is to run go get -u golang.org/x/crypto/...
. You
can also manually git clone the repository to $GOPATH/src/golang.org/x/crypto
.
Report Issues / Send Patches
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the crypto repository is located at https://github.com/golang/go/issues. Prefix your issue with "x/crypto:" in the subject line, so it is easy to find.
Note that contributions to the cryptography package receive additional scrutiny due to their sensitive nature. Patches may take longer than normal to receive feedback.