summaryrefslogtreecommitdiffhomepage
path: root/signkey.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2005-09-06 03:57:21 +0000
committerMatt Johnston <matt@ucc.asn.au>2005-09-06 03:57:21 +0000
commit744268f3887868fe5edee6912afd983208121715 (patch)
tree465658b3a95c4f68f3f628a3b0c76c639634816e /signkey.c
parent18b082955b77ecf775f36b8fc64e0a9262b583d9 (diff)
- add explicit check that correct keytype exists for pubkey verification
--HG-- extra : convert_revision : 8d86185c9b7efcedc1d640208c03bb1b377cc502
Diffstat (limited to 'signkey.c')
-rw-r--r--signkey.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/signkey.c b/signkey.c
index 8dee10b..b8afb58 100644
--- a/signkey.c
+++ b/signkey.c
@@ -404,6 +404,9 @@ int buf_verify(buffer * buf, sign_key *key, const unsigned char *data,
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 @@ int buf_verify(buffer * buf, sign_key *key, const unsigned char *data,
#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