Skip to content

Commit

Permalink
Reduce size for ESP8266
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger committed Dec 14, 2024
1 parent 3b17e8d commit a2eb71a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,9 @@ extern "C" {
sha1_update_len(&shactx, rsakey.n, rsakey.nlen); // modulus

br_sha1_out(&shactx, xc->pubkey_recv_fingerprint); // copy to fingerprint
} else if (xc->ctx.pkey.key_type == BR_KEYTYPE_EC) {
}
#ifndef ESP8266
else if (xc->ctx.pkey.key_type == BR_KEYTYPE_EC) {
br_ec_public_key eckey = xc->ctx.pkey.key.ec;

br_sha1_context shactx;
Expand All @@ -813,7 +815,9 @@ extern "C" {
// key type. For ECDSA it's a fixed string.
sha1_update_len(&shactx, "ecdsa-sha2-nistp256", 19); // tag
sha1_update_len(&shactx, eckey.q, eckey.qlen); // exponent
} else {
}
#endif
else {
// We don't support anything else, so just set the fingerprint to all zeros.
memset(xc->pubkey_recv_fingerprint, 0, 20);
}
Expand Down Expand Up @@ -908,7 +912,9 @@ extern "C" {

// we support only P256 EC curve for AWS IoT, no EC curve for Letsencrypt unless forced
br_ssl_engine_set_ec(&cc->eng, &br_ec_p256_m15); // TODO
br_ssl_engine_set_ecdsa(&cc->eng, &br_ecdsa_i15_vrfy_asn1);
#ifndef ESP8266
br_ssl_engine_set_ecdsa(&cc->eng, &br_ecdsa_i15_vrfy_asn1);
#endif
}
}

Expand Down

0 comments on commit a2eb71a

Please sign in to comment.