comparison common-kex.c @ 116:2010f4119c1a

Check for non-matching algos properly
author Matt Johnston <matt@ucc.asn.au>
date Thu, 02 Sep 2004 15:24:17 +0000
parents 29a5c7c62350
children 0cfba3034be5
comparison
equal deleted inserted replaced
115:9ffe5a6dbf3f 116:2010f4119c1a
632 TRACE(("hostkey algo %s", algo->name)); 632 TRACE(("hostkey algo %s", algo->name));
633 ses.newkeys->algo_hostkey = algo->val; 633 ses.newkeys->algo_hostkey = algo->val;
634 634
635 /* encryption_algorithms_client_to_server */ 635 /* encryption_algorithms_client_to_server */
636 c2s_cipher_algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess); 636 c2s_cipher_algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess);
637 if (algo == NULL) { 637 if (c2s_cipher_algo == NULL) {
638 erralgo = "enc c->s"; 638 erralgo = "enc c->s";
639 goto error; 639 goto error;
640 } 640 }
641 TRACE(("c2s is %s", c2s_cipher_algo->name));
641 642
642 /* encryption_algorithms_server_to_client */ 643 /* encryption_algorithms_server_to_client */
643 s2c_cipher_algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess); 644 s2c_cipher_algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess);
644 if (algo == NULL) { 645 if (s2c_cipher_algo == NULL) {
645 erralgo = "enc s->c"; 646 erralgo = "enc s->c";
646 goto error; 647 goto error;
647 } 648 }
649 TRACE(("s2c is %s", s2c_cipher_algo->name));
648 650
649 /* mac_algorithms_client_to_server */ 651 /* mac_algorithms_client_to_server */
650 c2s_hash_algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess); 652 c2s_hash_algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess);
651 if (algo == NULL) { 653 if (c2s_hash_algo == NULL) {
652 erralgo = "mac c->s"; 654 erralgo = "mac c->s";
653 goto error; 655 goto error;
654 } 656 }
655 657
656 /* mac_algorithms_server_to_client */ 658 /* mac_algorithms_server_to_client */
657 s2c_hash_algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess); 659 s2c_hash_algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess);
658 if (algo == NULL) { 660 if (s2c_hash_algo == NULL) {
659 erralgo = "mac s->c"; 661 erralgo = "mac s->c";
660 goto error; 662 goto error;
661 } 663 }
662 664
663 /* compression_algorithms_client_to_server */ 665 /* compression_algorithms_client_to_server */
664 c2s_comp_algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess); 666 c2s_comp_algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess);
665 if (algo == NULL) { 667 if (c2s_comp_algo == NULL) {
666 erralgo = "comp c->s"; 668 erralgo = "comp c->s";
667 goto error; 669 goto error;
668 } 670 }
669 671
670 /* compression_algorithms_server_to_client */ 672 /* compression_algorithms_server_to_client */
671 s2c_comp_algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess); 673 s2c_comp_algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess);
672 if (algo == NULL) { 674 if (s2c_comp_algo == NULL) {
673 erralgo = "comp s->c"; 675 erralgo = "comp s->c";
674 goto error; 676 goto error;
675 } 677 }
676 678
677 /* languages_client_to_server */ 679 /* languages_client_to_server */