From 28e1555e762e57f9e26bfb7fc5709ac2a4b5f2a1 Mon Sep 17 00:00:00 2001 From: Noah Laptop Date: Mon, 20 May 2019 16:15:08 -0700 Subject: [PATCH] removed virtual, added override specifiers, regenerated documentation --- docs/html/_s_s_l_client_8h_source.html | 52 +-- docs/html/class_s_s_l_client-members.html | 52 +-- docs/html/class_s_s_l_client.html | 378 +++++++++--------- docs/html/class_s_s_l_client.js | 52 +-- docs/html/class_s_s_l_client_impl.html | 50 +-- docs/html/functions.html | 38 +- docs/html/functions_func.html | 38 +- docs/html/index.html | 6 +- ...ibraries__s_s_l_client__trust_anchors.html | 2 +- docs/html/navtreeindex0.js | 52 +-- docs/html/search/all_1.js | 2 +- docs/html/search/all_11.js | 2 +- docs/html/search/all_3.js | 4 +- docs/html/search/all_6.js | 2 +- docs/html/search/all_7.js | 8 +- docs/html/search/all_9.js | 2 +- docs/html/search/all_b.js | 6 +- docs/html/search/all_c.js | 2 +- docs/html/search/all_d.js | 8 +- docs/html/search/all_e.js | 2 +- docs/html/search/functions_0.js | 2 +- docs/html/search/functions_2.js | 4 +- docs/html/search/functions_3.js | 2 +- docs/html/search/functions_4.js | 8 +- docs/html/search/functions_6.js | 2 +- docs/html/search/functions_8.js | 6 +- docs/html/search/functions_9.js | 2 +- docs/html/search/functions_a.js | 8 +- docs/html/search/functions_b.js | 2 +- docs/html/search/functions_d.js | 2 +- src/SSLClient.h | 52 +-- 31 files changed, 424 insertions(+), 424 deletions(-) diff --git a/docs/html/_s_s_l_client_8h_source.html b/docs/html/_s_s_l_client_8h_source.html index b5a6df8..399ab6a 100644 --- a/docs/html/_s_s_l_client_8h_source.html +++ b/docs/html/_s_s_l_client_8h_source.html @@ -91,51 +91,51 @@ $(document).ready(function(){initNavTree('_s_s_l_client_8h_source.html','');});
SSLClient.h
-Go to the documentation of this file.
1 /* Copyright 2019 OSU OPEnS Lab
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy of this
4  * software and associated documentation files (the "Software"), to deal in the Software
5  * without restriction, including without limitation the rights to use, copy, modify,
6  * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7  * permit persons to whom the Software is furnished to do so, subject to the following
8  * conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in all
11  * copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
15  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
16  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
21 #include <type_traits>
22 #include "Client.h"
23 #include "SSLClientImpl.h"
24 #include "SSLSession.h"
25 
26 #ifndef SSLClient_H_
27 #define SSLClient_H_
28 
34 template <class C, size_t SessionCache = 1>
35 class SSLClient : public SSLClientImpl {
36 /*
37  * static checks
38  * I'm a java developer, so I want to ensure that my inheritance is safe.
39  * These checks ensure that all the functions we use on class C are
40  * actually present on class C. It does this by checking that the
41  * class inherits from Client.
42  *
43  * Additionally, I ran into a lot of memory issues with large sessions caches.
44  * Since each session contains at max 352 bytes of memory, they eat of the
45  * stack quite quickly and can cause overflows. As a result, I have added a
46  * warning here to discourage the use of more than 3 sessions at a time. Any
47  * amount past that will require special modification of this library, and
48  * assumes you know what you are doing.
49  */
50 static_assert(std::is_base_of<Client, C>::value, "SSLClient can only accept a type with base class Client!");
51 static_assert(SessionCache > 0 && SessionCache < 255, "There can be no less than one and no more than 255 sessions in the cache!");
52 static_assert(SessionCache <= 3, "You need to decrease the size of m_iobuf in order to have more than 3 sessions at once, otherwise memory issues will occur.");
53 
54 public:
71  explicit SSLClient(const C& client, const br_x509_trust_anchor *trust_anchors, const size_t trust_anchors_num, const int analog_pin, const DebugLevel debug = SSL_WARN)
72  : SSLClientImpl(trust_anchors, trust_anchors_num, analog_pin, debug)
73  , m_client(client)
74  , m_sessions{SSLSession()}
75  {
76  // set the timeout to a reasonable number (it can always be changes later)
77  // SSL Connections take a really long time so we don't want to time out a legitimate thing
78  setTimeout(10 * 1000);
79  }
80 
81  //========================================
82  //= Functions implemented in SSLClientImpl
83  //========================================
84 
124  virtual int connect(IPAddress ip, uint16_t port) { return connect_impl(ip, port); }
125 
162  virtual int connect(const char *host, uint16_t port) { return connect_impl(host, port); }
163 
165  virtual size_t write(uint8_t b) { return write_impl(&b, 1); }
189  virtual size_t write(const uint8_t *buf, size_t size) { return write_impl(buf, size); }
190 
209  virtual int available() { return available_impl(); }
210 
215  virtual int read() { uint8_t read_val; return read(&read_val, 1) > 0 ? read_val : -1; };
237  virtual int read(uint8_t *buf, size_t size) { return read_impl(buf, size); }
238 
247  virtual int peek() { return peek_impl(); }
248 
256  virtual void flush() { return flush_impl(); }
257 
266  virtual void stop() { return stop_impl(); }
267 
280  virtual uint8_t connected() { return connected_impl(); }
281 
282  //========================================
283  //= Functions Not in the Client Interface
284  //========================================
285 
300  virtual SSLSession& getSession(const char* host, const IPAddress& addr) { return get_session_impl(host, addr); }
301 
310  virtual void removeSession(const char* host, const IPAddress& addr) { return remove_session_impl(host, addr); }
311 
317  virtual size_t getSessionCount() const { return SessionCache; }
318 
324  virtual operator bool() { return connected() > 0; }
326  virtual bool operator==(const bool value) { return bool() == value; }
328  virtual bool operator!=(const bool value) { return bool() != value; }
330  virtual bool operator==(const C& rhs) { return m_client == rhs; }
332  virtual bool operator!=(const C& rhs) { return m_client != rhs; }
334  virtual uint16_t localPort() {
335  if (std::is_member_function_pointer<decltype(&C::localPort)>::value) return m_client.localPort();
336  else {
337  m_warn("Client class has no localPort function, so localPort() will always return 0", __func__);
338  return 0;
339  }
340  }
342  virtual IPAddress remoteIP() {
343  if (std::is_member_function_pointer<decltype(&C::remoteIP)>::value) return m_client.remoteIP();
344  else {
345  m_warn("Client class has no remoteIP function, so remoteIP() will always return INADDR_NONE. This means that sessions caching will always be disabled.", __func__);
346  return INADDR_NONE;
347  }
348  }
350  virtual uint16_t remotePort() {
351  if (std::is_member_function_pointer<decltype(&C::remotePort)>::value) return m_client.remotePort();
352  else {
353  m_warn("Client class has no remotePort function, so remotePort() will always return 0", __func__);
354  return 0;
355  }
356  }
357 
359  C& getClient() { return m_client; }
360 
361 protected:
363  virtual Client& get_arduino_client() { return m_client; }
364  virtual const Client& get_arduino_client() const { return m_client; }
366  virtual SSLSession* get_session_array() { return m_sessions; }
367  virtual const SSLSession* get_session_array() const { return m_sessions; }
368 
369 private:
370  // create a copy of the client
371  C m_client;
372  // also store an array of SSLSessions, so we can resume communication with multiple websites
373  SSLSession m_sessions[SessionCache];
374 };
375 
376 #endif
virtual uint8_t connected()
Check if the device is connected.
Definition: SSLClient.h:280
-
virtual bool operator!=(const bool value)
Definition: SSLClient.h:328
-
size_t write_impl(const uint8_t *buf, size_t size)
Definition: SSLClientImpl.cpp:130
-
virtual const SSLSession * get_session_array() const
Definition: SSLClient.h:367
-
virtual uint16_t remotePort()
Returns the remote port, if C::remotePort exists. Else return 0.
Definition: SSLClient.h:350
+Go to the documentation of this file.
1 /* Copyright 2019 OSU OPEnS Lab
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy of this
4  * software and associated documentation files (the "Software"), to deal in the Software
5  * without restriction, including without limitation the rights to use, copy, modify,
6  * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7  * permit persons to whom the Software is furnished to do so, subject to the following
8  * conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in all
11  * copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
15  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
16  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
21 #include <type_traits>
22 #include "Client.h"
23 #include "SSLClientImpl.h"
24 #include "SSLSession.h"
25 
26 #ifndef SSLClient_H_
27 #define SSLClient_H_
28 
34 template <class C, size_t SessionCache = 1>
35 class SSLClient : public SSLClientImpl {
36 /*
37  * static checks
38  * I'm a java developer, so I want to ensure that my inheritance is safe.
39  * These checks ensure that all the functions we use on class C are
40  * actually present on class C. It does this by checking that the
41  * class inherits from Client.
42  *
43  * Additionally, I ran into a lot of memory issues with large sessions caches.
44  * Since each session contains at max 352 bytes of memory, they eat of the
45  * stack quite quickly and can cause overflows. As a result, I have added a
46  * warning here to discourage the use of more than 3 sessions at a time. Any
47  * amount past that will require special modification of this library, and
48  * assumes you know what you are doing.
49  */
50 static_assert(std::is_base_of<Client, C>::value, "SSLClient can only accept a type with base class Client!");
51 static_assert(SessionCache > 0 && SessionCache < 255, "There can be no less than one and no more than 255 sessions in the cache!");
52 static_assert(SessionCache <= 3, "You need to decrease the size of m_iobuf in order to have more than 3 sessions at once, otherwise memory issues will occur.");
53 
54 public:
71  explicit SSLClient(const C& client, const br_x509_trust_anchor *trust_anchors, const size_t trust_anchors_num, const int analog_pin, const DebugLevel debug = SSL_WARN)
72  : SSLClientImpl(trust_anchors, trust_anchors_num, analog_pin, debug)
73  , m_client(client)
74  , m_sessions{SSLSession()}
75  {
76  // set the timeout to a reasonable number (it can always be changes later)
77  // SSL Connections take a really long time so we don't want to time out a legitimate thing
78  setTimeout(10 * 1000);
79  }
80 
81  //========================================
82  //= Functions implemented in SSLClientImpl
83  //========================================
84 
124  int connect(IPAddress ip, uint16_t port) override { return connect_impl(ip, port); }
125 
162  int connect(const char *host, uint16_t port) override { return connect_impl(host, port); }
163 
165  size_t write(uint8_t b) override { return write_impl(&b, 1); }
189  size_t write(const uint8_t *buf, size_t size) override { return write_impl(buf, size); }
190 
209  int available() override { return available_impl(); }
210 
215  int read() override { uint8_t read_val; return read(&read_val, 1) > 0 ? read_val : -1; };
237  int read(uint8_t *buf, size_t size) override { return read_impl(buf, size); }
238 
247  int peek() override { return peek_impl(); }
248 
256  void flush() override { return flush_impl(); }
257 
266  void stop() override { return stop_impl(); }
267 
280  uint8_t connected() override { return connected_impl(); }
281 
282  //========================================
283  //= Functions Not in the Client Interface
284  //========================================
285 
300  SSLSession& getSession(const char* host, const IPAddress& addr) { return get_session_impl(host, addr); }
301 
310  void removeSession(const char* host, const IPAddress& addr) { return remove_session_impl(host, addr); }
311 
317  size_t getSessionCount() const override { return SessionCache; }
318 
324  operator bool() { return connected() > 0; }
326  bool operator==(const bool value) { return bool() == value; }
328  bool operator!=(const bool value) { return bool() != value; }
330  bool operator==(const C& rhs) { return m_client == rhs; }
332  bool operator!=(const C& rhs) { return m_client != rhs; }
334  uint16_t localPort() override {
335  if (std::is_member_function_pointer<decltype(&C::localPort)>::value) return m_client.localPort();
336  else {
337  m_warn("Client class has no localPort function, so localPort() will always return 0", __func__);
338  return 0;
339  }
340  }
342  IPAddress remoteIP() override {
343  if (std::is_member_function_pointer<decltype(&C::remoteIP)>::value) return m_client.remoteIP();
344  else {
345  m_warn("Client class has no remoteIP function, so remoteIP() will always return INADDR_NONE. This means that sessions caching will always be disabled.", __func__);
346  return INADDR_NONE;
347  }
348  }
350  uint16_t remotePort() override {
351  if (std::is_member_function_pointer<decltype(&C::remotePort)>::value) return m_client.remotePort();
352  else {
353  m_warn("Client class has no remotePort function, so remotePort() will always return 0", __func__);
354  return 0;
355  }
356  }
357 
359  C& getClient() { return m_client; }
360 
361 protected:
363  Client& get_arduino_client() override { return m_client; }
364  const Client& get_arduino_client() const override { return m_client; }
366  SSLSession* get_session_array() override { return m_sessions; }
367  const SSLSession* get_session_array() const override { return m_sessions; }
368 
369 private:
370  // create a copy of the client
371  C m_client;
372  // also store an array of SSLSessions, so we can resume communication with multiple websites
373  SSLSession m_sessions[SessionCache];
374 };
375 
376 #endif
size_t write_impl(const uint8_t *buf, size_t size)
Definition: SSLClientImpl.cpp:130
+
const SSLSession * get_session_array() const override
Definition: SSLClient.h:367
+
IPAddress remoteIP() override
Returns the remote IP, if C::remoteIP exists. Else return INADDR_NONE.
Definition: SSLClient.h:342
+
size_t write(uint8_t b) override
Definition: SSLClient.h:165
Definition: SSLClientImpl.h:65
SSLSession & get_session_impl(const char *host, const IPAddress &addr)
Definition: SSLClientImpl.cpp:276
-
virtual int available()
Returns the number of bytes available to read from the data that has been received and decrypted.
Definition: SSLClient.h:209
This class stores values which allow SSLClient to save and resume SSL sessions.
Definition: SSLSession.h:52
-
virtual uint16_t localPort()
Returns the local port, C::localPort exists. Else return 0.
Definition: SSLClient.h:334
-
virtual IPAddress remoteIP()
Returns the remote IP, if C::remoteIP exists. Else return INADDR_NONE.
Definition: SSLClient.h:342
+
bool operator!=(const C &rhs)
Returns whether or not two SSLClient objects do not have the same underlying client object.
Definition: SSLClient.h:332
+
int available() override
Returns the number of bytes available to read from the data that has been received and decrypted.
Definition: SSLClient.h:209
C & getClient()
Returns a reference to the client object stored in this class. Take care not to break it.
Definition: SSLClient.h:359
-
virtual int peek()
View the first byte of the buffer, without removing it from the SSLClient Buffer.
Definition: SSLClient.h:247
int peek_impl()
Definition: SSLClientImpl.cpp:209
-
virtual SSLSession & getSession(const char *host, const IPAddress &addr)
Gets a session reference corresponding to a host and IP, or a reference to a empty session if none ex...
Definition: SSLClient.h:300
-
virtual size_t write(const uint8_t *buf, size_t size)
Write some bytes to the SSL connection.
Definition: SSLClient.h:189
+
void flush() override
Force writing the buffered bytes from SSLClient::write to the network.
Definition: SSLClient.h:256
The main SSLClient class. Check out README.md for more info.
Definition: SSLClient.h:35
+
bool operator!=(const bool value)
Definition: SSLClient.h:328
+
void stop() override
Close the connection.
Definition: SSLClient.h:266
+
size_t write(const uint8_t *buf, size_t size) override
Write some bytes to the SSL connection.
Definition: SSLClient.h:189
SSLClient(const C &client, const br_x509_trust_anchor *trust_anchors, const size_t trust_anchors_num, const int analog_pin, const DebugLevel debug=SSL_WARN)
Initialize SSLClient with all of the prerequisites needed.
Definition: SSLClient.h:71
-
virtual void stop()
Close the connection.
Definition: SSLClient.h:266
+
int peek() override
View the first byte of the buffer, without removing it from the SSLClient Buffer.
Definition: SSLClient.h:247
int available_impl()
Definition: SSLClientImpl.cpp:173
+
bool operator==(const C &rhs)
Returns whether or not two SSLClient objects have the same underlying client object.
Definition: SSLClient.h:330
int read_impl(uint8_t *buf, size_t size)
Definition: SSLClientImpl.cpp:194
+
SSLSession * get_session_array() override
Returns an instance of the session array that is on the stack.
Definition: SSLClient.h:366
void remove_session_impl(const char *host, const IPAddress &addr)
Definition: SSLClientImpl.cpp:295
-
virtual size_t getSessionCount() const
Get the maximum number of SSL sessions that can be stored at once.
Definition: SSLClient.h:317
-
virtual int read()
Read a single byte, or -1 if none is available.
Definition: SSLClient.h:215
-
virtual size_t write(uint8_t b)
Definition: SSLClient.h:165
+
Client & get_arduino_client() override
Returns an instance of m_client that is polymorphic and can be used by SSLClientImpl.
Definition: SSLClient.h:363
+
uint16_t localPort() override
Returns the local port, C::localPort exists. Else return 0.
Definition: SSLClient.h:334
void m_warn(const T str, const char *func_name) const
Definition: SSLClientImpl.h:153
-
virtual bool operator==(const bool value)
Definition: SSLClient.h:326
-
virtual void flush()
Force writing the buffered bytes from SSLClient::write to the network.
Definition: SSLClient.h:256
-
virtual const Client & get_arduino_client() const
Definition: SSLClient.h:364
-
virtual int connect(const char *host, uint16_t port)
Connect over SSL to a host specified by a hostname.
Definition: SSLClient.h:162
-
virtual SSLSession * get_session_array()
Returns an instance of the session array that is on the stack.
Definition: SSLClient.h:366
+
int read() override
Read a single byte, or -1 if none is available.
Definition: SSLClient.h:215
+
uint8_t connected() override
Check if the device is connected.
Definition: SSLClient.h:280
-
virtual bool operator!=(const C &rhs)
Returns whether or not two SSLClient objects do not have the same underlying client object.
Definition: SSLClient.h:332
-
virtual void removeSession(const char *host, const IPAddress &addr)
Clear the session corresponding to a host and IP.
Definition: SSLClient.h:310
-
virtual int connect(IPAddress ip, uint16_t port)
Connect over SSL to a host specified by an IP address.
Definition: SSLClient.h:124
+
const Client & get_arduino_client() const override
Definition: SSLClient.h:364
+
int connect(const char *host, uint16_t port) override
Connect over SSL to a host specified by a hostname.
Definition: SSLClient.h:162
+
bool operator==(const bool value)
Definition: SSLClient.h:326
+
uint16_t remotePort() override
Returns the remote port, if C::remotePort exists. Else return 0.
Definition: SSLClient.h:350
int connect_impl(IPAddress ip, uint16_t port)
Definition: SSLClientImpl.cpp:74
+
size_t getSessionCount() const override
Get the maximum number of SSL sessions that can be stored at once.
Definition: SSLClient.h:317
void stop_impl()
Definition: SSLClientImpl.cpp:229
void flush_impl()
Definition: SSLClientImpl.cpp:221
Implementation code to be inherited by SSLClient.
Definition: SSLClientImpl.h:71
-
virtual int read(uint8_t *buf, size_t size)
Read size bytes from the SSL client buffer, copying them into *buf, and return the number of bytes re...
Definition: SSLClient.h:237
-
virtual bool operator==(const C &rhs)
Returns whether or not two SSLClient objects have the same underlying client object.
Definition: SSLClient.h:330
+
void removeSession(const char *host, const IPAddress &addr)
Clear the session corresponding to a host and IP.
Definition: SSLClient.h:310
uint8_t connected_impl()
Definition: SSLClientImpl.cpp:250
-
virtual Client & get_arduino_client()
Returns an instance of m_client that is polymorphic and can be used by SSLClientImpl.
Definition: SSLClient.h:363
+
SSLSession & getSession(const char *host, const IPAddress &addr)
Gets a session reference corresponding to a host and IP, or a reference to a empty session if none ex...
Definition: SSLClient.h:300
DebugLevel
Level of verbosity used in logging for SSLClient.
Definition: SSLClientImpl.h:59
+
int read(uint8_t *buf, size_t size) override
Read size bytes from the SSL client buffer, copying them into *buf, and return the number of bytes re...
Definition: SSLClient.h:237
+
int connect(IPAddress ip, uint16_t port) override
Connect over SSL to a host specified by an IP address.
Definition: SSLClient.h:124
diff --git a/docs/html/class_s_s_l_client-members.html b/docs/html/class_s_s_l_client-members.html index 45f2498..d196482 100644 --- a/docs/html/class_s_s_l_client-members.html +++ b/docs/html/class_s_s_l_client-members.html @@ -94,25 +94,25 @@ $(document).ready(function(){initNavTree('class_s_s_l_client.html','');});

