comparison common-kex.c @ 1739:13d834efc376 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Thu, 15 Oct 2020 19:55:15 +0800
parents 8f93f37c01de
children 7d8462677355
comparison
equal deleted inserted replaced
1562:768ebf737aa0 1739:13d834efc376
34 #include "packet.h" 34 #include "packet.h"
35 #include "bignum.h" 35 #include "bignum.h"
36 #include "dbrandom.h" 36 #include "dbrandom.h"
37 #include "runopts.h" 37 #include "runopts.h"
38 #include "ecc.h" 38 #include "ecc.h"
39 #include "curve25519.h"
39 #include "crypto_desc.h" 40 #include "crypto_desc.h"
40 41
41 static void kexinitialise(void); 42 static void kexinitialise(void);
42 static void gen_new_keys(void); 43 static void gen_new_keys(void);
43 #ifndef DISABLE_ZLIB 44 #ifndef DISABLE_ZLIB
62 63
63 /* kex algos */ 64 /* kex algos */
64 buf_put_algolist(ses.writepayload, sshkex); 65 buf_put_algolist(ses.writepayload, sshkex);
65 66
66 /* server_host_key_algorithms */ 67 /* server_host_key_algorithms */
67 buf_put_algolist(ses.writepayload, sshhostkey); 68 buf_put_algolist(ses.writepayload, sigalgs);
68 69
69 /* encryption_algorithms_client_to_server */ 70 /* encryption_algorithms_client_to_server */
70 buf_put_algolist(ses.writepayload, sshciphers); 71 buf_put_algolist(ses.writepayload, sshciphers);
71 72
72 /* encryption_algorithms_server_to_client */ 73 /* encryption_algorithms_server_to_client */
107 ses.kexstate.sentkexinit = 1; 108 ses.kexstate.sentkexinit = 1;
108 109
109 ses.newkeys = (struct key_context*)m_malloc(sizeof(struct key_context)); 110 ses.newkeys = (struct key_context*)m_malloc(sizeof(struct key_context));
110 111
111 if (ses.send_kex_first_guess) { 112 if (ses.send_kex_first_guess) {
112 ses.newkeys->algo_kex = sshkex[0].data; 113 ses.newkeys->algo_kex = first_usable_algo(sshkex)->data;
113 ses.newkeys->algo_hostkey = sshhostkey[0].val; 114 ses.newkeys->algo_signature = first_usable_algo(sigalgs)->val;
115 ses.newkeys->algo_hostkey = signkey_type_from_signature(ses.newkeys->algo_signature);
114 ses.send_kex_first_guess(); 116 ses.send_kex_first_guess();
115 } 117 }
116 118
117 TRACE(("DATAALLOWED=0")) 119 TRACE(("DATAALLOWED=0"))
118 TRACE(("-> KEXINIT")) 120 TRACE(("-> KEXINIT"))
149 if (ses.kexstate.sentnewkeys && ses.kexstate.recvnewkeys) 151 if (ses.kexstate.sentnewkeys && ses.kexstate.recvnewkeys)
150 { 152 {
151 TRACE(("switch_keys done")) 153 TRACE(("switch_keys done"))
152 ses.keys->algo_kex = ses.newkeys->algo_kex; 154 ses.keys->algo_kex = ses.newkeys->algo_kex;
153 ses.keys->algo_hostkey = ses.newkeys->algo_hostkey; 155 ses.keys->algo_hostkey = ses.newkeys->algo_hostkey;
156 ses.keys->algo_signature = ses.newkeys->algo_signature;
154 ses.keys->allow_compress = 0; 157 ses.keys->allow_compress = 0;
155 m_free(ses.newkeys); 158 m_free(ses.newkeys);
156 ses.newkeys = NULL; 159 ses.newkeys = NULL;
157 kexinitialise(); 160 kexinitialise();
158 } 161 }
170 encrypt_packet(); 173 encrypt_packet();
171 174
172 175
173 /* set up our state */ 176 /* set up our state */
174 ses.kexstate.sentnewkeys = 1; 177 ses.kexstate.sentnewkeys = 1;
178 if (ses.kexstate.donefirstkex) {
179 ses.kexstate.donesecondkex = 1;
180 }
175 ses.kexstate.donefirstkex = 1; 181 ses.kexstate.donefirstkex = 1;
176 ses.dataallowed = 1; /* we can send other packets again now */ 182 ses.dataallowed = 1; /* we can send other packets again now */
177 gen_new_keys(); 183 gen_new_keys();
178 switch_keys(); 184 switch_keys();
179 185
192 } 198 }
193 199
194 200
195 /* Set up the kex for the first time */ 201 /* Set up the kex for the first time */
196 void kexfirstinitialise() { 202 void kexfirstinitialise() {
197 ses.kexstate.donefirstkex = 0;
198
199 #ifdef DISABLE_ZLIB 203 #ifdef DISABLE_ZLIB
200 ses.compress_algos = ssh_nocompress; 204 ses.compress_algos = ssh_nocompress;
201 #else 205 #else
202 switch (opts.compress_mode) 206 switch (opts.compress_mode)
203 { 207 {
326 hashkeys(S2C_IV, sizeof(S2C_IV), &hs, 'B'); 330 hashkeys(S2C_IV, sizeof(S2C_IV), &hs, 'B');
327 hashkeys(C2S_key, sizeof(C2S_key), &hs, 'C'); 331 hashkeys(C2S_key, sizeof(C2S_key), &hs, 'C');
328 hashkeys(S2C_key, sizeof(S2C_key), &hs, 'D'); 332 hashkeys(S2C_key, sizeof(S2C_key), &hs, 'D');
329 333
330 if (ses.newkeys->recv.algo_crypt->cipherdesc != NULL) { 334 if (ses.newkeys->recv.algo_crypt->cipherdesc != NULL) {
331 int recv_cipher = find_cipher(ses.newkeys->recv.algo_crypt->cipherdesc->name); 335 int recv_cipher = -1;
332 if (recv_cipher < 0) 336 if (ses.newkeys->recv.algo_crypt->cipherdesc->name != NULL) {
333 dropbear_exit("Crypto error"); 337 recv_cipher = find_cipher(ses.newkeys->recv.algo_crypt->cipherdesc->name);
338 if (recv_cipher < 0) {
339 dropbear_exit("Crypto error");
340 }
341 }
334 if (ses.newkeys->recv.crypt_mode->start(recv_cipher, 342 if (ses.newkeys->recv.crypt_mode->start(recv_cipher,
335 recv_IV, recv_key, 343 recv_IV, recv_key,
336 ses.newkeys->recv.algo_crypt->keysize, 0, 344 ses.newkeys->recv.algo_crypt->keysize, 0,
337 &ses.newkeys->recv.cipher_state) != CRYPT_OK) { 345 &ses.newkeys->recv.cipher_state) != CRYPT_OK) {
338 dropbear_exit("Crypto error"); 346 dropbear_exit("Crypto error");
339 } 347 }
340 } 348 }
341 349
342 if (ses.newkeys->trans.algo_crypt->cipherdesc != NULL) { 350 if (ses.newkeys->trans.algo_crypt->cipherdesc != NULL) {
343 int trans_cipher = find_cipher(ses.newkeys->trans.algo_crypt->cipherdesc->name); 351 int trans_cipher = -1;
344 if (trans_cipher < 0) 352 if (ses.newkeys->trans.algo_crypt->cipherdesc->name != NULL) {
345 dropbear_exit("Crypto error"); 353 trans_cipher = find_cipher(ses.newkeys->trans.algo_crypt->cipherdesc->name);
354 if (trans_cipher < 0) {
355 dropbear_exit("Crypto error");
356 }
357 }
346 if (ses.newkeys->trans.crypt_mode->start(trans_cipher, 358 if (ses.newkeys->trans.crypt_mode->start(trans_cipher,
347 trans_IV, trans_key, 359 trans_IV, trans_key,
348 ses.newkeys->trans.algo_crypt->keysize, 0, 360 ses.newkeys->trans.algo_crypt->keysize, 0,
349 &ses.newkeys->trans.cipher_state) != CRYPT_OK) { 361 &ses.newkeys->trans.cipher_state) != CRYPT_OK) {
350 dropbear_exit("Crypto error"); 362 dropbear_exit("Crypto error");
534 ses.kexstate.recvkexinit = 1; 546 ses.kexstate.recvkexinit = 1;
535 547
536 TRACE(("leave recv_msg_kexinit")) 548 TRACE(("leave recv_msg_kexinit"))
537 } 549 }
538 550
551 #if DROPBEAR_NORMAL_DH
539 static void load_dh_p(mp_int * dh_p) 552 static void load_dh_p(mp_int * dh_p)
540 { 553 {
541 bytes_to_mp(dh_p, ses.newkeys->algo_kex->dh_p_bytes, 554 bytes_to_mp(dh_p, ses.newkeys->algo_kex->dh_p_bytes,
542 ses.newkeys->algo_kex->dh_p_len); 555 ses.newkeys->algo_kex->dh_p_len);
543 } 556 }
558 m_mp_init_multi(&param->pub, &param->priv, &dh_g, &dh_p, &dh_q, NULL); 571 m_mp_init_multi(&param->pub, &param->priv, &dh_g, &dh_p, &dh_q, NULL);
559 572
560 /* read the prime and generator*/ 573 /* read the prime and generator*/
561 load_dh_p(&dh_p); 574 load_dh_p(&dh_p);
562 575
563 if (mp_set_int(&dh_g, DH_G_VAL) != MP_OKAY) { 576 mp_set_ul(&dh_g, DH_G_VAL);
564 dropbear_exit("Diffie-Hellman error");
565 }
566 577
567 /* calculate q = (p-1)/2 */ 578 /* calculate q = (p-1)/2 */
568 /* dh_priv is just a temp var here */ 579 /* dh_priv is just a temp var here */
569 if (mp_sub_d(&dh_p, 1, &param->priv) != MP_OKAY) { 580 if (mp_sub_d(&dh_p, 1, &param->priv) != MP_OKAY) {
570 dropbear_exit("Diffie-Hellman error"); 581 dropbear_exit("Diffie-Hellman error");
644 buf_putmpint(ses.kexhashbuf, ses.dh_K); 655 buf_putmpint(ses.kexhashbuf, ses.dh_K);
645 656
646 /* calculate the hash H to sign */ 657 /* calculate the hash H to sign */
647 finish_kexhashbuf(); 658 finish_kexhashbuf();
648 } 659 }
660 #endif
649 661
650 #if DROPBEAR_ECDH 662 #if DROPBEAR_ECDH
651 struct kex_ecdh_param *gen_kexecdh_param() { 663 struct kex_ecdh_param *gen_kexecdh_param() {
652 struct kex_ecdh_param *param = m_malloc(sizeof(*param)); 664 struct kex_ecdh_param *param = m_malloc(sizeof(*param));
653 if (ecc_make_key_ex(NULL, dropbear_ltc_prng, 665 if (ecc_make_key_ex(NULL, dropbear_ltc_prng,
692 /* Q_S, server's ephemeral public key octet string */ 704 /* Q_S, server's ephemeral public key octet string */
693 buf_put_ecc_raw_pubkey_string(ses.kexhashbuf, Q_S); 705 buf_put_ecc_raw_pubkey_string(ses.kexhashbuf, Q_S);
694 /* K, the shared secret */ 706 /* K, the shared secret */
695 buf_putmpint(ses.kexhashbuf, ses.dh_K); 707 buf_putmpint(ses.kexhashbuf, ses.dh_K);
696 708
709 ecc_free(Q_them);
710 m_free(Q_them);
711
697 /* calculate the hash H to sign */ 712 /* calculate the hash H to sign */
698 finish_kexhashbuf(); 713 finish_kexhashbuf();
699 } 714 }
700 #endif /* DROPBEAR_ECDH */ 715 #endif /* DROPBEAR_ECDH */
701 716
702 #if DROPBEAR_CURVE25519 717 #if DROPBEAR_CURVE25519
703 struct kex_curve25519_param *gen_kexcurve25519_param () { 718 struct kex_curve25519_param *gen_kexcurve25519_param() {
704 /* Per http://cr.yp.to/ecdh.html */ 719 /* Per http://cr.yp.to/ecdh.html */
705 struct kex_curve25519_param *param = m_malloc(sizeof(*param)); 720 struct kex_curve25519_param *param = m_malloc(sizeof(*param));
706 const unsigned char basepoint[32] = {9}; 721 const unsigned char basepoint[32] = {9};
707 722
708 genrandom(param->priv, CURVE25519_LEN); 723 genrandom(param->priv, CURVE25519_LEN);
709 param->priv[0] &= 248; 724 dropbear_curve25519_scalarmult(param->pub, param->priv, basepoint);
710 param->priv[31] &= 127;
711 param->priv[31] |= 64;
712
713 curve25519_donna(param->pub, param->priv, basepoint);
714 725
715 return param; 726 return param;
716 } 727 }
717 728
718 void free_kexcurve25519_param(struct kex_curve25519_param *param) 729 void free_kexcurve25519_param(struct kex_curve25519_param *param) {
719 {
720 m_burn(param->priv, CURVE25519_LEN); 730 m_burn(param->priv, CURVE25519_LEN);
721 m_free(param); 731 m_free(param);
722 } 732 }
723 733
724 void kexcurve25519_comb_key(const struct kex_curve25519_param *param, const buffer *buf_pub_them, 734 void kexcurve25519_comb_key(const struct kex_curve25519_param *param, const buffer *buf_pub_them,
731 if (buf_pub_them->len != CURVE25519_LEN) 741 if (buf_pub_them->len != CURVE25519_LEN)
732 { 742 {
733 dropbear_exit("Bad curve25519"); 743 dropbear_exit("Bad curve25519");
734 } 744 }
735 745
736 curve25519_donna(out, param->priv, buf_pub_them->data); 746 dropbear_curve25519_scalarmult(out, param->priv, buf_pub_them->data);
737 747
738 if (constant_time_memcmp(zeroes, out, CURVE25519_LEN) == 0) { 748 if (constant_time_memcmp(zeroes, out, CURVE25519_LEN) == 0) {
739 dropbear_exit("Bad curve25519"); 749 dropbear_exit("Bad curve25519");
740 } 750 }
741 751
817 char * erralgo = NULL; 827 char * erralgo = NULL;
818 828
819 int goodguess = 0; 829 int goodguess = 0;
820 int allgood = 1; /* we AND this with each goodguess and see if its still 830 int allgood = 1; /* we AND this with each goodguess and see if its still
821 true after */ 831 true after */
822 832 int kexguess2 = 0;
833
834 buf_incrpos(ses.payload, 16); /* start after the cookie */
835
836 memset(ses.newkeys, 0x0, sizeof(*ses.newkeys));
837
838 /* kex_algorithms */
823 #if DROPBEAR_KEXGUESS2 839 #if DROPBEAR_KEXGUESS2
824 enum kexguess2_used kexguess2 = KEXGUESS2_LOOK; 840 if (buf_has_algo(ses.payload, KEXGUESS2_ALGO_NAME) == DROPBEAR_SUCCESS) {
825 #else 841 kexguess2 = 1;
826 enum kexguess2_used kexguess2 = KEXGUESS2_NO; 842 }
827 #endif 843 #endif
828 844
829 buf_incrpos(ses.payload, 16); /* start after the cookie */ 845 #if DROPBEAR_EXT_INFO
830 846 /* Determine if SSH_MSG_EXT_INFO messages should be sent.
831 memset(ses.newkeys, 0x0, sizeof(*ses.newkeys)); 847 Should be done for the first key exchange. Only required on server side
832 848 for server-sig-algs */
833 /* kex_algorithms */ 849 if (IS_DROPBEAR_SERVER) {
834 algo = buf_match_algo(ses.payload, sshkex, &kexguess2, &goodguess); 850 if (!ses.kexstate.donefirstkex) {
851 if (buf_has_algo(ses.payload, SSH_EXT_INFO_C) == DROPBEAR_SUCCESS) {
852 ses.allow_ext_info = 1;
853 }
854 }
855 }
856 #endif
857
858 algo = buf_match_algo(ses.payload, sshkex, kexguess2, &goodguess);
835 allgood &= goodguess; 859 allgood &= goodguess;
836 if (algo == NULL || algo->val == KEXGUESS2_ALGO_ID) { 860 if (algo == NULL || algo->data == NULL) {
861 /* kexguess2, ext-info-c, ext-info-s should not match negotiation */
837 erralgo = "kex"; 862 erralgo = "kex";
838 goto error; 863 goto error;
839 } 864 }
840 TRACE(("kexguess2 %d", kexguess2)) 865 TRACE(("kexguess2 %d", kexguess2))
841 TRACE(("kex algo %s", algo->name)) 866 TRACE(("kex algo %s", algo->name))
842 ses.newkeys->algo_kex = algo->data; 867 ses.newkeys->algo_kex = algo->data;
843 868
844 /* server_host_key_algorithms */ 869 /* server_host_key_algorithms */
845 algo = buf_match_algo(ses.payload, sshhostkey, &kexguess2, &goodguess); 870 algo = buf_match_algo(ses.payload, sigalgs, kexguess2, &goodguess);
846 allgood &= goodguess; 871 allgood &= goodguess;
847 if (algo == NULL) { 872 if (algo == NULL) {
848 erralgo = "hostkey"; 873 erralgo = "hostkey";
849 goto error; 874 goto error;
850 } 875 }
851 TRACE(("hostkey algo %s", algo->name)) 876 TRACE(("signature algo %s", algo->name))
852 ses.newkeys->algo_hostkey = algo->val; 877 ses.newkeys->algo_signature = algo->val;
878 ses.newkeys->algo_hostkey = signkey_type_from_signature(ses.newkeys->algo_signature);
853 879
854 /* encryption_algorithms_client_to_server */ 880 /* encryption_algorithms_client_to_server */
855 c2s_cipher_algo = buf_match_algo(ses.payload, sshciphers, NULL, NULL); 881 c2s_cipher_algo = buf_match_algo(ses.payload, sshciphers, 0, NULL);
856 if (c2s_cipher_algo == NULL) { 882 if (c2s_cipher_algo == NULL) {
857 erralgo = "enc c->s"; 883 erralgo = "enc c->s";
858 goto error; 884 goto error;
859 } 885 }
860 TRACE(("enc c2s is %s", c2s_cipher_algo->name)) 886 TRACE(("enc c2s is %s", c2s_cipher_algo->name))
861 887
862 /* encryption_algorithms_server_to_client */ 888 /* encryption_algorithms_server_to_client */
863 s2c_cipher_algo = buf_match_algo(ses.payload, sshciphers, NULL, NULL); 889 s2c_cipher_algo = buf_match_algo(ses.payload, sshciphers, 0, NULL);
864 if (s2c_cipher_algo == NULL) { 890 if (s2c_cipher_algo == NULL) {
865 erralgo = "enc s->c"; 891 erralgo = "enc s->c";
866 goto error; 892 goto error;
867 } 893 }
868 TRACE(("enc s2c is %s", s2c_cipher_algo->name)) 894 TRACE(("enc s2c is %s", s2c_cipher_algo->name))
869 895
870 /* mac_algorithms_client_to_server */ 896 /* mac_algorithms_client_to_server */
871 c2s_hash_algo = buf_match_algo(ses.payload, sshhashes, NULL, NULL); 897 c2s_hash_algo = buf_match_algo(ses.payload, sshhashes, 0, NULL);
898 #if DROPBEAR_AEAD_MODE
899 if (((struct dropbear_cipher_mode*)c2s_cipher_algo->mode)->aead_crypt != NULL) {
900 c2s_hash_algo = NULL;
901 } else
902 #endif
872 if (c2s_hash_algo == NULL) { 903 if (c2s_hash_algo == NULL) {
873 erralgo = "mac c->s"; 904 erralgo = "mac c->s";
874 goto error; 905 goto error;
875 } 906 }
876 TRACE(("hash c2s is %s", c2s_hash_algo->name)) 907 TRACE(("hash c2s is %s", c2s_hash_algo ? c2s_hash_algo->name : "<implicit>"))
877 908
878 /* mac_algorithms_server_to_client */ 909 /* mac_algorithms_server_to_client */
879 s2c_hash_algo = buf_match_algo(ses.payload, sshhashes, NULL, NULL); 910 s2c_hash_algo = buf_match_algo(ses.payload, sshhashes, 0, NULL);
911 #if DROPBEAR_AEAD_MODE
912 if (((struct dropbear_cipher_mode*)s2c_cipher_algo->mode)->aead_crypt != NULL) {
913 s2c_hash_algo = NULL;
914 } else
915 #endif
880 if (s2c_hash_algo == NULL) { 916 if (s2c_hash_algo == NULL) {
881 erralgo = "mac s->c"; 917 erralgo = "mac s->c";
882 goto error; 918 goto error;
883 } 919 }
884 TRACE(("hash s2c is %s", s2c_hash_algo->name)) 920 TRACE(("hash s2c is %s", s2c_hash_algo ? s2c_hash_algo->name : "<implicit>"))
885 921
886 /* compression_algorithms_client_to_server */ 922 /* compression_algorithms_client_to_server */
887 c2s_comp_algo = buf_match_algo(ses.payload, ses.compress_algos, NULL, NULL); 923 c2s_comp_algo = buf_match_algo(ses.payload, ses.compress_algos, 0, NULL);
888 if (c2s_comp_algo == NULL) { 924 if (c2s_comp_algo == NULL) {
889 erralgo = "comp c->s"; 925 erralgo = "comp c->s";
890 goto error; 926 goto error;
891 } 927 }
892 TRACE(("hash c2s is %s", c2s_comp_algo->name)) 928 TRACE(("hash c2s is %s", c2s_comp_algo->name))
893 929
894 /* compression_algorithms_server_to_client */ 930 /* compression_algorithms_server_to_client */
895 s2c_comp_algo = buf_match_algo(ses.payload, ses.compress_algos, NULL, NULL); 931 s2c_comp_algo = buf_match_algo(ses.payload, ses.compress_algos, 0, NULL);
896 if (s2c_comp_algo == NULL) { 932 if (s2c_comp_algo == NULL) {
897 erralgo = "comp s->c"; 933 erralgo = "comp s->c";
898 goto error; 934 goto error;
899 } 935 }
900 TRACE(("hash s2c is %s", s2c_comp_algo->name)) 936 TRACE(("hash s2c is %s", s2c_comp_algo->name))
924 ses.newkeys->recv.crypt_mode = 960 ses.newkeys->recv.crypt_mode =
925 (struct dropbear_cipher_mode*)s2c_cipher_algo->mode; 961 (struct dropbear_cipher_mode*)s2c_cipher_algo->mode;
926 ses.newkeys->trans.crypt_mode = 962 ses.newkeys->trans.crypt_mode =
927 (struct dropbear_cipher_mode*)c2s_cipher_algo->mode; 963 (struct dropbear_cipher_mode*)c2s_cipher_algo->mode;
928 ses.newkeys->recv.algo_mac = 964 ses.newkeys->recv.algo_mac =
965 #if DROPBEAR_AEAD_MODE
966 s2c_hash_algo == NULL ? ses.newkeys->recv.crypt_mode->aead_mac :
967 #endif
929 (struct dropbear_hash*)s2c_hash_algo->data; 968 (struct dropbear_hash*)s2c_hash_algo->data;
930 ses.newkeys->trans.algo_mac = 969 ses.newkeys->trans.algo_mac =
970 #if DROPBEAR_AEAD_MODE
971 c2s_hash_algo == NULL ? ses.newkeys->trans.crypt_mode->aead_mac :
972 #endif
931 (struct dropbear_hash*)c2s_hash_algo->data; 973 (struct dropbear_hash*)c2s_hash_algo->data;
932 ses.newkeys->recv.algo_comp = s2c_comp_algo->val; 974 ses.newkeys->recv.algo_comp = s2c_comp_algo->val;
933 ses.newkeys->trans.algo_comp = c2s_comp_algo->val; 975 ses.newkeys->trans.algo_comp = c2s_comp_algo->val;
934 } else { 976 } else {
935 /* SERVER */ 977 /* SERVER */
940 ses.newkeys->recv.crypt_mode = 982 ses.newkeys->recv.crypt_mode =
941 (struct dropbear_cipher_mode*)c2s_cipher_algo->mode; 983 (struct dropbear_cipher_mode*)c2s_cipher_algo->mode;
942 ses.newkeys->trans.crypt_mode = 984 ses.newkeys->trans.crypt_mode =
943 (struct dropbear_cipher_mode*)s2c_cipher_algo->mode; 985 (struct dropbear_cipher_mode*)s2c_cipher_algo->mode;
944 ses.newkeys->recv.algo_mac = 986 ses.newkeys->recv.algo_mac =
987 #if DROPBEAR_AEAD_MODE
988 c2s_hash_algo == NULL ? ses.newkeys->recv.crypt_mode->aead_mac :
989 #endif
945 (struct dropbear_hash*)c2s_hash_algo->data; 990 (struct dropbear_hash*)c2s_hash_algo->data;
946 ses.newkeys->trans.algo_mac = 991 ses.newkeys->trans.algo_mac =
992 #if DROPBEAR_AEAD_MODE
993 s2c_hash_algo == NULL ? ses.newkeys->trans.crypt_mode->aead_mac :
994 #endif
947 (struct dropbear_hash*)s2c_hash_algo->data; 995 (struct dropbear_hash*)s2c_hash_algo->data;
948 ses.newkeys->recv.algo_comp = c2s_comp_algo->val; 996 ses.newkeys->recv.algo_comp = c2s_comp_algo->val;
949 ses.newkeys->trans.algo_comp = s2c_comp_algo->val; 997 ses.newkeys->trans.algo_comp = s2c_comp_algo->val;
950 } 998 }
951 999