diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-12-18 02:25:15 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-12-19 15:21:37 +1100 |
commit | 04c7e28f83062dc42f2380d1bb3a6bf0190852c0 (patch) | |
tree | bc2c59d39a33aba84e0576039474668ada2546d2 /clientloop.c | |
parent | 931c78dfd7fe30669681a59e536bbe66535f3ee9 (diff) |
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
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clientloop.c b/clientloop.c index e3824ccd9..3ce5d930e 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.307 2017/11/25 05:58:47 dtucker Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.308 2017/12/18 02:25:15 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1934,7 +1934,8 @@ client_global_hostkeys_private_confirm(struct ssh *ssh, int type, | |||
1934 | goto out; | 1934 | goto out; |
1935 | } | 1935 | } |
1936 | if ((r = sshkey_verify(ctx->keys[i], sig, siglen, | 1936 | if ((r = sshkey_verify(ctx->keys[i], sig, siglen, |
1937 | sshbuf_ptr(signdata), sshbuf_len(signdata), 0)) != 0) { | 1937 | sshbuf_ptr(signdata), sshbuf_len(signdata), |
1938 | ssh->kex->hostkey_alg, 0)) != 0) { | ||
1938 | error("%s: server gave bad signature for %s key %zu", | 1939 | error("%s: server gave bad signature for %s key %zu", |
1939 | __func__, sshkey_type(ctx->keys[i]), i); | 1940 | __func__, sshkey_type(ctx->keys[i]), i); |
1940 | goto out; | 1941 | goto out; |