Skip to content

Commit 802cd2c

Browse files
committed
BearSSLClientProfile: allow profile configuration
- remove unnecessary include - rename - add include guards - move into tls folder
1 parent 46706bd commit 802cd2c

File tree

4 files changed

+48
-9
lines changed

4 files changed

+48
-9
lines changed

src/tls/profile/aiotc_profile.c renamed to src/tls/BearSSLClientProfile.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@
2222
* SOFTWARE.
2323
*/
2424

25+
/******************************************************************************
26+
* INCLUDE
27+
******************************************************************************/
28+
2529
#include <AIoTC_Config.h>
2630
#ifdef BOARD_HAS_ECCX08
2731

28-
#include "../bearssl/inner.h"
32+
#include "bearssl/inner.h"
2933

3034
/* see bearssl_ssl.h */
3135
void aiotc_client_profile_init(br_ssl_client_context *cc, br_x509_minimal_context *xc, const br_x509_trust_anchor *trust_anchors, size_t trust_anchors_num)
@@ -99,3 +103,4 @@ void aiotc_client_profile_init(br_ssl_client_context *cc, br_x509_minimal_contex
99103
}
100104

101105
#endif /* #ifdef BOARD_HAS_ECCX08 */
106+

src/tls/BearSSLClientProfile.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2016 Thomas Pornin <pornin@bolet.org>
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining
5+
* a copy of this software and associated documentation files (the
6+
* "Software"), to deal in the Software without restriction, including
7+
* without limitation the rights to use, copy, modify, merge, publish,
8+
* distribute, sublicense, and/or sell copies of the Software, and to
9+
* permit persons to whom the Software is furnished to do so, subject to
10+
* the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be
13+
* included in all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19+
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20+
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
#ifndef _BEAR_SSL_CLIENT_PROFILE_H_
26+
#define _BEAR_SSL_CLIENT_PROFILE_H_
27+
28+
/******************************************************************************
29+
* INCLUDE
30+
******************************************************************************/
31+
32+
#include <AIoTC_Config.h>
33+
#ifdef BOARD_HAS_ECCX08
34+
35+
extern "C" void aiotc_client_profile_init(br_ssl_client_context *cc, br_x509_minimal_context *xc, const br_x509_trust_anchor *trust_anchors, size_t trust_anchors_num);
36+
37+
#endif /* #ifdef BOARD_HAS_ECCX08 */
38+
39+
#endif /* _BEAR_SSL_CLIENT_PROFILE_H_ */
40+

src/tls/utility/TLSClientMqtt.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@
2424

2525
#ifdef BOARD_HAS_ECCX08
2626
#include "tls/BearSSLTrustAnchors.h"
27+
#include "tls/BearSSLClientProfile.h"
2728
extern "C" {
28-
void aiotc_client_profile_init(br_ssl_client_context *cc,
29-
br_x509_minimal_context *xc,
30-
const br_x509_trust_anchor *trust_anchors,
31-
size_t trust_anchors_num);
3229
unsigned long getTime();
3330
}
3431
#endif

src/tls/utility/TLSClientOta.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@
2424

2525
#ifdef BOARD_HAS_ECCX08
2626
#include "tls/BearSSLTrustAnchors.h"
27+
#include "tls/BearSSLClientProfile.h"
2728
extern "C" {
28-
void aiotc_client_profile_init(br_ssl_client_context *cc,
29-
br_x509_minimal_context *xc,
30-
const br_x509_trust_anchor *trust_anchors,
31-
size_t trust_anchors_num);
3229
unsigned long getTime();
3330
}
3431
#endif

0 commit comments

Comments
 (0)