comparison common-kex.c @ 765:5503e05ab3a4 ecc

- Rename buf_put_ecc_pubkey_string() to buf_put_ecc_raw_pubkey_string() - Reindent ecc.c properly
author Matt Johnston <matt@ucc.asn.au>
date Mon, 08 Apr 2013 23:56:31 +0800
parents f744321ac048
children d1575fdc29a6
comparison
equal deleted inserted replaced
764:2202e854d187 765:5503e05ab3a4
660 sign_key *hostkey) { 660 sign_key *hostkey) {
661 const struct dropbear_kex *algo_kex = ses.newkeys->algo_kex; 661 const struct dropbear_kex *algo_kex = ses.newkeys->algo_kex;
662 // public keys from client and server 662 // public keys from client and server
663 ecc_key *Q_C, *Q_S, *Q_them; 663 ecc_key *Q_C, *Q_S, *Q_them;
664 664
665 Q_them = buf_get_ecc_pubkey(pub_them, algo_kex->ecc_curve); 665 Q_them = buf_get_ecc_raw_pubkey(pub_them, algo_kex->ecc_curve);
666 666
667 ses.dh_K = dropbear_ecc_shared_secret(Q_them, &param->key); 667 ses.dh_K = dropbear_ecc_shared_secret(Q_them, &param->key);
668 668
669 /* From here on, the code needs to work with the _same_ vars on each side, 669 /* From here on, the code needs to work with the _same_ vars on each side,
670 * not vice-versaing for client/server */ 670 * not vice-versaing for client/server */
678 678
679 /* Create the remainder of the hash buffer, to generate the exchange hash */ 679 /* Create the remainder of the hash buffer, to generate the exchange hash */
680 /* K_S, the host key */ 680 /* K_S, the host key */
681 buf_put_pub_key(ses.kexhashbuf, hostkey, ses.newkeys->algo_hostkey); 681 buf_put_pub_key(ses.kexhashbuf, hostkey, ses.newkeys->algo_hostkey);
682 /* Q_C, client's ephemeral public key octet string */ 682 /* Q_C, client's ephemeral public key octet string */
683 buf_put_ecc_pubkey_string(ses.kexhashbuf, Q_C); 683 buf_put_ecc_raw_pubkey_string(ses.kexhashbuf, Q_C);
684 /* Q_S, server's ephemeral public key octet string */ 684 /* Q_S, server's ephemeral public key octet string */
685 buf_put_ecc_pubkey_string(ses.kexhashbuf, Q_S); 685 buf_put_ecc_raw_pubkey_string(ses.kexhashbuf, Q_S);
686 /* K, the shared secret */ 686 /* K, the shared secret */
687 buf_putmpint(ses.kexhashbuf, ses.dh_K); 687 buf_putmpint(ses.kexhashbuf, ses.dh_K);
688 688
689 /* calculate the hash H to sign */ 689 /* calculate the hash H to sign */
690 finish_kexhashbuf(); 690 finish_kexhashbuf();