summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2017-12-18 02:25:15 +0000
committerDamien Miller <djm@mindrot.org>2017-12-19 15:21:37 +1100
commit04c7e28f83062dc42f2380d1bb3a6bf0190852c0 (patch)
treebc2c59d39a33aba84e0576039474668ada2546d2 /monitor_wrap.c
parent931c78dfd7fe30669681a59e536bbe66535f3ee9 (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 'monitor_wrap.c')
-rw-r--r--monitor_wrap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c
index a46628fb1..502d41687 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.c,v 1.95 2017/10/05 15:52:03 djm Exp $ */ 1/* $OpenBSD: monitor_wrap.c,v 1.96 2017/12/18 02:25:15 djm Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org> 4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -441,7 +441,7 @@ mm_key_allowed(enum mm_keytype type, const char *user, const char *host,
441 441
442int 442int
443mm_sshkey_verify(const struct sshkey *key, const u_char *sig, size_t siglen, 443mm_sshkey_verify(const struct sshkey *key, const u_char *sig, size_t siglen,
444 const u_char *data, size_t datalen, u_int compat) 444 const u_char *data, size_t datalen, const char *sigalg, u_int compat)
445{ 445{
446 Buffer m; 446 Buffer m;
447 u_char *blob; 447 u_char *blob;
@@ -458,6 +458,7 @@ mm_sshkey_verify(const struct sshkey *key, const u_char *sig, size_t siglen,
458 buffer_put_string(&m, blob, len); 458 buffer_put_string(&m, blob, len);
459 buffer_put_string(&m, sig, siglen); 459 buffer_put_string(&m, sig, siglen);
460 buffer_put_string(&m, data, datalen); 460 buffer_put_string(&m, data, datalen);
461 buffer_put_cstring(&m, sigalg);
461 free(blob); 462 free(blob);
462 463
463 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYVERIFY, &m); 464 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYVERIFY, &m);