forked from I2P_Developers/i2p.i2p
Addressbook: Check inner sig even if old name not found
More logging cleanup
This commit is contained in:
@@ -212,7 +212,12 @@ public class Daemon {
|
|||||||
List<Destination> pod2 = router.lookupAll(key);
|
List<Destination> pod2 = router.lookupAll(key);
|
||||||
if (pod2 == null) {
|
if (pod2 == null) {
|
||||||
// we didn't know it before, so we'll add it
|
// we didn't know it before, so we'll add it
|
||||||
// TODO check inner sig anyway?
|
// check inner sig anyway
|
||||||
|
if (!he.hasValidInnerSig()) {
|
||||||
|
logInner(log, action, key, addressbook);
|
||||||
|
invalid++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} else if (pod2.contains(dest)) {
|
} else if (pod2.contains(dest)) {
|
||||||
// we knew it before, with the same dest
|
// we knew it before, with the same dest
|
||||||
old++;
|
old++;
|
||||||
@@ -220,11 +225,7 @@ public class Daemon {
|
|||||||
} else if (pod2.contains(pod)) {
|
} else if (pod2.contains(pod)) {
|
||||||
// checks out, so verify the inner sig
|
// checks out, so verify the inner sig
|
||||||
if (!he.hasValidInnerSig()) {
|
if (!he.hasValidInnerSig()) {
|
||||||
if (log != null)
|
logInner(log, action, key, addressbook);
|
||||||
log.append("Action: " + action + " failed because" +
|
|
||||||
" inner signature for key " + key +
|
|
||||||
" failed" +
|
|
||||||
". From: " + addressbook.getLocation());
|
|
||||||
invalid++;
|
invalid++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -258,8 +259,7 @@ public class Daemon {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (log != null)
|
logMissing(log, action, key, addressbook);
|
||||||
log.append("Action: " + action + " failed, missing required parameters");
|
|
||||||
invalid++;
|
invalid++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -284,9 +284,7 @@ public class Daemon {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (log != null)
|
logMissing(log, action, key, addressbook);
|
||||||
log.append("Action: " + action + " failed, missing required parameters" +
|
|
||||||
". From: " + addressbook.getLocation());
|
|
||||||
invalid++;
|
invalid++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -314,15 +312,16 @@ public class Daemon {
|
|||||||
List<Destination> pod2 = router.lookupAll(poldname);
|
List<Destination> pod2 = router.lookupAll(poldname);
|
||||||
if (pod2 == null) {
|
if (pod2 == null) {
|
||||||
// we didn't have the old name
|
// we didn't have the old name
|
||||||
// TODO check inner sig anyway?
|
// check inner sig anyway
|
||||||
|
if (!he.hasValidInnerSig()) {
|
||||||
|
logInner(log, action, key, addressbook);
|
||||||
|
invalid++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} else if (pod2.contains(pod)) {
|
} else if (pod2.contains(pod)) {
|
||||||
// checks out, so verify the inner sig
|
// checks out, so verify the inner sig
|
||||||
if (!he.hasValidInnerSig()) {
|
if (!he.hasValidInnerSig()) {
|
||||||
if (log != null)
|
logInner(log, action, key, addressbook);
|
||||||
log.append("Action: " + action + " failed because" +
|
|
||||||
" inner signature for old name " + poldname +
|
|
||||||
" failed" +
|
|
||||||
". From: " + addressbook.getLocation());
|
|
||||||
invalid++;
|
invalid++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -333,9 +332,7 @@ public class Daemon {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (log != null)
|
logMissing(log, action, key, addressbook);
|
||||||
log.append("Action: " + action + " failed, missing required parameters" +
|
|
||||||
". From: " + addressbook.getLocation());
|
|
||||||
invalid++;
|
invalid++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -349,7 +346,12 @@ public class Daemon {
|
|||||||
List<Destination> pod2 = router.lookupAll(key);
|
List<Destination> pod2 = router.lookupAll(key);
|
||||||
if (pod2 == null) {
|
if (pod2 == null) {
|
||||||
// we didn't have the old name
|
// we didn't have the old name
|
||||||
// TODO check inner sig anyway?
|
// check inner sig anyway
|
||||||
|
if (!he.hasValidInnerSig()) {
|
||||||
|
logInner(log, action, key, addressbook);
|
||||||
|
invalid++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} else if (pod2.contains(dest)) {
|
} else if (pod2.contains(dest)) {
|
||||||
// we already have the new dest
|
// we already have the new dest
|
||||||
old++;
|
old++;
|
||||||
@@ -357,11 +359,7 @@ public class Daemon {
|
|||||||
} else if (pod2.contains(pod)) {
|
} else if (pod2.contains(pod)) {
|
||||||
// checks out, so verify the inner sig
|
// checks out, so verify the inner sig
|
||||||
if (!he.hasValidInnerSig()) {
|
if (!he.hasValidInnerSig()) {
|
||||||
if (log != null)
|
logInner(log, action, key, addressbook);
|
||||||
log.append("Action: " + action + " failed because" +
|
|
||||||
" inner signature for key " + key +
|
|
||||||
" failed" +
|
|
||||||
". From: " + addressbook.getLocation());
|
|
||||||
invalid++;
|
invalid++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -382,9 +380,7 @@ public class Daemon {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (log != null)
|
logMissing(log, action, key, addressbook);
|
||||||
log.append("Action: " + action + " failed, missing required parameters" +
|
|
||||||
". From: " + addressbook.getLocation());
|
|
||||||
invalid++;
|
invalid++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -432,9 +428,7 @@ public class Daemon {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (log != null)
|
logMissing(log, action, key, addressbook);
|
||||||
log.append("Action: " + action + " failed, missing required parameters" +
|
|
||||||
". From: " + addressbook.getLocation());
|
|
||||||
invalid++;
|
invalid++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -527,9 +521,7 @@ public class Daemon {
|
|||||||
old++;
|
old++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (log != null)
|
logMissing(log, action, "delete", addressbook);
|
||||||
log.append("Action: " + action + " failed, missing required parameters" +
|
|
||||||
". From: " + addressbook.getLocation());
|
|
||||||
invalid++;
|
invalid++;
|
||||||
}
|
}
|
||||||
} else if (action.equals(HostTxtEntry.ACTION_REMOVEALL)) {
|
} else if (action.equals(HostTxtEntry.ACTION_REMOVEALL)) {
|
||||||
@@ -603,9 +595,7 @@ public class Daemon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (log != null)
|
logMissing(log, action, "delete", addressbook);
|
||||||
log.append("Action: " + action + " failed, missing required parameters" +
|
|
||||||
". From: " + addressbook.getLocation());
|
|
||||||
invalid++;
|
invalid++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -666,6 +656,26 @@ public class Daemon {
|
|||||||
subscriptions.write();
|
subscriptions.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 0.9.26 */
|
||||||
|
private static void logInner(Log log, String action, String name, AddressBook addressbook) {
|
||||||
|
if (log != null) {
|
||||||
|
log.append("Action: " + action + " failed because" +
|
||||||
|
" inner signature for key " + name +
|
||||||
|
" failed" +
|
||||||
|
". From: " + addressbook.getLocation());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @since 0.9.26 */
|
||||||
|
private static void logMissing(Log log, String action, String name, AddressBook addressbook) {
|
||||||
|
if (log != null) {
|
||||||
|
log.append("Action: " + action + " for " + name +
|
||||||
|
" failed, missing required parameters" +
|
||||||
|
". From: " + addressbook.getLocation());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @since 0.9.26 */
|
||||||
private static void logMismatch(Log log, String action, String name, List<Destination> dests,
|
private static void logMismatch(Log log, String action, String name, List<Destination> dests,
|
||||||
String olddest, AddressBook addressbook) {
|
String olddest, AddressBook addressbook) {
|
||||||
if (log != null) {
|
if (log != null) {
|
||||||
|
23
history.txt
23
history.txt
@@ -1,3 +1,26 @@
|
|||||||
|
2016-04-26 zzz
|
||||||
|
* Addressbook:
|
||||||
|
- Finish implementation of signed actions
|
||||||
|
- Move HostTxtEntry to net.i2p.client.naming for use by i2ptunnel
|
||||||
|
- Add tests for Daemon to read local subscription file
|
||||||
|
- Store last-modified date
|
||||||
|
- Logging cleanups and consolidation
|
||||||
|
* Blockfile: Remove unused code and classes
|
||||||
|
* BlockfileNamingService:
|
||||||
|
- Implementation and fixes for new API methods
|
||||||
|
- Add support for long property values, backward compatbile, no version bump
|
||||||
|
* DataHelper: Properties methods cleanup
|
||||||
|
* i2ptunnel:
|
||||||
|
- New page for registration authentication
|
||||||
|
- Remove old, unused hostname signature generation
|
||||||
|
* NamingService: Add new API methods for reverseLookupAll()
|
||||||
|
* PrivateKeyFile:
|
||||||
|
- Add InputStream constructor for i2ptunnel
|
||||||
|
- Ensure initialization before returning private keys
|
||||||
|
* SusiDNS:
|
||||||
|
- Display signature validation on details page
|
||||||
|
- Add support for multiple dests per hostname
|
||||||
|
|
||||||
2016-04-20 zzz
|
2016-04-20 zzz
|
||||||
* Addressbook:
|
* Addressbook:
|
||||||
- Add sign/verify methods for inner signature
|
- Add sign/verify methods for inner signature
|
||||||
|
@@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 4;
|
public final static long BUILD = 5;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
Reference in New Issue
Block a user