<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/124312/">https://git.reviewboard.kde.org/r/124312/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On July 21st, 2015, 5:28 a.m. UTC, <b>Albert Vaca Cintora</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/124312/diff/3/?file=386055#file386055line28" style="color: black; font-weight: bold; text-decoration: underline;">core/backends/lan/server.h</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">28</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">class</span> <span class="nl">Server</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Can you add a comment explaining why did you have to extend QTcpServer? ie: why was not enough to just use it directly.</pre>
 </blockquote>



 <p>On July 21st, 2015, 9:38 p.m. UTC, <b>Vineet Garg</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">On using QTcpServer directly it binds QTcpSocket to native socket descriptor, setting SSL configuration to it is not possible. By using custom server QSslSocket is binded to native socket descriptor and QSslSocket is returned by nextPendingConnection instead of QTcpSocket.</p></pre>
 </blockquote>





 <p>On July 21st, 2015, 10:42 p.m. UTC, <b>Albert Vaca Cintora</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Add it as a comment in the code.</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Ok</p></pre>
<br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On July 21st, 2015, 5:28 a.m. UTC, <b>Albert Vaca Cintora</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/124312/diff/3/?file=386067#file386067line284" style="color: black; font-weight: bold; text-decoration: underline;">core/device.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void Device::addLink(const NetworkPackage& identityPackage, DeviceLink* link)</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">284</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> <span class="p">(</span><span class="n">identityPackage</span><span class="p">.</span><span class="n">has</span><span class="p">(</span><span class="s">"certificate"</span><span class="p">))</span> <span class="p">{</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">285</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">m_certificate</span> <span class="o">=</span> <span class="n">QSslCertificate</span><span class="p">(</span><span class="n">identityPackage</span><span class="p">.</span><span class="n">get</span><span class="o"><</span><span class="n">QByteArray</span><span class="o">></span><span class="p">(</span><span class="s">"certificate"</span><span class="p">));</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">286</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="p">}</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Should be done in the pairing handler.</pre>
 </blockquote>



 <p>On July 21st, 2015, 9:38 p.m. UTC, <b>Vineet Garg</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">But it's not related to pairing. It is how I set the certificate by adding it to identity package after handshake.</p></pre>
 </blockquote>





 <p>On July 21st, 2015, 10:42 p.m. UTC, <b>Albert Vaca Cintora</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The certificate is for SSL pairing what the public key is for non-SSL pairing. If the public key is managed by the handler, this should be as well, no?</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">We get a public key after pairing request, but we had a certificate as soon as their is a new connection.</p></pre>
<br />




<p>- Vineet</p>


<br />
<p>On July 19th, 2015, 4:33 p.m. UTC, Vineet Garg wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for kdeconnect.</div>
<div>By Vineet Garg.</div>


<p style="color: grey;"><i>Updated July 19, 2015, 4:33 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdeconnect-kde
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Similar to Android version, this SSL implementation supports old version also.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Certificate is generated when public key is generated using QCA, but used as QSslCertificate because QSslSocket don't like QCA certificate.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">A new server is written overriding QTcpServer for setting socket descriptor to QSslSocket.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">QSslSocket works as plain socket to transfer identity package and then either uses encrypted mode or normal mode according to the received package.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">If connetion is to be on SSL, new link is only added after successful handshake.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Certificate is embedded into identity package on start of encrypted mode and then set in device using it.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">PairingHandler is added like in Android version so that each LinkProvider manage pairing according to its own rules.</li>
</ul>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">P.S. : Uploaded the patch with some debug statements, will comment out them.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Working fine, tested using connection to Android devices.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Pairing handler needs to be tested using two LinkProvider, working fine with one, but there be some problems with two LinkProviders simultaneouly.</li>
</ul></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>cli/kdeconnect-cli.cpp <span style="color: grey">(3aa49e5)</span></li>

 <li>core/CMakeLists.txt <span style="color: grey">(dd8fedb)</span></li>

 <li>core/backends/lan/CMakeLists.txt <span style="color: grey">(7c5be38)</span></li>

 <li>core/backends/lan/downloadjob.h <span style="color: grey">(eeeab07)</span></li>

 <li>core/backends/lan/downloadjob.cpp <span style="color: grey">(bba2e98)</span></li>

 <li>core/backends/lan/landevicelink.h <span style="color: grey">(7d31881)</span></li>

 <li>core/backends/lan/landevicelink.cpp <span style="color: grey">(0987057)</span></li>

 <li>core/backends/lan/lanlinkprovider.h <span style="color: grey">(b379434)</span></li>

 <li>core/backends/lan/lanlinkprovider.cpp <span style="color: grey">(f5d2b22)</span></li>

 <li>core/backends/lan/lanpairinghandler.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>core/backends/lan/lanpairinghandler.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>core/backends/lan/server.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>core/backends/lan/server.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>core/backends/lan/socketlinereader.h <span style="color: grey">(b3be55a)</span></li>

 <li>core/backends/lan/socketlinereader.cpp <span style="color: grey">(a6bd85e)</span></li>

 <li>core/backends/lan/uploadjob.h <span style="color: grey">(12b6f7e)</span></li>

 <li>core/backends/lan/uploadjob.cpp <span style="color: grey">(b0d35fc)</span></li>

 <li>core/backends/linkprovider.h <span style="color: grey">(f4fc309)</span></li>

 <li>core/backends/pairinghandler.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>core/backends/pairinghandler.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>core/daemon.h <span style="color: grey">(674ca01)</span></li>

 <li>core/daemon.cpp <span style="color: grey">(af4c67b)</span></li>

 <li>core/device.h <span style="color: grey">(03f528c)</span></li>

 <li>core/device.cpp <span style="color: grey">(c2dc609)</span></li>

 <li>core/kdeconnectconfig.h <span style="color: grey">(af6c6df)</span></li>

 <li>core/kdeconnectconfig.cpp <span style="color: grey">(919505c)</span></li>

 <li>core/networkpackage.h <span style="color: grey">(6a0bf9c)</span></li>

 <li>core/networkpackage.cpp <span style="color: grey">(64cfab7)</span></li>

 <li>tests/CMakeLists.txt <span style="color: grey">(b00a574)</span></li>

 <li>tests/testsocketlinereader.cpp <span style="color: grey">(77a9b4b)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/124312/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>