forked from I2P_Developers/i2p.i2p
lint core, console, i2ptunnel, jetty
This commit is contained in:
@@ -56,7 +56,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
|||||||
%><h4><%=intl._t("New proxy settings")%></h4><%
|
%><h4><%=intl._t("New proxy settings")%></h4><%
|
||||||
} %>
|
} %>
|
||||||
<input type="hidden" name="tunnel" value="<%=curTunnel%>" />
|
<input type="hidden" name="tunnel" value="<%=curTunnel%>" />
|
||||||
<input type="hidden" name="nonce" value="<%=editBean.getNextNonce()%>" />
|
<input type="hidden" name="nonce" value="<%=net.i2p.i2ptunnel.web.IndexBean.getNextNonce()%>" />
|
||||||
<input type="hidden" name="type" value="<%=tunnelType%>" />
|
<input type="hidden" name="type" value="<%=tunnelType%>" />
|
||||||
<%
|
<%
|
||||||
// these are four keys that are generated automatically on first save,
|
// these are four keys that are generated automatically on first save,
|
||||||
|
@@ -56,7 +56,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
|||||||
%><h4><%=intl._t("New server settings")%></h4><%
|
%><h4><%=intl._t("New server settings")%></h4><%
|
||||||
} %>
|
} %>
|
||||||
<input type="hidden" name="tunnel" value="<%=curTunnel%>" />
|
<input type="hidden" name="tunnel" value="<%=curTunnel%>" />
|
||||||
<input type="hidden" name="nonce" value="<%=editBean.getNextNonce()%>" />
|
<input type="hidden" name="nonce" value="<%=net.i2p.i2ptunnel.web.IndexBean.getNextNonce()%>" />
|
||||||
<input type="hidden" name="type" value="<%=tunnelType%>" />
|
<input type="hidden" name="type" value="<%=tunnelType%>" />
|
||||||
<%
|
<%
|
||||||
// these are four keys that are generated automatically on first save,
|
// these are four keys that are generated automatically on first save,
|
||||||
|
@@ -60,6 +60,7 @@
|
|||||||
<%
|
<%
|
||||||
|
|
||||||
if (indexBean.isInitialized()) {
|
if (indexBean.isInitialized()) {
|
||||||
|
String nextNonce = net.i2p.i2ptunnel.web.IndexBean.getNextNonce();
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<div id="globalOperationsPanel" class="panel">
|
<div id="globalOperationsPanel" class="panel">
|
||||||
@@ -67,12 +68,12 @@
|
|||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div class="toolbox">
|
<div class="toolbox">
|
||||||
<a class="control" href="wizard"><%=intl._t("Tunnel Wizard")%></a>
|
<a class="control" href="wizard"><%=intl._t("Tunnel Wizard")%></a>
|
||||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Stop%20all"><%=intl._t("Stop All")%></a>
|
<a class="control" href="list?nonce=<%=nextNonce%>&action=Stop%20all"><%=intl._t("Stop All")%></a>
|
||||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Start%20all"><%=intl._t("Start All")%></a>
|
<a class="control" href="list?nonce=<%=nextNonce%>&action=Start%20all"><%=intl._t("Start All")%></a>
|
||||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Restart%20all"><%=intl._t("Restart All")%></a>
|
<a class="control" href="list?nonce=<%=nextNonce%>&action=Restart%20all"><%=intl._t("Restart All")%></a>
|
||||||
<%--
|
<%--
|
||||||
//this is really bad because it stops and restarts all tunnels, which is probably not what you want
|
//this is really bad because it stops and restarts all tunnels, which is probably not what you want
|
||||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Reload%20configuration"><%=intl._t("Reload Config")%></a>
|
<a class="control" href="list?nonce=<%=nextNonce%>&action=Reload%20configuration"><%=intl._t("Reload Config")%></a>
|
||||||
--%>
|
--%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -152,17 +153,17 @@
|
|||||||
switch (indexBean.getTunnelStatus(curServer)) {
|
switch (indexBean.getTunnelStatus(curServer)) {
|
||||||
case IndexBean.STARTING:
|
case IndexBean.STARTING:
|
||||||
%><div class="statusStarting text"><%=intl._t("Starting...")%></div>
|
%><div class="statusStarting text"><%=intl._t("Starting...")%></div>
|
||||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curServer%>"><%=intl._t("Stop")%></a>
|
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&action=stop&tunnel=<%=curServer%>"><%=intl._t("Stop")%></a>
|
||||||
<%
|
<%
|
||||||
break;
|
break;
|
||||||
case IndexBean.RUNNING:
|
case IndexBean.RUNNING:
|
||||||
%><div class="statusRunning text"><%=intl._t("Running")%></div>
|
%><div class="statusRunning text"><%=intl._t("Running")%></div>
|
||||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curServer%>"><%=intl._t("Stop")%></a>
|
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&action=stop&tunnel=<%=curServer%>"><%=intl._t("Stop")%></a>
|
||||||
<%
|
<%
|
||||||
break;
|
break;
|
||||||
case IndexBean.NOT_RUNNING:
|
case IndexBean.NOT_RUNNING:
|
||||||
%><div class="statusNotRunning text"><%=intl._t("Stopped")%></div>
|
%><div class="statusNotRunning text"><%=intl._t("Stopped")%></div>
|
||||||
<a class="control" title="Start this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=start&tunnel=<%=curServer%>"><%=intl._t("Start")%></a>
|
<a class="control" title="Start this Tunnel" href="list?nonce=<%=nextNonce%>&action=start&tunnel=<%=curServer%>"><%=intl._t("Start")%></a>
|
||||||
<%
|
<%
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -275,22 +276,22 @@
|
|||||||
switch (indexBean.getTunnelStatus(curClient)) {
|
switch (indexBean.getTunnelStatus(curClient)) {
|
||||||
case IndexBean.STARTING:
|
case IndexBean.STARTING:
|
||||||
%><div class="statusStarting text"><%=intl._t("Starting...")%></div>
|
%><div class="statusStarting text"><%=intl._t("Starting...")%></div>
|
||||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
|
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
|
||||||
<%
|
<%
|
||||||
break;
|
break;
|
||||||
case IndexBean.STANDBY:
|
case IndexBean.STANDBY:
|
||||||
%><div class="statusStarting text"><%=intl._t("Standby")%></div>
|
%><div class="statusStarting text"><%=intl._t("Standby")%></div>
|
||||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
|
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
|
||||||
<%
|
<%
|
||||||
break;
|
break;
|
||||||
case IndexBean.RUNNING:
|
case IndexBean.RUNNING:
|
||||||
%><div class="statusRunning text"><%=intl._t("Running")%></div>
|
%><div class="statusRunning text"><%=intl._t("Running")%></div>
|
||||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
|
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=nextNonce%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
|
||||||
<%
|
<%
|
||||||
break;
|
break;
|
||||||
case IndexBean.NOT_RUNNING:
|
case IndexBean.NOT_RUNNING:
|
||||||
%><div class="statusNotRunning text"><%=intl._t("Stopped")%></div>
|
%><div class="statusNotRunning text"><%=intl._t("Stopped")%></div>
|
||||||
<a class="control" title="Start this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=start&tunnel=<%=curClient%>"><%=intl._t("Start")%></a>
|
<a class="control" title="Start this Tunnel" href="list?nonce=<%=nextNonce%>&action=start&tunnel=<%=curClient%>"><%=intl._t("Start")%></a>
|
||||||
<%
|
<%
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -92,7 +92,7 @@
|
|||||||
} %>
|
} %>
|
||||||
<input type="hidden" name="page" value="<%=curPage%>" />
|
<input type="hidden" name="page" value="<%=curPage%>" />
|
||||||
<input type="hidden" name="tunnel" value="null" />
|
<input type="hidden" name="tunnel" value="null" />
|
||||||
<input type="hidden" name="nonce" value="<%=editBean.getNextNonce()%>" />
|
<input type="hidden" name="nonce" value="<%=net.i2p.i2ptunnel.web.IndexBean.getNextNonce()%>" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="separator">
|
<div class="separator">
|
||||||
|
@@ -84,11 +84,10 @@ public class XSSRequestWrapper extends HttpServletRequestWrapper {
|
|||||||
* Parameter names starting with "nofilter_" will not be filtered.
|
* Parameter names starting with "nofilter_" will not be filtered.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
public Map<String, String[]> getParameterMap() {
|
||||||
public Map getParameterMap() {
|
Map<String, String[]> rv = new HashMap<String, String[]>();
|
||||||
Map rv = new HashMap();
|
for (Enumeration<String> keys = getParameterNames(); keys.hasMoreElements(); ) {
|
||||||
for (Enumeration keys = getParameterNames(); keys.hasMoreElements(); ) {
|
String k = keys.nextElement();
|
||||||
String k = (String) keys.nextElement();
|
|
||||||
String[] v = getParameterValues(k);
|
String[] v = getParameterValues(k);
|
||||||
if (v != null)
|
if (v != null)
|
||||||
rv.put(k, v);
|
rv.put(k, v);
|
||||||
|
@@ -31,7 +31,7 @@ input.default {
|
|||||||
<%@include file="formhandler.jsi" %>
|
<%@include file="formhandler.jsi" %>
|
||||||
<div class="configure"><div class="topshimten"><h3><%=uihelper._t("Router Console Theme")%></h3></div>
|
<div class="configure"><div class="topshimten"><h3><%=uihelper._t("Router Console Theme")%></h3></div>
|
||||||
<form action="" method="POST">
|
<form action="" method="POST">
|
||||||
<input type="hidden" name="consoleNonce" value="<%=intl.getNonce()%>" >
|
<input type="hidden" name="consoleNonce" value="<%=net.i2p.router.web.CSSHelper.getNonce()%>" >
|
||||||
<input type="hidden" name="nonce" value="<%=pageNonce%>" >
|
<input type="hidden" name="nonce" value="<%=pageNonce%>" >
|
||||||
<input type="hidden" name="action" value="blah" >
|
<input type="hidden" name="action" value="blah" >
|
||||||
<%
|
<%
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
<%@include file="summaryajax.jsi" %>
|
<%@include file="summaryajax.jsi" %>
|
||||||
</head><body onload="initAjax()">
|
</head><body onload="initAjax()">
|
||||||
<%
|
<%
|
||||||
String consoleNonce = intl.getNonce();
|
String consoleNonce = net.i2p.router.web.CSSHelper.getNonce();
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<%@include file="summary.jsi" %>
|
<%@include file="summary.jsi" %>
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
String conNonceParam = request.getParameter("consoleNonce");
|
String conNonceParam = request.getParameter("consoleNonce");
|
||||||
if (intl.getNonce().equals(conNonceParam)) {
|
if (net.i2p.router.web.CSSHelper.getNonce().equals(conNonceParam)) {
|
||||||
intl.setLang(request.getParameter("lang"));
|
intl.setLang(request.getParameter("lang"));
|
||||||
intl.setNews(request.getParameter("news"));
|
intl.setNews(request.getParameter("news"));
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<%@include file="summaryajax.jsi" %>
|
<%@include file="summaryajax.jsi" %>
|
||||||
</head><body onload="initAjax()">
|
</head><body onload="initAjax()">
|
||||||
<%
|
<%
|
||||||
String consoleNonce = intl.getNonce();
|
String consoleNonce = net.i2p.router.web.CSSHelper.getNonce();
|
||||||
%>
|
%>
|
||||||
<jsp:useBean class="net.i2p.router.web.NewsHelper" id="newshelper" scope="request" />
|
<jsp:useBean class="net.i2p.router.web.NewsHelper" id="newshelper" scope="request" />
|
||||||
<jsp:setProperty name="newshelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
|
<jsp:setProperty name="newshelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
if (!shutdownSoon) {
|
if (!shutdownSoon) {
|
||||||
if (d == null || "".equals(d)) {
|
if (d == null || "".equals(d)) {
|
||||||
// set below
|
// set below
|
||||||
} else if (intl.getNonce().equals(conNonceParam)) {
|
} else if (net.i2p.router.web.CSSHelper.getNonce().equals(conNonceParam)) {
|
||||||
d = net.i2p.data.DataHelper.stripHTML(d); // XSS
|
d = net.i2p.data.DataHelper.stripHTML(d); // XSS
|
||||||
intl.setRefresh(d);
|
intl.setRefresh(d);
|
||||||
intl.setDisableRefresh(d);
|
intl.setDisableRefresh(d);
|
||||||
|
@@ -628,6 +628,7 @@ public class KBucketSet<T extends SimpleDataStructure> {
|
|||||||
* @param data size <= SDS length, else throws IAE
|
* @param data size <= SDS length, else throws IAE
|
||||||
* Can be 1 bigger if top byte is zero
|
* Can be 1 bigger if top byte is zero
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private T makeKey(byte[] data) {
|
private T makeKey(byte[] data) {
|
||||||
int len = _us.length();
|
int len = _us.length();
|
||||||
int dlen = data.length;
|
int dlen = data.length;
|
||||||
|
Reference in New Issue
Block a user