Author: toad
Date: 2009-01-21 14:24:52 +0000 (Wed, 21 Jan 2009)
New Revision: 25185

Modified:
   trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
   trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java
   trunk/freenet/src/freenet/clients/http/ConnectivityToadlet.java
   trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
   trunk/freenet/src/freenet/clients/http/OpennetConnectionsToadlet.java
   trunk/freenet/src/freenet/clients/http/PageMaker.java
   trunk/freenet/src/freenet/clients/http/QueueToadlet.java
   trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
   trunk/freenet/src/freenet/clients/http/ToadletContainer.java
   trunk/freenet/src/freenet/clients/http/ToadletContext.java
   trunk/freenet/src/freenet/node/NodeCrypto.java
Log:
Revert more history cloaking:
24936
24935
24934
24932
24931


Modified: trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ConfigToadlet.java   2009-01-21 
14:19:01 UTC (rev 25184)
+++ trunk/freenet/src/freenet/clients/http/ConfigToadlet.java   2009-01-21 
14:24:52 UTC (rev 25185)
@@ -72,8 +72,8 @@
                        if (node.isUsingWrapper()) {
                                alertNode.addChild("br");
                                HTMLNode restartForm = 
alertNode.addChild("form", //
-                                               new String[] { "action", 
"method", "enctype" },//
-                                       new String[] { "/", "post", 
"multipart/form-data" });
+                                               new String[] { "action", 
"method" },//
+                                       new String[] { "/", "get" });
                                restartForm.addChild("div");
                                restartForm.addChild("input",//
                                                new String[] { "type", "name" 
},//
@@ -297,7 +297,9 @@
 
                                if (node.isUsingWrapper()) {
                                        content.addChild("br");
-                                       HTMLNode restartForm = 
ctx.addFormChild(content, "/", "restartForm").addChild("div");
+                                       HTMLNode restartForm = 
content.addChild("form",//
+                                               new String[] { "action", 
"method" }, new String[] { "/", "get" }//
+                                               ).addChild("div");
                                        restartForm.addChild("input",//
                                                new String[] { "type", "name" 
},//
                                                new String[] { "hidden", 
"restart" });
@@ -352,7 +354,7 @@
                
                contentNode.addChild(core.alerts.createSummary());
                
-               final int mode = 
ctx.getPageMaker().drawModeSelectionArray(core, ctx, req, contentNode, 
MODE_SECURITY_LEVELS, "SecurityLevels.title", "SecurityLevels.tooltip", 
"/config/");
+               final int mode = 
ctx.getPageMaker().drawModeSelectionArray(core, req, contentNode, 
MODE_SECURITY_LEVELS, "SecurityLevels.title", "SecurityLevels.tooltip");
                
                if(mode == MODE_SECURITY_LEVELS) {
                        drawSecurityLevelsPage(contentNode, ctx);
@@ -362,7 +364,7 @@
                        HTMLNode navigationBar = 
ctx.getPageMaker().getInfobox("navbar", l10n("configNavTitle"));
                        HTMLNode navigationContent = 
ctx.getPageMaker().getContentNode(navigationBar).addChild("ul");
                        
if(!L10n.getSelectedLanguage().equals(L10n.LANGUAGE.getDefault()))
-                               navigationContent.addChild("a", "href", 
ctx.fixLink(TranslationToadlet.TOADLET_URL), l10n("contributeTranslation"));
+                               navigationContent.addChild("a", "href", 
TranslationToadlet.TOADLET_URL, l10n("contributeTranslation"));
                        HTMLNode navigationTable = 
navigationContent.addChild("table", "class", "config_navigation");
                        HTMLNode navigationTableRow = 
navigationTable.addChild("tr");
                        HTMLNode nextTableCell = navigationTableRow;

Modified: trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java      
2009-01-21 14:19:01 UTC (rev 25184)
+++ trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java      
2009-01-21 14:24:52 UTC (rev 25185)
@@ -236,8 +236,8 @@
                long now = System.currentTimeMillis();
        
                if(ctx.isAllowedFullAccess())
-                       contentNode.addChild(core.alerts.createSummary(ctx));
-               final int mode = 
ctx.getPageMaker().drawModeSelectionArray(core, ctx, request, contentNode, 
getURL());
+                       contentNode.addChild(core.alerts.createSummary());
+               final int mode = 
ctx.getPageMaker().drawModeSelectionArray(core, request, contentNode);
                
                if(peerNodeStatuses.length>0){
 
@@ -476,8 +476,6 @@
                this.writeHTMLReply(ctx, 200, "OK", pageNode.generate());
        }
 
-       protected abstract String getURL();
-
        protected abstract boolean acceptRefPosts();
        
        /** Where to redirect to if there is an error */

Modified: trunk/freenet/src/freenet/clients/http/ConnectivityToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ConnectivityToadlet.java     
2009-01-21 14:19:01 UTC (rev 25184)
+++ trunk/freenet/src/freenet/clients/http/ConnectivityToadlet.java     
2009-01-21 14:24:52 UTC (rev 25185)
@@ -64,8 +64,8 @@
 
                /* add alert summary box */
                if(ctx.isAllowedFullAccess())
-                       contentNode.addChild(core.alerts.createSummary(ctx));
-               final int mode = 
ctx.getPageMaker().drawModeSelectionArray(core, ctx, request, contentNode, 
"/connectivity/");
+                       contentNode.addChild(core.alerts.createSummary());
+               final int mode = 
ctx.getPageMaker().drawModeSelectionArray(core, request, contentNode);
 
                // Add connection type box.
                

Modified: trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java       
2009-01-21 14:19:01 UTC (rev 25184)
+++ trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java       
2009-01-21 14:24:52 UTC (rev 25185)
@@ -401,9 +401,4 @@
                return null;
        }
 
-       @Override
-       protected String getURL() {
-               return "/friends/";
-       }
-
 }

Modified: trunk/freenet/src/freenet/clients/http/OpennetConnectionsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/OpennetConnectionsToadlet.java       
2009-01-21 14:19:01 UTC (rev 25184)
+++ trunk/freenet/src/freenet/clients/http/OpennetConnectionsToadlet.java       
2009-01-21 14:24:52 UTC (rev 25185)
@@ -145,10 +145,5 @@
                                        }
                                }};
        }
