mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-03-29 09:50:25 +00:00
Client: Deprecate getters for unused encryption private key
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user