Author: infinity0
Date: 2009-03-28 23:04:47 +0000 (Sat, 28 Mar 2009)
New Revision: 26256
Modified:
trunk/freenet/src/freenet/keys/FreenetURI.java
Log:
decode KSK docNames - should fix bug #1383
Modified: trunk/freenet/src/freenet/keys/FreenetURI.java
===================================================================
--- trunk/freenet/src/freenet/keys/FreenetURI.java 2009-03-28 15:31:47 UTC
(rev 26255)
+++ trunk/freenet/src/freenet/keys/FreenetURI.java 2009-03-28 23:04:47 UTC
(rev 26256)
@@ -274,10 +274,15 @@
if(!validKeyType)
throw new MalformedURLException("Invalid key type: " +
keyType);
+ boolean isSSK = "SSK".equals(keyType);
+ boolean isUSK = "USK".equals(keyType);
+ boolean isKSK = "KSK".equals(keyType);
+
// decode metaString
ArrayList<String> sv = null;
int slash2;
sv = new ArrayList<String>();
+ if (isKSK) URI = "/" + URI; // ensure that KSK docNames are
decoded
while ((slash2 = URI.lastIndexOf('/')) != -1) {
String s;
try {
@@ -295,12 +300,8 @@
// sv is *backwards*
// this makes for more efficient handling
- boolean isSSK = "SSK".equals(keyType);
- boolean isUSK = "USK".equals(keyType);
- boolean isKSK = "KSK".equals(keyType);
+ if(isSSK || isUSK || isKSK) {
- if(isSSK || isUSK) {
-
if(sv.isEmpty())
throw new MalformedURLException("No docname for
" + keyType);
docName = sv.remove(sv.size() - 1);
@@ -316,10 +317,6 @@
}
} else
suggestedEdition = -1;
- } else if(isKSK) {
- // Deal with KSKs
- docName = URI;
- suggestedEdition = -1;
} else {
// docName not necessary, nor is it supported, for CHKs.
docName = null;
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs