Skip to content
Snippets Groups Projects
Commit 744268f3 authored by Matt Johnston's avatar Matt Johnston
Browse files

- add explicit check that correct keytype exists for pubkey verification

--HG--
extra : convert_revision : 8d86185c9b7efcedc1d640208c03bb1b377cc502
parent 18b08295
No related merge requests found
...@@ -404,6 +404,9 @@ int buf_verify(buffer * buf, sign_key *key, const unsigned char *data, ...@@ -404,6 +404,9 @@ int buf_verify(buffer * buf, sign_key *key, const unsigned char *data,
if (bloblen == DSS_SIGNATURE_SIZE && if (bloblen == DSS_SIGNATURE_SIZE &&
memcmp(ident, SSH_SIGNKEY_DSS, identlen) == 0) { memcmp(ident, SSH_SIGNKEY_DSS, identlen) == 0) {
m_free(ident); m_free(ident);
if (key->dsskey == NULL) {
dropbear_exit("no dss key to verify signature");
}
return buf_dss_verify(buf, key->dsskey, data, len); return buf_dss_verify(buf, key->dsskey, data, len);
} }
#endif #endif
...@@ -411,6 +414,9 @@ int buf_verify(buffer * buf, sign_key *key, const unsigned char *data, ...@@ -411,6 +414,9 @@ int buf_verify(buffer * buf, sign_key *key, const unsigned char *data,
#ifdef DROPBEAR_RSA #ifdef DROPBEAR_RSA
if (memcmp(ident, SSH_SIGNKEY_RSA, identlen) == 0) { if (memcmp(ident, SSH_SIGNKEY_RSA, identlen) == 0) {
m_free(ident); m_free(ident);
if (key->rsakey == NULL) {
dropbear_exit("no rsa key to verify signature");
}
return buf_rsa_verify(buf, key->rsakey, data, len); return buf_rsa_verify(buf, key->rsakey, data, len);
} }
#endif #endif
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment