Mercurial > dropbear
comparison common-kex.c @ 34:e2a1eaa19f22
Client mostly works up to password auth
Need to rework algo-choosing etc, since server is now broken.
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 28 Jul 2004 16:44:16 +0000 |
parents | f789045062e6 |
children | 0ad5fb979f42 |
comparison
equal
deleted
inserted
replaced
33:f789045062e6 | 34:e2a1eaa19f22 |
---|---|
611 allgood &= goodguess; | 611 allgood &= goodguess; |
612 if (algo == NULL) { | 612 if (algo == NULL) { |
613 erralgo = "kex"; | 613 erralgo = "kex"; |
614 goto error; | 614 goto error; |
615 } | 615 } |
616 TRACE(("kex algo %s", algo->name)); | |
616 ses.newkeys->algo_kex = algo->val; | 617 ses.newkeys->algo_kex = algo->val; |
617 | 618 |
618 /* server_host_key_algorithms */ | 619 /* server_host_key_algorithms */ |
619 algo = ses.buf_match_algo(ses.payload, sshhostkey, &goodguess); | 620 algo = ses.buf_match_algo(ses.payload, sshhostkey, &goodguess); |
620 allgood &= goodguess; | 621 allgood &= goodguess; |
621 if (algo == NULL) { | 622 if (algo == NULL) { |
622 erralgo = "hostkey"; | 623 erralgo = "hostkey"; |
623 goto error; | 624 goto error; |
624 } | 625 } |
626 TRACE(("hostkey algo %s", algo->name)); | |
625 ses.newkeys->algo_hostkey = algo->val; | 627 ses.newkeys->algo_hostkey = algo->val; |
626 | 628 |
627 /* encryption_algorithms_client_to_server */ | 629 /* encryption_algorithms_client_to_server */ |
628 algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess); | 630 algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess); |
629 if (algo == NULL) { | 631 if (algo == NULL) { |
630 erralgo = "enc c->s"; | 632 erralgo = "enc c->s"; |
631 goto error; | 633 goto error; |
632 } | 634 } |
633 ses.newkeys->recv_algo_crypt = (struct dropbear_cipher*)algo->data; | 635 ses.newkeys->recv_algo_crypt = (struct dropbear_cipher*)algo->data; |
636 TRACE(("enc algo recv %s", algo->name)); | |
634 | 637 |
635 /* encryption_algorithms_server_to_client */ | 638 /* encryption_algorithms_server_to_client */ |
636 algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess); | 639 algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess); |
637 if (algo == NULL) { | 640 if (algo == NULL) { |
638 erralgo = "enc s->c"; | 641 erralgo = "enc s->c"; |
639 goto error; | 642 goto error; |
640 } | 643 } |
641 ses.newkeys->trans_algo_crypt = (struct dropbear_cipher*)algo->data; | 644 ses.newkeys->trans_algo_crypt = (struct dropbear_cipher*)algo->data; |
645 TRACE(("enc algo trans %s", algo->name)); | |
642 | 646 |
643 /* mac_algorithms_client_to_server */ | 647 /* mac_algorithms_client_to_server */ |
644 algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess); | 648 algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess); |
645 if (algo == NULL) { | 649 if (algo == NULL) { |
646 erralgo = "mac c->s"; | 650 erralgo = "mac c->s"; |
647 goto error; | 651 goto error; |
648 } | 652 } |
649 ses.newkeys->recv_algo_mac = (struct dropbear_hash*)algo->data; | 653 ses.newkeys->recv_algo_mac = (struct dropbear_hash*)algo->data; |
654 TRACE(("mac algo recv %s", algo->name)); | |
650 | 655 |
651 /* mac_algorithms_server_to_client */ | 656 /* mac_algorithms_server_to_client */ |
652 algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess); | 657 algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess); |
653 if (algo == NULL) { | 658 if (algo == NULL) { |
654 erralgo = "mac s->c"; | 659 erralgo = "mac s->c"; |
655 goto error; | 660 goto error; |
656 } | 661 } |
657 ses.newkeys->trans_algo_mac = (struct dropbear_hash*)algo->data; | 662 ses.newkeys->trans_algo_mac = (struct dropbear_hash*)algo->data; |
663 TRACE(("mac algo trans %s", algo->name)); | |
658 | 664 |
659 /* compression_algorithms_client_to_server */ | 665 /* compression_algorithms_client_to_server */ |
660 algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess); | 666 algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess); |
661 if (algo == NULL) { | 667 if (algo == NULL) { |
662 erralgo = "comp c->s"; | 668 erralgo = "comp c->s"; |
663 goto error; | 669 goto error; |
664 } | 670 } |
665 ses.newkeys->recv_algo_comp = algo->val; | 671 ses.newkeys->recv_algo_comp = algo->val; |
672 TRACE(("comp algo recv %s", algo->name)); | |
666 | 673 |
667 /* compression_algorithms_server_to_client */ | 674 /* compression_algorithms_server_to_client */ |
668 algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess); | 675 algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess); |
669 if (algo == NULL) { | 676 if (algo == NULL) { |
670 erralgo = "comp s->c"; | 677 erralgo = "comp s->c"; |
671 goto error; | 678 goto error; |
672 } | 679 } |
673 ses.newkeys->trans_algo_comp = algo->val; | 680 ses.newkeys->trans_algo_comp = algo->val; |
681 TRACE(("comp algo trans %s", algo->name)); | |
674 | 682 |
675 /* languages_client_to_server */ | 683 /* languages_client_to_server */ |
676 buf_eatstring(ses.payload); | 684 buf_eatstring(ses.payload); |
677 | 685 |
678 /* languages_server_to_client */ | 686 /* languages_server_to_client */ |