|
25 | 25 | #include <ArduinoIoTCloudTCP.h> |
26 | 26 | #include "utility/time/TimeService.h" |
27 | 27 | #ifdef BOARD_HAS_ECCX08 |
28 | | - #include <ArduinoECCX08.h> |
29 | | - #include "utility/crypto/CryptoUtil.h" |
30 | | - #include "utility/crypto/BearSSLTrustAnchor.h" |
| 28 | + #include "tls/BearSSLTrustAnchors.h" |
| 29 | + #include "tls/utility/CryptoUtil.h" |
31 | 30 | #endif |
32 | 31 |
|
33 | 32 | /****************************************************************************** |
@@ -65,7 +64,7 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP() |
65 | 64 | , _mqtt_data_len{0} |
66 | 65 | , _mqtt_data_request_retransmit{false} |
67 | 66 | #ifdef BOARD_HAS_ECCX08 |
68 | | -, _sslClient(nullptr, ArduinoIoTCloudTrustAnchor, ArduinoIoTCloudTrustAnchor_NUM) |
| 67 | +, _sslClient(nullptr, ArduinoIoTCloudTrustAnchor, ArduinoIoTCloudTrustAnchor_NUM, getTime) |
69 | 68 | #endif |
70 | 69 | #ifdef BOARD_ESP |
71 | 70 | , _password("") |
@@ -110,7 +109,6 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort) |
110 | 109 | if (!ECCX08.begin()) { Debug.print(DBG_ERROR, "Cryptography processor failure. Make sure you have a compatible board."); return 0; } |
111 | 110 | if (!CryptoUtil::readDeviceId(ECCX08, getDeviceId(), ECCX08Slot::DeviceId)) { Debug.print(DBG_ERROR, "Cryptography processor read failure."); return 0; } |
112 | 111 | if (!CryptoUtil::reconstructCertificate(_eccx08_cert, getDeviceId(), ECCX08Slot::Key, ECCX08Slot::CompressedCertificate, ECCX08Slot::SerialNumberAndAuthorityKeyIdentifier)) { Debug.print(DBG_ERROR, "Cryptography certificate reconstruction failure."); return 0; } |
113 | | - ArduinoBearSSL.onGetTime(getTime); |
114 | 112 | _sslClient.setClient(_connection->getClient()); |
115 | 113 | _sslClient.setEccSlot(static_cast<int>(ECCX08Slot::Key), _eccx08_cert.bytes(), _eccx08_cert.length()); |
116 | 114 | #elif defined(BOARD_ESP) |
|
0 commit comments