Check for non-matching algos properly

--HG--
extra : convert_revision : 20ab9edd3f3f714ecc4630bb97912185d88aa376
This commit is contained in:
Matt Johnston 2004-09-02 15:24:17 +00:00
parent cb0657bdf3
commit 8559be015a

View File

@ -634,42 +634,44 @@ static void read_kex_algos() {
/* encryption_algorithms_client_to_server */ /* encryption_algorithms_client_to_server */
c2s_cipher_algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess); c2s_cipher_algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess);
if (algo == NULL) { if (c2s_cipher_algo == NULL) {
erralgo = "enc c->s"; erralgo = "enc c->s";
goto error; goto error;
} }
TRACE(("c2s is %s", c2s_cipher_algo->name));
/* encryption_algorithms_server_to_client */ /* encryption_algorithms_server_to_client */
s2c_cipher_algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess); s2c_cipher_algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess);
if (algo == NULL) { if (s2c_cipher_algo == NULL) {
erralgo = "enc s->c"; erralgo = "enc s->c";
goto error; goto error;
} }
TRACE(("s2c is %s", s2c_cipher_algo->name));
/* mac_algorithms_client_to_server */ /* mac_algorithms_client_to_server */
c2s_hash_algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess); c2s_hash_algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess);
if (algo == NULL) { if (c2s_hash_algo == NULL) {
erralgo = "mac c->s"; erralgo = "mac c->s";
goto error; goto error;
} }
/* mac_algorithms_server_to_client */ /* mac_algorithms_server_to_client */
s2c_hash_algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess); s2c_hash_algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess);
if (algo == NULL) { if (s2c_hash_algo == NULL) {
erralgo = "mac s->c"; erralgo = "mac s->c";
goto error; goto error;
} }
/* compression_algorithms_client_to_server */ /* compression_algorithms_client_to_server */
c2s_comp_algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess); c2s_comp_algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess);
if (algo == NULL) { if (c2s_comp_algo == NULL) {
erralgo = "comp c->s"; erralgo = "comp c->s";
goto error; goto error;
} }
/* compression_algorithms_server_to_client */ /* compression_algorithms_server_to_client */
s2c_comp_algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess); s2c_comp_algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess);
if (algo == NULL) { if (s2c_comp_algo == NULL) {
erralgo = "comp s->c"; erralgo = "comp s->c";
goto error; goto error;
} }