diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-16 12:31:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-16 12:31:41 +0000 |
commit | 49fc1a8b9b5858974f90b9d2ed14ba5442c8cbfc (patch) | |
tree | 0f2e69541ce8636e696459326872299a4c201489 /protocols/Yahoo/src/libyahoo2 | |
parent | 30ee89a6764a8d38a078374c6ed5de70635b42c0 (diff) |
mir_md5_byte_t => BYTE;
macros mir_base64_encode_bufsize for calculating buffer size
macros mir_base64_encodebuf for in-place base64 encoding
git-svn-id: http://svn.miranda-ng.org/main/trunk@5716 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo/src/libyahoo2')
-rw-r--r-- | protocols/Yahoo/src/libyahoo2/crypt.c | 24 | ||||
-rw-r--r-- | protocols/Yahoo/src/libyahoo2/libyahoo2.c | 12 |
2 files changed, 18 insertions, 18 deletions
diff --git a/protocols/Yahoo/src/libyahoo2/crypt.c b/protocols/Yahoo/src/libyahoo2/crypt.c index d8c50a08f6..b54456fd85 100644 --- a/protocols/Yahoo/src/libyahoo2/crypt.c +++ b/protocols/Yahoo/src/libyahoo2/crypt.c @@ -50,7 +50,7 @@ char *yahoo_crypt(char *key, char *salt) int buflen = 0;
int needed = 3 + strlen (salt) + 1 + 26 + 1;
- mir_md5_byte_t alt_result[16];
+ BYTE alt_result[16];
mir_md5_state_t ctx;
mir_md5_state_t alt_ctx;
int salt_len;
@@ -77,29 +77,29 @@ char *yahoo_crypt(char *key, char *salt) mir_md5_init(&ctx);
/* Add the key string. */
- mir_md5_append(&ctx, (mir_md5_byte_t *)key, (int)key_len);
+ mir_md5_append(&ctx, (BYTE *)key, (int)key_len);
/* Because the SALT argument need not always have the salt prefix we
add it separately. */
- mir_md5_append(&ctx, (mir_md5_byte_t *)md5_salt_prefix, sizeof (md5_salt_prefix) - 1);
+ mir_md5_append(&ctx, (BYTE *)md5_salt_prefix, sizeof (md5_salt_prefix) - 1);
/* The last part is the salt string. This must be at most 8
characters and it ends at the first `$' character (for
compatibility which existing solutions). */
- mir_md5_append(&ctx, (mir_md5_byte_t *)salt, (int)salt_len);
+ mir_md5_append(&ctx, (BYTE *)salt, (int)salt_len);
/* Compute alternate MD5 sum with input KEY, SALT, and KEY. The
final result will be added to the first context. */
mir_md5_init(&alt_ctx);
/* Add key. */
- mir_md5_append(&alt_ctx, (mir_md5_byte_t *)key, key_len);
+ mir_md5_append(&alt_ctx, (BYTE *)key, key_len);
/* Add salt. */
- mir_md5_append(&alt_ctx, (mir_md5_byte_t *)salt, salt_len);
+ mir_md5_append(&alt_ctx, (BYTE *)salt, salt_len);
/* Add key again. */
- mir_md5_append(&alt_ctx, (mir_md5_byte_t *)key, key_len);
+ mir_md5_append(&alt_ctx, (BYTE *)key, key_len);
/* Now get result of this (16 bytes) and add it to the other
context. */
@@ -118,7 +118,7 @@ char *yahoo_crypt(char *key, char *salt) bit the first character of the key. This does not seem to be
what was intended but we have to follow this to be compatible. */
for (cnt = key_len; cnt > 0; cnt >>= 1)
- mir_md5_append(&ctx, (cnt & 1) != 0 ? alt_result : (mir_md5_byte_t *)key, 1);
+ mir_md5_append(&ctx, (cnt & 1) != 0 ? alt_result : (BYTE *)key, 1);
/* Create intermediate result. */
mir_md5_finish(&ctx, alt_result);
@@ -132,23 +132,23 @@ char *yahoo_crypt(char *key, char *salt) /* Add key or last result. */
if ((cnt & 1) != 0)
- mir_md5_append(&ctx, (mir_md5_byte_t *)key, key_len);
+ mir_md5_append(&ctx, (BYTE *)key, key_len);
else
mir_md5_append(&ctx, alt_result, 16);
/* Add salt for numbers not divisible by 3. */
if (cnt % 3 != 0)
- mir_md5_append(&ctx, (mir_md5_byte_t *)salt, salt_len);
+ mir_md5_append(&ctx, (BYTE *)salt, salt_len);
/* Add key for numbers not divisible by 7. */
if (cnt % 7 != 0)
- mir_md5_append(&ctx, (mir_md5_byte_t *)key, key_len);
+ mir_md5_append(&ctx, (BYTE *)key, key_len);
/* Add key or last result. */
if ((cnt & 1) != 0)
mir_md5_append(&ctx, alt_result, 16);
else
- mir_md5_append(&ctx, (mir_md5_byte_t *)key, key_len);
+ mir_md5_append(&ctx, (BYTE *)key, key_len);
/* Create intermediate result. */
mir_md5_finish(&ctx, alt_result);
diff --git a/protocols/Yahoo/src/libyahoo2/libyahoo2.c b/protocols/Yahoo/src/libyahoo2/libyahoo2.c index 3da50e7b67..71b0fb4886 100644 --- a/protocols/Yahoo/src/libyahoo2/libyahoo2.c +++ b/protocols/Yahoo/src/libyahoo2/libyahoo2.c @@ -2397,7 +2397,7 @@ static void yahoo_process_auth_0x0f(struct yahoo_input_data *yid, const char *se char *response = NULL;
char url[1024];
char *c, *t;
- mir_md5_byte_t result[16];
+ BYTE result[16];
mir_md5_state_t ctx;
unsigned char *magic_hash = (unsigned char*) malloc(50); /* this one is like 26 bytes? */
int i;
@@ -2657,8 +2657,8 @@ LBL_FAILED: */
mir_md5_init(&ctx);
- mir_md5_append(&ctx, (mir_md5_byte_t *)crumb, strlen(crumb));
- mir_md5_append(&ctx, (mir_md5_byte_t *)seed, strlen(seed));
+ mir_md5_append(&ctx, (BYTE *)crumb, strlen(crumb));
+ mir_md5_append(&ctx, (BYTE *)seed, strlen(seed));
mir_md5_finish(&ctx, result);
to_y64(magic_hash, result, 16);
@@ -6477,17 +6477,17 @@ char *yahoo_ft7dc_send(int id, const char *buddy, YList *files) struct yahoo_packet *pkt = NULL;
char ft_token[32]; // we only need 23 chars actually
YList *l=files;
- mir_md5_byte_t result[16];
+ BYTE result[16];
mir_md5_state_t ctx;
if (!yid)
return NULL;
mir_md5_init(&ctx);
- mir_md5_append(&ctx, (mir_md5_byte_t *)buddy, strlen(buddy));
+ mir_md5_append(&ctx, (BYTE *)buddy, strlen(buddy));
snprintf(ft_token, 32, "%lu", time(NULL));
- mir_md5_append(&ctx, (mir_md5_byte_t *)ft_token, strlen(ft_token));
+ mir_md5_append(&ctx, (BYTE *)ft_token, strlen(ft_token));
mir_md5_finish(&ctx, result);
to_y64((unsigned char *)ft_token, result, 16);
|