Commit Graph

82 Commits

Author SHA1 Message Date
Damien Miller 26841ac265 some more duplicated key algorithm lines
From Adam Eijdenberg
2018-10-11 13:02:11 +11:00
Damien Miller 5d9d17603b fix duplicated algorithm specification lines
Spotted by Adam Eijdenberg
2018-10-11 11:56:36 +11:00
djm@openbsd.org ebfafd9c7a upstream: typo in plain RSA algorithm counterpart names for
certificates; spotted by Adam Eijdenberg; ok dtucker@

OpenBSD-Commit-ID: bfcdeb6f4fc9e7607f5096574c8f118f2e709e00
2018-10-11 11:55:57 +11:00
Damien Miller 12731158c7 supply callback to PEM_read_bio_PrivateKey
OpenSSL 1.1.0i has changed the behaviour of their PEM APIs,
so that empty passphrases are interpreted differently. This
probabalistically breaks loading some keys, because the PEM format
is terrible and doesn't include a proper MAC.

Avoid this by providing a basic callback to avoid passing empty
passphrases to OpenSSL in cases where one is required.

Based on patch from Jakub Jelen in bz#2913; ok dtucker@
2018-10-11 10:29:29 +11:00
djm@openbsd.org edbb6febcc upstream: Treat all PEM_read_bio_PrivateKey() errors when a passphrase
is specified as "incorrect passphrase" instead of trying to choose between
that and "invalid format".

libcrypto can return ASN1 parsing errors rather than the expected
decrypt error in certain infrequent cases when trying to decrypt/parse
PEM private keys when supplied with an invalid passphrase.

Report and repro recipe from Thomas Deutschmann in bz#2901

ok markus@

OpenBSD-Commit-ID: b1d4cd92395f9743f81c0d23aab2524109580870
2018-10-09 16:45:45 +11:00
Darren Tucker cce8cbe0ed Fix openssl-1.1 fallout for --without-openssl.
ok djm@
2018-09-15 19:44:06 +10:00
djm@openbsd.org 6da046f9c3 upstream: garbage-collect moribund ssh_new_private() API.
OpenBSD-Commit-ID: 7c05bf13b094093dfa01848a9306c82eb6e95f6c
2018-09-14 14:19:06 +10:00
Damien Miller 48f54b9d12 adapt -portable to OpenSSL 1.1x API
Polyfill missing API with replacement functions extracted from LibreSSL
2018-09-13 12:13:50 +10:00
djm@openbsd.org 482d23bcac upstream: hold our collective noses and use the openssl-1.1.x API in
OpenSSH; feedback and ok tb@ jsing@ markus@

OpenBSD-Commit-ID: cacbcac87ce5da0d3ca7ef1b38a6f7fb349e4417
2018-09-13 12:12:33 +10:00
djm@openbsd.org ba9e788315 upstream: add sshkey_check_cert_sigtype() that checks a
cert->signature_type against a supplied whitelist; ok markus

OpenBSD-Commit-ID: caadb8073292ed7a9535e5adc067d11d356d9302
2018-09-12 16:49:21 +10:00
djm@openbsd.org a70fd4ad7b upstream: add cert->signature_type field and keep it in sync with
certificate signature wrt loading and certification operations; ok markus@

OpenBSD-Commit-ID: e8b8b9f76b66707a0cd926109c4383db8f664df3
2018-09-12 16:49:21 +10:00
djm@openbsd.org b4d4eda633 upstream: some finesse to fix RSA-SHA2 certificate authentication
for certs hosted in ssh-agent

OpenBSD-Commit-ID: e5fd5edd726137dda2d020e1cdebc464110a010f
2018-07-03 23:26:47 +10:00
djm@openbsd.org 4ba0d54794 upstream: Improve strictness and control over RSA-SHA2 signature
In ssh, when an agent fails to return a RSA-SHA2 signature when
requested and falls back to RSA-SHA1 instead, retry the signature to
ensure that the public key algorithm sent in the SSH_MSG_USERAUTH
matches the one in the signature itself.

In sshd, strictly enforce that the public key algorithm sent in the
SSH_MSG_USERAUTH message matches what appears in the signature.