This is the complete list of members for SSLClient< C, SessionCache >, including all inherited members.

- + - - + + - + - + - - - - + + + + - - - + + + @@ -120,26 +120,26 @@ $(document).ready(function(){initNavTree('class_s_s_l_client.html','');}); - - - - - - + + + + + + - - + + - - + + - + - + - - + +
available()SSLClient< C, SessionCache >inlinevirtual
available() overrideSSLClient< C, SessionCache >inline
available_impl()SSLClientImpl
connect(IPAddress ip, uint16_t port)SSLClient< C, SessionCache >inlinevirtual
connect(const char *host, uint16_t port)SSLClient< C, SessionCache >inlinevirtual
connect(IPAddress ip, uint16_t port) overrideSSLClient< C, SessionCache >inline
connect(const char *host, uint16_t port) overrideSSLClient< C, SessionCache >inline
connect_impl(IPAddress ip, uint16_t port)SSLClientImpl
connect_impl(const char *host, uint16_t port)SSLClientImpl
connected()SSLClient< C, SessionCache >inlinevirtual
connected() overrideSSLClient< C, SessionCache >inline
connected_impl()SSLClientImpl
flush()SSLClient< C, SessionCache >inlinevirtual
flush() overrideSSLClient< C, SessionCache >inline
flush_impl()SSLClientImpl
get_arduino_client()SSLClient< C, SessionCache >inlineprotectedvirtual
get_arduino_client() constSSLClient< C, SessionCache >inlineprotectedvirtual
get_session_array()SSLClient< C, SessionCache >inlineprotectedvirtual
get_session_array() constSSLClient< C, SessionCache >inlineprotectedvirtual
get_arduino_client() overrideSSLClient< C, SessionCache >inlineprotectedvirtual
get_arduino_client() const overrideSSLClient< C, SessionCache >inlineprotectedvirtual
get_session_array() overrideSSLClient< C, SessionCache >inlineprotectedvirtual
get_session_array() const overrideSSLClient< C, SessionCache >inlineprotectedvirtual
get_session_impl(const char *host, const IPAddress &addr)SSLClientImpl
getClient()SSLClient< C, SessionCache >inline
getSession(const char *host, const IPAddress &addr)SSLClient< C, SessionCache >inlinevirtual
getSessionCount() constSSLClient< C, SessionCache >inlinevirtual
localPort()SSLClient< C, SessionCache >inlinevirtual
getSession(const char *host, const IPAddress &addr)SSLClient< C, SessionCache >inline
getSessionCount() const overrideSSLClient< C, SessionCache >inlinevirtual
localPort() overrideSSLClient< C, SessionCache >inlinevirtual
m_error(const T str, const char *func_name) constSSLClientImplinlineprotected
m_info(const T str, const char *func_name) constSSLClientImplinlineprotected
m_print(const T str, const char *func_name, const DebugLevel level) constSSLClientImplinlineprotected
m_print_prefix(const char *func_name, const DebugLevel level) constSSLClientImplprotected
m_print_ssl_error(const int ssl_error, const DebugLevel level) constSSLClientImplprotected
m_warn(const T str, const char *func_name) constSSLClientImplinlineprotected
operator bool()SSLClient< C, SessionCache >inlinevirtual
operator!=(const bool value)SSLClient< C, SessionCache >inlinevirtual
operator!=(const C &rhs)SSLClient< C, SessionCache >inlinevirtual
operator==(const bool value)SSLClient< C, SessionCache >inlinevirtual
operator==(const C &rhs)SSLClient< C, SessionCache >inlinevirtual
peek()SSLClient< C, SessionCache >inlinevirtual
operator bool()SSLClient< C, SessionCache >inline
operator!=(const bool value)SSLClient< C, SessionCache >inline
operator!=(const C &rhs)SSLClient< C, SessionCache >inline
operator==(const bool value)SSLClient< C, SessionCache >inline
operator==(const C &rhs)SSLClient< C, SessionCache >inline
peek() overrideSSLClient< C, SessionCache >inline
peek_impl()SSLClientImpl
read()SSLClient< C, SessionCache >inlinevirtual
read(uint8_t *buf, size_t size)SSLClient< C, SessionCache >inlinevirtual
read() overrideSSLClient< C, SessionCache >inline
read(uint8_t *buf, size_t size) overrideSSLClient< C, SessionCache >inline
read_impl(uint8_t *buf, size_t size)SSLClientImpl
remoteIP()SSLClient< C, SessionCache >inlinevirtual
remotePort()SSLClient< C, SessionCache >inlinevirtual
remoteIP() overrideSSLClient< C, SessionCache >inlinevirtual
remotePort() overrideSSLClient< C, SessionCache >inlinevirtual
remove_session_impl(const char *host, const IPAddress &addr)SSLClientImpl
removeSession(const char *host, const IPAddress &addr)SSLClient< C, SessionCache >inlinevirtual
removeSession(const char *host, const IPAddress &addr)SSLClient< C, SessionCache >inline
SSLClient(const C &client, const br_x509_trust_anchor *trust_anchors, const size_t trust_anchors_num, const int analog_pin, const DebugLevel debug=SSL_WARN)SSLClient< C, SessionCache >inlineexplicit
SSLClientImpl(const br_x509_trust_anchor *trust_anchors, const size_t trust_anchors_num, const int analog_pin, const DebugLevel debug)SSLClientImplexplicit
stop()SSLClient< C, SessionCache >inlinevirtual
stop() overrideSSLClient< C, SessionCache >inline
stop_impl()SSLClientImpl
write(uint8_t b)SSLClient< C, SessionCache >inlinevirtual
write(const uint8_t *buf, size_t size)SSLClient< C, SessionCache >inlinevirtual
write(uint8_t b) overrideSSLClient< C, SessionCache >inline
write(const uint8_t *buf, size_t size) overrideSSLClient< C, SessionCache >inline
write_impl(const uint8_t *buf, size_t size)SSLClientImpl
diff --git a/docs/html/class_s_s_l_client.html b/docs/html/class_s_s_l_client.html index eadc3cf..a9b36cf 100644 --- a/docs/html/class_s_s_l_client.html +++ b/docs/html/class_s_s_l_client.html @@ -115,69 +115,69 @@ Public Member Functions  SSLClient (const C &client, const br_x509_trust_anchor *trust_anchors, const size_t trust_anchors_num, const int analog_pin, const DebugLevel debug=SSL_WARN)  Initialize SSLClient with all of the prerequisites needed. More...
  -virtual int connect (IPAddress ip, uint16_t port) - Connect over SSL to a host specified by an IP address. More...
