Skip to content

Commit d9f1b8c

Browse files
committed
Check if ECC508 is locked before using it
1 parent 26c939e commit d9f1b8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BearSSLClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ int BearSSLClient::connectSSL(const char* host)
179179
// inject entropy in engine
180180
unsigned char entropy[32];
181181

182-
if (ECC508.begin() && ECC508.random(entropy, sizeof(entropy))) {
182+
if (ECC508.begin() && ECC508.locked() && ECC508.random(entropy, sizeof(entropy))) {
183183
// ECC508 random success, add custom ECDSA vfry and EC sign
184184
br_ssl_engine_set_ecdsa(&_sc.eng, ecc508_vrfy_asn1);
185185
br_x509_minimal_set_ecdsa(&_xc, br_ssl_engine_get_ec(&_sc.eng), br_ssl_engine_get_ecdsa(&_sc.eng));

0 commit comments

Comments
 (0)