Class SESTSConnectionImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.utils.security.SESTSConnectionImpl
-
- All Implemented Interfaces:
GenericMessageConnection
public class SESTSConnectionImpl extends java.lang.Object implements GenericMessageConnection
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.biglybt.pif.messaging.generic.GenericMessageConnection
GenericMessageConnection.GenericMessageConnectionPropertyHandler
-
-
Field Summary
-
Fields inherited from interface com.biglybt.pif.messaging.generic.GenericMessageConnection
TT_INDIRECT, TT_NONE, TT_TCP, TT_UDP
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SESTSConnectionImpl(Core _core, GenericMessageConnectionImpl _connection, SEPublicKey _my_public_key, SEPublicKeyLocator _key_locator, java.lang.String _reason, int _block_crypto)
-
Method Summary
-
-
-
Field Detail
-
CRYPTO_SETUP_TIMEOUT
private static final int CRYPTO_SETUP_TIMEOUT
- See Also:
- Constant Field Values
-
LOGID
private static final LogIDs LOGID
-
AES_IV1
private static final byte[] AES_IV1
-
AES_IV2
private static final byte[] AES_IV2
-
AES_KEY_SIZE_BYTES
private final int AES_KEY_SIZE_BYTES
-
connections
private static java.util.List<SESTSConnectionImpl> connections
-
dispatcher
private static AsyncDispatcher dispatcher
-
BLOOM_RECREATE
private static final int BLOOM_RECREATE
- See Also:
- Constant Field Values
-
BLOOM_INCREASE
private static final int BLOOM_INCREASE
- See Also:
- Constant Field Values
-
generate_bloom
private static BloomFilter generate_bloom
-
generate_bloom_create_time
private static long generate_bloom_create_time
-
core
private Core core
-
connection
private GenericMessageConnectionImpl connection
-
my_public_key
private SEPublicKey my_public_key
-
key_locator
private SEPublicKeyLocator key_locator
-
reason
private java.lang.String reason
-
block_crypto
private int block_crypto
-
create_time
private long create_time
-
sts_engine
private CryptoSTSEngine sts_engine
-
listeners
private CopyOnWriteList<GenericMessageConnectionListener> listeners
-
sent_keys
private boolean sent_keys
-
sent_auth
private boolean sent_auth
-
pending_message
private PooledByteBuffer pending_message
-
crypto_complete
private AESemaphore crypto_complete
-
outgoing_cipher
private javax.crypto.Cipher outgoing_cipher
-
incoming_cipher
private javax.crypto.Cipher incoming_cipher
-
failed
private volatile boolean failed
-
-
Constructor Detail
-
SESTSConnectionImpl
protected SESTSConnectionImpl(Core _core, GenericMessageConnectionImpl _connection, SEPublicKey _my_public_key, SEPublicKeyLocator _key_locator, java.lang.String _reason, int _block_crypto) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-
Method Detail
-
getStartpoint
public GenericMessageStartpoint getStartpoint()
- Specified by:
getStartpoint
in interfaceGenericMessageConnection
- Returns:
- may be null if unknown
-
getConnection
public Connection getConnection()
- Specified by:
getConnection
in interfaceGenericMessageConnection
-
getConnectMethodCount
protected int getConnectMethodCount()
-
rateLimit
protected static void rateLimit(java.net.InetSocketAddress originator) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getEndpoint
public GenericMessageEndpoint getEndpoint()
- Specified by:
getEndpoint
in interfaceGenericMessageConnection
-
getMaximumMessageSize
public int getMaximumMessageSize()
- Specified by:
getMaximumMessageSize
in interfaceGenericMessageConnection
-
getType
public java.lang.String getType()
- Specified by:
getType
in interfaceGenericMessageConnection
-
getTransportType
public int getTransportType()
- Specified by:
getTransportType
in interfaceGenericMessageConnection
-
addInboundRateLimiter
public void addInboundRateLimiter(RateLimiter limiter)
- Specified by:
addInboundRateLimiter
in interfaceGenericMessageConnection
-
removeInboundRateLimiter
public void removeInboundRateLimiter(RateLimiter limiter)
- Specified by:
removeInboundRateLimiter
in interfaceGenericMessageConnection
-
addOutboundRateLimiter
public void addOutboundRateLimiter(RateLimiter limiter)
- Specified by:
addOutboundRateLimiter
in interfaceGenericMessageConnection
-
removeOutboundRateLimiter
public void removeOutboundRateLimiter(RateLimiter limiter)
- Specified by:
removeOutboundRateLimiter
in interfaceGenericMessageConnection
-
connect
public void connect(GenericMessageConnection.GenericMessageConnectionPropertyHandler ph) throws MessageException
- Specified by:
connect
in interfaceGenericMessageConnection
- Throws:
MessageException
-
setFailed
protected void setFailed()
-
receive
public void receive(PooledByteBuffer message) throws MessageException
- Throws:
MessageException
-
setupBlockCrypto
protected void setupBlockCrypto() throws MessageException
- Throws:
MessageException
-
cryptoComplete
protected void cryptoComplete() throws MessageException
- Throws:
MessageException
-
send
public void send(PooledByteBuffer message) throws MessageException
- Specified by:
send
in interfaceGenericMessageConnection
- Throws:
MessageException
-
sendContent
protected void sendContent(PooledByteBuffer message) throws MessageException
- Throws:
MessageException
-
receiveContent
protected void receiveContent(PooledByteBuffer message) throws MessageException
- Throws:
MessageException
-
close
public void close() throws MessageException
- Specified by:
close
in interfaceGenericMessageConnection
- Throws:
MessageException
-
reportConnected
protected void reportConnected()
-
reportFailed
protected void reportFailed(java.lang.Throwable error)
-
addListener
public void addListener(GenericMessageConnectionListener listener)
- Specified by:
addListener
in interfaceGenericMessageConnection
-
removeListener
public void removeListener(GenericMessageConnectionListener listener)
- Specified by:
removeListener
in interfaceGenericMessageConnection
-
-