-  -virtual int connect (const char *host, uint16_t port) - Connect over SSL to a host specified by a hostname. More...
-  -virtual size_t write (uint8_t b) -  -virtual size_t write (const uint8_t *buf, size_t size) - Write some bytes to the SSL connection. More...
-  -virtual int available () - Returns the number of bytes available to read from the data that has been received and decrypted. More...
-  -virtual int read () - Read a single byte, or -1 if none is available. More...
-  -virtual int read (uint8_t *buf, size_t size) - Read size bytes from the SSL client buffer, copying them into *buf, and return the number of bytes read. More...
-  -virtual int peek () - View the first byte of the buffer, without removing it from the SSLClient Buffer. More...
-  -virtual void flush () - Force writing the buffered bytes from SSLClient::write to the network. More...
-  -virtual void stop () - Close the connection. More...
-  -virtual uint8_t connected () - Check if the device is connected. More...
-  -virtual SSLSessiongetSession (const char *host, const IPAddress &addr) - Gets a session reference corresponding to a host and IP, or a reference to a empty session if none exist. More...
-  -virtual void removeSession (const char *host, const IPAddress &addr) - Clear the session corresponding to a host and IP. More...
-  -virtual size_t getSessionCount () const - Get the maximum number of SSL sessions that can be stored at once. More...
-  -virtual operator bool () - Equivalent to SSLClient::connected() > 0. More...
-  -virtual bool operator== (const bool value) -  -virtual bool operator!= (const bool value) -  -virtual bool operator== (const C &rhs) - Returns whether or not two SSLClient objects have the same underlying client object. More...
-  -virtual bool operator!= (const C &rhs) - Returns whether or not two SSLClient objects do not have the same underlying client object. More...
-  -virtual uint16_t localPort () - Returns the local port, C::localPort exists. Else return 0. More...
-  -virtual IPAddress remoteIP () - Returns the remote IP, if C::remoteIP exists. Else return INADDR_NONE. More...
-  -virtual uint16_t remotePort () - Returns the remote port, if C::remotePort exists. Else return 0. More...
-  +int connect (IPAddress ip, uint16_t port) override + Connect over SSL to a host specified by an IP address. More...
+  +int connect (const char *host, uint16_t port) override + Connect over SSL to a host specified by a hostname. More...
+  +size_t write (uint8_t b) override +  +size_t write (const uint8_t *buf, size_t size) override + Write some bytes to the SSL connection. More...
+  +int available () override + Returns the number of bytes available to read from the data that has been received and decrypted. More...
+  +int read () override + Read a single byte, or -1 if none is available. More...
+  +int read (uint8_t *buf, size_t size) override + Read size bytes from the SSL client buffer, copying them into *buf, and return the number of bytes read. More...
+  +int peek () override + View the first byte of the buffer, without removing it from the SSLClient Buffer. More...
+  +void flush () override + Force writing the buffered bytes from SSLClient::write to the network. More...
+  +void stop () override + Close the connection. More...
+  +uint8_t connected () override + Check if the device is connected. More...
+  +SSLSessiongetSession (const char *host, const IPAddress &addr) + Gets a session reference corresponding to a host and IP, or a reference to a empty session if none exist. More...
+  +void removeSession (const char *host, const IPAddress &addr) + Clear the session corresponding to a host and IP. More...
+  +size_t getSessionCount () const override + Get the maximum number of SSL sessions that can be stored at once. More...
+  + operator bool () + Equivalent to SSLClient::connected() > 0. More...
+  +bool operator== (const bool value) +  +bool operator!= (const bool value) +  +bool operator== (const C &rhs) + Returns whether or not two SSLClient objects have the same underlying client object. More...
+  +bool operator!= (const C &rhs) + Returns whether or not two SSLClient objects do not have the same underlying client object. More...
+  +uint16_t localPort () override + Returns the local port, C::localPort exists. Else return 0. More...
+  +IPAddress remoteIP () override + Returns the remote IP, if C::remoteIP exists. Else return INADDR_NONE. More...
+  +uint16_t remotePort () override + Returns the remote port, if C::remotePort exists. Else return 0. More...
+  C & getClient ()  Returns a reference to the client object stored in this class. Take care not to break it. More...
  @@ -209,16 +209,16 @@ Public Member Functions - - - - - - - - - - + + + + + + + + + + @@ -322,8 +322,8 @@ The analog_pin should be set to input.

