]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
Rename http_digest_authorization to global_http_digest_authorization.
authorSimon Ruderich <simon@ruderich.org>
Thu, 8 Aug 2013 19:07:03 +0000 (21:07 +0200)
committerSimon Ruderich <simon@ruderich.org>
Thu, 8 Aug 2013 19:07:03 +0000 (21:07 +0200)
src/connection.c
src/tlsproxy.c
src/tlsproxy.h

index aa42bfd2bffb60b9e8011b03a11c28bbbaf7013a..abd89758c463c5399ce1a51f0672442d269b201c 100644 (file)
@@ -542,14 +542,14 @@ static int read_http_request(FILE *client_fd, char *request, size_t length) {
     while (fgets(buffer, sizeof(buffer), client_fd) != NULL) {
         const char *authentication = "Proxy-Authorization: Basic ";
 
-        if (http_digest_authorization != NULL
+        if (global_http_digest_authorization != NULL
                 && !strncmp(buffer, authentication, strlen(authentication))) {
             found_proxy_authorization = 1;
 
             /* Check if the passphrase matches. */
             strtok(buffer, "\r\n");
             if (strcmp(buffer + strlen(authentication),
-                       http_digest_authorization)) {
+                       global_http_digest_authorization)) {
                 return -3;
             }
         }
@@ -564,7 +564,7 @@ static int read_http_request(FILE *client_fd, char *request, size_t length) {
         return -1;
     }
 
-    if (http_digest_authorization != NULL && !found_proxy_authorization) {
+    if (global_http_digest_authorization != NULL && !found_proxy_authorization) {
         return -3;
     }
 
index b391b738e641d1314db5c8289fefa62e694379a9..ee65febba68ef14445effc63d32851660b3cadef 100644 (file)
@@ -237,7 +237,7 @@ int main(int argc, char **argv) {
 
     free(global_proxy_host);
     free(global_proxy_port);
-    free(http_digest_authorization);
+    free(global_http_digest_authorization);
 
     return EXIT_FAILURE;
 }
@@ -265,20 +265,20 @@ static void parse_arguments(int argc, char **argv) {
     while ((option = getopt(argc, argv, "a:d:p:t:uh?")) != -1) {
         switch (option) {
             case 'a': {
-                http_digest_authorization = slurp_text_file(optarg);
-                if (http_digest_authorization == NULL) {
+                global_http_digest_authorization = slurp_text_file(optarg);
+                if (global_http_digest_authorization == NULL) {
                     fprintf(stderr, "failed to open authorization file '%s': ",
                                     optarg);
                     perror("");
                     exit(EXIT_FAILURE);
-                } else if (strlen(http_digest_authorization) == 0) {
+                } else if (strlen(global_http_digest_authorization) == 0) {
                     fprintf(stderr, "empty authorization file '%s'\n",
                                     optarg);
                     exit(EXIT_FAILURE);
                 }
 
                 /* Just in case the file has a trailing newline. */
-                strtok(http_digest_authorization, "\r\n");
+                strtok(global_http_digest_authorization, "\r\n");
 
                 break;
             }
index d244b8d01efd6ac17948d9b8c13e0286a0db36e8..5c0940c932f66365af0e12cd657e8e9d22e03e6e 100644 (file)
@@ -55,7 +55,7 @@ char *global_proxy_host;
 char *global_proxy_port;
 
 /* Passphrase for authentication of this proxy. Used with the -a option. */
-char *http_digest_authorization;
+char *global_http_digest_authorization;
 
 /* Log level, command line option. */
 int global_log_level;