Run indentation script.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1658 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
4dc2ce1a6a
commit
cdce9aae75
@ -104,8 +104,7 @@ licence_send_request(uint8 * client_random, uint8 * rsa_data, char *user, char *
|
||||
uint16 userlen = strlen(user) + 1;
|
||||
uint16 hostlen = strlen(host) + 1;
|
||||
uint16 length =
|
||||
24 + SEC_RANDOM_SIZE + SEC_MODULUS_SIZE + SEC_PADDING_SIZE +
|
||||
userlen + hostlen;
|
||||
24 + SEC_RANDOM_SIZE + SEC_MODULUS_SIZE + SEC_PADDING_SIZE + userlen + hostlen;
|
||||
STREAM s;
|
||||
|
||||
s = sec_init(sec_flags, length + 2);
|
||||
|
12
rdesktop.c
12
rdesktop.c
@ -1557,7 +1557,8 @@ mkdir_p(const char *path, int mask)
|
||||
if (res != 0)
|
||||
return res;
|
||||
|
||||
} while ((ptok = strtok(NULL, "/")) != NULL);
|
||||
}
|
||||
while ((ptok = strtok(NULL, "/")) != NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1578,16 +1579,14 @@ load_licence(unsigned char **data)
|
||||
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
|
||||
sec_hash_to_string(hash, 40, ho, 22);
|
||||
|
||||
snprintf(path, PATH_MAX, "%s"RDESKTOP_LICENSE_STORE"/%s.cal",
|
||||
home, hash);
|
||||
snprintf(path, PATH_MAX, "%s" RDESKTOP_LICENSE_STORE "/%s.cal", home, hash);
|
||||
path[sizeof(path) - 1] = '\0';
|
||||
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd == -1)
|
||||
{
|
||||
/* fallback to try reading old license file */
|
||||
snprintf(path, PATH_MAX, "%s/.rdesktop/license.%s",
|
||||
home, g_hostname);
|
||||
snprintf(path, PATH_MAX, "%s/.rdesktop/license.%s", home, g_hostname);
|
||||
path[sizeof(path) - 1] = '\0';
|
||||
if ((fd = open(path, O_RDONLY)) == -1)
|
||||
return -1;
|
||||
@ -1630,8 +1629,7 @@ save_licence(unsigned char *data, int length)
|
||||
|
||||
/* write licence to {sha1}.cal.new, then atomically
|
||||
rename to {sha1}.cal */
|
||||
snprintf(path, PATH_MAX, "%s"RDESKTOP_LICENSE_STORE"/%s.cal",
|
||||
home, hash);
|
||||
snprintf(path, PATH_MAX, "%s" RDESKTOP_LICENSE_STORE "/%s.cal", home, hash);
|
||||
path[sizeof(path) - 1] = '\0';
|
||||
|
||||
snprintf(tmppath, PATH_MAX, "%s.new", path);
|
||||
|
6
secure.c
6
secure.c
@ -114,7 +114,8 @@ sec_hash_16(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2)
|
||||
/*
|
||||
* 16-byte sha1 hash
|
||||
*/
|
||||
void sec_hash_sha1_16(uint8 * out, uint8 * in, uint8 *salt1)
|
||||
void
|
||||
sec_hash_sha1_16(uint8 * out, uint8 * in, uint8 * salt1)
|
||||
{
|
||||
SSL_SHA1 sha1;
|
||||
ssl_sha1_init(&sha1);
|
||||
@ -124,7 +125,8 @@ void sec_hash_sha1_16(uint8 * out, uint8 * in, uint8 *salt1)
|
||||
}
|
||||
|
||||
/* create string from hash */
|
||||
void sec_hash_to_string(char * out, int out_size, uint8 * in, int in_size)
|
||||
void
|
||||
sec_hash_to_string(char *out, int out_size, uint8 * in, int in_size)
|
||||
{
|
||||
int k;
|
||||
memset(out, 0, out_size);
|
||||
|
Loading…
Reference in New Issue
Block a user