Skip to content

Commit

Permalink
Fix TLS by removing redundant BearSSL code from libmail (#19472)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger authored Sep 6, 2023
1 parent f7775b5 commit 4100682
Show file tree
Hide file tree
Showing 308 changed files with 20 additions and 67,696 deletions.
4 changes: 2 additions & 2 deletions lib/lib_ssl/bearssl-esp8266/src/t_bearssl_x509.h
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ typedef struct {
* \param append_in issuer DN receiver callback (or `0`).
* \param append_in_ctx context for the issuer DN receiver callback.
*/
void br_x509_decoder_init_esp8266(br_x509_decoder_context *ctx,
void br_x509_decoder_init(br_x509_decoder_context *ctx,
void (*append_dn)(void *ctx, const void *buf, size_t len),
void *append_dn_ctx,
void (*append_in)(void *ctx, const void *buf, size_t len),
Expand All @@ -1048,7 +1048,7 @@ void br_x509_decoder_init_esp8266(br_x509_decoder_context *ctx,
* \param data certificate data chunk.
* \param len certificate data chunk length (in bytes).
*/
void br_x509_decoder_push_tasmota(br_x509_decoder_context *ctx,
void br_x509_decoder_push(br_x509_decoder_context *ctx,
const void *data, size_t len);

/**
Expand Down
18 changes: 9 additions & 9 deletions lib/lib_ssl/bearssl-esp8266/src/x509/x509_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ t0_parse7E_signed(const unsigned char **p)
/* static const unsigned char t0_datablock[]; */


void br_x509_decoder_init_main_tasmota(void *t0ctx);
void br_x509_decoder_init_main(void *t0ctx);

void br_x509_decoder_run_tasmota(void *t0ctx);
void br_x509_decoder_run(void *t0ctx);



Expand All @@ -81,7 +81,7 @@ void br_x509_decoder_run_tasmota(void *t0ctx);

/* see bearssl_x509.h */
void
br_x509_decoder_init_esp8266(br_x509_decoder_context *ctx,
br_x509_decoder_init(br_x509_decoder_context *ctx,
void (*append_dn)(void *ctx, const void *buf, size_t len),
void *append_dn_ctx,
void (*append_in)(void *ctx, const void *buf, size_t len),
Expand All @@ -99,18 +99,18 @@ br_x509_decoder_init_esp8266(br_x509_decoder_context *ctx,
ctx->append_in_ctx = append_in_ctx;
ctx->cpu.dp = &ctx->dp_stack[0];
ctx->cpu.rp = &ctx->rp_stack[0];
br_x509_decoder_init_main_tasmota(&ctx->cpu);
br_x509_decoder_run_tasmota(&ctx->cpu);
br_x509_decoder_init_main(&ctx->cpu);
br_x509_decoder_run(&ctx->cpu);
}

/* see bearssl_x509.h */
void
br_x509_decoder_push_tasmota(br_x509_decoder_context *ctx,
br_x509_decoder_push(br_x509_decoder_context *ctx,
const void *data, size_t len)
{
ctx->hbuf = data;
ctx->hlen = len;
br_x509_decoder_run_tasmota(&ctx->cpu);
br_x509_decoder_run(&ctx->cpu);
}


Expand Down Expand Up @@ -381,12 +381,12 @@ name(void *ctx) \
T0_ENTER(t0ctx->ip, t0ctx->rp, slot); \
}

T0_DEFENTRY(br_x509_decoder_init_main_tasmota, 93)
T0_DEFENTRY(br_x509_decoder_init_main, 93)

#define T0_NEXT(t0ipp) (pgm_read_byte((*t0ipp)++))

void
br_x509_decoder_run_tasmota(void *t0ctx)
br_x509_decoder_run(void *t0ctx)
{
uint32_t *dp, *rp;
const unsigned char *ip;
Expand Down
4 changes: 2 additions & 2 deletions lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ extern "C" {
br_x509_pubkeyfingerprint_context *xc = (br_x509_pubkeyfingerprint_context *)ctx;
// Don't process anything but the first certificate in the chain
if (!xc->done_cert) {
br_x509_decoder_init_esp8266(&xc->ctx, nullptr, nullptr, nullptr, nullptr);
br_x509_decoder_init(&xc->ctx, nullptr, nullptr, nullptr, nullptr);
}
(void)server_name; // ignore server name
}
Expand All @@ -748,7 +748,7 @@ extern "C" {
br_x509_pubkeyfingerprint_context *xc = (br_x509_pubkeyfingerprint_context *)ctx;
// Don't process anything but the first certificate in the chain
if (!xc->done_cert) {
br_x509_decoder_push_tasmota(&xc->ctx, (const void*)buf, len);
br_x509_decoder_push(&xc->ctx, (const void*)buf, len);
}
}

Expand Down
74 changes: 0 additions & 74 deletions lib/libesp32/ESP-Mail-Client/src/SSLClient/bssl/aes_big_cbcdec.c

This file was deleted.

72 changes: 0 additions & 72 deletions lib/libesp32/ESP-Mail-Client/src/SSLClient/bssl/aes_big_cbcenc.c

This file was deleted.

89 changes: 0 additions & 89 deletions lib/libesp32/ESP-Mail-Client/src/SSLClient/bssl/aes_big_ctr.c

This file was deleted.

Loading

0 comments on commit 4100682

Please sign in to comment.