if (k->server) {
if (kex->server) {
kex_choose_conf(Kex *k){	char **my, **peer;	char **cprop, **sprop;	int mode;	int ctos;				/* direction: if true client-to-server */	int need;	my   = kex_buf2prop(&k->my);	peer = kex_buf2prop(&k->peer);	if (k->server) {		cprop=peer;		sprop=my;	} else {		cprop=my;		sprop=peer;	}	for (mode = 0; mode < MODE_MAX; mode++) {		int nenc, nmac, ncomp;		ctos = (!k->server && mode == MODE_OUT) || (k->server && mode == MODE_IN);		nenc  = ctos ? PROPOSAL_ENC_ALGS_CTOS  : PROPOSAL_ENC_ALGS_STOC;		nmac  = ctos ? PROPOSAL_MAC_ALGS_CTOS  : PROPOSAL_MAC_ALGS_STOC;		ncomp = ctos ? PROPOSAL_COMP_ALGS_CTOS : PROPOSAL_COMP_ALGS_STOC;		choose_enc (&k->enc [mode], cprop[nenc],  sprop[nenc]);		choose_mac (&k->mac [mode], cprop[nmac],  sprop[nmac]);		choose_comp(&k->comp[mode], cprop[ncomp], sprop[ncomp]);		debug("kex: %s %s %s %s",		    ctos ? "client->server" : "server->client",		    k->enc[mode].name,		    k->mac[mode].name,		    k->comp[mode].name);	}	choose_kex(k, cprop[PROPOSAL_KEX_ALGS], sprop[PROPOSAL_KEX_ALGS]);	choose_hostkeyalg(k, cprop[PROPOSAL_SERVER_HOST_KEY_ALGS],	    sprop[PROPOSAL_SERVER_HOST_KEY_ALGS]);	need = 0;	for (mode = 0; mode < MODE_MAX; mode++) {	    if (need < k->enc[mode].cipher->key_len)		    need = k->enc[mode].cipher->key_len;	    if (need < k->enc[mode].cipher->block_size)		    need = k->enc[mode].cipher->block_size;	    if (need < k->mac[mode].key_len)		    need = k->mac[mode].key_len;	}	/* XXX need runden? */	k->we_need = need;	kex_prop_free(my);	kex_prop_free(peer);}