summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxebd <xeb@mail.ru>2018-04-20 12:54:58 +0300
committerGitHub <noreply@github.com>2018-04-20 12:54:58 +0300
commitdd1418d6a0d4906c2fa1aaec07f1ea0569d62ad7 (patch)
tree65bd41cf1c31bbd3efdf01f5b547b11112769737
parent1eaf9b4fc806c233e66a86e80705e1e580029599 (diff)
parent1dbc4c4ab811edc1321d502de18fa3f2f9b8dc1b (diff)
downloadaccel-ppp-dd1418d6a0d4906c2fa1aaec07f1ea0569d62ad7.tar.gz
accel-ppp-dd1418d6a0d4906c2fa1aaec07f1ea0569d62ad7.zip
Merge pull request #48 from themiron/sstp
sstp: fix mppe, non-standard port and hostname checking issues
-rw-r--r--accel-pppd/ctrl/sstp/sstp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c
index d6262e8b..0206b69d 100644
--- a/accel-pppd/ctrl/sstp/sstp.c
+++ b/accel-pppd/ctrl/sstp/sstp.c
@@ -834,7 +834,7 @@ static int http_send_response(struct sstp_conn_t *conn, char *proto, char *statu
static int http_recv_request(struct sstp_conn_t *conn, uint8_t *data, int len)
{
char linebuf[1024], protobuf[sizeof("HTTP/1.x")];
- char *line, *method, *request, *proto, *host;
+ char *line, *method, *request, *proto, *host, *ptr;
struct buffer_t buf;
int ret = -1;
@@ -878,8 +878,10 @@ static int http_recv_request(struct sstp_conn_t *conn, uint8_t *data, int len)
if (!host && conf_hostname) {
host = http_getvalue(line, "Host", sizeof("Host") - 1);
- if (host)
- host = _strdup(host);
+ if (host) {
+ ptr = _strdup(host);
+ host = strsep(&ptr, ":");
+ }
}
}
@@ -2193,13 +2195,13 @@ static int sstp_connect(struct triton_md_handler_t *h)
conn->ctrl.ppp = 1;
conn->ctrl.name = "sstp";
conn->ctrl.ifname = "";
- conn->ctrl.mppe = MPPE_UNSET;
+ conn->ctrl.mppe = MPPE_DENY;
- conn->ctrl.calling_station_id = strdup(addr_buf);
+ conn->ctrl.calling_station_id = _strdup(addr_buf);
addr.len = sizeof(addr.u);
getsockname(sock, &addr.u.sa, &addr.len);
sockaddr_ntop(&addr, addr_buf, sizeof(addr_buf));
- conn->ctrl.called_station_id = strdup(addr_buf);
+ conn->ctrl.called_station_id = _strdup(addr_buf);
ppp_init(&conn->ppp);
conn->ppp.ses.ctrl = &conn->ctrl;