/[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 39 by matthewc, Fri Apr 5 07:57:43 2002 UTC revision 61 by matthewc, Sun Jul 14 12:06:03 2002 UTC
# Line 7  Line 7 
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
8     the Free Software Foundation; either version 2 of the License, or     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.     (at your option) any later version.
10      
11     This program is distributed in the hope that it will be useful,     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# Line 103  licence_send_request(uint8 *client_rando Line 103  licence_send_request(uint8 *client_rando
103          uint32 sec_flags = SEC_LICENCE_NEG;          uint32 sec_flags = SEC_LICENCE_NEG;
104          uint16 userlen = strlen(user) + 1;          uint16 userlen = strlen(user) + 1;
105          uint16 hostlen = strlen(host) + 1;          uint16 hostlen = strlen(host) + 1;
106          uint16 length = 120 + userlen + hostlen;          uint16 length = 128 + userlen + hostlen;
107          STREAM s;          STREAM s;
108    
109          s = sec_init(sec_flags, length + 2);          s = sec_init(sec_flags, length + 2);
# Line 162  licence_process_demand(STREAM s) Line 162  licence_process_demand(STREAM s)
162    
163          /* Generate a signature for the HWID buffer */          /* Generate a signature for the HWID buffer */
164          licence_generate_hwid(hwid);          licence_generate_hwid(hwid);
165          sec_sign(signature, licence_sign_key, 16, hwid, sizeof(hwid));          sec_sign(signature, 16, licence_sign_key, 16, hwid, sizeof(hwid));
166    
167          /* Now encrypt the HWID */          /* Now encrypt the HWID */
168          RC4_set_key(&crypt_key, 16, licence_key);          RC4_set_key(&crypt_key, 16, licence_key);
# Line 245  licence_process_authreq(STREAM s) Line 245  licence_process_authreq(STREAM s)
245          licence_generate_hwid(hwid);          licence_generate_hwid(hwid);
246          memcpy(sealed_buffer, decrypt_token, LICENCE_TOKEN_SIZE);          memcpy(sealed_buffer, decrypt_token, LICENCE_TOKEN_SIZE);
247          memcpy(sealed_buffer + LICENCE_TOKEN_SIZE, hwid, LICENCE_HWID_SIZE);          memcpy(sealed_buffer + LICENCE_TOKEN_SIZE, hwid, LICENCE_HWID_SIZE);
248          sec_sign(out_sig, licence_sign_key, 16,          sec_sign(out_sig, 16, licence_sign_key, 16,
249                   sealed_buffer, sizeof(sealed_buffer));                   sealed_buffer, sizeof(sealed_buffer));
250    
251          /* Deliberately break signature if licencing disabled */          /* Deliberately break signature if licencing disabled */

Legend:
Removed from v.39  
changed lines
  Added in v.61

  ViewVC Help
Powered by ViewVC 1.1.26