Make the sshd_config PubkeyAcceptedKeyTypes and
HostbasedAcceptedKeyTypes options control accepted signature algorithms
(previously they selected supported key types). This allows these
options to ban RSA-SHA1 in favour of RSA-SHA2.

Add new signature algorithms "rsa-sha2-256-cert-v01@openssh.com" and
"rsa-sha2-512-cert-v01@openssh.com" to force use of RSA-SHA2 signatures
with certificate keys.

feedback and ok markus@

OpenBSD-Commit-ID: c6e9f6d45eed8962ad502d315d7eaef32c419dde
2018-07-03 23:26:36 +10:00
markus@openbsd.org 27979da9e4 upstream: ssh/xmss: fix deserialize for certs; ok djm@
OpenBSD-Commit-ID: f44c41636c16ec83502039828beaf521c057dddc
2018-03-23 11:05:39 +11:00
djm@openbsd.org 94b4e2d29a upstream: refactor sshkey_read() to make it a little more, err,
readable. ok markus

OpenBSD-Commit-ID: 2e9247b5762fdac3b6335dc606d3822121714c28
2018-03-02 14:39:16 +11:00
markus@openbsd.org 1b11ea7c58 upstream: Add experimental support for PQC XMSS keys (Extended
Hash-Based Signatures) The code is not compiled in by default (see WITH_XMSS
in Makefile.inc) Joint work with stefan-lukas_gazdag at genua.eu See
https://tools.ietf.org/html/draft-irtf-cfrg-xmss-hash-based-signatures-12 ok
djm@

OpenBSD-Commit-ID: ef3eccb96762a5d6f135d7daeef608df7776a7ac
2018-02-26 11:40:41 +11:00
jsing@openbsd.org 4270efad70 upstream: Some obvious freezero() conversions.
This also zeros an ed25519_pk when it was not being zeroed previously.

ok djm@ dtucker@

OpenBSD-Commit-ID: 5c196a3c85c23ac0bd9b11bcadaedd90b7a2ce82
2018-02-16 13:35:28 +11:00
jsing@openbsd.org 7cd31632e3 upstream commit
Remove all guards for calls to OpenSSL free functions -
all of these functions handle NULL, from at least OpenSSL 1.0.1g onwards.

Prompted by dtucker@ asking about guards for RSA_free(), when looking at
openssh-portable pr#84 on github.

ok deraadt@ dtucker@

OpenBSD-Commit-ID: 954f1c51b94297d0ae1f749271e184141e0cadae
2018-02-08 09:26:27 +11:00
djm@openbsd.org 04c7e28f83 upstream commit
pass negotiated signing algorithm though to
sshkey_verify() and check that the negotiated algorithm matches the type in
the signature (only matters for RSA SHA1/SHA2 sigs). ok markus@

OpenBSD-Commit-ID: 735fb15bf4adc060d3bee9d047a4bcaaa81b1af9
2017-12-19 15:21:37 +11:00
djm@openbsd.org 931c78dfd7 upstream commit
sshkey_sigtype() function to return the type of a
signature; ok markus@

OpenBSD-Commit-ID: d3772b065ad6eed97285589bfb544befed9032e8
2017-12-19 15:20:44 +11:00
djm@openbsd.org 224f193d6a upstream commit
BIO_get_mem_data() is supposed to take a char* as pointer
argument, so don't pass it a const char*

Upstream-ID: 1ccd91eb7f4dd4f0fa812d4f956987cd00b5f6ec
2017-10-20 12:01:03 +11:00
djm@openbsd.org 0f3455356b upstream commit
Switch from aes256-cbc to aes256-ctr for encrypting
new-style private keys. The latter having the advantage of being supported
for no-OpenSSL builds; bz#2754 ok markus@

Upstream-ID: 54179a2afd28f93470471030567ac40431e56909
2017-08-12 16:47:10 +10:00
markus@openbsd.org dc2bd30876 upstream commit
fix support for unknown key types; ok djm@

Upstream-ID: 53fb29394ed04d616d65b3748dee5aa06b07ab48
2017-07-21 14:17:33 +10:00
djm@openbsd.org 83fa3a0448 upstream commit
remove post-SSHv1 removal dead code from rsa.c and merge
the remaining bit that it still used into ssh-rsa.c; ok markus

