[SOLVED] XMPP Auth Problem
Im working on XMPP client for my server.
For client authorization im must encode "\x00{username}\x00{password}" string. The problem is AMXX cuts string after 0x00 symbol. Code:
The strlen(auth) give me 0. How to do that? What i need to do for 0x00 do not cuting the string? |
Re: 0x00 in string
You can't, but you can manipulate that array as an array instead of a string.
|
Re: 0x00 in string
Ok.
The next problem how to encode this string to base64. Im used encode64 function from this stock. With my edit: Code:
Code:
Code:
Result: Code:
XMPP Says: Code:
|
Re: XMPP Auth Problem
Encode64(auth, ( strlen(USER) + strlen(PASSWORD) ) + 2, auth, 511)
Decode64(auth, auth, 511) These functions are making changes to the output string on-the-fly. This means you cannot use the same input as output. The only function that can be used like that is "format" if I'm not mistaken. This is my code and result: Code:
Code:
Encoded: AEJsYWNrUm9zZQBwYXNzd29yZA== |
Re: XMPP Auth Problem
Good! Thank you very much!
|
| All times are GMT -4. The time now is 06:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.