Mercurial > dropbear
diff signkey.c @ 244:eb7b9f2bb8e8
- add explicit check that correct keytype exists for pubkey verification
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 06 Sep 2005 03:57:21 +0000 |
parents | 5a75f8a21503 |
children | dc6173e09ff7 7282370416a0 |
line wrap: on
line diff
--- a/signkey.c Mon Sep 05 17:10:32 2005 +0000 +++ b/signkey.c Tue Sep 06 03:57:21 2005 +0000 @@ -404,6 +404,9 @@ if (bloblen == DSS_SIGNATURE_SIZE && memcmp(ident, SSH_SIGNKEY_DSS, identlen) == 0) { m_free(ident); + if (key->dsskey == NULL) { + dropbear_exit("no dss key to verify signature"); + } return buf_dss_verify(buf, key->dsskey, data, len); } #endif @@ -411,6 +414,9 @@ #ifdef DROPBEAR_RSA if (memcmp(ident, SSH_SIGNKEY_RSA, identlen) == 0) { m_free(ident); + if (key->rsakey == NULL) { + dropbear_exit("no rsa key to verify signature"); + } return buf_rsa_verify(buf, key->rsakey, data, len); } #endif