summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2004-09-02 15:24:17 +0000
committerMatt Johnston <matt@ucc.asn.au>2004-09-02 15:24:17 +0000
commit8559be015aa7a5fca3598047716b8b795e855584 (patch)
tree0bc1db900f13d82169a0d3e13213153dc1bb11f6
parentcb0657bdf3491bb86de929d86409791d306b5f64 (diff)
Check for non-matching algos properly
--HG-- extra : convert_revision : 20ab9edd3f3f714ecc4630bb97912185d88aa376
-rw-r--r--common-kex.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/common-kex.c b/common-kex.c
index 7bb0c82..38ce090 100644
--- a/common-kex.c
+++ b/common-kex.c
@@ -634,42 +634,44 @@ static void read_kex_algos() {
/* encryption_algorithms_client_to_server */
c2s_cipher_algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess);
- if (algo == NULL) {
+ if (c2s_cipher_algo == NULL) {
erralgo = "enc c->s";
goto error;
}
+ TRACE(("c2s is %s", c2s_cipher_algo->name));
/* encryption_algorithms_server_to_client */
s2c_cipher_algo = ses.buf_match_algo(ses.payload, sshciphers, &goodguess);
- if (algo == NULL) {
+ if (s2c_cipher_algo == NULL) {
erralgo = "enc s->c";
goto error;
}
+ TRACE(("s2c is %s", s2c_cipher_algo->name));
/* mac_algorithms_client_to_server */
c2s_hash_algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess);
- if (algo == NULL) {
+ if (c2s_hash_algo == NULL) {
erralgo = "mac c->s";
goto error;
}
/* mac_algorithms_server_to_client */
s2c_hash_algo = ses.buf_match_algo(ses.payload, sshhashes, &goodguess);
- if (algo == NULL) {
+ if (s2c_hash_algo == NULL) {
erralgo = "mac s->c";
goto error;
}
/* compression_algorithms_client_to_server */
c2s_comp_algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess);
- if (algo == NULL) {
+ if (c2s_comp_algo == NULL) {
erralgo = "comp c->s";
goto error;
}
/* compression_algorithms_server_to_client */
s2c_comp_algo = ses.buf_match_algo(ses.payload, sshcompress, &goodguess);
- if (algo == NULL) {
+ if (s2c_comp_algo == NULL) {
erralgo = "comp s->c";
goto error;
}