Fixed issues with a too small buffer used for output of
sec_hash_sha1_16() which introduced crashes on solaris, sha1 need 160bit output buffer. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1648 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
e789af1aea
commit
be90d40a34
12
rdesktop.c
12
rdesktop.c
@ -1565,8 +1565,8 @@ mkdir_p(const char *path, int mask)
|
|||||||
int
|
int
|
||||||
load_licence(unsigned char **data)
|
load_licence(unsigned char **data)
|
||||||
{
|
{
|
||||||
uint8 ho[16], hi[16];
|
uint8 ho[20], hi[16];
|
||||||
char *home, path[PATH_MAX], hash[33];
|
char *home, path[PATH_MAX], hash[40];
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int fd, length;
|
int fd, length;
|
||||||
|
|
||||||
@ -1576,7 +1576,7 @@ load_licence(unsigned char **data)
|
|||||||
|
|
||||||
snprintf((char*)hi, 16, g_hostname);
|
snprintf((char*)hi, 16, g_hostname);
|
||||||
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
|
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
|
||||||
sec_hash_to_string(hash, 33, ho, 16);
|
sec_hash_to_string(hash, 40, ho, 22);
|
||||||
|
|
||||||
snprintf(path, PATH_MAX, "%s"RDESKTOP_LICENSE_STORE"/%s.cal",
|
snprintf(path, PATH_MAX, "%s"RDESKTOP_LICENSE_STORE"/%s.cal",
|
||||||
home, hash);
|
home, hash);
|
||||||
@ -1608,8 +1608,8 @@ load_licence(unsigned char **data)
|
|||||||
void
|
void
|
||||||
save_licence(unsigned char *data, int length)
|
save_licence(unsigned char *data, int length)
|
||||||
{
|
{
|
||||||
uint8 ho[16], hi[16];
|
uint8 ho[20], hi[16];
|
||||||
char *home, path[PATH_MAX], tmppath[PATH_MAX], hash[33];
|
char *home, path[PATH_MAX], tmppath[PATH_MAX], hash[40];
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
home = getenv("HOME");
|
home = getenv("HOME");
|
||||||
@ -1626,7 +1626,7 @@ save_licence(unsigned char *data, int length)
|
|||||||
|
|
||||||
snprintf((char*)hi,16,g_hostname);
|
snprintf((char*)hi,16,g_hostname);
|
||||||
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
|
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
|
||||||
sec_hash_to_string(hash, 33, ho, 16);
|
sec_hash_to_string(hash, 40, ho, 20);
|
||||||
|
|
||||||
/* write licence to {sha1}.cal.new, then atomically
|
/* write licence to {sha1}.cal.new, then atomically
|
||||||
rename to {sha1}.cal */
|
rename to {sha1}.cal */
|
||||||
|
Loading…
Reference in New Issue
Block a user