feat(esp_http_client): SHA256 support in digest auth

Added support for using SHA256 algorithm while calculating
digest auth in HTTP client connection

Closes https://github.com/espressif/esp-idf/issues/12383
This commit is contained in:
Harshit Malpani
2023-10-19 18:27:08 +05:30
parent 5ec9f498bc
commit 803ad150cf
5 changed files with 119 additions and 20 deletions

View File

@@ -123,6 +123,23 @@ char *http_utils_get_string_between(const char *str, const char *begin, const ch
return NULL;
}
char *http_utils_get_string_after(const char *str, const char *begin)
{
char *found = strcasestr(str, begin);
char *ret = NULL;
if (found) {
found += strlen(begin);
char *found_end = (char *)str + strlen(str);
if (found_end) {
ret = calloc(1, found_end - found + 1);
mem_check(ret);
memcpy(ret, found, found_end - found);
return ret;
}
}
return NULL;
}
int http_utils_str_starts_with(const char *str, const char *start)
{
int i;