Author: toad
Date: 2008-03-04 16:31:06 +0000 (Tue, 04 Mar 2008)
New Revision: 18337
Modified:
trunk/freenet/src/freenet/node/NodeARKInserter.java
trunk/freenet/src/freenet/node/NodeCrypto.java
Log:
Correct fix for ARKs.
Modified: trunk/freenet/src/freenet/node/NodeARKInserter.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeARKInserter.java 2008-03-04 16:14:45 UTC
(rev 18336)
+++ trunk/freenet/src/freenet/node/NodeARKInserter.java 2008-03-04 16:31:06 UTC
(rev 18337)
@@ -65,7 +65,7 @@
if(!checkIPUpdated()) return;
// We'll broadcast the new physical.udp entry to our connected
peers via a differential node reference
// We'll err on the side of caution and not update our peer to
an empty physical.udp entry using a differential node reference
- SimpleFieldSet nfs = crypto.exportPublicFieldSet(true, false);
// More or less
+ SimpleFieldSet nfs = crypto.exportPublicFieldSet(false, false,
true);
String[] entries = nfs.getAll("physical.udp");
if(entries != null) {
SimpleFieldSet fs = new SimpleFieldSet(true);
@@ -127,7 +127,7 @@
if(logMINOR) Logger.minor(this, "starting " +
darknetOpennetString + " ARK inserter");
- SimpleFieldSet fs = crypto.exportPublicFieldSet(true, false);
// More or less
+ SimpleFieldSet fs = crypto.exportPublicFieldSet(false, false,
true);
// Remove some unnecessary fields that only cause collisions.
Modified: trunk/freenet/src/freenet/node/NodeCrypto.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeCrypto.java 2008-03-04 16:14:45 UTC
(rev 18336)
+++ trunk/freenet/src/freenet/node/NodeCrypto.java 2008-03-04 16:31:06 UTC
(rev 18337)
@@ -258,7 +258,7 @@
}
public SimpleFieldSet exportPrivateFieldSet() {
- SimpleFieldSet fs = exportPublicFieldSet(false, false);
+ SimpleFieldSet fs = exportPublicFieldSet(false, false, false);
addPrivateFields(fs);
return fs;
}
@@ -269,7 +269,7 @@
* @see exportPublicFieldSet(boolean forSetup).
*/
public SimpleFieldSet exportPublicFieldSet() {
- return exportPublicFieldSet(false, false);
+ return exportPublicFieldSet(false, false, false);
}
/**
@@ -281,9 +281,9 @@
* exchange. Minimal noderef which we can construct a PeerNode from.
Short lived so no ARK etc.
* Already signed so dump the signature.
*/
- SimpleFieldSet exportPublicFieldSet(boolean forSetup, boolean
forAnonInitiator) {
+ SimpleFieldSet exportPublicFieldSet(boolean forSetup, boolean
forAnonInitiator, boolean forARK) {
SimpleFieldSet fs = exportPublicCryptoFieldSet(forSetup,
forAnonInitiator);
- if(!forAnonInitiator) {
+ if((!forAnonInitiator) && (!forSetup) && !(forARK)) {
// IP addresses
Peer[] ips = detector.detectPrimaryPeers();
if(ips != null) {
@@ -366,8 +366,8 @@
}
}
- private byte[] myCompressedRef(boolean setup, boolean heavySetup) {
- SimpleFieldSet fs = exportPublicFieldSet(setup, heavySetup);
+ private byte[] myCompressedRef(boolean setup, boolean heavySetup,
boolean forARK) {
+ SimpleFieldSet fs = exportPublicFieldSet(setup, heavySetup,
forARK);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DeflaterOutputStream gis;
gis = new DeflaterOutputStream(baos);
@@ -394,7 +394,7 @@
* @see exportSetupFieldSet()
*/
public byte[] myCompressedSetupRef() {
- return myCompressedRef(true, false);
+ return myCompressedRef(true, false, false);
}
/**
@@ -403,7 +403,7 @@
* @see exportSetupFieldSet()
*/
public byte[] myCompressedHeavySetupRef() {
- return myCompressedRef(false, true);
+ return myCompressedRef(false, true, false);
}
/**
@@ -411,7 +411,7 @@
* @see exportSetupFieldSet()
*/
public byte[] myCompressedFullRef() {
- return myCompressedRef(false, false);
+ return myCompressedRef(false, false, false);
}
void addPrivateFields(SimpleFieldSet fs) {