Member Function Documentation

- -

◆ available()

+ +

◆ available()

@@ -334,7 +334,7 @@ template<class C , size_t SessionCache = 1>
+inlineoverride

Protected Member Functions

virtual Client & get_arduino_client ()
 Returns an instance of m_client that is polymorphic and can be used by SSLClientImpl. More...
 
virtual const Client & get_arduino_client () const
 
virtual SSLSessionget_session_array ()
 Returns an instance of the session array that is on the stack. More...
 
virtual const SSLSessionget_session_array () const
 
Client & get_arduino_client () override
 Returns an instance of m_client that is polymorphic and can be used by SSLClientImpl. More...
 
const Client & get_arduino_client () const override
 
SSLSessionget_session_array () override
 Returns an instance of the session array that is on the stack. More...
 
const SSLSessionget_session_array () const override
 
- Protected Member Functions inherited from SSLClientImpl
void m_print_prefix (const char *func_name, const DebugLevel level) const
 Prints a debugging prefix to all logs, so we can attatch them to useful information. More...
- + @@ -342,21 +342,21 @@ template<class C , size_t SessionCache = 1>
virtual int SSLClient< C, SessionCache >::available int SSLClient< C, SessionCache >::available ( )
-inlinevirtual

Returns the number of bytes available to read from the data that has been received and decrypted.

