[svn-commits] seanbright: trunk r316920 - in /trunk: ./ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed May 4 21:34:36 CDT 2011


Author: seanbright
Date: Wed May  4 21:34:29 2011
New Revision: 316920

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=316920
Log:
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
........

Modified:
    trunk/   (props changed)
    trunk/main/http.c
    trunk/main/manager.c
    trunk/main/utils.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/main/http.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/http.c?view=diff&rev=316920&r1=316919&r2=316920
==============================================================================
--- trunk/main/http.c (original)
+++ trunk/main/http.c Wed May  4 21:34:29 2011
@@ -134,7 +134,7 @@
 
 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 @@
 
 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)

Modified: trunk/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager.c?view=diff&rev=316920&r1=316919&r2=316920
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Wed May  4 21:34:29 2011
@@ -5693,7 +5693,7 @@
 					     struct ast_variable *headers)
 {
 	struct mansession_session *session = NULL;
-	struct mansession s = { NULL, };
+	struct mansession s = { .session = NULL, .tcptls_session = ser };
 	struct ast_variable *v, *params = get_params;
 	char template[] = "/tmp/ast-http-XXXXXX";	/* template for temporary file */
 	struct ast_str *http_header = NULL, *out = NULL;

Modified: trunk/main/utils.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/utils.c?view=diff&rev=316920&r1=316919&r2=316920
==============================================================================
--- trunk/main/utils.c (original)
+++ trunk/main/utils.c Wed May  4 21:34:29 2011
@@ -1995,7 +1995,7 @@
  */
 int ast_parse_digest(const char *digest, struct ast_http_digest *d, int request, int pedantic) {
 	int i;
-	char *c, key[512], val[512], tmp[512];
+	char *c, key[512], val[512];
 	struct ast_str *str = ast_str_create(16);
 
 	if (ast_strlen_zero(digest) || !d || !str) {
@@ -2007,7 +2007,7 @@
 
 	c = ast_skip_blanks(ast_str_buffer(str));
 
-	if (strncasecmp(tmp, "Digest ", strlen("Digest "))) {
+	if (strncasecmp(c, "Digest ", strlen("Digest "))) {
 		ast_log(LOG_WARNING, "Missing Digest.\n");
 		ast_free(str);
 		return -1;




More information about the svn-commits mailing list