X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fconnection.c;h=abd89758c463c5399ce1a51f0672442d269b201c;hb=3eebfbd0b124c034d57e9ddba051e82fe99ba05f;hp=28f2e699f1d68ae2a41e7d3a36c4cf0f3adb03c1;hpb=28bc2ca1129818da944dcd5f2073cffdc497065c;p=tlsproxy%2Ftlsproxy.git diff --git a/src/connection.c b/src/connection.c index 28f2e69..abd8975 100644 --- a/src/connection.c +++ b/src/connection.c @@ -491,7 +491,12 @@ static int initialize_tls_session_both(int flags, return -1; } +#ifdef HAVE_GNUTLS_TRANSPORT_SET_INT2 + /* gnutls_transport_set_int() is a macro. */ + gnutls_transport_set_int(*session, peer_socket); +#else gnutls_transport_set_ptr(*session, (gnutls_transport_ptr_t)peer_socket); +#endif return 0; } @@ -537,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; } } @@ -559,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; }