X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=client_common.c;h=3b8ed511090a5a637d867f48baf391338677c837;hb=6eab6671f857009b6d6a2de2c2ec8187f869f705;hp=6652cc35477234a9dd4a9f0621be953c5cc9ba00;hpb=d87806284b9f6be9aab71ccbf0280d273b57eeb3;p=paraslash.git diff --git a/client_common.c b/client_common.c index 6652cc35..3b8ed511 100644 --- a/client_common.c +++ b/client_common.c @@ -336,7 +336,8 @@ static int client_post_select(struct sched *s, struct task *t) case CL_RECEIVED_WELCOME: /* send auth command */ if (!FD_ISSET(ct->scc.fd, &s->wfds)) return 0; - sprintf(buf, AUTH_REQUEST_MSG "%s sideband", ct->user); + sprintf(buf, AUTH_REQUEST_MSG "%s sideband%s", ct->user, + has_feature("aes_ctr128", ct)? ",aes_ctr128" : ""); PARA_INFO_LOG("--> %s\n", buf); ret = write_buffer(ct->scc.fd, buf); if (ret < 0) @@ -352,6 +353,7 @@ static int client_post_select(struct sched *s, struct task *t) /* decrypted challenge/session key buffer */ unsigned char crypt_buf[1024]; struct sb_buffer sbb; + bool use_aes; ret = recv_sb(ct, &s->rfds, &sbb); if (ret <= 0) @@ -370,9 +372,10 @@ static int client_post_select(struct sched *s, struct task *t) goto out; ct->challenge_hash = para_malloc(HASH_SIZE); hash_function((char *)crypt_buf, CHALLENGE_SIZE, ct->challenge_hash); - ct->scc.send = sc_new(crypt_buf + CHALLENGE_SIZE, SESSION_KEY_LEN); + use_aes = has_feature("aes_ctr128", ct); + ct->scc.send = sc_new(crypt_buf + CHALLENGE_SIZE, SESSION_KEY_LEN, use_aes); ct->scc.recv = sc_new(crypt_buf + CHALLENGE_SIZE + SESSION_KEY_LEN, - SESSION_KEY_LEN); + SESSION_KEY_LEN, use_aes); hash_to_asc(ct->challenge_hash, buf); PARA_INFO_LOG("--> %s\n", buf); ct->status = CL_RECEIVED_CHALLENGE;