Mercurial > dropbear
comparison svr-runopts.c @ 876:5bfce5dcd461
Fix disabling DSS key
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 03 Dec 2013 21:26:59 +0800 |
parents | 17b15683648d |
children | 17d874ae93a1 |
comparison
equal
deleted
inserted
replaced
875:6c7a15668d5a | 876:5bfce5dcd461 |
---|---|
473 #ifdef DROPBEAR_ECDSA | 473 #ifdef DROPBEAR_ECDSA |
474 loadhostkey(ECDSA_PRIV_FILENAME, 0); | 474 loadhostkey(ECDSA_PRIV_FILENAME, 0); |
475 #endif | 475 #endif |
476 | 476 |
477 #ifdef DROPBEAR_DELAY_HOSTKEY | 477 #ifdef DROPBEAR_DELAY_HOSTKEY |
478 if (svr_opts.delay_hostkey) | 478 if (svr_opts.delay_hostkey) { |
479 { | |
480 disable_unset_keys = 0; | 479 disable_unset_keys = 0; |
481 } | 480 } |
482 #endif | 481 #endif |
483 | 482 |
484 #ifdef DROPBEAR_RSA | 483 #ifdef DROPBEAR_RSA |
485 if (disable_unset_keys && !svr_opts.hostkey->rsakey) { | 484 if (disable_unset_keys && !svr_opts.hostkey->rsakey) { |
486 disablekey(DROPBEAR_SIGNKEY_RSA); | 485 disablekey(DROPBEAR_SIGNKEY_RSA); |
487 } | 486 } else { |
488 else | |
489 { | |
490 any_keys = 1; | 487 any_keys = 1; |
491 } | 488 } |
492 #endif | 489 #endif |
493 | 490 |
494 #ifdef DROPBEAR_DSS | 491 #ifdef DROPBEAR_DSS |
495 if (disable_unset_keys && !svr_opts.hostkey->dsskey) { | 492 if (disable_unset_keys && !svr_opts.hostkey->dsskey) { |
496 disablekey(DROPBEAR_SIGNKEY_RSA); | 493 disablekey(DROPBEAR_SIGNKEY_DSS); |
497 } | 494 } else { |
498 else | |
499 { | |
500 any_keys = 1; | 495 any_keys = 1; |
501 } | 496 } |
502 #endif | 497 #endif |
503 | 498 |
504 | 499 |
505 #ifdef DROPBEAR_ECDSA | 500 #ifdef DROPBEAR_ECDSA |
506 #ifdef DROPBEAR_ECC_256 | 501 #ifdef DROPBEAR_ECC_256 |
507 if ((disable_unset_keys || ECDSA_DEFAULT_SIZE != 256) | 502 if ((disable_unset_keys || ECDSA_DEFAULT_SIZE != 256) |
508 && !svr_opts.hostkey->ecckey256) { | 503 && !svr_opts.hostkey->ecckey256) { |
509 disablekey(DROPBEAR_SIGNKEY_ECDSA_NISTP256); | 504 disablekey(DROPBEAR_SIGNKEY_ECDSA_NISTP256); |
510 } | 505 } else { |
511 else | |
512 { | |
513 any_keys = 1; | 506 any_keys = 1; |
514 } | 507 } |
515 #endif | 508 #endif |
516 | 509 |
517 #ifdef DROPBEAR_ECC_384 | 510 #ifdef DROPBEAR_ECC_384 |
518 if ((disable_unset_keys || ECDSA_DEFAULT_SIZE != 384) | 511 if ((disable_unset_keys || ECDSA_DEFAULT_SIZE != 384) |
519 && !svr_opts.hostkey->ecckey384) { | 512 && !svr_opts.hostkey->ecckey384) { |
520 disablekey(DROPBEAR_SIGNKEY_ECDSA_NISTP384); | 513 disablekey(DROPBEAR_SIGNKEY_ECDSA_NISTP384); |
521 } | 514 } else { |
522 else | |
523 { | |
524 any_keys = 1; | 515 any_keys = 1; |
525 } | 516 } |
526 #endif | 517 #endif |
527 | 518 |
528 #ifdef DROPBEAR_ECC_521 | 519 #ifdef DROPBEAR_ECC_521 |
529 if ((disable_unset_keys || ECDSA_DEFAULT_SIZE != 521) | 520 if ((disable_unset_keys || ECDSA_DEFAULT_SIZE != 521) |
530 && !svr_opts.hostkey->ecckey521) { | 521 && !svr_opts.hostkey->ecckey521) { |
531 disablekey(DROPBEAR_SIGNKEY_ECDSA_NISTP521); | 522 disablekey(DROPBEAR_SIGNKEY_ECDSA_NISTP521); |
532 } | 523 } else { |
533 else | |
534 { | |
535 any_keys = 1; | 524 any_keys = 1; |
536 } | 525 } |
537 #endif | 526 #endif |
538 #endif /* DROPBEAR_ECDSA */ | 527 #endif /* DROPBEAR_ECDSA */ |
539 | 528 |
540 if (!any_keys) | 529 if (!any_keys) { |
541 { | |
542 dropbear_exit("No hostkeys available"); | 530 dropbear_exit("No hostkeys available"); |
543 } | 531 } |
544 | 532 } |
545 } |