From: Michael H. <Mic...@we...> - 2011-12-16 11:37:52
|
Hello, I started with Seagull recently and I currently prepare some default SIP scenarios. No problems occured with basic call handling scenarios, but now I have a problem , when performing a REGISTER scenario with MD5 authentication. I have enhanced the dictionary by the following: - an external method "authentication", acc. to the documentation <external-method> <defmethod name="authentication" param="lib=lib_crypto.so;function=crypto_method"> </defmethod> </external-method> - a header field WWW-Authenticate (returned from server in 401 Unaithorized) with its parameters realm and nonce <fielddef name="www-authenticate"> <regexp name="www-auth" expr="[Ww][Ww][Ww]-[Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii][Cc][Aa][Tt][Ee][ ]*:[ ]*(.*)$" nbexpr="2" subexpr="1"> </regexp> </fielddef> <fielddef name="www-auth-realm"> <regexp name="www-auth-realm" expr="[Ww][Ww][Ww]-[Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii][Cc][Aa][Tt][Ee][ ]*:[ ]*Digest realm=\"([A-Za-z0-9.:_\-]*)\", nonce=\"([A-Za-z0-9]*)\", algorithm=MD5" nbexpr="3" subexpr="1"> </regexp> </fielddef> <fielddef name="www-auth-nonce"> <regexp name="www-auth-nonce" expr="[Ww][Ww][Ww]-[Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii][Cc][Aa][Tt][Ee][ ]*:[ ]*Digest realm=\"([A-Za-z0-9.:_\-]*)\", nonce=\"([A-Za-z0-9]*)\", algorithm=MD5" nbexpr="3" subexpr="2"> </regexp> </fielddef> - a header field Authorization (to be sent to the server in the second REGISTER as response to 401) <fielddef name="authorization"> <regexp name="authorization" expr="[Aa][Uu][Tt][Hh][Oo][Rr][Ii][Zz][Aa][Tt][Ii][Oo][Nn][ ]*:[ ]*(.*)$" nbexpr="2" subexpr="1"> </regexp> </fielddef> - may be, I need to add a field authorization-response as well, e.g. <fielddef name="auth-resp"> <regexp name="auth-resp" expr="[Aa][Uu][Tt][Hh][Oo][Rr][Ii][Zz][Aa][Tt][Ii][Oo][Nn][ ]*:[ ]*Digest username=\"([!-}]*@[A-Za-z0-9.:_-]*)\",realm=\"([A-Za-z0-9.:_-]*)\",nonce=\"([A-Za-z0-9]*)\",uri=\"sip:([A-Za-z0-9.:_-]*)\",response=\"([A-Za-z0-9]*)\",algorithm=MD5" nbexpr="6" subexpr="5"> </regexp> </fielddef> I want to generate the Authorization header with several parameters (userid, realm, nonce, response, algorithm) using the set-value method. The only tricky (and this is where I got stuck) is the response parameter: I need to take nonce from WWW-Autenticate header (has been stored as WWW_AUTH_NONCE) and the user's password (from an external file) and apply the MD5 algorithm with help from the authentcation method. I do not have an idea, how to do that. Can someone please provide me some hints, how to overcome this issue? Thanks in advance and kind regards, Michael ___________________________________________________________ SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192 |