ESPAsyncWebServer icon indicating copy to clipboard operation
ESPAsyncWebServer copied to clipboard

compilation error with ESP 2.01 library compilation erreur WebAuthentication.cpp:73: undefined reference to mbedtls_md5_starts'

Open fbell58 opened this issue 4 years ago • 15 comments

i have a sckech witch is compling ok in version 1.6 of ESP32 library arduino software (ESP32 Arduino Release 1.0.6 based on ESP-IDF v3.3.5)

I have upgrade to the new 2.0.1 ESP library soft (ESP32 Arduino 2.0.1 based on ESP-IDF 4.4)

and I get the following error ? anay idea of what I can do to solde that ?

Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: libraries/ESPAsyncWebServer-master/WebAuthentication.cpp.o: in function getMD5(unsigned char*, unsigned short, char*)': /Volumes/homes-1/NAS_francois/Drive/Arduino/libraries/ESPAsyncWebServer-master/src/WebAuthentication.cpp:73: undefined reference to mbedtls_md5_starts'

fbell58 avatar Nov 11 '21 09:11 fbell58

**I found I think in Arduino new package old mbedtls have been removed (depreciated...) I change with the new fonction in "WebAuthentication.h" and I can compile this out error .... It is strange that I am the only one ????

extract from md(. h in new package ....*

_* MBEDTLS_DEPRECATED void mbedtls_md5_starts( mbedtls_md5_context *ctx );

/**

  • \brief MD5 process buffer
  • \deprecated Superseded by mbedtls_md5_update_ret() in 2.7.0
  • \param ctx MD5 context
  • \param input buffer holding the data
  • \param ilen length of the input data
  • \warning MD5 is considered a weak message digest and its use
  •             constitutes a security risk. We recommend considering
    
  •             stronger message digests instead.
    

*/ MBEDTLS_DEPRECATED void mbedtls_md5_update( mbedtls_md5_context *ctx, const unsigned char *input, size_t ilen );

/**

  • \brief MD5 final digest
  • \deprecated Superseded by mbedtls_md5_finish_ret() in 2.7.0
  • \param ctx MD5 context
  • \param output MD5 checksum result
  • \warning MD5 is considered a weak message digest and its use
  •             constitutes a security risk. We recommend considering
    
  •             stronger message digests instead.
    

*/ MBEDTLS_DEPRECATED void mbedtls_md5_finish( mbedtls_md5_context *ctx, unsigned char output[16] );

/**

  • \brief MD5 process data block (internal use only)
  • \deprecated Superseded by mbedtls_internal_md5_process() in 2.7.0
  • \param ctx MD5 context
  • \param data buffer holding one block of data
  • \warning MD5 is considered a weak message digest and its use
  •             constitutes a security risk. We recommend considering
    
  •             stronger message digests instead.
    

*/ MBEDTLS_DEPRECATED void mbedtls_md5_process( mbedtls_md5_context *ctx, const unsigned char data[64] );

#undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */_

fbell58 avatar Nov 18 '21 13:11 fbell58

meet the same issue

beats0126 avatar Dec 01 '21 02:12 beats0126

meet the same issue

As I try to explain You can try to solve by replacing obsolet call by the new one ...I did not test all function but for me there is no compilation issue and the server is working fine .....

fbell58 avatar Dec 01 '21 12:12 fbell58

Hi, sorry to ask. @fbell58 what do I have to do exactly?

weoiss1998 avatar Jan 06 '22 16:01 weoiss1998

Hi, sorry to ask. @fbell58 what do I have to do exactly?

you must modify WebAuthentication.cpp as this (it is working for me but of course i did not make all the possible tests for any specific case ....)

you modify in the library directory your_directory/Arduino/libraries/ESPAsyncWebServer-master/src/WebAuthentication.cpp

line 72 with this (the comment are the old line ......)

#ifdef ESP32 mbedtls_md5_init(&_ctx); mbedtls_md5_update_ret (&_ctx,data,len); mbedtls_md5_finish_ret(&_ctx,data); mbedtls_internal_md5_process( &_ctx ,data); // mbedtls_md5_starts(&_ctx); // mbedtls_md5_update(&_ctx, data, len); // mbedtls_md5_finish(&_ctx, _buf);

fbell58 avatar Jan 10 '22 20:01 fbell58

ok, thank you

weoiss1998 avatar Jan 13 '22 14:01 weoiss1998

Now could be a library version number issue. There was no increase in this library's version when the mbed fix was made so no indication in Arduino library manager that you don't have the latest code. see #1128

drmpf avatar Mar 07 '22 23:03 drmpf

Thank you @fbell58

MartinVerges avatar May 08 '22 10:05 MartinVerges

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 10 '22 11:07 stale[bot]

needs to be fixed, not stale!

MartinVerges avatar Jul 10 '22 13:07 MartinVerges

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

stale[bot] avatar Jul 10 '22 13:07 stale[bot]

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 02 '22 00:11 stale[bot]

ainda errado

Renato-Sanchez avatar May 01 '23 14:05 Renato-Sanchez

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

stale[bot] avatar May 01 '23 14:05 stale[bot]

This has been fixed by https://github.com/me-no-dev/ESPAsyncWebServer/commit/17a8d442169f3ca8496b20ebd24bbc06f55d4a62

@fbell58 install the latest version of the library from this GitHub repository (make sure you don't install one of the forks which haven't pulled down the fix), then check to see if the bug is fixed. If so, you can close the issue by clicking the "Close issue" button here on the issue web page.

per1234 avatar Dec 17 '24 07:12 per1234