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:
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>
__________________