Updated documentation and examples to include new ethernet library fork

This commit is contained in:
Noah Laptop 2019-06-13 19:38:48 -07:00
parent 5919696b89
commit 5d1c32d3c3
49 changed files with 70 additions and 64 deletions

View file

@ -133,7 +133,11 @@ If you need to clear a session, you can do so using the SSLSession::removeSessio
Some ideas that didn't quite fit in the API documentation.
### SSLClient with Ethernet
If you are using the [Arduino Ethernet library](https://github.com/arduino-libraries/Ethernet), you will need to modify the library to support the large buffer sizes required by SSL (detailed in [resources](#resources)). To do this, first find the location of the library in the directory where Arduino is installed (`C:\Program Files (x86)\Arduino` on Windows). Inside of this directory, navigate to `libraries\Ethernet\src` (`C:\Program Files (x86)\Arduino\libraries\Ethernet\src` on Windows). Modify `Ethernet.h` to replace these lines:
If you are using the [Arduino Ethernet library](https://github.com/arduino-libraries/Ethernet), you will need to modify the library to support the large buffer sizes required by SSL (detailed in [resources](#resources)). You can either modify the library yourself, or use [this fork of the Ethernet library with the modification](https://github.com/OPEnSLab-OSU/EthernetLarge). To use the fork, simply install the library using the "add a .zip library" button in Arduino, and replace `#include "Ethernet.h"` with `#include "EthernetLarge.h"` in your sketch. Alternatively if for some reason this solution does not work, you can apply the modification using the instructions below.
#### Manual Modification
First find the location of the library in the directory where Arduino is installed (`C:\Program Files (x86)\Arduino` on Windows). Inside of this directory, navigate to `libraries\Ethernet\src` (`C:\Program Files (x86)\Arduino\libraries\Ethernet\src` on Windows). Modify `Ethernet.h` to replace these lines:
```C++
...
// Configure the maximum number of sockets to support. W5100 chips can have

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>
@ -96,7 +96,7 @@ $(document).ready(function(){initNavTree('_s_s_l_client_8h_source.html','');});
<div class="ttc" id="class_s_s_l_client_html_af76a0df76834e0d0999dbf44c7c0a174"><div class="ttname"><a href="class_s_s_l_client.html#af76a0df76834e0d0999dbf44c7c0a174">SSLClient::remoteIP</a></div><div class="ttdeci">IPAddress remoteIP() override</div><div class="ttdoc">Returns the remote IP, if C::remoteIP exists. Else return INADDR_NONE.</div><div class="ttdef"><b>Definition:</b> SSLClient.h:343</div></div>
<div class="ttc" id="class_s_s_l_client_html_a6b8ff53c10fe34aab1dc2561410f70bb"><div class="ttname"><a href="class_s_s_l_client.html#a6b8ff53c10fe34aab1dc2561410f70bb">SSLClient::write</a></div><div class="ttdeci">size_t write(uint8_t b) override</div><div class="ttdef"><b>Definition:</b> SSLClient.h:165</div></div>
<div class="ttc" id="_s_s_l_client_impl_8h_html_ab658e6d84759440dbf3c890446075395a86c8fdfc38831619d5ed73dff5b0911d"><div class="ttname"><a href="_s_s_l_client_impl_8h.html#ab658e6d84759440dbf3c890446075395a86c8fdfc38831619d5ed73dff5b0911d">SSL_WARN</a></div><div class="ttdef"><b>Definition:</b> SSLClientImpl.h:65</div></div>
<div class="ttc" id="class_s_s_l_client_impl_html_ab4e38d4319ec504395d67d2ab21a639e"><div class="ttname"><a href="class_s_s_l_client_impl.html#ab4e38d4319ec504395d67d2ab21a639e">SSLClientImpl::get_session_impl</a></div><div class="ttdeci">SSLSession &amp; get_session_impl(const char *host, const IPAddress &amp;addr)</div><div class="ttdef"><b>Definition:</b> SSLClientImpl.cpp:280</div></div>
<div class="ttc" id="class_s_s_l_client_impl_html_ab4e38d4319ec504395d67d2ab21a639e"><div class="ttname"><a href="class_s_s_l_client_impl.html#ab4e38d4319ec504395d67d2ab21a639e">SSLClientImpl::get_session_impl</a></div><div class="ttdeci">SSLSession &amp; get_session_impl(const char *host, const IPAddress &amp;addr)</div><div class="ttdef"><b>Definition:</b> SSLClientImpl.cpp:294</div></div>
<div class="ttc" id="class_s_s_l_session_html"><div class="ttname"><a href="class_s_s_l_session.html">SSLSession</a></div><div class="ttdoc">This class stores values which allow SSLClient to save and resume SSL sessions.</div><div class="ttdef"><b>Definition:</b> SSLSession.h:52</div></div>
<div class="ttc" id="class_s_s_l_client_html_adab82ba09345fa070712d3124af30e1b"><div class="ttname"><a href="class_s_s_l_client.html#adab82ba09345fa070712d3124af30e1b">SSLClient::operator!=</a></div><div class="ttdeci">bool operator!=(const C &amp;rhs)</div><div class="ttdoc">Returns whether or not two SSLClient objects do not have the same underlying client object.</div><div class="ttdef"><b>Definition:</b> SSLClient.h:333</div></div>
<div class="ttc" id="class_s_s_l_client_html_a5d13fd2f32ee2ea65a1f3820f758e77e"><div class="ttname"><a href="class_s_s_l_client.html#a5d13fd2f32ee2ea65a1f3820f758e77e">SSLClient::available</a></div><div class="ttdeci">int available() override</div><div class="ttdoc">Returns the number of bytes available to read from the data that has been received and decrypted.</div><div class="ttdef"><b>Definition:</b> SSLClient.h:209</div></div>
@ -113,7 +113,7 @@ $(document).ready(function(){initNavTree('_s_s_l_client_8h_source.html','');});
<div class="ttc" id="class_s_s_l_client_html_a5f40f8f4d26d21e14276c3e8162b62b9"><div class="ttname"><a href="class_s_s_l_client.html#a5f40f8f4d26d21e14276c3e8162b62b9">SSLClient::operator==</a></div><div class="ttdeci">bool operator==(const C &amp;rhs)</div><div class="ttdoc">Returns whether or not two SSLClient objects have the same underlying client object.</div><div class="ttdef"><b>Definition:</b> SSLClient.h:331</div></div>
<div class="ttc" id="class_s_s_l_client_impl_html_a231b7b1bb2182cda1ed6e9d5ebf66afe"><div class="ttname"><a href="class_s_s_l_client_impl.html#a231b7b1bb2182cda1ed6e9d5ebf66afe">SSLClientImpl::read_impl</a></div><div class="ttdeci">int read_impl(uint8_t *buf, size_t size)</div><div class="ttdef"><b>Definition:</b> SSLClientImpl.cpp:196</div></div>
<div class="ttc" id="class_s_s_l_client_html_a9e7769fed78825cf4723778f4b5aa3e9"><div class="ttname"><a href="class_s_s_l_client.html#a9e7769fed78825cf4723778f4b5aa3e9">SSLClient::get_session_array</a></div><div class="ttdeci">SSLSession * get_session_array() override</div><div class="ttdoc">Returns an instance of the session array that is on the stack.</div><div class="ttdef"><b>Definition:</b> SSLClient.h:367</div></div>
<div class="ttc" id="class_s_s_l_client_impl_html_a6baed094969874fb9d2bea3a00ecbee1"><div class="ttname"><a href="class_s_s_l_client_impl.html#a6baed094969874fb9d2bea3a00ecbee1">SSLClientImpl::remove_session_impl</a></div><div class="ttdeci">void remove_session_impl(const char *host, const IPAddress &amp;addr)</div><div class="ttdef"><b>Definition:</b> SSLClientImpl.cpp:299</div></div>
<div class="ttc" id="class_s_s_l_client_impl_html_a6baed094969874fb9d2bea3a00ecbee1"><div class="ttname"><a href="class_s_s_l_client_impl.html#a6baed094969874fb9d2bea3a00ecbee1">SSLClientImpl::remove_session_impl</a></div><div class="ttdeci">void remove_session_impl(const char *host, const IPAddress &amp;addr)</div><div class="ttdef"><b>Definition:</b> SSLClientImpl.cpp:313</div></div>
<div class="ttc" id="class_s_s_l_client_html_a9c5001bdfa75ccc0d93cc60dd872b38a"><div class="ttname"><a href="class_s_s_l_client.html#a9c5001bdfa75ccc0d93cc60dd872b38a">SSLClient::get_arduino_client</a></div><div class="ttdeci">Client &amp; get_arduino_client() override</div><div class="ttdoc">Returns an instance of m_client that is polymorphic and can be used by SSLClientImpl.</div><div class="ttdef"><b>Definition:</b> SSLClient.h:364</div></div>
<div class="ttc" id="class_s_s_l_client_html_a563c5f9829757075bf16742cffa4cf73"><div class="ttname"><a href="class_s_s_l_client.html#a563c5f9829757075bf16742cffa4cf73">SSLClient::localPort</a></div><div class="ttdeci">uint16_t localPort() override</div><div class="ttdoc">Returns the local port, C::localPort exists. Else return 0.</div><div class="ttdef"><b>Definition:</b> SSLClient.h:335</div></div>
<div class="ttc" id="_s_s_l_client_impl_8h_html"><div class="ttname"><a href="_s_s_l_client_impl_8h.html">SSLClientImpl.h</a></div></div>
@ -131,7 +131,7 @@ $(document).ready(function(){initNavTree('_s_s_l_client_8h_source.html','');});
<div class="ttc" id="class_s_s_l_client_impl_html_a21ab78a0917f74ae5383d688e1548788"><div class="ttname"><a href="class_s_s_l_client_impl.html#a21ab78a0917f74ae5383d688e1548788">SSLClientImpl::flush_impl</a></div><div class="ttdeci">void flush_impl()</div><div class="ttdef"><b>Definition:</b> SSLClientImpl.cpp:223</div></div>
<div class="ttc" id="class_s_s_l_client_impl_html"><div class="ttname"><a href="class_s_s_l_client_impl.html">SSLClientImpl</a></div><div class="ttdoc">Implementation code to be inherited by SSLClient.</div><div class="ttdef"><b>Definition:</b> SSLClientImpl.h:71</div></div>
<div class="ttc" id="class_s_s_l_client_html_a5b626703a24089dbb0480a9b6ddf348c"><div class="ttname"><a href="class_s_s_l_client.html#a5b626703a24089dbb0480a9b6ddf348c">SSLClient::removeSession</a></div><div class="ttdeci">void removeSession(const char *host, const IPAddress &amp;addr)</div><div class="ttdoc">Clear the session corresponding to a host and IP.</div><div class="ttdef"><b>Definition:</b> SSLClient.h:311</div></div>
<div class="ttc" id="class_s_s_l_client_impl_html_a957984fa392550a7df86f758e9b14bfb"><div class="ttname"><a href="class_s_s_l_client_impl.html#a957984fa392550a7df86f758e9b14bfb">SSLClientImpl::connected_impl</a></div><div class="ttdeci">uint8_t connected_impl()</div><div class="ttdef"><b>Definition:</b> SSLClientImpl.cpp:254</div></div>
<div class="ttc" id="class_s_s_l_client_impl_html_a957984fa392550a7df86f758e9b14bfb"><div class="ttname"><a href="class_s_s_l_client_impl.html#a957984fa392550a7df86f758e9b14bfb">SSLClientImpl::connected_impl</a></div><div class="ttdeci">uint8_t connected_impl()</div><div class="ttdef"><b>Definition:</b> SSLClientImpl.cpp:263</div></div>
<div class="ttc" id="class_s_s_l_client_html_a2d8bf9b891151bc5b0b865d70cf9c086"><div class="ttname"><a href="class_s_s_l_client.html#a2d8bf9b891151bc5b0b865d70cf9c086">SSLClient::getSession</a></div><div class="ttdeci">SSLSession &amp; getSession(const char *host, const IPAddress &amp;addr)</div><div class="ttdoc">Gets a session reference corresponding to a host and IP, or a reference to a empty session if none ex...</div><div class="ttdef"><b>Definition:</b> SSLClient.h:301</div></div>
<div class="ttc" id="_s_s_l_client_impl_8h_html_ab658e6d84759440dbf3c890446075395"><div class="ttname"><a href="_s_s_l_client_impl_8h.html#ab658e6d84759440dbf3c890446075395">DebugLevel</a></div><div class="ttdeci">DebugLevel</div><div class="ttdoc">Level of verbosity used in logging for SSLClient.</div><div class="ttdef"><b>Definition:</b> SSLClientImpl.h:59</div></div>
<div class="ttc" id="class_s_s_l_client_html_afd6d7ae798c05cf566b2eb5651dba795"><div class="ttname"><a href="class_s_s_l_client.html#afd6d7ae798c05cf566b2eb5651dba795">SSLClient::read</a></div><div class="ttdeci">int read(uint8_t *buf, size_t size) override</div><div class="ttdoc">Read size bytes from the SSL client buffer, copying them into *buf, and return the number of bytes re...</div><div class="ttdef"><b>Definition:</b> SSLClient.h:237</div></div>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

File diff suppressed because one or more lines are too long

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>
@ -138,7 +138,9 @@ $(document).ready(function(){initNavTree('index.html','');});
<h2>Implementation Gotchas</h2>
<p>Some ideas that didn't quite fit in the API documentation.</p>
<h3><a class="el" href="class_s_s_l_client.html" title="The main SSLClient class. Check out README.md for more info.">SSLClient</a> with Ethernet</h3>
<p>If you are using the <a href="https://github.com/arduino-libraries/Ethernet">Arduino Ethernet library</a>, you will need to modify the library to support the large buffer sizes required by SSL (detailed in <a href="#resources">resources</a>). To do this, first find the location of the library in the directory where Arduino is installed (<code>C:\Program Files (x86)\Arduino</code> on Windows). Inside of this directory, navigate to <code>libraries\Ethernet\src</code> (<code>C:\Program Files (x86)\Arduino\libraries\Ethernet\src</code> on Windows). Modify <code>Ethernet.h</code> to replace these lines: </p><div class="fragment"><div class="line"> {C++}</div><div class="line">...</div><div class="line">// Configure the maximum number of sockets to support. W5100 chips can have</div><div class="line">// up to 4 sockets. W5200 &amp; W5500 can have up to 8 sockets. Several bytes</div><div class="line">// of RAM are used for each socket. Reducing the maximum can save RAM, but</div><div class="line">// you are limited to fewer simultaneous connections.</div><div class="line">#if defined(RAMEND) &amp;&amp; defined(RAMSTART) &amp;&amp; ((RAMEND - RAMSTART) &lt;= 2048)</div><div class="line">#define MAX_SOCK_NUM 4</div><div class="line">#else</div><div class="line">#define MAX_SOCK_NUM 8</div><div class="line">#endif</div><div class="line"></div><div class="line">// By default, each socket uses 2K buffers inside the Wiznet chip. If</div><div class="line">// MAX_SOCK_NUM is set to fewer than the chip&#39;s maximum, uncommenting</div><div class="line">// this will use larger buffers within the Wiznet chip. Large buffers</div><div class="line">// can really help with UDP protocols like Artnet. In theory larger</div><div class="line">// buffers should allow faster TCP over high-latency links, but this</div><div class="line">// does not always seem to work in practice (maybe Wiznet bugs?)</div><div class="line">//#define ETHERNET_LARGE_BUFFERS</div><div class="line">...</div></div><!-- fragment --><p> With this: </p><div class="fragment"><div class="line"> {C++}</div><div class="line">...</div><div class="line">// Configure the maximum number of sockets to support. W5100 chips can have</div><div class="line">// up to 4 sockets. W5200 &amp; W5500 can have up to 8 sockets. Several bytes</div><div class="line">// of RAM are used for each socket. Reducing the maximum can save RAM, but</div><div class="line">// you are limited to fewer simultaneous connections.</div><div class="line">#define MAX_SOCK_NUM 2</div><div class="line"></div><div class="line">// By default, each socket uses 2K buffers inside the Wiznet chip. If</div><div class="line">// MAX_SOCK_NUM is set to fewer than the chip&#39;s maximum, uncommenting</div><div class="line">// this will use larger buffers within the Wiznet chip. Large buffers</div><div class="line">// can really help with UDP protocols like Artnet. In theory larger</div><div class="line">// buffers should allow faster TCP over high-latency links, but this</div><div class="line">// does not always seem to work in practice (maybe Wiznet bugs?)</div><div class="line">#define ETHERNET_LARGE_BUFFERS</div><div class="line">...</div></div><!-- fragment --><p> You may need to use <code>sudo</code> or administrator permissions to make this modification. We change <code>MAX_SOCK_NUM</code> and <code>ETHERNET_LARGE_BUFFERS</code> so the Ethernet hardware can allocate a larger space for <a class="el" href="class_s_s_l_client.html" title="The main SSLClient class. Check out README.md for more info.">SSLClient</a>, however a downside of this modification is we are now only able to have two sockets concurrently. As most microprocessors barely have enough memory for one SSL connection, this limitation will rarely be encountered in practice.</p>
<p>If you are using the <a href="https://github.com/arduino-libraries/Ethernet">Arduino Ethernet library</a>, you will need to modify the library to support the large buffer sizes required by SSL (detailed in <a href="#resources">resources</a>). You can either modify the library yourself, or use <a href="https://github.com/OPEnSLab-OSU/EthernetLarge">this fork of the Ethernet library with the modification</a>. To use the fork, simply install the library using the "add a .zip library" button in Arduino, and replace <code>#include "Ethernet.h"</code> with <code>#include "EthernetLarge.h"</code> in your sketch. Alternatively if for some reason this solution does not work, you can apply the modification using the instructions below.</p>
<h4>Manual Modification</h4>
<p>First find the location of the library in the directory where Arduino is installed (<code>C:\Program Files (x86)\Arduino</code> on Windows). Inside of this directory, navigate to <code>libraries\Ethernet\src</code> (<code>C:\Program Files (x86)\Arduino\libraries\Ethernet\src</code> on Windows). Modify <code>Ethernet.h</code> to replace these lines: </p><div class="fragment"><div class="line"> {C++}</div><div class="line">...</div><div class="line">// Configure the maximum number of sockets to support. W5100 chips can have</div><div class="line">// up to 4 sockets. W5200 &amp; W5500 can have up to 8 sockets. Several bytes</div><div class="line">// of RAM are used for each socket. Reducing the maximum can save RAM, but</div><div class="line">// you are limited to fewer simultaneous connections.</div><div class="line">#if defined(RAMEND) &amp;&amp; defined(RAMSTART) &amp;&amp; ((RAMEND - RAMSTART) &lt;= 2048)</div><div class="line">#define MAX_SOCK_NUM 4</div><div class="line">#else</div><div class="line">#define MAX_SOCK_NUM 8</div><div class="line">#endif</div><div class="line"></div><div class="line">// By default, each socket uses 2K buffers inside the Wiznet chip. If</div><div class="line">// MAX_SOCK_NUM is set to fewer than the chip&#39;s maximum, uncommenting</div><div class="line">// this will use larger buffers within the Wiznet chip. Large buffers</div><div class="line">// can really help with UDP protocols like Artnet. In theory larger</div><div class="line">// buffers should allow faster TCP over high-latency links, but this</div><div class="line">// does not always seem to work in practice (maybe Wiznet bugs?)</div><div class="line">//#define ETHERNET_LARGE_BUFFERS</div><div class="line">...</div></div><!-- fragment --><p> With this: </p><div class="fragment"><div class="line"> {C++}</div><div class="line">...</div><div class="line">// Configure the maximum number of sockets to support. W5100 chips can have</div><div class="line">// up to 4 sockets. W5200 &amp; W5500 can have up to 8 sockets. Several bytes</div><div class="line">// of RAM are used for each socket. Reducing the maximum can save RAM, but</div><div class="line">// you are limited to fewer simultaneous connections.</div><div class="line">#define MAX_SOCK_NUM 2</div><div class="line"></div><div class="line">// By default, each socket uses 2K buffers inside the Wiznet chip. If</div><div class="line">// MAX_SOCK_NUM is set to fewer than the chip&#39;s maximum, uncommenting</div><div class="line">// this will use larger buffers within the Wiznet chip. Large buffers</div><div class="line">// can really help with UDP protocols like Artnet. In theory larger</div><div class="line">// buffers should allow faster TCP over high-latency links, but this</div><div class="line">// does not always seem to work in practice (maybe Wiznet bugs?)</div><div class="line">#define ETHERNET_LARGE_BUFFERS</div><div class="line">...</div></div><!-- fragment --><p> You may need to use <code>sudo</code> or administrator permissions to make this modification. We change <code>MAX_SOCK_NUM</code> and <code>ETHERNET_LARGE_BUFFERS</code> so the Ethernet hardware can allocate a larger space for <a class="el" href="class_s_s_l_client.html" title="The main SSLClient class. Check out README.md for more info.">SSLClient</a>, however a downside of this modification is we are now only able to have two sockets concurrently. As most microprocessors barely have enough memory for one SSL connection, this limitation will rarely be encountered in practice.</p>
<h3>Random Data</h3>
<p>The SSL protocol requires that <a class="el" href="class_s_s_l_client.html" title="The main SSLClient class. Check out README.md for more info.">SSLClient</a> generate some random bits before connecting with a server. BearSSL provides a random number generator but requires a <a href="https://bearssl.org/apidoc/bearssl__ssl_8h.html#a7d8e8de2afd49d6794eae02f56f81152">some entropy for a seed</a>. Normally this seed is generated by taking the microsecond time using the internal clock, however since most microcontrollers are not build with this feature another source must be found. As a simple solution, <a class="el" href="class_s_s_l_client.html" title="The main SSLClient class. Check out README.md for more info.">SSLClient</a> uses a floating analog pin as an external source of random data, passed through to the constructor in the <code>analog_pin</code> argument. Before every connection, <a class="el" href="class_s_s_l_client.html" title="The main SSLClient class. Check out README.md for more info.">SSLClient</a> will take the bottom byte from 16 analog reads on <code>analog_pin</code>, and combine these bytes into a 16 byte random number, which is used as a seed for BearSSL. To ensure the most random data, it is recommended that this analog pin be either floating or connected to a location not modifiable by the microcontroller (i.e. a battery voltage readout).</p>
<h3>Certificate Verification</h3>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -30,7 +30,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SSLClient
&#160;<span id="projectnumber">1.0</span>
&#160;<span id="projectnumber">v1.1.1</span>
</div>
<div id="projectbrief">Add TLS 1.2 functionality to any network library.</div>
</td>

View file

@ -14,11 +14,11 @@
*/
// NOTE: The Ethernet library MUST be modified to use this example!
// For more detailed instructions check out https://github.com/OPEnSLab-OSU/SSLClient#sslclient-with-ethernet
// NOTE: This example REQUIRES the EthernetLarge library.
// You can get it here: https://github.com/OPEnSLab-OSU/EthernetLarge
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetLarge.h>
#include <SSLClient.h>
#include "trust_anchors.h"

View file

@ -15,11 +15,11 @@
*/
// NOTE: The Ethernet library MUST be modified to use this example!
// For more detailed instructions check out https://github.com/OPEnSLab-OSU/SSLClient#sslclient-with-ethernet
// NOTE: This example REQUIRES the EthernetLarge library.
// You can get it here: https://github.com/OPEnSLab-OSU/EthernetLarge
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetLarge.h>
#include <SSLClient.h>
#include "trustanchors.h"
// Enter a MAC address for your controller below.

View file

@ -1,5 +1,5 @@
name=SSLClient
version=1.1
version=1.1.1
author=Noah Koontz <koontzn@oregonstate.edu>
maintainer=OPEnS Lab
sentence=Arduino library to add SSL functionality to any Client class