@@ -52,7 +52,9 @@ BearSSLClient::BearSSLClient(Client* client, const br_x509_trust_anchor* myTAs,
52
52
_TAs(myTAs),
53
53
_numTAs(myNumTAs),
54
54
_noSNI(false ),
55
+ #ifndef ARDUINO_BEARSSL_DISABLE_KEY_DECODER
55
56
_skeyDecoder (NULL ),
57
+ #endif
56
58
_ecChainLen (0 ),
57
59
#ifndef ARDUINO_BEARSSL_DISABLE_FULL_CLIENT_PROFILE
58
60
_br_ssl_client_init_function (br_ssl_client_init_full)
@@ -86,10 +88,12 @@ BearSSLClient::~BearSSLClient()
86
88
_ecCert[0 ].data = NULL ;
87
89
}
88
90
91
+ #ifndef ARDUINO_BEARSSL_DISABLE_KEY_DECODER
89
92
if (_skeyDecoder) {
90
93
free (_skeyDecoder);
91
94
_skeyDecoder = NULL ;
92
95
}
96
+ #endif
93
97
}
94
98
95
99
int BearSSLClient::connect (IPAddress ip, uint16_t port)
@@ -318,6 +322,7 @@ void BearSSLClient::setEccSlot(int ecc508KeySlot, const char cert[])
318
322
}
319
323
}
320
324
325
+ #ifndef ARDUINO_BEARSSL_DISABLE_KEY_DECODER
321
326
void BearSSLClient::setKey (const char key[], const char cert[])
322
327
{
323
328
// try to decode the key and cert
@@ -390,6 +395,7 @@ void BearSSLClient::setKey(const char key[], const char cert[])
390
395
}
391
396
}
392
397
}
398
+ #endif
393
399
394
400
void BearSSLClient::setEccCertParent (const char cert[])
395
401
{
@@ -475,6 +481,7 @@ int BearSSLClient::connectSSL(const char* host)
475
481
476
482
// enable client auth
477
483
if (_ecCert[0 ].data_len ) {
484
+ #ifndef ARDUINO_BEARSSL_DISABLE_KEY_DECODER
478
485
if (_skeyDecoder) {
479
486
int skeyType = br_skey_decoder_key_type (_skeyDecoder);
480
487
@@ -484,8 +491,11 @@ int BearSSLClient::connectSSL(const char* host)
484
491
br_ssl_client_set_single_rsa (&_sc, _ecCert, _ecChainLen, br_skey_decoder_get_rsa (_skeyDecoder), br_rsa_pkcs1_sign_get_default ());
485
492
}
486
493
} else {
494
+ #endif
487
495
br_ssl_client_set_single_ec (&_sc, _ecCert, _ecChainLen, &_ecKey, BR_KEYTYPE_KEYX | BR_KEYTYPE_SIGN, BR_KEYTYPE_EC, br_ec_get_default (), _ecSign);
496
+ #ifndef ARDUINO_BEARSSL_DISABLE_KEY_DECODER
488
497
}
498
+ #endif
489
499
}
490
500
491
501
// set the hostname used for SNI
@@ -588,12 +598,14 @@ void BearSSLClient::clientAppendCert(void *ctx, const void *data, size_t len)
588
598
c->_ecCert [0 ].data_len += len;
589
599
}
590
600
601
+ #ifndef ARDUINO_BEARSSL_DISABLE_KEY_DECODER
591
602
void BearSSLClient::clientAppendKey (void *ctx, const void *data, size_t len)
592
603
{
593
604
BearSSLClient* c = (BearSSLClient*)ctx;
594
605
595
606
br_skey_decoder_push (c->_skeyDecoder , data, len);
596
607
}
608
+ #endif
597
609
598
610
void BearSSLClient::parentAppendCert (void *ctx, const void *data, size_t len)
599
611
{
0 commit comments