1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Support XDM-AUTHORIZATION-1 for connecting to local X servers. If

we're going to be a security program, we can at least make a token
effort to use the most secure local X auth available! And I'm still
half-tempted to see if I can support it for remote X servers too...

[originally from svn r2537]
This commit is contained in:
Simon Tatham
2003-01-11 09:31:54 +00:00
parent 86977efa81
commit 87f9446a26
8 changed files with 111 additions and 41 deletions

View File

@ -897,6 +897,32 @@ void des3_encrypt_pubkey_ossh(unsigned char *key, unsigned char *iv,
memset(ourkeys, 0, sizeof(ourkeys));
}
void des_encrypt_xdmauth(unsigned char *keydata, unsigned char *blk, int len)
{
unsigned char key[8];
DESContext dc;
int i, nbits, j;
unsigned int bits;
bits = 0;
nbits = 0;
j = 0;
for (i = 0; i < 8; i++) {
if (nbits < 7) {
bits = (bits << 8) | keydata[j];
nbits += 8;
j++;
}
key[i] = (bits >> (nbits - 7)) << 1;
bits &= ~(0x7F << (nbits - 7));
nbits -= 7;
}
des_key_setup(GET_32BIT_MSB_FIRST(key), GET_32BIT_MSB_FIRST(key + 4),
&dc);
des_cbc_encrypt(blk, blk, 24, &dc);
}
static const struct ssh2_cipher ssh_3des_ssh2 = {
des3_make_context, des3_free_context, des3_iv, des3_key,
des3_ssh2_encrypt_blk, des3_ssh2_decrypt_blk,