I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit fbd0be94 authored by zzz's avatar zzz
Browse files

Client: Deprecate getters for unused encryption private key

parent 24614316
No related branches found
No related tags found
No related merge requests found
Pipeline #2203 passed
......@@ -298,8 +298,9 @@ public interface I2PSession {
/**
* Retrieve the decryption PrivateKey associated with the Destination
*
* @deprecated this key is unused
*/
@Deprecated
public PrivateKey getDecryptionKey();
/**
......
......@@ -370,7 +370,7 @@ public abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2
throw new I2PSessionException("Subsession request already pending");
sub = new SubSession(this, privateKeyStream, opts);
for (SubSession ss : _subsessions) {
if (ss.getDecryptionKey().equals(sub.getDecryptionKey()) &&
if (/* ss.getDecryptionKey().equals(sub.getDecryptionKey()) && */
ss.getPrivateKey().equals(sub.getPrivateKey())) {
throw new I2PSessionException("Dup subsession");
}
......@@ -1145,7 +1145,9 @@ public abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2
/**
* Retrieve the decryption PrivateKey
* @deprecated this key is unused
*/
@Deprecated
public PrivateKey getDecryptionKey() { return _privateKey; }
/**
......
......@@ -47,8 +47,8 @@ class SubSession extends I2PSessionMuxedImpl {
public SubSession(I2PSession primary, InputStream destKeyStream, Properties options) throws I2PSessionException {
super((I2PSessionMuxedImpl)primary, destKeyStream, options);
_primary = (I2PSessionMuxedImpl) primary;
if (!getDecryptionKey().equals(_primary.getDecryptionKey()))
throw new I2PSessionException("encryption key mismatch");
//if (!getDecryptionKey().equals(_primary.getDecryptionKey()))
// throw new I2PSessionException("encryption key mismatch");
if (getPrivateKey().equals(_primary.getPrivateKey()))
throw new I2PSessionException("signing key must differ");
// state management
......
......@@ -824,7 +824,9 @@ public class PrivateKeyFile {
* Private key may be random data or all zeros for Destinations as of 0.9.57
*
* @return null on error or if not initialized
* @deprecated this key is unused
*/
@Deprecated
public PrivateKey getPrivKey() {
try {
// call this to force initialization
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment