--- sourceforge.net/trunk/rdesktop/licence.c 2004/05/16 11:18:20 699 +++ sourceforge.net/trunk/rdesktop/licence.c 2005/08/03 10:56:16 963 @@ -1,7 +1,7 @@ -/* +/* -*- c-basic-offset: 8 -*- rdesktop: A Remote Desktop Protocol client. RDP licensing negotiation - Copyright (C) Matthew Chapman 1999-2002 + Copyright (C) Matthew Chapman 1999-2005 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,15 +19,10 @@ */ #include "rdesktop.h" - -#ifdef WITH_OPENSSL #include -#else -#include "crypto/rc4.h" -#endif -extern char g_username[16]; -extern char hostname[16]; +extern char g_username[64]; +extern char g_hostname[16]; static uint8 g_licence_key[16]; static uint8 g_licence_sign_key[16]; @@ -43,7 +38,7 @@ /* Generate master secret and then key material */ sec_hash_48(master_secret, pre_master_secret, client_random, server_random, 'A'); - sec_hash_48(key_block, master_secret, server_random, client_random, 'A'); + sec_hash_48(key_block, master_secret, server_random, client_random, 'A'); /* Store first 16 bytes of session key as MAC secret */ memcpy(g_licence_sign_key, key_block, 16); @@ -56,7 +51,7 @@ licence_generate_hwid(uint8 * hwid) { buf_out_uint32(hwid, 2); - strncpy((char *) (hwid + 4), hostname, LICENCE_HWID_SIZE - 4); + strncpy((char *) (hwid + 4), g_hostname, LICENCE_HWID_SIZE - 4); } /* Present an existing licence to the server */ @@ -174,7 +169,7 @@ return; } - licence_send_request(null_data, null_data, g_username, hostname); + licence_send_request(null_data, null_data, g_username, g_hostname); } /* Send an authentication response packet */