summaryrefslogtreecommitdiff
path: root/main/http.c
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2011-05-05 02:34:29 +0000
committerSean Bright <sean@malleable.com>2011-05-05 02:34:29 +0000
commitfe5938c51e973b8e29007f57801e73fa466f0b1d (patch)
tree230370cbbb639e7e7250899548c94d8c56e4271b /main/http.c
parentb9e763ecaeac9b647880d57082726ada04ebebb7 (diff)
Merged revisions 316917-316919 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r316917 | seanbright | 2011-05-04 22:23:28 -0400 (Wed, 04 May 2011) | 5 lines Make sure that tcptls_session is properly initialized. (issue #18598) Reported by: ksn ........ r316918 | seanbright | 2011-05-04 22:25:20 -0400 (Wed, 04 May 2011) | 5 lines Look at the correct buffer for our digest info instead of an empty one. (issue #18598) Reported by: ksn ........ r316919 | seanbright | 2011-05-04 22:30:45 -0400 (Wed, 04 May 2011) | 10 lines Use the correct HTTP method when generating our digest, otherwise we always fail. When calculating the 'A2' portion of our digest for verification, we need the HTTP method that is currently in use. Unfortunately our mapping function was incorrect, resulting in invalid hashes being generated and, in turn, failures in authentication. (closes issue #18598) Reported by: ksn ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/http.c')
-rw-r--r--main/http.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/main/http.c b/main/http.c
index cc32b9422..63d91c2b2 100644
--- a/main/http.c
+++ b/main/http.c
@@ -134,7 +134,7 @@ static AST_RWLIST_HEAD_STATIC(uri_redirects, http_uri_redirect);
static const struct ast_cfhttp_methods_text {
enum ast_http_method method;
- const char text[];
+ const char *text;
} ast_http_methods_text[] = {
{ AST_HTTP_UNKNOWN, "UNKNOWN" },
{ AST_HTTP_GET, "GET" },
@@ -145,7 +145,15 @@ static const struct ast_cfhttp_methods_text {
const char *ast_get_http_method(enum ast_http_method method)
{
- return ast_http_methods_text[method].text;
+ int x;
+
+ for (x = 0; x < ARRAY_LEN(ast_http_methods_text); x++) {
+ if (ast_http_methods_text[x].method == method) {
+ return ast_http_methods_text[x].text;
+ }
+ }
+
+ return NULL;
}
const char *ast_http_ftype2mtype(const char *ftype)