<div>Hello.<br></div><div>First of all thanks a lot for your great ssh client/server!</div><div>As for me, it isn&#39;t really &quot;totally wrong&quot; to call m_burn on the DROPBEAR_PASSWORD. It is really useful feature because when ssh session already established nobody can find correct password at /proc/pid/ environ ( Linux ) or pargs -e ( Solaris ).</div>
<div>So it will be great not just remove m_burn for DROPBEAR_PASSWORD but just move to any place, after authorization.</div><div><br></div><div>With regards,</div><div>Anton Pavlenko</div><br><div class="gmail_quote">On Tue, Dec 8, 2009 at 2:34 AM, Matt Johnston <span dir="ltr">&lt;<a href="mailto:matt@ucc.asn.au">matt@ucc.asn.au</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Anton,<br>
<br>
It certainly is wrong for it to be calling m_burn on the<br>
DROPBEAR_PASSWORD environment variable, I&#39;ll fix that. I&#39;m<br>
not totally sure what the correct behaviour for &quot;change<br>
password&quot; or other similar auth prompts is - perhaps<br>
DROPBEAR_PASSWORD should only be used for the first<br>
&quot;no-echo&quot; response.<br>
<br>
In keyboard interactive mode dbclient just gets given a<br>
series of &quot;ask the user this question, with echo off/on&quot;<br>
prompts from the server - it doesn&#39;t really know if it&#39;s<br>
being asked for the current password, a new password, or<br>
something totally different (like a token ID etc).<br>
<br>
Cheers,<br>
<font color="#888888">Matt<br>
</font><div><div class="h5"><br>
On Sat, Dec 05, 2009 at 08:18:11PM +0300, Antony Pavlenko wrote:<br>
&gt; Hello.<br>
&gt; There is rather unpleasant dbclient behavior when DROPBEAR_PASSWORD is used.<br>
&gt; Everything works great until password expiration is used.<br>
&gt; Then password is expired and you try to login wuth dbclient with DROPBEAR_PASSWORD than dbclient will change password to ffff . And there will be as much &#39;f&#39; symbols in new password as DROPBEAR_PASSWORD length.<br>

&gt;<br>
&gt; It works so because in recv_msg_userauth_info_request you call getpass_or_cancel and if DROPBEAR_PASSWORD is used it returns a pointer to the DROPBEAR_PASSWORD environment variable. And then you use m_burn to clear password value from the memory.<br>

&gt;<br>
&gt; here is the code :<br>
&gt;<br>
&gt; unsigned char* p = getpass_or_cancel(prompt);<br>
&gt; response = m_strdup(p);<br>
&gt; m_burn(p, strlen(p));<br>
&gt;<br>
&gt; But if this pass is correct and expired than host will ask dbclient to enter new one pass. dbclient will take DROPBEAR_PASSWORD again but now there is another pass, which was written by m_burn.<br>
&gt;<br>
&gt; I like very much DROPBEAR_PASSWORD feature and that dbclient can change expired password. Also it is great that nobody can dump password from environment variable.<br>
&gt;<br>
&gt; I don&#39;t know the best way to fix it and doesn&#39;t break this great<br>
&gt; feature. I can&#39;t say that I really understand dropbear code, but may be move m_burn for environment variable to the end of �recv_msg_userauth_specific_60, or any other place where authorization is really finished?<br>

&gt;<br>
&gt; With regards,<br>
&gt; --<br>
&gt; Anton Pavlenko<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>