#ifdef out licence save code. I don't think it's really necessary; it's
always been broken and AFAIK no-one has complained. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@158 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
1bee46c41e
commit
4cefa21dd4
17
licence.c
17
licence.c
@ -55,6 +55,7 @@ licence_generate_hwid(uint8 * hwid)
|
|||||||
strncpy((char *) (hwid + 4), hostname, LICENCE_HWID_SIZE - 4);
|
strncpy((char *) (hwid + 4), hostname, LICENCE_HWID_SIZE - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SAVE_LICENCE
|
||||||
/* Present an existing licence to the server */
|
/* Present an existing licence to the server */
|
||||||
static void
|
static void
|
||||||
licence_present(uint8 * client_random, uint8 * rsa_data,
|
licence_present(uint8 * client_random, uint8 * rsa_data,
|
||||||
@ -94,6 +95,7 @@ licence_present(uint8 * client_random, uint8 * rsa_data,
|
|||||||
s_mark_end(s);
|
s_mark_end(s);
|
||||||
sec_send(s, sec_flags);
|
sec_send(s, sec_flags);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Send a licence request packet */
|
/* Send a licence request packet */
|
||||||
static void
|
static void
|
||||||
@ -152,13 +154,10 @@ licence_process_demand(STREAM s)
|
|||||||
memset(null_data, 0, sizeof(null_data));
|
memset(null_data, 0, sizeof(null_data));
|
||||||
licence_generate_keys(null_data, server_random, null_data);
|
licence_generate_keys(null_data, server_random, null_data);
|
||||||
|
|
||||||
|
#ifdef SAVE_LICENCE
|
||||||
licence_size = load_licence(&licence_data);
|
licence_size = load_licence(&licence_data);
|
||||||
if (licence_size == -1)
|
if (licence_size != -1)
|
||||||
{
|
{
|
||||||
licence_send_request(null_data, null_data, username, hostname);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Generate a signature for the HWID buffer */
|
/* Generate a signature for the HWID buffer */
|
||||||
licence_generate_hwid(hwid);
|
licence_generate_hwid(hwid);
|
||||||
sec_sign(signature, 16, licence_sign_key, 16, hwid, sizeof(hwid));
|
sec_sign(signature, 16, licence_sign_key, 16, hwid, sizeof(hwid));
|
||||||
@ -169,6 +168,11 @@ licence_process_demand(STREAM s)
|
|||||||
|
|
||||||
licence_present(null_data, null_data, licence_data, licence_size, hwid, signature);
|
licence_present(null_data, null_data, licence_data, licence_size, hwid, signature);
|
||||||
xfree(licence_data);
|
xfree(licence_data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
licence_send_request(null_data, null_data, username, hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send an authentication response packet */
|
/* Send an authentication response packet */
|
||||||
@ -276,7 +280,10 @@ licence_process_issue(STREAM s)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
licence_issued = True;
|
licence_issued = True;
|
||||||
|
|
||||||
|
#ifdef SAVE_LICENCE
|
||||||
save_licence(s->p, length - 2);
|
save_licence(s->p, length - 2);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process a licence packet */
|
/* Process a licence packet */
|
||||||
|
@ -388,6 +388,7 @@ hexdump(unsigned char *p, unsigned int len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SAVE_LICENCE
|
||||||
int
|
int
|
||||||
load_licence(unsigned char **data)
|
load_licence(unsigned char **data)
|
||||||
{
|
{
|
||||||
@ -441,3 +442,4 @@ save_licence(unsigned char *data, int length)
|
|||||||
write(fd, data, length);
|
write(fd, data, length);
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user