Raised This Month: $ Target: $400
 0% 

[SOLVED] XMPP Auth Problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 07-26-2013 , 04:24   Re: 0x00 in string
Reply With Quote #3

Ok.

The next problem how to encode this string to base64.
Im used encode64 function from this stock. With my edit:
Code:
/* Encodes a string to Base64 */ stock Encode64(const sString[], strLen, sResult[], len) {     new const cFillChar = '=';     new nLength = strLen;

Code:
#define USER        "[email protected]" #define PASSWORD    "12345"
Code:
new auth[512]     formatex(auth,511,"%c%s%c%s",0x00,USER,0x00,PASSWORD)     Encode64(auth,(strlen(USER)+strlen(PASSWORD))+2,auth,511)         server_print(" Encoded: %s",auth)     Decode64(auth,auth,511)     server_print(" Decoded: %s",auth)

Result:
Code:
 Encoded: AQEFRlJsSnNTbk5UYms1VVltczFWVmx0Y3pGVw==  Decoded: FRlJsSnNTbk5UYms1VVltczFW

XMPP Says:
Code:
<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><malformed-request/></failure>
__________________
The functional way is the right way

Last edited by GordonFreeman (RU); 07-26-2013 at 04:28.
GordonFreeman (RU) is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode