Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit 8a752f8

Browse files
committed
Remove header guard hack for Arduino v3.0.0
1 parent b2bf375 commit 8a752f8

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/certStore.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
namespace BearSSL {
66

7-
void CertStore::installCertStore(br_x509_minimal_context *ctx) {
7+
void CertStoreP::installCertStore(br_x509_minimal_context *ctx) {
88
br_x509_minimal_set_dynamic(ctx, (void*)this, findHashedTA, freeHashedTA);
99
}
1010

11-
const br_x509_trust_anchor *CertStore::findHashedTA(void *ctx, void *hashed_dn, size_t len) {
11+
const br_x509_trust_anchor *CertStoreP::findHashedTA(void *ctx, void *hashed_dn, size_t len) {
1212
//compare sha256 from index file with hashed_dn
1313
//then return certificate
1414

15-
CertStore *cs = static_cast<CertStore *>(ctx);
15+
CertStoreP *cs = static_cast<CertStoreP *>(ctx);
1616

1717
if (!cs || len != 32)
1818
{
@@ -49,8 +49,8 @@ const br_x509_trust_anchor *CertStore::findHashedTA(void *ctx, void *hashed_dn,
4949
return nullptr;
5050
}
5151

52-
void CertStore::freeHashedTA(void *ctx, const br_x509_trust_anchor *ta) {
53-
CertStore *cs = static_cast<CertStore*>(ctx);
52+
void CertStoreP::freeHashedTA(void *ctx, const br_x509_trust_anchor *ta) {
53+
CertStoreP *cs = static_cast<CertStoreP*>(ctx);
5454
(void) ta; // Unused
5555
delete cs->_x509;
5656
cs->_x509 = nullptr;

src/certStore.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
//the class is completely overwritten by using the same preprocessor
33
//include guard
44

5-
#ifndef _CERTSTORE_BEARSSL_H
6-
#define _CERTSTORE_BEARSSL_H
5+
#ifndef _CERTSTORE_H
6+
#define _CERTSTORE_H
77

88
#include <Arduino.h>
99
#include <BearSSLHelpers.h>
1010
#include <bearssl/bearssl.h>
11+
#include <CertStoreBearSSL.h>
1112

1213
namespace BearSSL {
1314

14-
class CertStore {
15+
class CertStoreP: public CertStoreBase {
1516
public:
16-
CertStore() { };
17+
CertStoreP() { };
1718

1819
// Installs the cert store into the X509 decoder (normally via static function callbacks)
1920
void installCertStore(br_x509_minimal_context *ctx);

src/fetch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class HTTPRequest
3535
void addHeader(String name, String value);
3636

3737
private :
38-
BearSSL::CertStore certStore;
38+
BearSSL::CertStoreP certStore;
3939

4040
HTTPClient *http;
4141
WiFiClient *client;

0 commit comments

Comments
 (0)