Class ProtocolDecoderPHE
java.lang.Object
com.biglybt.core.networkmanager.impl.ProtocolDecoder
com.biglybt.core.networkmanager.impl.ProtocolDecoderPHE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ProtocolDecoderAdapterprivate static final intprivate static final intprivate intprivate intprivate static final byteprivate static booleanprivate static final byteprivate static final byteprivate static booleanprivate static final byteprivate booleanprivate static final Stringprivate static final BigIntegerprivate static KeyPairGeneratorprivate static final intprivate static final Stringprivate static final BigIntegerprivate byte[]private static final intprivate TransportHelperFilterprivate static BloomFilterprivate static longprivate static final Map<HashWrapper, Object[]> private booleanprivate ByteBufferprivate ByteBufferprivate KeyAgreementstatic final byte[]static final byte[]private longprivate static final LogIDsprivate static final int(package private) static bytestatic final intprivate byteprivate static final Map<HashWrapper, Object[]> private booleanprivate static final intprivate static final intprivate static final intprivate byte[]private final AEMonitorprivate booleanprivate intprivate intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final Randomprivate static final Stringprivate static final Stringprivate static final intprivate static final intprivate ByteBufferprivate TransportCipherstatic final byte[]static final byte[]static final byte[]private byte[]private byteprivate byte[]private static final byteprivate TransportHelperstatic final byte[]private ByteBufferprivate TransportCipherFields inherited from class 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 voidaddSecretsSupport(String name, byte[][] secrets) protected byte[]bigIntegerToBytes(BigInteger bi, int num_bytes) protected BigIntegerbytesToBigInteger(byte[] bytes, int offset, int len) protected voidcomplete()protected voidcompleteDH(byte[] buffer) private static booleanprotected voidprotected static KeyPairgenerateDHKeyPair(TransportHelper transport, boolean outbound) longstatic intgetMaxIncomingInitialPacketSize(boolean min_overheads) protected intprotected static byte[]getRandomPadding(int max_len) protected static byte[]getZeroPadding(int max_len) protected voidprotected voidbooleanisComplete(long now) static booleanprotected voidprocess()protected voidread(ByteBuffer buffer) static voidremoveSecretsSupport(byte[][] secrets) voidselectFailure(TransportHelper transport, Object attachment, Throwable msg) booleanselectSuccess(TransportHelper transport, Object attachment, boolean write_operation) protected voidprotected voidwrite(ByteBuffer buffer) Methods inherited from class 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:
isCompletein classProtocolDecoder
-
getFilter
- Specified by:
getFilterin classProtocolDecoder
-
getLastReadTime
public long getLastReadTime() -
getString
-