Mercurial > dropbear
comparison 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 |
comparison
equal
deleted
inserted
replaced
243:0056419cf0f4 | 244:eb7b9f2bb8e8 |
---|---|
402 | 402 |
403 #ifdef DROPBEAR_DSS | 403 #ifdef DROPBEAR_DSS |
404 if (bloblen == DSS_SIGNATURE_SIZE && | 404 if (bloblen == DSS_SIGNATURE_SIZE && |
405 memcmp(ident, SSH_SIGNKEY_DSS, identlen) == 0) { | 405 memcmp(ident, SSH_SIGNKEY_DSS, identlen) == 0) { |
406 m_free(ident); | 406 m_free(ident); |
407 if (key->dsskey == NULL) { | |
408 dropbear_exit("no dss key to verify signature"); | |
409 } | |
407 return buf_dss_verify(buf, key->dsskey, data, len); | 410 return buf_dss_verify(buf, key->dsskey, data, len); |
408 } | 411 } |
409 #endif | 412 #endif |
410 | 413 |
411 #ifdef DROPBEAR_RSA | 414 #ifdef DROPBEAR_RSA |
412 if (memcmp(ident, SSH_SIGNKEY_RSA, identlen) == 0) { | 415 if (memcmp(ident, SSH_SIGNKEY_RSA, identlen) == 0) { |
413 m_free(ident); | 416 m_free(ident); |
417 if (key->rsakey == NULL) { | |
418 dropbear_exit("no rsa key to verify signature"); | |
419 } | |
414 return buf_rsa_verify(buf, key->rsakey, data, len); | 420 return buf_rsa_verify(buf, key->rsakey, data, len); |
415 } | 421 } |
416 #endif | 422 #endif |
417 | 423 |
418 m_free(ident); | 424 m_free(ident); |