Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ssl): Add size arg to NetworkClientSecure::setCACertBundle #10101

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libraries/NetworkClientSecure/src/NetworkClientSecure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ void NetworkClientSecure::setCACert(const char *rootCA) {
_use_insecure = false;
}

void NetworkClientSecure::setCACertBundle(const uint8_t *bundle) {
if (bundle != NULL) {
esp_crt_bundle_set(bundle, sizeof(bundle));
void NetworkClientSecure::setCACertBundle(const uint8_t *bundle, size_t size) {
if (bundle != NULL && size > 0) {
esp_crt_bundle_set(bundle, size);
attach_ssl_certificate_bundle(sslclient.get(), true);
_use_ca_bundle = true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion libraries/NetworkClientSecure/src/NetworkClientSecure.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class NetworkClientSecure : public NetworkClient {
void setCertificate(const char *client_ca);
void setPrivateKey(const char *private_key);
bool loadCACert(Stream &stream, size_t size);
void setCACertBundle(const uint8_t *bundle);
void setCACertBundle(const uint8_t *bundle, size_t size);
bool loadCertificate(Stream &stream, size_t size);
bool loadPrivateKey(Stream &stream, size_t size);
bool verify(const char *fingerprint, const char *domain_name);
Expand Down
Loading