View | Details | Raw Unified | Return to bug 1022 | Differences between
and this patch

Collapse All | Expand All

(-)cipher.c (-17 / +34 lines)
Lines 54-79 struct Cipher { Link Here
54
	int	number;		/* for ssh1 only */
54
	int	number;		/* for ssh1 only */
55
	u_int	block_size;
55
	u_int	block_size;
56
	u_int	key_len;
56
	u_int	key_len;
57
	u_int	discard_len;
57
	const EVP_CIPHER	*(*evptype)(void);
58
	const EVP_CIPHER	*(*evptype)(void);
58
} ciphers[] = {
59
} ciphers[] = {
59
	{ "none",		SSH_CIPHER_NONE, 8, 0, EVP_enc_null },
60
	{ "none",		SSH_CIPHER_NONE, 8, 0, 0, EVP_enc_null },
60
	{ "des",		SSH_CIPHER_DES, 8, 8, EVP_des_cbc },
61
	{ "des",		SSH_CIPHER_DES, 8, 8, 0, EVP_des_cbc },
61
	{ "3des",		SSH_CIPHER_3DES, 8, 16, evp_ssh1_3des },
62
	{ "3des",		SSH_CIPHER_3DES, 8, 16, 0, evp_ssh1_3des },
62
	{ "blowfish",		SSH_CIPHER_BLOWFISH, 8, 32, evp_ssh1_bf },
63
	{ "blowfish",		SSH_CIPHER_BLOWFISH, 8, 32, 0, evp_ssh1_bf },
63
64
64
	{ "3des-cbc",		SSH_CIPHER_SSH2, 8, 24, EVP_des_ede3_cbc },
65
	{ "3des-cbc",		SSH_CIPHER_SSH2, 8, 24, 0, EVP_des_ede3_cbc },
65
	{ "blowfish-cbc",	SSH_CIPHER_SSH2, 8, 16, EVP_bf_cbc },
66
	{ "blowfish-cbc",	SSH_CIPHER_SSH2, 8, 16, 0, EVP_bf_cbc },
66
	{ "cast128-cbc",	SSH_CIPHER_SSH2, 8, 16, EVP_cast5_cbc },
67
	{ "cast128-cbc",	SSH_CIPHER_SSH2, 8, 16, 0, EVP_cast5_cbc },
67
	{ "arcfour",		SSH_CIPHER_SSH2, 8, 16, EVP_rc4 },
68
	{ "arcfour",		SSH_CIPHER_SSH2, 8, 16, 0, EVP_rc4 },
68
	{ "aes128-cbc",		SSH_CIPHER_SSH2, 16, 16, EVP_aes_128_cbc },
69
	{ "arcfour128-draft-00@putty.projects.tartarus.org",
69
	{ "aes192-cbc",		SSH_CIPHER_SSH2, 16, 24, EVP_aes_192_cbc },
70
				SSH_CIPHER_SSH2, 8, 16, 1536, EVP_rc4 },
70
	{ "aes256-cbc",		SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc },
71
	{ "arcfour256-draft-00@putty.projects.tartarus.org",
72
				SSH_CIPHER_SSH2, 8, 32, 1536, EVP_rc4 },
73
	{ "aes128-cbc",		SSH_CIPHER_SSH2, 16, 16, 0, EVP_aes_128_cbc },
74
	{ "aes192-cbc",		SSH_CIPHER_SSH2, 16, 24, 0, EVP_aes_192_cbc },
75
	{ "aes256-cbc",		SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc },
71
	{ "rijndael-cbc@lysator.liu.se",
76
	{ "rijndael-cbc@lysator.liu.se",
72
				SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc },
77
				SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc },
73
	{ "aes128-ctr",		SSH_CIPHER_SSH2, 16, 16, evp_aes_128_ctr },
78
	{ "aes128-ctr",		SSH_CIPHER_SSH2, 16, 16, 0, evp_aes_128_ctr },
74
	{ "aes192-ctr",		SSH_CIPHER_SSH2, 16, 24, evp_aes_128_ctr },
79
	{ "aes192-ctr",		SSH_CIPHER_SSH2, 16, 24, 0, evp_aes_128_ctr },
75
	{ "aes256-ctr",		SSH_CIPHER_SSH2, 16, 32, evp_aes_128_ctr },
80
	{ "aes256-ctr",		SSH_CIPHER_SSH2, 16, 32, 0, evp_aes_128_ctr },
76
	{ "acss@openssh.org",	SSH_CIPHER_SSH2, 16, 5, EVP_acss },
81
	{ "acss@openssh.org",	SSH_CIPHER_SSH2, 16, 5, 0, EVP_acss },
77
82
78
	{ NULL,			SSH_CIPHER_INVALID, 0, 0, NULL }
83
	{ NULL,			SSH_CIPHER_INVALID, 0, 0, NULL }
79
};
84
};
Lines 189-194 cipher_init(CipherContext *cc, Cipher *c Link Here
189
	static int dowarn = 1;
194
	static int dowarn = 1;
190
	const EVP_CIPHER *type;
195
	const EVP_CIPHER *type;
191
	int klen;
196
	int klen;
197
	u_char *zero, *discard;
192
198
193
	if (cipher->number == SSH_CIPHER_DES) {
199
	if (cipher->number == SSH_CIPHER_DES) {
194
		if (dowarn) {
200
		if (dowarn) {
Lines 226-231 cipher_init(CipherContext *cc, Cipher *c Link Here
226
	if (EVP_CipherInit(&cc->evp, NULL, (u_char *)key, NULL, -1) == 0)
232
	if (EVP_CipherInit(&cc->evp, NULL, (u_char *)key, NULL, -1) == 0)
227
		fatal("cipher_init: EVP_CipherInit: set key failed for %s",
233
		fatal("cipher_init: EVP_CipherInit: set key failed for %s",
228
		    cipher->name);
234
		    cipher->name);
235
236
	if (cipher->discard_len > 0) {		
237
		zero = xmalloc(cipher->discard_len);
238
		discard = xmalloc(cipher->discard_len);
239
		if (EVP_Cipher(&cc->evp, discard, zero,
240
		    cipher->discard_len) == 0)
241
			fatal("evp_crypt: EVP_Cipher failed during discard");
242
		memset(discard, 0, cipher->discard_len);
243
		xfree(zero);
244
		xfree(discard);
245
	}
229
}
246
}
230
247
231
void
248
void
(-)myproposal.h (-1 / +4 lines)
Lines 28-34 Link Here
28
	"diffie-hellman-group1-sha1"
28
	"diffie-hellman-group1-sha1"
29
#define	KEX_DEFAULT_PK_ALG	"ssh-rsa,ssh-dss"
29
#define	KEX_DEFAULT_PK_ALG	"ssh-rsa,ssh-dss"
30
#define	KEX_DEFAULT_ENCRYPT \
30
#define	KEX_DEFAULT_ENCRYPT \
31
	"aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour," \
31
	"aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \
32
	"arcfour128-draft-00@putty.projects.tartarus.org," \
33
	"arcfour256-draft-00@putty.projects.tartarus.org," \
34
	"arcfour," \
32
	"aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se," \
35
	"aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se," \
33
	"aes128-ctr,aes192-ctr,aes256-ctr"
36
	"aes128-ctr,aes192-ctr,aes256-ctr"
34
#define	KEX_DEFAULT_MAC \
37
#define	KEX_DEFAULT_MAC \

Return to bug 1022