Mercurial > dropbear
comparison common-algo.c @ 579:8c737cd7c1af
merge of '48fdaa8706d1acda35e9d564adc9a1fbc96c18c8'
and '658fd03abd21e0da7c4c89b9fff9dc693c72daae'
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 27 Feb 2010 11:53:18 +0000 |
parents | f9b5dc0cba61 |
children | a98a2138364a |
comparison
equal
deleted
inserted
replaced
577:69e98c45db7c | 579:8c737cd7c1af |
---|---|
29 /* This file (algo.c) organises the ciphers which can be used, and is used to | 29 /* This file (algo.c) organises the ciphers which can be used, and is used to |
30 * decide which ciphers/hashes/compression/signing to use during key exchange*/ | 30 * decide which ciphers/hashes/compression/signing to use during key exchange*/ |
31 | 31 |
32 static int void_cipher(const unsigned char* in, unsigned char* out, | 32 static int void_cipher(const unsigned char* in, unsigned char* out, |
33 unsigned long len, void *cipher_state) { | 33 unsigned long len, void *cipher_state) { |
34 memcpy(out, in, len); | 34 if (in != out) { |
35 memmove(out, in, len); | |
36 } | |
35 return CRYPT_OK; | 37 return CRYPT_OK; |
36 } | 38 } |
37 | 39 |
38 static int void_start(int cipher, const unsigned char *IV, | 40 static int void_start(int cipher, const unsigned char *IV, |
39 const unsigned char *key, | 41 const unsigned char *key, |
164 {"hmac-md5", 0, &dropbear_md5, 1, NULL}, | 166 {"hmac-md5", 0, &dropbear_md5, 1, NULL}, |
165 #endif | 167 #endif |
166 {NULL, 0, NULL, 0, NULL} | 168 {NULL, 0, NULL, 0, NULL} |
167 }; | 169 }; |
168 | 170 |
169 algo_type sshcompress[] = { | |
170 #ifndef DISABLE_ZLIB | 171 #ifndef DISABLE_ZLIB |
172 algo_type ssh_compress[] = { | |
171 {"zlib", DROPBEAR_COMP_ZLIB, NULL, 1, NULL}, | 173 {"zlib", DROPBEAR_COMP_ZLIB, NULL, 1, NULL}, |
172 {"[email protected]", DROPBEAR_COMP_ZLIB_DELAY, NULL, 1, NULL}, | 174 {"[email protected]", DROPBEAR_COMP_ZLIB_DELAY, NULL, 1, NULL}, |
173 #endif | 175 {"none", DROPBEAR_COMP_NONE, NULL, 1, NULL}, |
176 {NULL, 0, NULL, 0, NULL} | |
177 }; | |
178 #endif | |
179 | |
180 algo_type ssh_nocompress[] = { | |
174 {"none", DROPBEAR_COMP_NONE, NULL, 1, NULL}, | 181 {"none", DROPBEAR_COMP_NONE, NULL, 1, NULL}, |
175 {NULL, 0, NULL, 0, NULL} | 182 {NULL, 0, NULL, 0, NULL} |
176 }; | 183 }; |
177 | 184 |
178 algo_type sshhostkey[] = { | 185 algo_type sshhostkey[] = { |