Class ProtocolDecoderPHE
java.lang.Object
com.biglybt.core.networkmanager.impl.ProtocolDecoder
com.biglybt.core.networkmanager.impl.ProtocolDecoderPHE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ProtocolDecoderAdapter
private static final int
private static final int
private int
private int
private static final byte
private static boolean
private static final byte
private static final byte
private static boolean
private static final byte
private boolean
private static final String
private static final BigInteger
private static KeyPairGenerator
private static final int
private static final String
private static final BigInteger
private byte[]
private static final int
private TransportHelperFilter
private static BloomFilter
private static long
private static final Map<HashWrapper,
Object[]> private boolean
private ByteBuffer
private ByteBuffer
private KeyAgreement
static final byte[]
static final byte[]
private long
private static final LogIDs
private static final int
(package private) static byte
static final int
private byte
private static final Map<HashWrapper,
Object[]> private boolean
private static final int
private static final int
private static final int
private byte[]
private final AEMonitor
private boolean
private int
private int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final Random
private static final String
private static final String
private static final int
private static final int
private ByteBuffer
private TransportCipher
static final byte[]
static final byte[]
static final byte[]
private byte[]
private byte
private byte[]
private static final byte
private TransportHelper
static final byte[]
private ByteBuffer
private TransportCipher
Fields inherited from class com.biglybt.core.networkmanager.impl.ProtocolDecoder
class_mon, decoders, loop
-
Constructor Summary
ConstructorsConstructorDescriptionProtocolDecoderPHE
(TransportHelper _transport, byte[][] _shared_secrets, ByteBuffer _header, ByteBuffer _initial_data, ProtocolDecoderAdapter _adapter) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addSecretsSupport
(String name, byte[][] secrets) protected byte[]
bigIntegerToBytes
(BigInteger bi, int num_bytes) protected BigInteger
bytesToBigInteger
(byte[] bytes, int offset, int len) protected void
complete()
protected void
completeDH
(byte[] buffer) private static boolean
protected void
protected static KeyPair
generateDHKeyPair
(TransportHelper transport, boolean outbound) long
static int
getMaxIncomingInitialPacketSize
(boolean min_overheads) protected int
protected static byte[]
getRandomPadding
(int max_len) protected static byte[]
getZeroPadding
(int max_len) protected void
protected void
boolean
isComplete
(long now) static boolean
protected void
process()
protected void
read
(ByteBuffer buffer) static void
removeSecretsSupport
(byte[][] secrets) void
selectFailure
(TransportHelper transport, Object attachment, Throwable msg) boolean
selectSuccess
(TransportHelper transport, Object attachment, boolean write_operation) protected void
protected void
write
(ByteBuffer buffer) Methods inherited from class com.biglybt.core.networkmanager.impl.ProtocolDecoder
addSecrets, removeSecrets
-
Field Details
-
LOGID
-
CRYPTO_PLAIN
private static final byte CRYPTO_PLAIN- See Also:
-
CRYPTO_RC4
private static final byte CRYPTO_RC4- See Also:
-
CRYPTO_XOR
private static final byte CRYPTO_XOR- See Also:
-
CRYPTO_AES
private static final byte CRYPTO_AES- See Also:
-
DH_P
- See Also:
-
DH_G
- See Also:
-
DH_L
private static final int DH_L- See Also:
-
DH_SIZE_BYTES
private static final int DH_SIZE_BYTES -
MIN_INCOMING_INITIAL_PACKET_SIZE
public static final int MIN_INCOMING_INITIAL_PACKET_SIZE -
DH_P_BI
-
DH_G_BI
-
dh_key_generator
-
BLOOM_RECREATE
private static final int BLOOM_RECREATE- See Also:
-
BLOOM_INCREASE
private static final int BLOOM_INCREASE- See Also:
-
generate_bloom
-
generate_bloom_create_time
private static long generate_bloom_create_time -
crypto_setup_done
private static boolean crypto_setup_done -
crypto_ok
private static boolean crypto_ok -
RC4_STREAM_ALG
- See Also:
-
RC4_STREAM_CIPHER
- See Also:
-
RC4_STREAM_KEY_SIZE
private static final int RC4_STREAM_KEY_SIZE- See Also:
-
RC4_STREAM_KEY_SIZE_BYTES
private static final int RC4_STREAM_KEY_SIZE_BYTES- See Also:
-
PADDING_MAX
private static final int PADDING_MAX- See Also:
-
PADDING_MAX_NORMAL
private static final int PADDING_MAX_NORMAL- See Also:
-
PADDING_MAX_LIMITED
private static final int PADDING_MAX_LIMITED- See Also:
-
random
-
MAX_OLD_SECRETS
private static final int MAX_OLD_SECRETS- See Also:
-
SUPPORTED_PROTOCOLS
private static final byte SUPPORTED_PROTOCOLS- See Also:
-
MIN_CRYPTO
static byte MIN_CRYPTO -
PS_OUTBOUND_1
private static final int PS_OUTBOUND_1- See Also:
-
PS_OUTBOUND_2
private static final int PS_OUTBOUND_2- See Also:
-
PS_OUTBOUND_3
private static final int PS_OUTBOUND_3- See Also:
-
PS_OUTBOUND_4
private static final int PS_OUTBOUND_4- See Also:
-
PS_INBOUND_1
private static final int PS_INBOUND_1- See Also:
-
PS_INBOUND_2
private static final int PS_INBOUND_2- See Also:
-
PS_INBOUND_3
private static final int PS_INBOUND_3- See Also:
-
PS_INBOUND_4
private static final int PS_INBOUND_4- See Also:
-
KEYA_IV
public static final byte[] KEYA_IV -
KEYB_IV
public static final byte[] KEYB_IV -
REQ1_IV
public static final byte[] REQ1_IV -
REQ2_IV
public static final byte[] REQ2_IV -
REQ3_IV
public static final byte[] REQ3_IV -
VC
public static final byte[] VC -
transport
-
write_buffer
-
read_buffer
-
adapter
-
key_agreement
-
dh_public_key_bytes
private byte[] dh_public_key_bytes -
secret_bytes
private byte[] secret_bytes -
initial_data_out
-
initial_data_in
-
write_cipher
-
read_cipher
-
padding_skip_marker
private byte[] padding_skip_marker -
my_supported_protocols
private byte my_supported_protocols -
selected_protocol
private byte selected_protocol -
outbound
private boolean outbound -
protocol_state
private int protocol_state -
protocol_substate
private int protocol_substate -
handshake_complete
private boolean handshake_complete -
bytes_read
private int bytes_read -
bytes_written
private int bytes_written -
last_read_time
private long last_read_time -
filter
-
delay_outbound_4
private boolean delay_outbound_4 -
processing_complete
private boolean processing_complete -
process_mon
-
-
Constructor Details
-
ProtocolDecoderPHE
public ProtocolDecoderPHE(TransportHelper _transport, byte[][] _shared_secrets, ByteBuffer _header, ByteBuffer _initial_data, ProtocolDecoderAdapter _adapter) throws IOException - Throws:
IOException
-
-
Method Details
-
getMaxIncomingInitialPacketSize
public static int getMaxIncomingInitialPacketSize(boolean min_overheads) -
cryptoSetup
private static boolean cryptoSetup() -
isCryptoOK
public static boolean isCryptoOK() -
addSecretsSupport
-
removeSecretsSupport
public static void removeSecretsSupport(byte[][] secrets) -
initCrypto
- Throws:
IOException
-
completeDH
- Throws:
IOException
-
setupCrypto
- Throws:
IOException
-
handshakeComplete
- Throws:
IOException
-
process
- Throws:
IOException
-
read
- Throws:
IOException
-
write
- Throws:
IOException
-
selectSuccess
-
selectFailure
-
bigIntegerToBytes
-
bytesToBigInteger
-
getPaddingMax
protected int getPaddingMax() -
getRandomPadding
protected static byte[] getRandomPadding(int max_len) -
getZeroPadding
protected static byte[] getZeroPadding(int max_len) -
generateDHKeyPair
protected static KeyPair generateDHKeyPair(TransportHelper transport, boolean outbound) throws IOException - Throws:
IOException
-
complete
protected void complete() -
failed
-
isComplete
public boolean isComplete(long now) - Specified by:
isComplete
in classProtocolDecoder
-
getFilter
- Specified by:
getFilter
in classProtocolDecoder
-
getLastReadTime
public long getLastReadTime() -
getString
-