Upstream-ID: ac8a048d24dcd89594b0052ea5e3404b473bfa2f
2017-07-21 14:17:32 +10:00
djm@openbsd.org a98339edbc upstream commit
Allow ssh-keygen to use a key held in ssh-agent as a CA when
signing certificates. bz#2377 ok markus

Upstream-ID: fb42e920b592edcbb5b50465739a867c09329c8f
2017-06-28 11:13:19 +10:00
djm@openbsd.org 2076e4adb9 upstream commit
better translate libcrypto errors by looking deeper in
the accursed error stack for codes that indicate the wrong passphrase was
supplied for a PEM key. bz#2699 ok dtucker@

Upstream-ID: 4da4286326d570f4f0489459bb71f6297e54b681
2017-06-10 16:40:10 +10:00
deraadt@openbsd.org 9e509d4ec9 upstream commit
Switch to recallocarray() for a few operations.  Both
growth and shrinkage are handled safely, and there also is no need for
preallocation dances. Future changes in this area will be less error prone.
Review and one bug found by markus

Upstream-ID: 822d664d6a5a1d10eccb23acdd53578a679d5065
2017-06-01 14:55:22 +10:00
djm@openbsd.org 5f02bb1f99 upstream commit
make requesting bad ECDSA bits yield the same error
(SSH_ERR_KEY_LENGTH) as the same mistake for RSA/DSA

Upstream-ID: bf40d3fee567c271e33f05ef8e4e0fa0b6f0ece6
2017-05-10 11:40:18 +10:00
djm@openbsd.org bd636f4091 upstream commit
Refuse RSA keys <1024 bits in length. Improve reporting
for keys that do not meet this requirement. ok markus@

Upstream-ID: b385e2a7b13b1484792ee681daaf79e1e203df6c
2017-05-08 09:21:22 +10:00
djm@openbsd.org 873d3e7d9a upstream commit
remove KEY_RSA1

ok markus@

Upstream-ID: 7408517b077c892a86b581e19f82a163069bf133
2017-05-01 10:05:01 +10:00
djm@openbsd.org cdccebdf85 upstream commit
remove SSHv1 ciphers; ok markus@

Upstream-ID: e5ebc5e540d7f23a8c1266db1839794d4d177890
2017-05-01 10:04:58 +10:00
djm@openbsd.org 56912dea6e upstream commit
unifdef WITH_SSH1 ok markus@

Upstream-ID: 9716e62a883ef8826c57f4d33b4a81a9cc7755c7
2017-05-01 09:37:40 +10:00
Darren Tucker 8fed0a5fe7 Remove compat code for OpenSSL < 0.9.7.
Resyncs that code with OpenBSD upstream.
2017-03-29 10:16:15 +11:00
djm@openbsd.org 183ba55aaa upstream commit
fix regression in 7.4 server-sig-algs, where we were
accidentally excluding SHA2 RSA signature methods. bz#2680, patch from Nuno
Goncalves; ok dtucker@

Upstream-ID: 81ac8bfb30960447740b9b8f6a214dcf322f12e8
2017-03-10 15:35:39 +11:00
dtucker@openbsd.org 7fadbb6da3 upstream commit
Check for NULL argument to sshkey_read.  Patch from
jjelen at redhat.com via bz#2687, ok djm@

Upstream-ID: c2d00c2ea50c4861d271d0a586f925cc64a87e0e
2017-03-10 15:35:38 +11:00
dtucker@openbsd.org ecc3589371 upstream commit
ifdef out "rsa1" from the list of supported keytypes when
compiled without SSH1 support.  Found by kdunlop at guralp.com, ok djm@

Upstream-ID: cea93a26433d235bb1d64b1d990f19a9c160a70f
2017-02-17 14:52:24 +11:00
Darren Tucker bd5d7d2395 ifdef out EVP_R_PRIVATE_KEY_DECODE_ERROR
EVP_R_PRIVATE_KEY_DECODE_ERROR was added in OpenSSL 1.0.0 so ifdef out
for the benefit of OpenSSL versions prior to that.
2017-02-12 15:45:15 +11:00
djm@openbsd.org 155d540d00 upstream commit
bring back r1.34 that was backed out for problems loading
public keys:

translate OpenSSL error codes to something more
meaninful; bz#2522 reported by Jakub Jelen, ok dtucker@

with additional fix from Jakub Jelen to solve the backout.
bz#2525 bz#2523 re-ok dtucker@

Upstream-ID: a9d5bc0306f4473d9b4f4484f880e95f3c1cc031
2017-02-10 15:35:28 +11:00
dtucker@openbsd.org a903e315de upstream commit
Remove dead breaks, found via opencoverage.net.  ok
deraadt@

Upstream-ID: ad9cc655829d67fad219762810770787ba913069
2016-10-26 08:52:46 +11:00
djm@openbsd.org a571dbcc7b upstream commit
add a comment about implicitly-expected checks to
sshkey_ec_validate_public()

Upstream-ID: 74a7f71c28f7c13a50f89fc78e7863b9cd61713f
2016-10-06 06:00:43 +11:00
djm@openbsd.org 27c3a9c2ae upstream commit
Avoid a theoretical signed integer overflow should
BN_num_bytes() ever violate its manpage and return a negative value. Improve
order of tests to avoid confusing increasingly pedantic compilers.

Reported by Guido Vranken from stack (css.csail.mit.edu/stack)
unstable optimisation analyser output.  ok deraadt@

Upstream-ID: f8508c830c86d8f36c113985e52bf8eedae23505
2016-09-29 03:09:50 +10:00
djm@openbsd.org 130f5df4fa upstream commit
list all supported signature algorithms in the
server-sig-algs Reported by mb AT smartftp.com in bz#2547 and (independantly)
Ron Frederick; ok markus@

Upstream-ID: ddf702d721f54646b11ef2cee6d916666cb685cd
2016-09-13 09:33:24 +10:00
deraadt@openbsd.org 9136ec134c upstream commit
Add MAXIMUM(), MINIMUM(), and ROUNDUP() to misc.h, then
use those definitions rather than pulling <sys/param.h> and unknown namespace
pollution. ok djm markus dtucker

Upstream-ID: 712cafa816c9f012a61628b66b9fbd5687223fb8
2016-09-12 13:46:29 +10:00
djm@openbsd.org 4706c1d8c1 upstream commit
small refactor of cipher.c: make ciphercontext opaque to
callers feedback and ok markus@

Upstream-ID: 094849f8be68c3bdad2c0f3dee551ecf7be87f6f
2016-08-09 09:06:52 +10:00
djm@openbsd.org 3147e7595d upstream commit
revert 1.34; causes problems loading public keys

reported by semarie@

Upstream-ID: b393794f8935c8b15d98a407fe7721c62d2ed179
2016-06-24 13:35:28 +10:00
djm@openbsd.org 5e28b1a2a3 upstream commit
translate OpenSSL error codes to something more
meaninful; bz#2522 reported by Jakub Jelen, ok dtucker@

Upstream-ID: 4cb0795a366381724314e6515d57790c5930ffe5
2016-06-24 13:35:28 +10:00
djm@openbsd.org 57464e3934 upstream commit
support SHA256 and SHA512 RSA signatures in certificates;
 ok markus@

Upstream-ID: b45be2f2ce8cacd794dc5730edaabc90e5eb434a
2016-05-02 20:35:05 +10:00
djm@openbsd.org dce19bf6e4 upstream commit
make private key loading functions consistently handle NULL
 key pointer arguments; ok markus@

Upstream-ID: 92038726ef4a338169c35dacc9c5a07fcc7fa761
2016-04-13 10:44:06 +10:00
mmcc@openbsd.org 52d7078421 upstream commit
Remove NULL-checks before sshbuf_free().

ok djm@

Upstream-ID: 5ebed00ed5f9f03b119a345085e8774565466917
2015-12-18 14:50:48 +11:00
mmcc@openbsd.org 89540b6de0 upstream commit
Remove NULL-checks before sshkey_free().

ok djm@

Upstream-ID: 3e35afe8a25e021216696b5d6cde7f5d2e5e3f52
2015-12-18 14:49:32 +11:00