-

This function updates the state of the SSL engine (including writing any data, see SSLClient::write) and as a result should be called periodically when expecting data. Additionally, since if there are no bytes and if SSLClient::connected is false this function returns zero (this same behavior is found in EthernetClient), it is prudent to ensure in your own code that the preconditions are met before checking this function to prevent an ambiguous result.

+

This function updates the state of the SSL engine (including writing any data, see SSLClient::write) and as a result should be called periodically when expecting data. Additionally, since if there are no bytes and if SSLClient::connected is false this function returns zero (this same behavior is found in EthernetClient), it is prudent to ensure in your own code that the preconditions are met before checking this function to prevent an ambiguous result.

The implementation for this function can be found in SSLClientImpl::available

-
Precondition
SSLClient::connected must be true.
+
Precondition
SSLClient::connected must be true.
Returns
The number of bytes available (can be zero), or zero if any of the pre conditions aren't satisfied.
- -

◆ connect() [1/2]

+ +

◆ connect() [1/2]

@@ -367,7 +367,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -386,7 +386,7 @@ template<class C , size_t SessionCache = 1>
virtual int SSLClient< C, SessionCache >::connect int SSLClient< C, SessionCache >::connect ( IPAddress  ip,
-inlinevirtual +inlineoverride
@@ -414,8 +414,8 @@ There must be a trust anchor given to the constructor that corresponds to the ce
- -

◆ connect() [2/2]

+ +

◆ connect() [2/2]

@@ -426,7 +426,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -445,7 +445,7 @@ template<class C , size_t SessionCache = 1>
virtual int SSLClient< C, SessionCache >::connect int SSLClient< C, SessionCache >::connect ( const char *  host,
-inlinevirtual +inlineoverride
@@ -473,8 +473,8 @@ There must be a trust anchor given to the constructor that corresponds to the ce
- -

◆ connected()

+ +

◆ connected()

@@ -485,7 +485,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -493,20 +493,20 @@ template<class C , size_t SessionCache = 1>
virtual uint8_t SSLClient< C, SessionCache >::connected uint8_t SSLClient< C, SessionCache >::connected ( )
-inlinevirtual +inlineoverride

Check if the device is connected.

-

Use this function to determine if SSLClient is still connected and a SSL connection is active. It should be noted that SSLClient::available should be preferred over this function for rapid polling–both functions send and receive data with the SSLClient::m_client device, however SSLClient::available has some delays built in to protect SSLClient::m_client from being polled too frequently.

+

Use this function to determine if SSLClient is still connected and a SSL connection is active. It should be noted that SSLClient::available should be preferred over this function for rapid polling–both functions send and receive data with the SSLClient::m_client device, however SSLClient::available has some delays built in to protect SSLClient::m_client from being polled too frequently.

The implementation for this function can be found in SSLClientImpl::connected_impl.

Returns
1 if connected, 0 if not
- -

◆ flush()

+ +

◆ flush()

@@ -517,7 +517,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -525,18 +525,18 @@ template<class C , size_t SessionCache = 1>
virtual void SSLClient< C, SessionCache >::flush void SSLClient< C, SessionCache >::flush ( )
-inlinevirtual +inlineoverride
-

Force writing the buffered bytes from SSLClient::write to the network.

-

This function is blocking until all bytes from the buffer are written. For an explanation of how writing with SSLClient works, please see SSLClient::write. The implementation for this function can be found in SSLClientImpl::flush.

+

Force writing the buffered bytes from SSLClient::write to the network.

+

This function is blocking until all bytes from the buffer are written. For an explanation of how writing with SSLClient works, please see SSLClient::write. The implementation for this function can be found in SSLClientImpl::flush.

- -

◆ get_arduino_client() [1/2]

+ +

◆ get_arduino_client() [1/2]

@@ -547,7 +547,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -555,7 +555,7 @@ template<class C , size_t SessionCache = 1>
virtual Client& SSLClient< C, SessionCache >::get_arduino_client Client& SSLClient< C, SessionCache >::get_arduino_client ( )
-inlineprotectedvirtual +inlineoverrideprotectedvirtual
@@ -566,8 +566,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ get_arduino_client() [2/2]

+ +

◆ get_arduino_client() [2/2]

@@ -578,7 +578,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -586,7 +586,7 @@ template<class C , size_t SessionCache = 1>
virtual const Client& SSLClient< C, SessionCache >::get_arduino_client const Client& SSLClient< C, SessionCache >::get_arduino_client ( ) const
-inlineprotectedvirtual +inlineoverrideprotectedvirtual
@@ -595,8 +595,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ get_session_array() [1/2]

+ +

◆ get_session_array() [1/2]

@@ -607,7 +607,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -615,7 +615,7 @@ template<class C , size_t SessionCache = 1>
virtual SSLSession* SSLClient< C, SessionCache >::get_session_array SSLSession* SSLClient< C, SessionCache >::get_session_array ( )
-inlineprotectedvirtual +inlineoverrideprotectedvirtual
@@ -626,8 +626,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ get_session_array() [2/2]

+ +

◆ get_session_array() [2/2]

@@ -638,7 +638,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -646,7 +646,7 @@ template<class C , size_t SessionCache = 1>
virtual const SSLSession* SSLClient< C, SessionCache >::get_session_array const SSLSession* SSLClient< C, SessionCache >::get_session_array ( ) const
-inlineprotectedvirtual +inlineoverrideprotectedvirtual
@@ -684,8 +684,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ getSession()

+ +

◆ getSession()

@@ -696,7 +696,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -715,7 +715,7 @@ template<class C , size_t SessionCache = 1>
virtual SSLSession& SSLClient< C, SessionCache >::getSession SSLSession& SSLClient< C, SessionCache >::getSession ( const char *  host,
-inlinevirtual +inline
@@ -734,8 +734,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ getSessionCount()

+ +

◆ getSessionCount()

@@ -746,7 +746,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -754,7 +754,7 @@ template<class C , size_t SessionCache = 1>
virtual size_t SSLClient< C, SessionCache >::getSessionCount size_t SSLClient< C, SessionCache >::getSessionCount ( ) const
-inlinevirtual +inlineoverridevirtual
@@ -766,8 +766,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ localPort()

+ +

◆ localPort()

@@ -778,7 +778,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -786,7 +786,7 @@ template<class C , size_t SessionCache = 1>
virtual uint16_t SSLClient< C, SessionCache >::localPort uint16_t SSLClient< C, SessionCache >::localPort ( )
-inlinevirtual +inlineoverridevirtual
@@ -797,8 +797,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ operator bool()

+ +

◆ operator bool()

@@ -809,7 +809,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -817,18 +817,18 @@ template<class C , size_t SessionCache = 1>
virtual SSLClient< C, SessionCache >::operator bool SSLClient< C, SessionCache >::operator bool ( )
-inlinevirtual +inline
-

Equivalent to SSLClient::connected() > 0.

+

Equivalent to SSLClient::connected() > 0.

Returns
true if connected, false if not
- -

◆ operator!=() [1/2]

+ +

◆ operator!=() [1/2]

@@ -839,7 +839,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -848,7 +848,7 @@ template<class C , size_t SessionCache = 1>
virtual bool SSLClient< C, SessionCache >::operator!= bool SSLClient< C, SessionCache >::operator!= ( const bool  value)
-inlinevirtual +inline
@@ -856,8 +856,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ operator!=() [2/2]

+ +

◆ operator!=() [2/2]

@@ -868,7 +868,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -877,7 +877,7 @@ template<class C , size_t SessionCache = 1>
virtual bool SSLClient< C, SessionCache >::operator!= bool SSLClient< C, SessionCache >::operator!= ( const C &  rhs)
-inlinevirtual +inline
@@ -886,8 +886,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ operator==() [1/2]

+ +

◆ operator==() [1/2]

@@ -898,7 +898,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -907,7 +907,7 @@ template<class C , size_t SessionCache = 1>
virtual bool SSLClient< C, SessionCache >::operator== bool SSLClient< C, SessionCache >::operator== ( const bool  value)
-inlinevirtual +inline
@@ -915,8 +915,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ operator==() [2/2]

+ +

◆ operator==() [2/2]

@@ -927,7 +927,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -936,7 +936,7 @@ template<class C , size_t SessionCache = 1>
virtual bool SSLClient< C, SessionCache >::operator== bool SSLClient< C, SessionCache >::operator== ( const C &  rhs)
-inlinevirtual +inline
@@ -945,8 +945,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ peek()

+ +

◆ peek()

@@ -957,7 +957,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -965,19 +965,19 @@ template<class C , size_t SessionCache = 1>
virtual int SSLClient< C, SessionCache >::peek int SSLClient< C, SessionCache >::peek ( )
-inlinevirtual +inlineoverride

View the first byte of the buffer, without removing it from the SSLClient Buffer.

-

The implementation for this function can be found in SSLClientImpl::peek

Precondition
SSLClient::available must be >0
+

The implementation for this function can be found in SSLClientImpl::peek

Precondition
SSLClient::available must be >0
Returns
The first byte received, or -1 if the preconditions are not satisfied (warning: do not use if your data may be -1, as the return value is ambiguous)
- -

◆ read() [1/2]

+ +

◆ read() [1/2]

@@ -988,7 +988,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -996,18 +996,18 @@ template<class C , size_t SessionCache = 1>
virtual int SSLClient< C, SessionCache >::read int SSLClient< C, SessionCache >::read ( )
-inlinevirtual +inlineoverride

Read a single byte, or -1 if none is available.

-
See also
SSLClient::read(uint8_t*, size_t)
+
See also
SSLClient::read(uint8_t*, size_t)
- -

◆ read() [2/2]

+ +

◆ read() [2/2]

@@ -1018,7 +1018,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -1037,16 +1037,16 @@ template<class C , size_t SessionCache = 1>
virtual int SSLClient< C, SessionCache >::read int SSLClient< C, SessionCache >::read ( uint8_t *  buf,
-inlinevirtual +inlineoverride

Read size bytes from the SSL client buffer, copying them into *buf, and return the number of bytes read.

-

This function checks if bytes are ready to be read by calling SSLClient::available, and if so copies size number of bytes from the IO buffer into the buf pointer. Data read using this function will not include any SSL or socket commands, as the Client and BearSSL will capture those and process them separately.

+

This function checks if bytes are ready to be read by calling SSLClient::available, and if so copies size number of bytes from the IO buffer into the buf pointer. Data read using this function will not include any SSL or socket commands, as the Client and BearSSL will capture those and process them separately.

If you find that you are having a lot of timeout errors, SSLClient may be experiencing a buffer overflow. Checkout README.md for more information.

The implementation for this function can be found in SSLClientImpl::read_impl(uint8_t*, size_t)

-
Precondition
SSLClient::available must be >0
+
Precondition
SSLClient::available must be >0
Parameters
@@ -1058,8 +1058,8 @@ template<class C , size_t SessionCache = 1> - -

◆ remoteIP()

+ +

◆ remoteIP()

@@ -1070,7 +1070,7 @@ template<class C , size_t SessionCache = 1>
+inlineoverridevirtual
bufThe pointer to the buffer to put SSL application data into
- + @@ -1078,7 +1078,7 @@ template<class C , size_t SessionCache = 1>
virtual IPAddress SSLClient< C, SessionCache >::remoteIP IPAddress SSLClient< C, SessionCache >::remoteIP ( )
-inlinevirtual
@@ -1089,8 +1089,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ remotePort()

+ +

◆ remotePort()

@@ -1101,7 +1101,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -1109,7 +1109,7 @@ template<class C , size_t SessionCache = 1>
virtual uint16_t SSLClient< C, SessionCache >::remotePort uint16_t SSLClient< C, SessionCache >::remotePort ( )
-inlinevirtual +inlineoverridevirtual
@@ -1120,8 +1120,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ removeSession()

+ +

◆ removeSession()

@@ -1132,7 +1132,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -1151,7 +1151,7 @@ template<class C , size_t SessionCache = 1>
virtual void SSLClient< C, SessionCache >::removeSession void SSLClient< C, SessionCache >::removeSession ( const char *  host,
-inlinevirtual +inline
@@ -1168,8 +1168,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ stop()

+ +

◆ stop()

@@ -1180,7 +1180,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -1188,7 +1188,7 @@ template<class C , size_t SessionCache = 1>
virtual void SSLClient< C, SessionCache >::stop void SSLClient< C, SessionCache >::stop ( )
-inlinevirtual +inlineoverride
@@ -1198,8 +1198,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ write() [1/2]

+ +

◆ write() [1/2]

@@ -1210,7 +1210,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -1219,7 +1219,7 @@ template<class C , size_t SessionCache = 1>
virtual size_t SSLClient< C, SessionCache >::write size_t SSLClient< C, SessionCache >::write ( uint8_t  b)
-inlinevirtual +inlineoverride
@@ -1227,8 +1227,8 @@ template<class C , size_t SessionCache = 1>
- -

◆ write() [2/2]

+ +

◆ write() [2/2]

@@ -1239,7 +1239,7 @@ template<class C , size_t SessionCache = 1>
- + @@ -1258,15 +1258,15 @@ template<class C , size_t SessionCache = 1>
virtual size_t SSLClient< C, SessionCache >::write size_t SSLClient< C, SessionCache >::write ( const uint8_t *  buf,
-inlinevirtual +inlineoverride

Write some bytes to the SSL connection.

-

Assuming all preconditions are met, this function writes data to the BearSSL IO buffer, BUT does not initially send the data. Instead, you must call SSLClient::available or SSLClient::flush, which will detect that the buffer is ready for writing, and will write the data to the network. Alternatively, if this function is requested to write a larger amount of data than SSLClientImpl::m_iobuf can handle, data will be written to the network in pages the size of SSLClientImpl::m_iobuf until all the data in buf is sent–attempting to keep all writes to the network grouped together. For information on why this is the case check out README.md .

+

Assuming all preconditions are met, this function writes data to the BearSSL IO buffer, BUT does not initially send the data. Instead, you must call SSLClient::available or SSLClient::flush, which will detect that the buffer is ready for writing, and will write the data to the network. Alternatively, if this function is requested to write a larger amount of data than SSLClientImpl::m_iobuf can handle, data will be written to the network in pages the size of SSLClientImpl::m_iobuf until all the data in buf is sent–attempting to keep all writes to the network grouped together. For information on why this is the case check out README.md .

The implementation for this function can be found in SSLClientImpl::write_impl(const uint8_t*, size_t)

-
Precondition
The socket and SSL layer must be connected, meaning SSLClient::connected must be true.
+
Precondition
The socket and SSL layer must be connected, meaning SSLClient::connected must be true.
BearSSL must not be waiting for the recipt of user data (if it is, there is probably an error with how the protocol in implemented in your code).
Parameters
diff --git a/docs/html/class_s_s_l_client.js b/docs/html/class_s_s_l_client.js index 0c36bb8..340f3b7 100644 --- a/docs/html/class_s_s_l_client.js +++ b/docs/html/class_s_s_l_client.js @@ -1,31 +1,31 @@ var class_s_s_l_client = [ [ "SSLClient", "class_s_s_l_client.html#ae9a7509bc8a18f67e286547c19deb3c0", null ], - [ "available", "class_s_s_l_client.html#a40ec85568d0aec376219125b604dbc29", null ], - [ "connect", "class_s_s_l_client.html#ae6540b9a02f1392bf2ac48421189f70e", null ], - [ "connect", "class_s_s_l_client.html#a5814c11e96848c2bcea78210f099aad5", null ], - [ "connected", "class_s_s_l_client.html#a7318aadc0ec9775bffaaac0b1f00aaf8", null ], - [ "flush", "class_s_s_l_client.html#a51eb668f6a328a6a66298c6bc1361d41", null ], - [ "get_arduino_client", "class_s_s_l_client.html#ab3ebfbca41a56bfa11e34aac2c2e0106", null ], - [ "get_arduino_client", "class_s_s_l_client.html#a20742b36588c45435139a4f47fe0f1f6", null ], - [ "get_session_array", "class_s_s_l_client.html#aaa52b481eb1d36a0ae1d208daa2fec51", null ], - [ "get_session_array", "class_s_s_l_client.html#ab076a76b142b553c0dfd29174d4e17e7", null ], + [ "available", "class_s_s_l_client.html#a5d13fd2f32ee2ea65a1f3820f758e77e", null ], + [ "connect", "class_s_s_l_client.html#a4a2172aedfcc483ba2a256ad12148630", null ], + [ "connect", "class_s_s_l_client.html#a91c63e35f31652c20faa5b9be95984bf", null ], + [ "connected", "class_s_s_l_client.html#a25e4414ab0c9424d09592f9567a678dc", null ], + [ "flush", "class_s_s_l_client.html#a2ee6a3134d07ca09cf61ee04d32c3d44", null ], + [ "get_arduino_client", "class_s_s_l_client.html#a9c5001bdfa75ccc0d93cc60dd872b38a", null ], + [ "get_arduino_client", "class_s_s_l_client.html#a353c875d17a85dbb7bfe10de155f3b52", null ], + [ "get_session_array", "class_s_s_l_client.html#a9e7769fed78825cf4723778f4b5aa3e9", null ], + [ "get_session_array", "class_s_s_l_client.html#a18adfc074d6b8e996819d4beb4689cbd", null ], [ "getClient", "class_s_s_l_client.html#afd0d4d2c98433d60897d8828d8047d41", null ], - [ "getSession", "class_s_s_l_client.html#ae3f27a36ff9c0cd1e2bea5e1708b6e4f", null ], - [ "getSessionCount", "class_s_s_l_client.html#a36bb344866e4cbcba3bbfcf4d33e5187", null ], - [ "localPort", "class_s_s_l_client.html#ac725067566ee411680c88575c148300b", null ], - [ "operator bool", "class_s_s_l_client.html#a319a722dae252efdd85fdbaf5c7fbf17", null ], - [ "operator!=", "class_s_s_l_client.html#a9a060e49d0685c6c6795558e41cd3323", null ], - [ "operator!=", "class_s_s_l_client.html#a518f4ed733814f2f4a8c7f838555eb35", null ], - [ "operator==", "class_s_s_l_client.html#a6fb2e8a1cc54dd82a72217e5c4533e02", null ], - [ "operator==", "class_s_s_l_client.html#a26f9418e33d4ca459f78de98d3af43bb", null ], - [ "peek", "class_s_s_l_client.html#a227b1cbbe91bcb21153c09f97d0dd484", null ], - [ "read", "class_s_s_l_client.html#ac70b900ff798f9fd33f6367fcc9fad77", null ], - [ "read", "class_s_s_l_client.html#ae31dd88a1af8ec3794fb48f26a3dd4bf", null ], - [ "remoteIP", "class_s_s_l_client.html#ae2d1d17ee568ec2a37756bf6894dcd05", null ], - [ "remotePort", "class_s_s_l_client.html#ae8bd9420fec3b11f855729c4ecfe1c2c", null ], - [ "removeSession", "class_s_s_l_client.html#a0000d7f1e8656cf4a506a98133391fe0", null ], - [ "stop", "class_s_s_l_client.html#a158d87df3fe118b7565a19b72f310322", null ], - [ "write", "class_s_s_l_client.html#a0699ff4b966162cba2ef59ff4a287270", null ], - [ "write", "class_s_s_l_client.html#a3a48b190985cdea2eba79ef0bdc80461", null ] + [ "getSession", "class_s_s_l_client.html#a2d8bf9b891151bc5b0b865d70cf9c086", null ], + [ "getSessionCount", "class_s_s_l_client.html#a2d71f00d6634092f50c5262ad25cdacd", null ], + [ "localPort", "class_s_s_l_client.html#a563c5f9829757075bf16742cffa4cf73", null ], + [ "operator bool", "class_s_s_l_client.html#a2d378fbb7b8f15a1691746572f9d95b1", null ], + [ "operator!=", "class_s_s_l_client.html#a824b599264f893e1b206a9100bc52ee1", null ], + [ "operator!=", "class_s_s_l_client.html#adab82ba09345fa070712d3124af30e1b", null ], + [ "operator==", "class_s_s_l_client.html#a505bfb6831a45aebf58d84e3b89d4cfc", null ], + [ "operator==", "class_s_s_l_client.html#a5f40f8f4d26d21e14276c3e8162b62b9", null ], + [ "peek", "class_s_s_l_client.html#a31742867b00bd8d130637af0935bacbd", null ], + [ "read", "class_s_s_l_client.html#aedf2746cc35da596faf8322776c2118e", null ], + [ "read", "class_s_s_l_client.html#afd6d7ae798c05cf566b2eb5651dba795", null ], + [ "remoteIP", "class_s_s_l_client.html#af76a0df76834e0d0999dbf44c7c0a174", null ], + [ "remotePort", "class_s_s_l_client.html#a5974a5f8722a752f121af4fac498bb22", null ], + [ "removeSession", "class_s_s_l_client.html#a5b626703a24089dbb0480a9b6ddf348c", null ], + [ "stop", "class_s_s_l_client.html#ad30db47248d78df7c12dedfb27f06529", null ], + [ "write", "class_s_s_l_client.html#a6b8ff53c10fe34aab1dc2561410f70bb", null ], + [ "write", "class_s_s_l_client.html#a6bcb7579ebc051c097acb794b95771a9", null ] ]; \ No newline at end of file diff --git a/docs/html/class_s_s_l_client_impl.html b/docs/html/class_s_s_l_client_impl.html index 7259c74..244b09f 100644 --- a/docs/html/class_s_s_l_client_impl.html +++ b/docs/html/class_s_s_l_client_impl.html @@ -246,7 +246,7 @@ Protected Member Functions
-
See also
SSLClient::available
+
See also
SSLClient::available
@@ -275,7 +275,7 @@ Protected Member Functions
-
See also
SSLClient::connect(IPAddress, uint16_t)
+
See also
SSLClient::connect(IPAddress, uint16_t)
@@ -304,7 +304,7 @@ Protected Member Functions
-
See also
SSLClient::connect(const char*, uint16_t)
+
See also
SSLClient::connect(const char*, uint16_t)
@@ -322,7 +322,7 @@ Protected Member Functions
-
See also
SSLClient::connected
+
See also
SSLClient::connected
@@ -340,7 +340,7 @@ Protected Member Functions
-
See also
SSLClient::flush
+
See also
SSLClient::flush
@@ -366,9 +366,9 @@ Protected Member Functions
-
See also
SSLClient::get_arduino_client
+
See also
SSLClient::get_arduino_client
-

Implemented in SSLClient< C, SessionCache >.

+

Implemented in SSLClient< C, SessionCache >.

@@ -395,7 +395,7 @@ Protected Member Functions
-

Implemented in SSLClient< C, SessionCache >.

+

Implemented in SSLClient< C, SessionCache >.

@@ -421,9 +421,9 @@ Protected Member Functions
-
See also
SSLClient::get_session_array
+
See also
SSLClient::get_session_array
-

Implemented in SSLClient< C, SessionCache >.

+

Implemented in SSLClient< C, SessionCache >.

@@ -450,7 +450,7 @@ Protected Member Functions
-

Implemented in SSLClient< C, SessionCache >.

+

Implemented in SSLClient< C, SessionCache >.

@@ -479,7 +479,7 @@ Protected Member Functions
-
See also
SSLClient::getSession
+
See also
SSLClient::getSession
@@ -505,9 +505,9 @@ Protected Member Functions
-
See also
SSLClient::getSessionCount
+
See also
SSLClient::getSessionCount
-

Implemented in SSLClient< C, SessionCache >.

+

Implemented in SSLClient< C, SessionCache >.

@@ -533,9 +533,9 @@ Protected Member Functions
-
See also
SSLClient::localPort
+
See also
SSLClient::localPort
-

Implemented in SSLClient< C, SessionCache >.

+

Implemented in SSLClient< C, SessionCache >.

@@ -829,7 +829,7 @@ template<typename T >
-
See also
SSLClient::peek
+
See also
SSLClient::peek
@@ -858,7 +858,7 @@ template<typename T >
-
See also
SSLClient::read(uint8_t*, size_t)
+
See also
SSLClient::read(uint8_t*, size_t)
@@ -884,9 +884,9 @@ template<typename T >
-
See also
SSLClient::remoteIP
+
See also
SSLClient::remoteIP
-

Implemented in SSLClient< C, SessionCache >.

+

Implemented in SSLClient< C, SessionCache >.

@@ -912,9 +912,9 @@ template<typename T >
-
See also
SSLClient::localPort
+
See also
SSLClient::localPort
-

Implemented in SSLClient< C, SessionCache >.

+

Implemented in SSLClient< C, SessionCache >.

@@ -943,7 +943,7 @@ template<typename T >
-
See also
SSLClient::removeSession
+
See also
SSLClient::removeSession
@@ -961,7 +961,7 @@ template<typename T >
-
See also
SSLClient::stop
+
See also
SSLClient::stop
@@ -990,7 +990,7 @@ template<typename T >
-
See also
SSLClient::write(const uint8_t*, size_t)
+
See also
SSLClient::write(const uint8_t*, size_t)
diff --git a/docs/html/functions.html b/docs/html/functions.html index 2848a51..dea6a9f 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -91,7 +91,7 @@ $(document).ready(function(){initNavTree('functions.html','');});

- a -