summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbenno <>2019-07-29 15:19:03 +0000
committerbenno <>2019-07-29 15:19:03 +0000
commit8aa29ced0a2622bb054d331a201313abcd7d7931 (patch)
tree6b38236e12872d3166ddb09b28b0307091d90e84
parentec5e42f16d114320124e5c4b7965c48a58428be6 (diff)
downloadopenbsd-8aa29ced0a2622bb054d331a201313abcd7d7931.tar.gz
openbsd-8aa29ced0a2622bb054d331a201313abcd7d7931.tar.bz2
openbsd-8aa29ced0a2622bb054d331a201313abcd7d7931.zip
Make proxy auth work with http 1.1 speaking webservers.
Diff from Alexander Koeppe format_c -AT- online -DOT- de, thanks. ok deraadt@
-rw-r--r--src/usr.bin/nc/socks.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/usr.bin/nc/socks.c b/src/usr.bin/nc/socks.c
index 39e4331be3..5ec5c95cd6 100644
--- a/src/usr.bin/nc/socks.c
+++ b/src/usr.bin/nc/socks.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: socks.c,v 1.28 2019/07/03 03:24:02 deraadt Exp $ */ 1/* $OpenBSD: socks.c,v 1.29 2019/07/29 15:19:03 benno Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. 4 * Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
@@ -373,7 +373,8 @@ socks_connect(const char *host, const char *port,
373 /* Read status reply */ 373 /* Read status reply */
374 proxy_read_line(proxyfd, buf, sizeof(buf)); 374 proxy_read_line(proxyfd, buf, sizeof(buf));
375 if (proxyuser != NULL && 375 if (proxyuser != NULL &&
376 strncmp(buf, "HTTP/1.0 407 ", 12) == 0) { 376 (strncmp(buf, "HTTP/1.0 407 ", 12) == 0 ||
377 strncmp(buf, "HTTP/1.1 407 ", 12) == 0)) {
377 if (authretry > 1) { 378 if (authretry > 1) {
378 fprintf(stderr, "Proxy authentication " 379 fprintf(stderr, "Proxy authentication "
379 "failed\n"); 380 "failed\n");