<div dir="ltr"><div><div><div><div><div><div><div><div>Hi Matt,<br><br></div>Thanks for the reply.<br><br></div>Things are working fine when I commented function &quot;buf_dss_verify&quot;. Actually majoriy of the time taken was in mp_exptmod()
routine with each call takes around 25 secs and because of this only openssh server is getting timeout. <br></div>As per your suggestion one of the solution is to merge tofastmath library but just for one function merging whole library is a hectic work though. Based on experiments i have couple of questions:<br></div>1)  dropbear ssh client is working by commenting out the function &quot;buf_dss_verify&quot;. Is it ok for me to take this as workaround and continue or this can cause any serious problem further?<br></div>2) Is there any other solution to improve the speed of calculations in function &quot;mp_exptmod()&quot; only? <br><br></div>Appreciate your response.<br><br></div>Thanks<br></div>Pratik <br> </div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 24, 2014 at 8:02 PM, Matt Johnston <span dir="ltr">&lt;<a href="mailto:matt@ucc.asn.au" target="_blank">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 Pratik,<br>
<br>
I&#39;m assuming that it is the session timeout that&#39;s causing<br>
the disconnection.  The log on the OpenSSH server should<br>
confirm that.<br>
<br>
I think the only real solution would be to improve the speed<br>
of libtommath on that device. Running a profiler to<br>
determine the slowest parts would be the first step. I don&#39;t<br>
know much about the device itself though it seems libtommath<br>
performs quite badly - OpenSSL is generally faster. Looking<br>
at the difference in its maths operations might help. It&#39;s<br>
non-trivial work though.<br>
<br>
Cheers,<br>
Matt<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, Sep 24, 2014 at 02:12:41PM +0530, pratik singh wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I am using Dropbear 0.48 with uClinux-dist. Currently dropbear server is<br>
&gt; working fine but while trying to run dbclient it throws write error. Some<br>
&gt; of the traces are:<br>
&gt;<br>
&gt; TRACE: leave process_packet<br>
&gt; TRACE: enter cli_sessionloop<br>
&gt; TRACE: enter send_msg_service_request: servicename=&#39;ssh-userauth&#39;<br>
&gt; TRACE: enter encrypt_packet()<br>
&gt; TRACE: encrypt_packet type is 5<br>
&gt;<br>
&gt; TRACE: enter writemac<br>
&gt; TRACE: leave writemac<br>
&gt; TRACE: enter enqueue<br>
&gt; TRACE: leave enqueue<br>
&gt; TRACE: leave encrypt_packet()<br>
&gt; TRACE: leave send_msg_service_request<br>
&gt; TRACE: leave cli_sessionloop: sent userauth service req<br>
&gt; TRACE: enter write_packet<br>
&gt;<br>
&gt; TRACE: enter cli_tty_cleanup<br>
&gt; TRACE: leave cli_tty_cleanup: not in raw mode<br>
&gt; TRACE: enter session_cleanup<br>
&gt; TRACE: enter chancleanup<br>
&gt; TRACE: leave chancleanup<br>
&gt; TRACE: leave session_cleanup<br>
&gt; dbclient: connection to <a href="http://pratik@10.10.10.1:22" target="_blank">pratik@10.10.10.1:22</a> exited: error writing<br>
&gt; --------------------------------------------------------------------------------------------------------------<br>
&gt;<br>
&gt; I have tried the following:<br>
&gt; 1) Run dbclient with -K option but still getting the same write error<br>
&gt; 2) Run dbclient with -y option but still getting the same write error<br>
&gt;<br>
&gt; On further debugging I have found that this write comes because server (in<br>
&gt; this case Openssh) is getting timeout.<br>
&gt;<br>
&gt; I am running microblaze processor at about 60mhz with hardware<br>
&gt; multiplier, divider enabled.<br>
&gt;<br>
&gt;<br>
&gt; From the wireshark capture i have seen that server is sending &quot;FIN&quot;<br>
&gt; packet. also server is sending the 2 ssh packets in one reply packet.<br>
&gt; Do not know the reason of this behavior.<br>
&gt;<br>
&gt;<br>
&gt; I am facing this problem for connection between dbclient &lt;----&gt; Openssh.<br>
&gt;<br>
&gt;<br>
&gt; Please help as m stuck to this problem since very long. Appreciate your reply.<br>
&gt;<br>
&gt;<br>
&gt; Attached the pcap file for your reference. apply &quot;ip.addr==10.216.114.137&quot;<br>
&gt; filter in pcap file. IP address is client having dbclient and other is<br>
&gt; server having openssh.<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Thanks &amp; Regards<br>
&gt; Pratik Singh<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Thanks &amp; Regards<br>Pratik Singh<br>
</div>