Mercurial > pidgin.yaz
comparison libpurple/protocols/msn/msnutils.c @ 23300:5cdd93dac7a2
Delete trailing whitespace
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 06 Jun 2008 22:46:04 +0000 |
parents | 50e5ac417035 |
children | 1ac5faa72c8d |
comparison
equal
deleted
inserted
replaced
23299:b2f91d7d3427 | 23300:5cdd93dac7a2 |
---|---|
167 msn_encode_mime(const char *str) | 167 msn_encode_mime(const char *str) |
168 { | 168 { |
169 gchar *base64, *retval; | 169 gchar *base64, *retval; |
170 | 170 |
171 g_return_val_if_fail(str != NULL, NULL); | 171 g_return_val_if_fail(str != NULL, NULL); |
172 | 172 |
173 base64 = purple_base64_encode((guchar *)str, strlen(str)); | 173 base64 = purple_base64_encode((guchar *)str, strlen(str)); |
174 retval = g_strdup_printf("=?utf-8?B?%s?=", base64); | 174 retval = g_strdup_printf("=?utf-8?B?%s?=", base64); |
175 g_free(base64); | 175 g_free(base64); |
176 | 176 |
177 return retval; | 177 return retval; |
507 /* | 507 /* |
508 * Handle MSN Chanllege computation | 508 * Handle MSN Chanllege computation |
509 *This algorithm reference with http://msnpiki.msnfanatic.com/index.php/MSNP11:Challenges | 509 *This algorithm reference with http://msnpiki.msnfanatic.com/index.php/MSNP11:Challenges |
510 */ | 510 */ |
511 #define BUFSIZE 256 | 511 #define BUFSIZE 256 |
512 void | 512 void |
513 msn_handle_chl(char *input, char *output) | 513 msn_handle_chl(char *input, char *output) |
514 { | 514 { |
515 PurpleCipher *cipher; | 515 PurpleCipher *cipher; |
516 PurpleCipherContext *context; | 516 PurpleCipherContext *context; |
517 char *productKey = MSNP13_WLM_PRODUCT_KEY, | 517 char *productKey = MSNP13_WLM_PRODUCT_KEY, |
536 purple_cipher_context_digest(context, sizeof(md5Hash), md5Hash, NULL); | 536 purple_cipher_context_digest(context, sizeof(md5Hash), md5Hash, NULL); |
537 purple_cipher_context_destroy(context); | 537 purple_cipher_context_destroy(context); |
538 | 538 |
539 /* Split it into four integers */ | 539 /* Split it into four integers */ |
540 md5Parts = (unsigned int *)md5Hash; | 540 md5Parts = (unsigned int *)md5Hash; |
541 for(i=0; i<4; i++){ | 541 for(i=0; i<4; i++){ |
542 /* adjust endianess */ | 542 /* adjust endianess */ |
543 md5Parts[i] = GUINT_TO_LE(md5Parts[i]); | 543 md5Parts[i] = GUINT_TO_LE(md5Parts[i]); |
544 | 544 |
545 /* & each integer with 0x7FFFFFFF */ | 545 /* & each integer with 0x7FFFFFFF */ |
546 /* and save one unmodified array for later */ | 546 /* and save one unmodified array for later */ |
576 newHashParts[2]^=nHigh; | 576 newHashParts[2]^=nHigh; |
577 newHashParts[3]^=nLow; | 577 newHashParts[3]^=nLow; |
578 | 578 |
579 /* adjust endianness */ | 579 /* adjust endianness */ |
580 for(i=0; i<4; i++) | 580 for(i=0; i<4; i++) |
581 newHashParts[i] = GUINT_TO_LE(newHashParts[i]); | 581 newHashParts[i] = GUINT_TO_LE(newHashParts[i]); |
582 | 582 |
583 /* make a string of the parts */ | 583 /* make a string of the parts */ |
584 newHash = (unsigned char *)newHashParts; | 584 newHash = (unsigned char *)newHashParts; |
585 | 585 |
586 /* convert to hexadecimal */ | 586 /* convert to hexadecimal */ |