[JDEV] XDB_SQL: Problems with the stored "token" value in "users0k" table

Alexis Darnois alexis.darnois at terravirtual.net
Tue Apr 15 12:07:40 CDT 2003


Hi all,

About the "token" field written by XDB_SQL module  in the "users0k" table, it seems that the original token is transformed before
beeing inserted, the token is generated by this line in "mod_auth_0k.c" (line 94):

 sprintf(token,"%X",(int)time(NULL));

It generates an eight character string like "3E9C3557". When I look the stored value in the table , I have 10 bytes stored in the
"token" field converted in ASCII char because the "token" field type is "varchar". This stream has two bytes containing "08" hexa
code which is the  ASCII backspace character code.

When I looked at the "jabberd" debug  log after trying to connect in auth_ok  authentification mode, I saw this line :

Tue Apr 15 18:05:09 2003  xdb.c:52 xdb_results checking xdb packet <xdb type='result' to='sessions' from='user at jabber.mydomain'
ns='jabber:iq:auth:0k' id='41'><zerok><hash>set</hash><tokenx61@¡</token><sequence>[Ì</sequence></zerok></xdb>

Due to backspace character presence, the ">" of the <token> tag has disappeared. It provokes the jabberd server to refuse the
auth_ok authentification mode and switch to digest authentification mode.

Can someone tell me why I do not retrieve the  "mod_auth_0k.c" original created value in the "token" field of the "users0k" MySQL
table ?

Thanks in advance,

Alexis Darnois.




More information about the JDev mailing list