merge of '1ba9885122d9a9ec69c77342719d8464aae244be'

and 'c61353ade089ac0e1fa83fab661dc6893b51b95a'
This commit is contained in:
dg2-new
2015-07-22 23:34:32 +00:00
13 changed files with 918 additions and 853 deletions

File diff suppressed because it is too large Load Diff

View File

@ -817,7 +817,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
* @throws BadRequestException on bad headers
* @throws IOException on other errors in the underlying stream
*/
private static Map<String, List<String>> readHeaders(I2PSocket socket, InputStream in, StringBuilder command,
static Map<String, List<String>> readHeaders(I2PSocket socket, InputStream in, StringBuilder command,
String[] skipHeaders, I2PAppContext ctx) throws IOException {
HashMap<String, List<String>> headers = new HashMap<String, List<String>>();
StringBuilder buf = new StringBuilder(128);

View File

@ -28,7 +28,7 @@ public class I2PTunnelHTTPServerTest extends TestCase {
headerString += "BLAH: something\r\n";
headerString += "\r\n";
InputStream in = fillInputStream(headerString);
Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(in, new StringBuilder(128), new String[0], I2PAppContext.getGlobalContext());
Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(null, in, new StringBuilder(128), new String[0], I2PAppContext.getGlobalContext());
assertEquals(headers.size(), 1); //One header
}
@ -38,7 +38,7 @@ public class I2PTunnelHTTPServerTest extends TestCase {
headerString += "someHeader: oh my, duplication!\r\n";
headerString += "\r\n";
InputStream in = fillInputStream(headerString);
Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(in, new StringBuilder(128), new String[0], I2PAppContext.getGlobalContext());
Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(null, in, new StringBuilder(128), new String[0], I2PAppContext.getGlobalContext());
assertEquals(headers.size(), 1);
assertEquals(headers.get("someHeader").size(), 2);
}
@ -51,7 +51,7 @@ public class I2PTunnelHTTPServerTest extends TestCase {
headerString += "\r\n";
InputStream in = fillInputStream(headerString);
StringBuilder builder = new StringBuilder(128);
Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(in, builder, new String[0], I2PAppContext.getGlobalContext());
Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(null, in, builder, new String[0], I2PAppContext.getGlobalContext());
String result = I2PTunnelHTTPServer.formatHeaders(headers, builder);
int first = result.indexOf("abc");
assertTrue(first >= 0);

View File

@ -10,6 +10,7 @@ import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@ -18,6 +19,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TimeZone;
import net.i2p.crypto.SU3File;
import net.i2p.crypto.TrustedUpdate;
@ -553,11 +555,19 @@ class NewsFetcher extends UpdateRunner {
out.write("-->\n");
if (entries == null)
return;
DateFormat fmt = DateFormat.getDateInstance(DateFormat.SHORT);
// the router sets the JVM time zone to UTC but saves the original here so we can get it
String systemTimeZone = _context.getProperty("i2p.systemTimeZone");
if (systemTimeZone != null)
fmt.setTimeZone(TimeZone.getTimeZone(systemTimeZone));
for (NewsEntry e : entries) {
if (e.title == null || e.content == null)
continue;
out.write("<!-- Entry Date: " + (new Date(e.updated)) + " -->\n");
Date date = new Date(e.updated);
out.write("<!-- Entry Date: " + date + " -->\n");
out.write("<h3>");
out.write(fmt.format(date));
out.write(": ");
out.write(e.title);
out.write("</h3>\n");
out.write(e.content);

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: I2P routerconsole\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-10-14 13:33+0000\n"
"POT-Creation-Date: 2015-07-17 01:33+0000\n"
"PO-Revision-Date: 2010-06-15 14:09+0100\n"
"Last-Translator: duck <duck@mail.i2p>\n"
"Language-Team: duck <duck@mail.i2p>\n"
@ -51,6 +51,9 @@ msgstr ""
msgid "Angola"
msgstr ""
msgid "Asia/Pacific Region"
msgstr ""
msgid "Antarctica"
msgstr ""
@ -102,6 +105,9 @@ msgstr ""
msgid "Benin"
msgstr ""
msgid "Saint Barthélemy"
msgstr ""
msgid "Bermuda"
msgstr ""
@ -111,6 +117,9 @@ msgstr ""
msgid "Bolivia"
msgstr ""
msgid "Bonaire"
msgstr ""
msgid "Brazil"
msgstr ""
@ -138,15 +147,12 @@ msgstr ""
msgid "Cocos (Keeling) Islands"
msgstr ""
msgid "The Democratic Republic of the Congo"
msgid "Congo"
msgstr ""
msgid "Central African Republic"
msgstr ""
msgid "Congo"
msgstr ""
msgid "Switzerland"
msgstr ""
@ -243,7 +249,7 @@ msgstr ""
msgid "Falkland Islands (Malvinas)"
msgstr ""
msgid "Federated States of Micronesia"
msgid "Micronesia"
msgstr ""
msgid "Faroe Islands"
@ -345,7 +351,7 @@ msgstr ""
msgid "Iraq"
msgstr ""
msgid "Islamic Republic of Iran"
msgid "Iran"
msgstr ""
msgid "Iceland"
@ -384,7 +390,7 @@ msgstr ""
msgid "Saint Kitts and Nevis"
msgstr ""
msgid "The Democratic People's Republic of Korea"
msgid "North Korea"
msgstr ""
msgid "Republic of Korea"
@ -429,7 +435,7 @@ msgstr ""
msgid "Latvia"
msgstr ""
msgid "Libyan Arab Jamahiriya"
msgid "Libya"
msgstr ""
msgid "Morocco"
@ -438,7 +444,7 @@ msgstr ""
msgid "Monaco"
msgstr ""
msgid "Republic of Moldova"
msgid "Moldova"
msgstr ""
msgid "Montenegro"
@ -453,7 +459,7 @@ msgstr ""
msgid "Marshall Islands"
msgstr ""
msgid "The Former Yugoslav Republic of Macedonia"
msgid "Macedonia"
msgstr ""
msgid "Mali"
@ -465,7 +471,7 @@ msgstr ""
msgid "Mongolia"
msgstr ""
msgid "Macao"
msgid "Macau"
msgstr ""
msgid "Northern Mariana Islands"
@ -645,13 +651,19 @@ msgstr ""
msgid "Suriname"
msgstr ""
msgid "South Sudan"
msgstr ""
msgid "Sao Tome and Principe"
msgstr ""
msgid "El Salvador"
msgstr ""
msgid "Syrian Arab Republic"
msgid "Sint Maarten"
msgstr ""
msgid "Syria"
msgstr ""
msgid "Swaziland"
@ -702,7 +714,7 @@ msgstr ""
msgid "Taiwan"
msgstr ""
msgid "United Republic of Tanzania"
msgid "Tanzania"
msgstr ""
msgid "Ukraine"
@ -723,7 +735,7 @@ msgstr ""
msgid "Uzbekistan"
msgstr ""
msgid "Holy See (Vatican City State)"
msgid "Vatican"
msgstr ""
msgid "Saint Vincent and the Grenadines"
@ -735,7 +747,7 @@ msgstr ""
msgid "Virgin Islands"
msgstr ""
msgid "Viet Nam"
msgid "Vietnam"
msgstr ""
msgid "Vanuatu"

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: I2P susidns\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-14 08:33+0000\n"
"POT-Creation-Date: 2015-07-17 01:33+0000\n"
"PO-Revision-Date: 2010-06-15 14:09+0100\n"
"Last-Translator: duck <duck@mail.i2p>\n"
"Language-Team: duck <duck@mail.i2p>\n"
@ -222,7 +222,7 @@ msgstr ""
#: ../src/java/src/i2p/susi/dns/AddressbookBean.java:326
#: ../src/java/src/i2p/susi/dns/ConfigBean.java:108
#: ../src/java/src/i2p/susi/dns/NamingServiceBean.java:316
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:153
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:157
msgid ""
"Invalid form submission, probably because you used the \"back\" or \"reload"
"\" button on your browser. Please resubmit."
@ -231,14 +231,14 @@ msgstr ""
#: ../src/java/src/i2p/susi/dns/AddressbookBean.java:328
#: ../src/java/src/i2p/susi/dns/ConfigBean.java:110
#: ../src/java/src/i2p/susi/dns/NamingServiceBean.java:318
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:155
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:159
msgid ""
"If the problem persists, verify that you have cookies enabled in your "
"browser."
msgstr ""
#: ../src/java/src/i2p/susi/dns/ConfigBean.java:99
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:128
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:131
#: ../src/tmp/i2p/susi/dns/jsp/config_jsp.java:160
#: ../src/tmp/i2p/susi/dns/jsp/subscriptions_jsp.java:151
msgid "Save"
@ -249,7 +249,7 @@ msgid "Configuration saved."
msgstr ""
#: ../src/java/src/i2p/susi/dns/ConfigBean.java:102
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:147
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:151
#: ../src/tmp/i2p/susi/dns/jsp/config_jsp.java:158
#: ../src/tmp/i2p/susi/dns/jsp/subscriptions_jsp.java:149
msgid "Reload"
@ -278,16 +278,16 @@ msgstr ""
msgid "Failed to delete Destination for {0} from naming service {1}"
msgstr ""
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:140
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:144
msgid ""
"Subscriptions saved, updating addressbook from subscription sources now."
msgstr ""
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:145
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:149
msgid "Subscriptions saved."
msgstr ""
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:149
#: ../src/java/src/i2p/susi/dns/SubscriptionsBean.java:153
msgid "Subscriptions reloaded."
msgstr ""

View File

@ -122,7 +122,7 @@ public class KeyCertificate extends Certificate {
/**
* Signing Key extra data, if any, is first in the array.
* Crypto Key extra data, if any, is second in the array,
* at offset max(0, 128 - getSigType().getPubkeyLen()
* at offset max(0, getSigType().getPubkeyLen() - 128)
*
* @return null if unset or none
*/
@ -148,7 +148,7 @@ public class KeyCertificate extends Certificate {
SigType type = getSigType();
if (type == null)
throw new UnsupportedOperationException("unknown sig type");
int extra = 128 - type.getPubkeyLen();
int extra = Math.max(0, type.getPubkeyLen() - 128);
if (_payload.length == HEADER_LENGTH + extra)
return getExtraKeyData();
byte[] rv = new byte[extra];

View File

@ -0,0 +1,45 @@
package net.i2p.data;
/*
* free (adj.): unencumbered; not under the control of others
* Written by str4d in 2015 and released into the public domain
* with no warranty of any kind, either expressed or implied.
* It probably won't make your computer catch on fire, or eat
* your children, but it might. Use at your own risk.
*
*/
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import net.i2p.crypto.EncType;
import net.i2p.crypto.SigType;
import junit.framework.TestCase;
/**
* @author str4d
*/
public class KeyCertificateTest extends TestCase {
private static final byte[] P256_PAYLOAD = new byte[] {
0, (byte) (SigType.ECDSA_SHA256_P256.getCode()),
0, (byte) (EncType.EC_P256.getCode())
};
private static final byte[] P521_PAYLOAD = new byte[] {
0, (byte) (SigType.ECDSA_SHA512_P521.getCode()),
0, (byte) (EncType.ELGAMAL_2048.getCode()),
0, 0, 0, 0
};
public void testFromP256Payload() throws DataFormatException {
KeyCertificate cert = new KeyCertificate(P256_PAYLOAD);
assertThat(cert.getSigTypeCode(), is(equalTo(SigType.ECDSA_SHA256_P256.getCode())));
assertThat(cert.getCryptoTypeCode(), is(equalTo(EncType.EC_P256.getCode())));
assertThat(cert.getExtraSigningKeyData(), is(nullValue()));
}
public void testFromEd25519Payload() throws DataFormatException {
KeyCertificate cert = new KeyCertificate(P521_PAYLOAD);
assertThat(cert.getSigTypeCode(), is(equalTo(SigType.ECDSA_SHA512_P521.getCode())));
assertThat(cert.getCryptoTypeCode(), is(equalTo(EncType.ELGAMAL_2048.getCode())));
assertThat(cert.getExtraSigningKeyData().length, is(4));
}
}

View File

@ -1,3 +1,6 @@
2015-07-16 zzz
* Console: Add dates to news headings
2015-07-12 zzz
* Findbugs all over

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: I2P startup script\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-18 20:15+0000\n"
"POT-Creation-Date: 2015-07-17 01:16+0000\n"
"PO-Revision-Date: 2012-12-21 23:34+0000\n"
"Last-Translator: kytv <killyourtv@mail.i2p>\n"
"Language-Team: English \n"
@ -22,176 +22,176 @@ msgstr ""
msgid "Failed to load the wrapper"
msgstr ""
#: ../i2prouter:943 ../i2prouter:967 ../i2prouter:1041 ../i2prouter:1069
#: ../i2prouter:1090
#: ../i2prouter:978 ../i2prouter:1006 ../i2prouter:1080 ../i2prouter:1108
#: ../i2prouter:1129
#, sh-format
msgid "$APP_LONG_NAME is already running."
msgstr ""
#: ../i2prouter:954
#: ../i2prouter:989
#, sh-format
msgid "Running $APP_LONG_NAME"
msgstr ""
#: ../i2prouter:974
#: ../i2prouter:1013
#, sh-format
msgid "Waiting for $APP_LONG_NAME"
msgstr ""
#: ../i2prouter:1021
#: ../i2prouter:1060
#, sh-format
msgid "WARNING: $APP_LONG_NAME may have failed to start."
msgstr ""
#: ../i2prouter:1035 ../i2prouter:1063 ../i2prouter:1269 ../i2prouter:1558
#: ../i2prouter:1074 ../i2prouter:1102 ../i2prouter:1308 ../i2prouter:1597
msgid "Must be root to perform this action."
msgstr ""
#: ../i2prouter:1079
#: ../i2prouter:1118
#, sh-format
msgid "Starting $APP_LONG_NAME"
msgstr ""
#: ../i2prouter:1101
#: ../i2prouter:1140
#, sh-format
msgid "Stopping $APP_LONG_NAME"
msgstr ""
#: ../i2prouter:1105 ../i2prouter:1173 ../i2prouter:1726
#: ../i2prouter:1144 ../i2prouter:1212 ../i2prouter:1765
#, sh-format
msgid "$APP_LONG_NAME was not running."
msgstr ""
#: ../i2prouter:1118 ../i2prouter:1126 ../i2prouter:1188 ../i2prouter:1196
#: ../i2prouter:1157 ../i2prouter:1165 ../i2prouter:1227 ../i2prouter:1235
#, sh-format
msgid "Unable to stop $APP_LONG_NAME."
msgstr ""
#: ../i2prouter:1144
#: ../i2prouter:1183
#, sh-format
msgid "Waiting for $APP_LONG_NAME to exit"
msgstr ""
#: ../i2prouter:1158
#: ../i2prouter:1197
#, sh-format
msgid "Failed to stop $APP_LONG_NAME."
msgstr ""
#: ../i2prouter:1161
#: ../i2prouter:1200
#, sh-format
msgid "Stopped $APP_LONG_NAME."
msgstr ""
#: ../i2prouter:1169
#: ../i2prouter:1208
#, sh-format
msgid "Stopping $APP_LONG_NAME gracefully"
msgstr ""
#: ../i2prouter:1215
#: ../i2prouter:1254
#, sh-format
msgid "$APP_LONG_NAME is not running."
msgstr ""
#: ../i2prouter:1220
#: ../i2prouter:1259
#, sh-format
msgid "$APP_LONG_NAME is running: PID:$pid"
msgstr ""
#: ../i2prouter:1223
#: ../i2prouter:1262
#, sh-format
msgid "$APP_LONG_NAME is running: PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS"
msgstr ""
#: ../i2prouter:1276 ../i2prouter:1288 ../i2prouter:1307 ../i2prouter:1324
#: ../i2prouter:1391 ../i2prouter:1411 ../i2prouter:1425 ../i2prouter:1439
#: ../i2prouter:1467 ../i2prouter:1505 ../i2prouter:1540
#: ../i2prouter:1315 ../i2prouter:1327 ../i2prouter:1346 ../i2prouter:1363
#: ../i2prouter:1430 ../i2prouter:1450 ../i2prouter:1464 ../i2prouter:1478
#: ../i2prouter:1506 ../i2prouter:1544 ../i2prouter:1579
#, sh-format
msgid "The $APP_LONG_NAME daemon is already installed."
msgstr ""
#: ../i2prouter:1279 ../i2prouter:1294 ../i2prouter:1396 ../i2prouter:1428
#: ../i2prouter:1442 ../i2prouter:1456 ../i2prouter:1470 ../i2prouter:1508
#: ../i2prouter:1543
#: ../i2prouter:1318 ../i2prouter:1333 ../i2prouter:1435 ../i2prouter:1467
#: ../i2prouter:1481 ../i2prouter:1495 ../i2prouter:1509 ../i2prouter:1547
#: ../i2prouter:1582
#, sh-format
msgid "Installing the $APP_LONG_NAME daemon"
msgstr ""
#: ../i2prouter:1550
#: ../i2prouter:1589
#, sh-format
msgid "Install not currently supported for $DIST_OS"
msgstr ""
#: ../i2prouter:1566 ../i2prouter:1579 ../i2prouter:1593 ../i2prouter:1602
#: ../i2prouter:1612 ../i2prouter:1636 ../i2prouter:1649 ../i2prouter:1661
#: ../i2prouter:1679 ../i2prouter:1692 ../i2prouter:1706
#: ../i2prouter:1605 ../i2prouter:1618 ../i2prouter:1632 ../i2prouter:1641
#: ../i2prouter:1651 ../i2prouter:1675 ../i2prouter:1688 ../i2prouter:1700
#: ../i2prouter:1718 ../i2prouter:1731 ../i2prouter:1745
#, sh-format
msgid "Removing $APP_LONG_NAME daemon"
msgstr ""
#: ../i2prouter:1572 ../i2prouter:1587 ../i2prouter:1596 ../i2prouter:1606
#: ../i2prouter:1617 ../i2prouter:1630 ../i2prouter:1642 ../i2prouter:1655
#: ../i2prouter:1673 ../i2prouter:1686 ../i2prouter:1700 ../i2prouter:1711
#: ../i2prouter:1611 ../i2prouter:1626 ../i2prouter:1635 ../i2prouter:1645
#: ../i2prouter:1656 ../i2prouter:1669 ../i2prouter:1681 ../i2prouter:1694
#: ../i2prouter:1712 ../i2prouter:1725 ../i2prouter:1739 ../i2prouter:1750
#, sh-format
msgid "The $APP_LONG_NAME daemon is not currently installed."
msgstr ""
#: ../i2prouter:1715
#: ../i2prouter:1754
#, sh-format
msgid "Remove not currently supported for $DIST_OS"
msgstr ""
#: ../i2prouter:1802
#: ../i2prouter:1841
msgid "Commands:"
msgstr ""
#: ../i2prouter:1803
#: ../i2prouter:1842
msgid "Launch in the current console."
msgstr ""
#: ../i2prouter:1804
#: ../i2prouter:1843
msgid "Start in the background as a daemon process."
msgstr ""
#: ../i2prouter:1805
#: ../i2prouter:1844
msgid "Stop if running as a daemon or in another console."
msgstr ""
#: ../i2prouter:1806
#: ../i2prouter:1845
msgid "Stop gracefully, may take up to 11 minutes."
msgstr ""
#: ../i2prouter:1807
#: ../i2prouter:1846
msgid "Stop if running and then start."
msgstr ""
#: ../i2prouter:1808
#: ../i2prouter:1847
msgid "Restart only if already running."
msgstr ""
#: ../i2prouter:1809
#: ../i2prouter:1848
msgid "Query the current status."
msgstr ""
#: ../i2prouter:1810
#: ../i2prouter:1849
msgid "Install to start automatically when system boots."
msgstr ""
#: ../i2prouter:1811
#: ../i2prouter:1850
msgid "Uninstall."
msgstr ""
#: ../i2prouter:1812
#: ../i2prouter:1851
msgid "Request a Java thread dump if running."
msgstr ""
#: ../i2prouter:1825
#: ../i2prouter:1864
msgid "Please edit i2prouter and set the variable RUN_AS_USER"
msgstr ""
#: ../i2prouter:1830
#: ../i2prouter:1869
msgid "Running I2P as the root user is *not* recommended."
msgstr ""
#: ../i2prouter:1833
#: ../i2prouter:1872
msgid "To run as root anyway, edit i2prouter and set ALLOW_ROOT=true."
msgstr ""

View File

@ -251,6 +251,7 @@ div.newsheadings {
div.newsheadings li {
list-style: none outside url('images/newsbullet_mini.png');
margin: 0 -4px 2px 8px;
line-height: 140%;
}
div.tunnels {

View File

@ -18,10 +18,10 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 16;
public final static long BUILD = 17;
/** for example "-test" */
public final static String EXTRA = "";
public final static String EXTRA = "-rc";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
public static void main(String args[]) {
System.out.println("I2P Router version: " + FULL_VERSION);