Hello, <br><br>i am successfully integrated an openLDAP server with my openSER SIP proxy server. however i am facing a security problem. let me explain it briefly. <br><br><b>*** Successful Registration with password save as clear in openLDAP DB ****<br>

<br></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Configration #<br>- user name was stored in clear in openSER database<br>- modparam(&quot;auth&quot;, &quot;calculate_ha1&quot;, 1)
which means the server will assume that the
                <span>&quot;password_spec&quot;</span> pseudo-variable contains plaintext passwords
                and it will calculate HA1 strings on the fly.<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Senario #<br> - after the UAC receives Authentication request he will build the response = MD5(username + MD5(passowrd) + realm + nonce)<br>- then the server will build the challenge by searching the the user in the database and retrieving the password in clear then hash the password with MD5 build the challenge such that challenge=MD5(username + MD5(passowrd) + realm + nonce) . . <br>

- by comparing the the response the with the challenge the user will be authenticated.<br>- <b>it works </b><br>&nbsp;<br><br><b>*** Successful Registration with password save as MD5 in openLDAP DB ****<br><br></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Configration #<br>

- user name was stored in MD5 in openSER database<br>- modparam(&quot;auth&quot;, &quot;calculate_ha1&quot;, 0)
which means the server assumes the pseudo-variable contains the HA1 strings directly
                and will not calculate them.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Senario #<br> - after the UAC receives Authentication request he will build the response = MD5(username + MD5(password) + realm + nonce)<br>-
then the server will build the challenge by searching the the user in
the database and retrieving the password in MD5 then challenge such that challenge=MD5(username + MD5(password) + realm + nonce) . <br>- by comparing the the response the with the challenge the user will be authenticated.<br>


- <b>401 unauthorized !!!! <br><br></b><b>*** CONCLUSION ****<br><br></b>there for possible scenarios:<br>1- password clear + calculate_ha1= 0 ==&gt; 401 unauthorized !!!!<br>2- password clear + calculate_ha1= 1 ==&gt; Authorized<br>
3- password MD5&nbsp; + calculate_ha1= 0 ==&gt; 401 unauthorized !!!!<br>4- password  MD5&nbsp; + calculate_ha1= 1 ==&gt; 401 unauthorized !!!!<br><b><br></b>-----------------------------------------------------------------------------------------<br>
<b><br>asuumptions:<br><br>
</b>1- the password might be not hashed. if so then why&nbsp; modparam(&quot;auth&quot;, &quot;calculate_ha1&quot;, ) used? does it mean that the password might be received hashed or not?<br><u>2- in scenario(2) the sip server hash the password by setting calculate_ha1= 1. if the password is already hashed in the database then scenario(3) should work unless there is a conflict with the hash. is this might be related to hash type or size?</u> or something else that i do not know!!!<br>
<br><b>question</b>:<br><br>1- why scenario(3) does not work? where might be the problem?<br>2- what to do if i want to change the hash algorithm used? for example i need to SSH1 instead of MD5 because nowadays MD5&nbsp; is proved to be weak algorithm<br>
<br>regards,<br>Ahmed ALALI<br><br><br>