-
-       @Override
-       protected String getURL() {
-               return "/strangers/";
-       }
                
 }

Modified: trunk/freenet/src/freenet/clients/http/PageMaker.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/PageMaker.java       2009-01-21 
14:19:01 UTC (rev 25184)
+++ trunk/freenet/src/freenet/clients/http/PageMaker.java       2009-01-21 
14:24:52 UTC (rev 25185)
@@ -146,12 +146,12 @@
                headNode.addChild("meta", new String[] { "http-equiv", 
"content" }, new String[] { "Content-Type", "text/html; charset=utf-8" });
                headNode.addChild("title", title + " - Freenet");
                if(override == null)
-                       headNode.addChild("link", new String[] { "rel", "href", 
"type", "title" }, new String[] { "stylesheet", ctx.fixLink("/static/themes/" + 
theme.code + "/theme.css"), "text/css", theme.code });
+                       headNode.addChild("link", new String[] { "rel", "href", 
"type", "title" }, new String[] { "stylesheet", "/static/themes/" + theme.code 
+ "/theme.css", "text/css", theme.code });
                else
                        headNode.addChild(getOverrideContent());
                for (THEME t: THEME.values()) {
                        String themeName = t.code;
-                       headNode.addChild("link", new String[] { "rel", "href", 
"type", "media", "title" }, new String[] { "alternate stylesheet", 
ctx.fixLink("/static/themes/" + themeName + "/theme.css"), "text/css", 
"screen", themeName });
+                       headNode.addChild("link", new String[] { "rel", "href", 
"type", "media", "title" }, new String[] { "alternate stylesheet", 
"/static/themes/" + themeName + "/theme.css", "text/css", "screen", themeName 
});
                }
                
                HTMLNode bodyNode = htmlNode.addChild("body");
@@ -168,9 +168,9 @@
                                String navigationPath = 
navigationLinks.get(navigationLink);
                                HTMLNode listItem = navbarUl.addChild("li");
                                if (plugin != null)
-                                       listItem.addChild("a", new String[] { 
"href", "title" }, new String[] { ctx.fixLink(navigationPath), 
plugin.getString(navigationTitle) }, plugin.getString(navigationLink));
+                                       listItem.addChild("a", new String[] { 
"href", "title" }, new String[] { navigationPath, 
plugin.getString(navigationTitle) }, plugin.getString(navigationLink));
                                else
-                                       listItem.addChild("a", new String[] { 
"href", "title" }, new String[] { ctx.fixLink(navigationPath), 
L10n.getString(navigationTitle) }, L10n.getString(navigationLink));
+                                       listItem.addChild("a", new String[] { 
"href", "title" }, new String[] { navigationPath, 
L10n.getString(navigationTitle) }, L10n.getString(navigationLink));
                        }
                }
                HTMLNode contentDiv = pageDiv.addChild("div", "id", "content");
@@ -254,11 +254,11 @@
                return result;
        }
        
