philbowles / ESPAsyncWebServer

Patched version of the original
5 stars 1 forks source link

Function mbedtls_md5_starts() was renamed, needs to be renamed in WebAuthentication.cpp #3

Open serpinio opened 2 years ago

serpinio commented 2 years ago

Just wanted to share an FYI and a fix:

SDK md5.h file had a small change in ESP framework: the mbedtls_md5_starts() was renamed which invalidated auth calls with the current version of AsyncWebserver fork with an "undefined reference to mbedtls_md5_starts" error.

How to fix:

Change these three lines in WebAuthentication.cpp:

  mbedtls_md5_starts(&_ctx);
  mbedtls_md5_update(&_ctx, data, len);
  mbedtls_md5_finish(&_ctx, _buf);

To:

  mbedtls_md5_starts_ret(&_ctx);
  mbedtls_md5_update_ret(&_ctx, data, len);
  mbedtls_md5_finish_ret(&_ctx, _buf);

Original discussion: https://github.com/me-no-dev/ESPAsyncWebServer/issues/1147

1024eric commented 2 years ago

Brilliant thanks Serpinio. Been searching for a solution that worked for hours!

LuisYadier commented 1 year ago

Thank you very much to solve the problem with your instructions!

lemar017 commented 11 months ago

Now it compile like a charm Thank's

HARIS4820 commented 3 months ago

Just wanted to share an FYI and a fix:

SDK md5.h file had a small change in ESP framework: the mbedtls_md5_starts() was renamed which invalidated auth calls with the current version of AsyncWebserver fork with an "undefined reference to mbedtls_md5_starts" error.

How to fix:

Change these three lines in WebAuthentication.cpp:

  mbedtls_md5_starts(&_ctx);
  mbedtls_md5_update(&_ctx, data, len);
  mbedtls_md5_finish(&_ctx, _buf);

To:

  mbedtls_md5_starts_ret(&_ctx);
  mbedtls_md5_update_ret(&_ctx, data, len);
  mbedtls_md5_finish_ret(&_ctx, _buf);

Original discussion: me-no-dev/ESPAsyncWebServer#1147

in my case the issue was

Arduino/libraries/ESPAsyncWebServer/src/WebAuthentication.cpp:74:3: error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'? 74 | mbedtls_md5_starts_ret(&_ctx);

arduino 2.3.2 ubuntu 24.4 esp32 3.0.2 espasyncwebserver 3.1.0