--- sourceforge.net/trunk/rdesktop/licence.c 2002/09/15 12:36:55 159 +++ sourceforge.net/trunk/rdesktop/licence.c 2003/01/21 20:22:44 293 @@ -1,7 +1,7 @@ /* rdesktop: A Remote Desktop Protocol client. RDP licensing negotiation - Copyright (C) Matthew Chapman 1999-2001 + Copyright (C) Matthew Chapman 1999-2002 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,11 +19,15 @@ */ #include "rdesktop.h" + +#ifdef WITH_OPENSSL +#include +#else #include "crypto/rc4.h" +#endif extern char username[16]; extern char hostname[16]; -extern BOOL licence; static uint8 licence_key[16]; static uint8 licence_sign_key[16]; @@ -139,12 +143,14 @@ licence_process_demand(STREAM s) { uint8 null_data[SEC_MODULUS_SIZE]; - uint8 hwid[LICENCE_HWID_SIZE]; - uint8 signature[LICENCE_SIGNATURE_SIZE]; uint8 *server_random; +#ifdef SAVE_LICENCE + uint8 signature[LICENCE_SIGNATURE_SIZE]; + uint8 hwid[LICENCE_HWID_SIZE]; uint8 *licence_data; int licence_size; RC4_KEY crypt_key; +#endif /* Retrieve the server random from the incoming packet */ in_uint8p(s, server_random, SEC_RANDOM_SIZE); @@ -248,10 +254,6 @@ memcpy(sealed_buffer + LICENCE_TOKEN_SIZE, hwid, LICENCE_HWID_SIZE); sec_sign(out_sig, 16, licence_sign_key, 16, sealed_buffer, sizeof(sealed_buffer)); - /* Deliberately break signature if licencing disabled */ - if (!licence) - memset(out_sig, 0, sizeof(out_sig)); - /* Now encrypt the HWID */ RC4_set_key(&crypt_key, 16, licence_key); RC4(&crypt_key, LICENCE_HWID_SIZE, hwid, crypt_hwid);