SU3File: Also look in config dir for signer certificate

This commit is contained in:
zzz
2016-07-18 14:39:35 +00:00
parent 37ebf04bb5
commit 767476ea51
3 changed files with 23 additions and 3 deletions

View File

@ -314,6 +314,7 @@ public class SU3File {
if (_certFile != null) {
_signerPubkey = loadKey(_certFile);
} else {
// look in both install dir and config dir for the signer cert
KeyRing ring = new DirKeyRing(new File(_context.getBaseDir(), "certificates"));
try {
_signerPubkey = ring.getKey(_signer, _contentType.getName(), _sigType);
@ -322,10 +323,26 @@ public class SU3File {
ioe.initCause(gse);
throw ioe;
}
if (_signerPubkey == null) {
boolean diff = true;
try {
diff = !_context.getBaseDir().getCanonicalPath().equals(_context.getConfigDir().getCanonicalPath());
} catch (IOException ioe) {}
if (diff) {
ring = new DirKeyRing(new File(_context.getConfigDir(), "certificates"));
try {
_signerPubkey = ring.getKey(_signer, _contentType.getName(), _sigType);
} catch (GeneralSecurityException gse) {
IOException ioe = new IOException("keystore error");
ioe.initCause(gse);
throw ioe;
}
}
if (_signerPubkey == null)
throw new IOException("unknown signer: " + _signer + " for content type: " + _contentType.getName());
}
}
}
_headerVerified = true;
}

View File

@ -1,3 +1,6 @@
2016-07-18 zzz
* SU3File: Also look in config dir for signer certificate
2016-07-16 zzz
* I2CP Client: Handle disconnect properly if received before first LS
* Streaming: Kill accept() when session disconnects

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 4;
public final static long BUILD = 5;
/** for example "-test" */
public final static String EXTRA = "";