diff --git a/ChangeLog b/ChangeLog
index e362e8a..8efdff3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
To email a contributor remove "DELETE" from the email address.
(The DELETEs are necessary as this list is published online.)
+2016/02/03 Jeffrey Fulmer
+ * SIEGE RELEASE RELEASE_3-1-4_FEB_02_2016
+ * src/auth.c Patched from 4.x.x
+ * src/auth.h Patched from 4.x.x
+ * src/client.c Patched 407 block from 4.x.x
+ * src/http.c Patched proxy-auth block from 4.x.x
+ * src/version.c Version increment: 3.1.4
+
2015/12/12 Jeffrey Fulmer
* SIEGE BETA RELEASE_3-1-4b2_DEC_12_2015
* configure.ac Added check for sys/types.h
diff --git a/src/auth.c b/src/auth.c
index 10607b7..54bf4f8 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -155,6 +155,10 @@ AUTH
auth_destroy(AUTH this)
{
this->creds = array_destroy(this->creds);
+ xfree(this->basic.encode);
+ xfree(this->digest.encode);
+ xfree(this->ntlm.encode);
+ xfree(this->proxy.encode);
xfree(this);
return NULL;
}
@@ -197,7 +201,7 @@ auth_set_basic_header(AUTH this, SCHEME scheme, char *realm)
CREDS tmp = array_get(this->creds, i);
if (realm == NULL) break;
if (strmatch(creds_get_realm(tmp), realm)) {
- if (creds_get_scheme(tmp) == HTTP || creds_get_scheme(tmp) == HTTPS) {
+ if (creds_get_scheme(tmp) == scheme) {
return __basic_header(this, scheme, tmp);
}
}
@@ -208,7 +212,7 @@ auth_set_basic_header(AUTH this, SCHEME scheme, char *realm)
for (i = 0; i < array_length(this->creds); i++) {
CREDS tmp = array_get(this->creds, i);
if (strmatch(creds_get_realm(tmp), "any")) {
- if (creds_get_scheme(tmp) == HTTP || creds_get_scheme(tmp) == HTTPS) {
+ if (creds_get_scheme(tmp) == scheme) {
return __basic_header(this, scheme, tmp);
}
}
@@ -253,22 +257,29 @@ auth_get_ntlm_header(AUTH this, SCHEME scheme)
}
}
-//digest_generate_authorization(C->auth.wwwchlg, C->auth.wwwcred, "GET", fullpath);
char *
auth_get_digest_header(AUTH this, SCHEME scheme, DCHLG *chlg, DCRED *cred, const char *method, const char *uri)
{
size_t len;
- char *cnonce = NULL;
- char *nonce_count = NULL;
- char *qop = NULL;
- char *response = NULL;
+ char *cnonce = NULL;
+ char *nonce_count = NULL;
+ char *qop = NULL;
+ char *response = NULL;
char *request_digest = NULL;
- char *h_a1 = NULL;
- char *h_a2 = NULL;
- char *opaque = NULL;
- char *result, *tmp;
+ char *h_a1 = NULL;
+ char *h_a2 = NULL;
+ char *opaque = NULL;
+ char *result = NULL;
+ char *tmp = NULL;
+
+ /**
+ * The user probably didn't set login credentials.
+ * We'll return "" here and display a message after
+ * the authorization failure.
+ */
+ if (chlg == NULL || cred == NULL) return "";
- if (NULL != chlg->qop) {
+ if (chlg != NULL && chlg->qop != NULL) {
nonce_count = xstrcat(", nc=", cred->nc, NULL);
cnonce = xstrcat(", cnonce=\"", cred->cnonce_value, "\"", NULL);
@@ -304,7 +315,7 @@ auth_get_digest_header(AUTH this, SCHEME scheme, DCHLG *chlg, DCRED *cred, const
xfree(tmp);
response = xstrcat(" response=\"", request_digest, "\"", NULL);
}
- if (NULL != chlg->opaque)
+ if (chlg != NULL && chlg->opaque != NULL)
opaque = xstrcat(", opaque=\"", chlg->opaque, "\"", NULL);
result = xstrcat (
@@ -544,6 +555,11 @@ __ntlm_header(AUTH this, SCHEME scheme, const char *header, CREDS creds)
return FALSE;
}
+ NOTIFY( // honestly this is here to silence the compiler...
+ DEBUG, "Parsing NTLM header: %d, %d, %s, %s",
+ this->okay, scheme, header, creds_get_username(creds)
+ );
+
header += 4; // Step past NTLM
while (*header && ISSPACE(*header)) {
header++;
diff --git a/src/cfg.c b/src/cfg.c
index 0dd199c..8a5e447 100644
--- a/src/cfg.c
+++ b/src/cfg.c
@@ -35,20 +35,14 @@ BOOLEAN is_variable_line(char *line);
* '#' empty lines beginning with \n
* Takes a char* as an argument
*/
-void
+void
parse(char *str)
{
char *ch;
- char *sp = strchr(str, ' ');
- char *sl = strchr(str, '/');
- if (sl==NULL && sp != NULL) {
- ch = (char *)strstr(str, "#");
- if (ch) {*ch = '\0';}
- }
- ch = (char *)strstr(str, "\n");
- if (ch) {*ch = '\0';}
-
- trim(str);
+ ch = (char *)strstr(str, "#");
+ if (ch){ *ch = '\0'; }
+ ch = (char *)strstr(str, "\n");
+ if (ch){ *ch = '\0'; }
}
/**
diff --git a/src/client.c b/src/client.c
index 06f3b63..2771953 100644
--- a/src/client.c
+++ b/src/client.c
@@ -461,12 +461,14 @@ __http(CONN *C, URL U, CLIENT *client)
if (head->auth.type.proxy == DIGEST) {
BOOLEAN b;
client->auth.type.proxy = DIGEST;
- b = auth_set_digest_header(
+ b = auth_set_digest_header (
my.auth, &(client->auth.pchlg), &(client->auth.pcred), &(client->rand_r_SEED),
head->auth.realm.proxy, head->auth.challenge.proxy
);
if (b == FALSE) {
- NOTIFY(ERROR, "unable to set digest header");
+ fprintf(stderr, "ERROR: Unable to respond to a proxy authorization challenge\n");
+ fprintf(stderr, " in the following HTTP realm: '%s'\n", head->auth.realm.proxy);
+ fprintf(stderr, " Did you set proxy-login credentials in the conf file?\n");
return FALSE;
}
}
diff --git a/src/http.c b/src/http.c
index 154c0f5..2a3c6fd 100644
--- a/src/http.c
+++ b/src/http.c
@@ -162,8 +162,8 @@ http_get(CONN *C, URL U)
if (C->auth.proxy) {
if (C->auth.type.proxy==DIGEST) {
snprintf (
- authwww, sizeof(authwww), "%s",
- auth_get_digest_header(my.auth, HTTP, C->auth.wchlg, C->auth.wcred, url_get_method_name(U), fullpath)
+ authpxy, sizeof(authpxy), "%s",
+ auth_get_digest_header(my.auth, PROXY, C->auth.pchlg, C->auth.pcred, url_get_method_name(U), fullpath)
);
} else {
snprintf(authpxy, sizeof(authpxy), "%s", auth_get_basic_header(my.auth, PROXY));
@@ -313,7 +313,7 @@ http_post(CONN *C, URL U)
authwww, sizeof(authwww), "%s",
auth_get_digest_header(my.auth, HTTP, C->auth.wchlg, C->auth.wcred, url_get_method_name(U), fullpath)
);
- } else if(C->auth.type.www==NTLM) {
+ } else if (C->auth.type.www==NTLM) {
snprintf(authwww, sizeof(authwww), "%s", auth_get_ntlm_header(my.auth, HTTP));
} else {
snprintf(authwww, sizeof(authwww), "%s", auth_get_basic_header(my.auth, HTTP));
@@ -322,8 +322,8 @@ http_post(CONN *C, URL U)
if (C->auth.proxy) {
if (C->auth.type.proxy==DIGEST) {
snprintf (
- authwww, sizeof(authwww), "%s",
- auth_get_digest_header(my.auth, HTTP, C->auth.wchlg, C->auth.wcred, url_get_method_name(U), fullpath)
+ authpxy, sizeof(authpxy), "%s",
+ auth_get_digest_header(my.auth, PROXY, C->auth.pchlg, C->auth.pcred, url_get_method_name(U), fullpath)
);
} else {
snprintf(authpxy, sizeof(authpxy), "%s", auth_get_basic_header(my.auth, PROXY));
diff --git a/src/load.c b/src/load.c
index 672674c..4cfe363 100644
--- a/src/load.c
+++ b/src/load.c
@@ -61,6 +61,7 @@ static const struct ContentType tmap[] = {
{"cpt", FALSE, "application/mac-compactpro"},
{"csh", FALSE, "application/x-csh"},
{"css", TRUE, "text/css"},
+ {"csv", TRUE, "text/csv"},
{"dcr", FALSE, "application/x-director"},
{"dir", FALSE, "application/x-director"},
{"dms", FALSE, "application/octet-stream"},
@@ -87,6 +88,7 @@ static const struct ContentType tmap[] = {
{"htm", TRUE, "text/html"},
{"html", TRUE, "text/html"},
{"ice", FALSE, "x-conference/x-cooltalk"},
+ {"ico", FALSE, "image/x-icon"},
{"ief", FALSE, "image/ief"},
{"iges", FALSE, "model/iges"},
{"igs", FALSE, "model/iges"},
@@ -104,6 +106,7 @@ static const struct ContentType tmap[] = {
{"lzh", FALSE, "application/octet-stream"},
{"m", TRUE, "text/plain"},
{"man", FALSE, "application/x-troff-man"},
+ {"md", TRUE, "text/x-markdown"},
{"me", FALSE, "application/x-troff-me"},
{"mesh", FALSE, "model/mesh"},
{"mid", FALSE, "audio/midi"},
@@ -170,6 +173,7 @@ static const struct ContentType tmap[] = {
{"stp", FALSE, "application/STEP"},
{"sv4cpio", FALSE, "application/x-sv4cpio"},
{"sv4crc", FALSE, "application/x-sv4crc"},
+ {"svg", TRUE, "image/svg+xml"},
{"swf", FALSE, "application/x-shockwave-flash"},
{"t", FALSE, "application/x-troff"},
{"tar", FALSE, "application/x-tar"},
@@ -203,6 +207,7 @@ static const struct ContentType tmap[] = {
{"xpm", FALSE, "image/x-xpixmap"},
{"xwd", FALSE, "image/x-xwindowdump"},
{"xyz", FALSE, "chemical/x-pdb"},
+ {"yml", TRUE, "application/x-yaml"},
{"zip", FALSE, "application/zip"}
};
diff --git a/src/version.c b/src/version.c
index ffccd65..396e614 100644
--- a/src/version.c
+++ b/src/version.c
@@ -4,7 +4,7 @@
* used by configure to dynamically assign those values
* to documentation files.
*/
-const char *version_string = "3.1.4-beta2";
+const char *version_string = "3.1.4";
const char *program_name = "siege";
const char *author_name = "Jeffrey Fulmer, et al.";
const char *email_address = "jeff@joedog.org";