Client: Deprecate getters for unused encryption private key

This commit is contained in:
zzz
2025-02-21 09:05:55 -05:00
parent 24614316be
commit fbd0be941a
4 changed files with 9 additions and 4 deletions

View File

@@ -298,8 +298,9 @@ public interface I2PSession {
/**
* Retrieve the decryption PrivateKey associated with the Destination
*
* @deprecated this key is unused
*/
@Deprecated
public PrivateKey getDecryptionKey();
/**

View File

@@ -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; }
/**

View File

@@ -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

View File

@@ -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