Skip to content

Commit aae713d

Browse files
authored
Arduino 3 fixes (#48)
1 parent c76c982 commit aae713d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/WebAuthentication.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,17 @@ static bool getMD5(uint8_t * data, uint16_t len, char * output){//33 bytes or mo
7070
return false;
7171
memset(_buf, 0x00, 16);
7272
#ifdef ESP32
73+
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
74+
mbedtls_md5_init(&_ctx);
75+
mbedtls_md5_starts(&_ctx);
76+
mbedtls_md5_update(&_ctx, data, len);
77+
mbedtls_md5_finish(&_ctx, _buf);
78+
#else
7379
mbedtls_md5_init(&_ctx);
7480
mbedtls_md5_starts_ret(&_ctx);
7581
mbedtls_md5_update_ret(&_ctx, data, len);
7682
mbedtls_md5_finish_ret(&_ctx, _buf);
83+
#endif
7784
#else
7885
MD5Init(&_ctx);
7986
MD5Update(&_ctx, data, len);

0 commit comments

Comments
 (0)