mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
Add AES support in SSH2. Not yet complete: there's no way to select
it in the GUI (or even in the registry). [originally from svn r966]
This commit is contained in:
parent
47fc223782
commit
bf25fd405c
7
Makefile
7
Makefile
@ -83,15 +83,15 @@ MOBJ2 = tree234.$(OBJ)
|
|||||||
OBJS1 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ)
|
OBJS1 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ)
|
||||||
OBJS2 = sshsha.$(OBJ) sshblowf.$(OBJ) noise.$(OBJ) sshdh.$(OBJ) sshdss.$(OBJ)
|
OBJS2 = sshsha.$(OBJ) sshblowf.$(OBJ) noise.$(OBJ) sshdh.$(OBJ) sshdss.$(OBJ)
|
||||||
OBJS3 = sshbn.$(OBJ) sshpubk.$(OBJ) ssh.$(OBJ) pageantc.$(OBJ) sshzlib.$(OBJ)
|
OBJS3 = sshbn.$(OBJ) sshpubk.$(OBJ) ssh.$(OBJ) pageantc.$(OBJ) sshzlib.$(OBJ)
|
||||||
OBJS4 = x11fwd.$(OBJ)
|
OBJS4 = x11fwd.$(OBJ) sshaes.$(OBJ)
|
||||||
##-- objects pageant
|
##-- objects pageant
|
||||||
PAGE1 = pageant.$(OBJ) sshrsa.$(OBJ) sshpubk.$(OBJ) sshdes.$(OBJ) sshbn.$(OBJ)
|
PAGE1 = pageant.$(OBJ) sshrsa.$(OBJ) sshpubk.$(OBJ) sshdes.$(OBJ) sshbn.$(OBJ)
|
||||||
PAGE2 = sshmd5.$(OBJ) version.$(OBJ) tree234.$(OBJ) misc.$(OBJ)
|
PAGE2 = sshmd5.$(OBJ) version.$(OBJ) tree234.$(OBJ) misc.$(OBJ) sshaes.$(OBJ)
|
||||||
##-- objects puttygen
|
##-- objects puttygen
|
||||||
GEN1 = puttygen.$(OBJ) sshrsag.$(OBJ) sshprime.$(OBJ) sshdes.$(OBJ)
|
GEN1 = puttygen.$(OBJ) sshrsag.$(OBJ) sshprime.$(OBJ) sshdes.$(OBJ)
|
||||||
GEN2 = sshbn.$(OBJ) sshmd5.$(OBJ) version.$(OBJ) sshrand.$(OBJ) noise.$(OBJ)
|
GEN2 = sshbn.$(OBJ) sshmd5.$(OBJ) version.$(OBJ) sshrand.$(OBJ) noise.$(OBJ)
|
||||||
GEN3 = sshsha.$(OBJ) winstore.$(OBJ) misc.$(OBJ) winctrls.$(OBJ)
|
GEN3 = sshsha.$(OBJ) winstore.$(OBJ) misc.$(OBJ) winctrls.$(OBJ)
|
||||||
GEN4 = sshrsa.$(OBJ) sshpubk.$(OBJ)
|
GEN4 = sshrsa.$(OBJ) sshpubk.$(OBJ) sshaes.$(OBJ)
|
||||||
##-- resources putty puttytel
|
##-- resources putty puttytel
|
||||||
PRESRC = win_res.$(RES)
|
PRESRC = win_res.$(RES)
|
||||||
##-- resources pageant
|
##-- resources pageant
|
||||||
@ -257,6 +257,7 @@ noise.$(OBJ): noise.c putty.h puttymem.h network.h ssh.h storage.h
|
|||||||
ssh.$(OBJ): ssh.c ssh.h putty.h puttymem.h network.h tree234.h
|
ssh.$(OBJ): ssh.c ssh.h putty.h puttymem.h network.h tree234.h
|
||||||
sshcrc.$(OBJ): sshcrc.c ssh.h puttymem.h
|
sshcrc.$(OBJ): sshcrc.c ssh.h puttymem.h
|
||||||
sshdes.$(OBJ): sshdes.c ssh.h puttymem.h
|
sshdes.$(OBJ): sshdes.c ssh.h puttymem.h
|
||||||
|
sshaes.$(OBJ): sshaes.c ssh.h puttymem.h
|
||||||
sshmd5.$(OBJ): sshmd5.c ssh.h puttymem.h
|
sshmd5.$(OBJ): sshmd5.c ssh.h puttymem.h
|
||||||
sshrsa.$(OBJ): sshrsa.c ssh.h puttymem.h
|
sshrsa.$(OBJ): sshrsa.c ssh.h puttymem.h
|
||||||
sshsha.$(OBJ): sshsha.c ssh.h puttymem.h
|
sshsha.$(OBJ): sshsha.c ssh.h puttymem.h
|
||||||
|
13
ssh.c
13
ssh.c
@ -167,6 +167,9 @@ enum { PKT_END, PKT_INT, PKT_CHAR, PKT_DATA, PKT_STR, PKT_BIGNUM };
|
|||||||
extern const struct ssh_cipher ssh_3des;
|
extern const struct ssh_cipher ssh_3des;
|
||||||
extern const struct ssh_cipher ssh_3des_ssh2;
|
extern const struct ssh_cipher ssh_3des_ssh2;
|
||||||
extern const struct ssh_cipher ssh_des;
|
extern const struct ssh_cipher ssh_des;
|
||||||
|
extern const struct ssh_cipher ssh_aes128_ssh2;
|
||||||
|
extern const struct ssh_cipher ssh_aes192_ssh2;
|
||||||
|
extern const struct ssh_cipher ssh_aes256_ssh2;
|
||||||
extern const struct ssh_cipher ssh_blowfish_ssh1;
|
extern const struct ssh_cipher ssh_blowfish_ssh1;
|
||||||
extern const struct ssh_cipher ssh_blowfish_ssh2;
|
extern const struct ssh_cipher ssh_blowfish_ssh2;
|
||||||
|
|
||||||
@ -181,7 +184,13 @@ extern void x11_invent_auth(char *, int, char *, int);
|
|||||||
* SSH1. (3DES uses outer chaining; Blowfish has the opposite
|
* SSH1. (3DES uses outer chaining; Blowfish has the opposite
|
||||||
* endianness and different-sized keys.)
|
* endianness and different-sized keys.)
|
||||||
*/
|
*/
|
||||||
const static struct ssh_cipher *ciphers[] = { &ssh_blowfish_ssh2, &ssh_3des_ssh2 };
|
const static struct ssh_cipher *ciphers[] = {
|
||||||
|
&ssh_aes256_ssh2,
|
||||||
|
&ssh_aes192_ssh2,
|
||||||
|
&ssh_aes128_ssh2,
|
||||||
|
&ssh_blowfish_ssh2,
|
||||||
|
&ssh_3des_ssh2
|
||||||
|
};
|
||||||
|
|
||||||
extern const struct ssh_kex ssh_diffiehellman;
|
extern const struct ssh_kex ssh_diffiehellman;
|
||||||
extern const struct ssh_kex ssh_diffiehellman_gex;
|
extern const struct ssh_kex ssh_diffiehellman_gex;
|
||||||
@ -940,7 +949,7 @@ static int ssh2_pkt_construct(void) {
|
|||||||
* Add padding. At least four bytes, and must also bring total
|
* Add padding. At least four bytes, and must also bring total
|
||||||
* length (minus MAC) up to a multiple of the block size.
|
* length (minus MAC) up to a multiple of the block size.
|
||||||
*/
|
*/
|
||||||
cipherblk = cipher ? cipher->blksize : 8; /* block size */
|
cipherblk = cscipher ? cscipher->blksize : 8; /* block size */
|
||||||
cipherblk = cipherblk < 8 ? 8 : cipherblk; /* or 8 if blksize < 8 */
|
cipherblk = cipherblk < 8 ? 8 : cipherblk; /* or 8 if blksize < 8 */
|
||||||
padding = 4;
|
padding = 4;
|
||||||
padding += (cipherblk - (pktout.length + padding) % cipherblk) % cipherblk;
|
padding += (cipherblk - (pktout.length + padding) % cipherblk) % cipherblk;
|
||||||
|
Loading…
Reference in New Issue
Block a user