Update for ESP32 RTOS SDK 3.0.0

This commit is contained in:
Me No Dev 2016-08-02 14:28:17 +03:00
parent fbb05a2765
commit 46d41ddcd4
1 changed files with 5 additions and 1 deletions

View File

@ -28,7 +28,7 @@ bool checkBasicAuthentication(const char * hash, const char * username, const ch
if(username == NULL || password == NULL || hash == NULL)
return false;
size_t toencodeLen = os_strlen(username)+os_strlen(password)+1;
size_t toencodeLen = strlen(username)+strlen(password)+1;
size_t encodedLen = base64_encode_expected_len(toencodeLen);
if(strlen(hash) != encodedLen)
return false;
@ -71,7 +71,11 @@ static bool getMD5(uint8_t * data, uint16_t len, char * output){//33 bytes or mo
}
static String genRandomMD5(){
#ifdef ESP8266
uint32_t r = RANDOM_REG32;
#else
uint32_t r = rand();
#endif
char * out = (char*)malloc(33);
if(out == NULL || !getMD5((uint8_t*)(&r), 4, out))
return "";