/[rdesktop]/sourceforge.net/trunk/rdesktop/licence.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/licence.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 699 by matthewc, Sun May 16 11:18:20 2004 UTC revision 963 by astrand, Wed Aug 3 10:56:16 2005 UTC
# Line 1  Line 1 
1  /*  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     RDP licensing negotiation     RDP licensing negotiation
4     Copyright (C) Matthew Chapman 1999-2002     Copyright (C) Matthew Chapman 1999-2005
5        
6     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 19  Line 19 
19  */  */
20    
21  #include "rdesktop.h"  #include "rdesktop.h"
   
 #ifdef WITH_OPENSSL  
22  #include <openssl/rc4.h>  #include <openssl/rc4.h>
 #else  
 #include "crypto/rc4.h"  
 #endif  
23    
24  extern char g_username[16];  extern char g_username[64];
25  extern char hostname[16];  extern char g_hostname[16];
26    
27  static uint8 g_licence_key[16];  static uint8 g_licence_key[16];
28  static uint8 g_licence_sign_key[16];  static uint8 g_licence_sign_key[16];
# Line 43  licence_generate_keys(uint8 * client_ran Line 38  licence_generate_keys(uint8 * client_ran
38    
39          /* Generate master secret and then key material */          /* Generate master secret and then key material */
40          sec_hash_48(master_secret, pre_master_secret, client_random, server_random, 'A');          sec_hash_48(master_secret, pre_master_secret, client_random, server_random, 'A');
41          sec_hash_48(key_block,     master_secret,     server_random, client_random, 'A');          sec_hash_48(key_block, master_secret, server_random, client_random, 'A');
42    
43          /* Store first 16 bytes of session key as MAC secret */          /* Store first 16 bytes of session key as MAC secret */
44          memcpy(g_licence_sign_key, key_block, 16);          memcpy(g_licence_sign_key, key_block, 16);
# Line 56  static void Line 51  static void
51  licence_generate_hwid(uint8 * hwid)  licence_generate_hwid(uint8 * hwid)
52  {  {
53          buf_out_uint32(hwid, 2);          buf_out_uint32(hwid, 2);
54          strncpy((char *) (hwid + 4), hostname, LICENCE_HWID_SIZE - 4);          strncpy((char *) (hwid + 4), g_hostname, LICENCE_HWID_SIZE - 4);
55  }  }
56    
57  /* Present an existing licence to the server */  /* Present an existing licence to the server */
# Line 174  licence_process_demand(STREAM s) Line 169  licence_process_demand(STREAM s)
169                  return;                  return;
170          }          }
171    
172          licence_send_request(null_data, null_data, g_username, hostname);          licence_send_request(null_data, null_data, g_username, g_hostname);
173  }  }
174    
175  /* Send an authentication response packet */  /* Send an authentication response packet */

Legend:
Removed from v.699  
changed lines
  Added in v.963

  ViewVC Help
Powered by ViewVC 1.1.26