-       protected int drawModeSelectionArray(NodeClientCore core, LinkFixer 
fixer, HTTPRequest req, HTMLNode contentNode, String baseURL) {
-               return drawModeSelectionArray(core, fixer, req, contentNode, 
-1, null, null, baseURL);
+       protected int drawModeSelectionArray(NodeClientCore core, HTTPRequest 
req, HTMLNode contentNode) {
+               return drawModeSelectionArray(core, req, contentNode, -1, null, 
null);
        }
        
-       protected int drawModeSelectionArray(NodeClientCore core, LinkFixer 
fixer, HTTPRequest req, HTMLNode contentNode, int alternateMode, String 
alternateModeTitleKey, String alternateModeTooltipKey, String baseURL) {
+       protected int drawModeSelectionArray(NodeClientCore core, HTTPRequest 
req, HTMLNode contentNode, int alternateMode, String alternateModeTitleKey, 
String alternateModeTooltipKey) {
                // Mode can be changed by a link, not just by the default
                
                int mode = core.isAdvancedModeEnabled() ? MODE_ADVANCED : 
MODE_SIMPLE;
@@ -274,19 +274,19 @@
                
                if(alternateMode > -1) {
                        if(mode != alternateMode)
-                               cell.addChild("a", new String[] { "href", 
"title" }, new String[] { fixer.fixLink(baseURL+"?mode="+alternateMode), 
L10n.getString(alternateModeTooltipKey) }, 
L10n.getString(alternateModeTitleKey));
+                               cell.addChild("a", new String[] { "href", 
"title" }, new String[] { "?mode="+alternateMode, 
L10n.getString(alternateModeTooltipKey) }, 
L10n.getString(alternateModeTitleKey));
                        else
                                cell.addChild("b", "title", 
L10n.getString(alternateModeTooltipKey), L10n.getString(alternateModeTitleKey));
                        cell = row.addChild("td");
                }
                
                if(mode != MODE_SIMPLE)
-                       cell.addChild("a", new String[] { "href", "title" }, 
new String[] { fixer.fixLink(baseURL+"?mode=1"), l10n("modeSimpleTooltip") }, 
l10n("modeSimple"));
+                       cell.addChild("a", new String[] { "href", "title" }, 
new String[] { "?mode=1", l10n("modeSimpleTooltip") }, l10n("modeSimple"));
                else
                        cell.addChild("b", "title", l10n("modeSimpleTooltip"), 
l10n("modeSimple"));
                cell = row.addChild("td");
                if(mode != MODE_ADVANCED)
-                       cell.addChild("a", new String[] { "href", "title" }, 
new String[] { fixer.fixLink(baseURL+"?mode=2"), l10n("modeAdvancedTooltip") }, 
l10n("modeAdvanced"));
+                       cell.addChild("a", new String[] { "href", "title" }, 
new String[] { "?mode=2", l10n("modeAdvancedTooltip") }, l10n("modeAdvanced"));
                else
                        cell.addChild("b", "title", 
l10n("modeAdvancedTooltip"), l10n("modeAdvanced"));
                return mode;

Modified: trunk/freenet/src/freenet/clients/http/QueueToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/QueueToadlet.java    2009-01-21 
14:19:01 UTC (rev 25184)
+++ trunk/freenet/src/freenet/clients/http/QueueToadlet.java    2009-01-21 
14:24:52 UTC (rev 25185)
@@ -520,7 +520,7 @@
                                                        String mimeType = 
clientGet.getMIMEType();
                                                        String 
requestedMimeType = request.getParam("type", null);
                                                        String forceString = 
request.getParam("force");
-                                                       
FProxyToadlet.handleDownload(ctx, data, ctx.getBucketFactory(), mimeType, 
requestedMimeType, forceString, request.isParameterSet("forcedownload"), 
"/queue/", uri, "", "/queue/", false, ctx, core);
+                                                       
FProxyToadlet.handleDownload(ctx, data, ctx.getBucketFactory(), mimeType, 
requestedMimeType, forceString, request.isParameterSet("forcedownload"), 
"/queue/", key, "", "/queue/", false, ctx, core);
                                                        return;
                                                }
                                        }
@@ -673,8 +673,8 @@
 
                /* add alert summary box */
                if(ctx.isAllowedFullAccess())
-                       contentNode.addChild(core.alerts.createSummary(ctx));
-               final int mode = pageMaker.drawModeSelectionArray(core, ctx, 
request, contentNode, "/queue/");
+                       contentNode.addChild(core.alerts.createSummary());
+               final int mode = pageMaker.drawModeSelectionArray(core, 
request, contentNode);
                /* add file insert box */
                contentNode.addChild(createInsertBox(pageMaker, ctx, mode >= 
PageMaker.MODE_ADVANCED));
 

Modified: trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java       
2009-01-21 14:19:01 UTC (rev 25184)
+++ trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java       
2009-01-21 14:24:52 UTC (rev 25185)
@@ -150,8 +150,8 @@
                final long nodeUptimeSeconds = (now - node.startupTime) / 1000;
 
                if(ctx.isAllowedFullAccess())
-                       contentNode.addChild(core.alerts.createSummary(ctx));
-               final int mode = 
ctx.getPageMaker().drawModeSelectionArray(core, ctx, request, contentNode, 
"/stats/");
+                       contentNode.addChild(core.alerts.createSummary());
+               final int mode = 
ctx.getPageMaker().drawModeSelectionArray(core, request, contentNode);
 
                double swaps = node.getSwaps();
                double noSwaps = node.getNoSwaps();

Modified: trunk/freenet/src/freenet/clients/http/ToadletContainer.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ToadletContainer.java        
2009-01-21 14:19:01 UTC (rev 25184)
+++ trunk/freenet/src/freenet/clients/http/ToadletContainer.java        
2009-01-21 14:24:52 UTC (rev 25185)
@@ -12,7 +12,7 @@
 import freenet.support.api.BucketFactory;
 
 /** Interface for toadlet containers. Toadlets should register here. */
-public interface ToadletContainer extends LinkFixer {
+public interface ToadletContainer {
        
        /** Register a Toadlet. All requests whose URL starts with the given
         * prefix will be passed to this toadlet.
@@ -63,20 +63,5 @@
         * queue or anything else that might conceivably result in a DoS. */
        public boolean publicGatewayMode();
 
-       /** Generate the secure-id for a specific path. This is a longish string
-        * which is generated from a node-specific nonce and the URI. It must be
-        * supplied or the node will complain. It is used to ensure that 
guessable
-        * URIs don't go into the browser history.
-        * @param realPath
-        * @return
-        */
-       public String generateSID(String realPath);
-
-       /**
-        * If true, secure-id checking is disabled.
-        * @return
-        */
-       public boolean isSecureIDCheckingDisabled();
-
        public boolean enableActivelinks();
 }

Modified: trunk/freenet/src/freenet/clients/http/ToadletContext.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ToadletContext.java  2009-01-21 
14:19:01 UTC (rev 25184)
+++ trunk/freenet/src/freenet/clients/http/ToadletContext.java  2009-01-21 
14:24:52 UTC (rev 25185)
@@ -12,7 +12,7 @@
  * Object represents context for a single request. Is used as a token,
  * when the Toadlet wants to e.g. write a reply.
  */
-public interface ToadletContext extends LinkFixer {
+public interface ToadletContext {
 
        /**
         * Write reply headers.
@@ -85,13 +85,5 @@
        boolean doRobots();
 
        ToadletContainer getContainer();
-
-       /**
-        * Add a valid ?sessionid= to a link
-        * @param string
-        * @param string2
-        * @return
-        */
-       String fixLink(String orig);
 }
 

Modified: trunk/freenet/src/freenet/node/NodeCrypto.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeCrypto.java      2009-01-21 14:19:01 UTC 
(rev 25184)
+++ trunk/freenet/src/freenet/node/NodeCrypto.java      2009-01-21 14:24:52 UTC 
(rev 25185)
@@ -58,6 +58,8 @@
        byte[] identityHash;
        /** Hash of hash of identity i.e. hash of setup key. */
        byte[] identityHashHash;
+       /** Nonce used to generate ?secureid= for fproxy etc */
+       byte[] clientNonce;
        /** My crypto group */
        private DSAGroup cryptoGroup;
        /** My private key */
@@ -231,6 +233,18 @@
                }
                myARK = ark;
                
+               String cn = fs.get("clientNonce");
+               if(cn != null) {
+                       try {
+                               clientNonce = Base64.decode(cn);
+                       } catch (IllegalBase64Exception e) {
+                               throw new IOException("Invalid clientNonce 
field: "+e);
+                       }
+               } else {
+                       clientNonce = new byte[32];
+                       node.random.nextBytes(clientNonce);
+               }
+               
        }
 
        /**
@@ -249,6 +263,8 @@
                myARKNumber = 0;
                SHA256.returnMessageDigest(md);
                anonSetupCipher.initialize(identityHash);
+               clientNonce = new byte[32];
+               node.random.nextBytes(clientNonce);
        }
 
        public void start(boolean disableHangchecker) {
@@ -433,6 +449,7 @@
                // We must save the location!
                if(fs.get("location") == null)
                        fs.put("location", node.lm.getLocation());
+               fs.putSingle("clientNonce", Base64.encode(clientNonce));
                
        }
 

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to