Class ProtocolDecoderPHE

    • Field Detail

      • LOGID

        private static final LogIDs LOGID
      • 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

        private static final java.math.BigInteger DH_P_BI
      • DH_G_BI

        private static final java.math.BigInteger DH_G_BI
      • dh_key_generator

        private static java.security.KeyPairGenerator dh_key_generator
      • generate_bloom

        private static BloomFilter 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_CIPHER

        private static final java.lang.String RC4_STREAM_CIPHER
        See Also:
        Constant Field Values
      • RC4_STREAM_KEY_SIZE_BYTES

        private static final int RC4_STREAM_KEY_SIZE_BYTES
        See Also:
        Constant Field Values
      • random

        private static final java.util.Random random
      • global_shared_secrets

        private static final java.util.Map global_shared_secrets
      • MIN_CRYPTO

        static byte MIN_CRYPTO
      • 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
      • write_buffer

        private java.nio.ByteBuffer write_buffer
      • read_buffer

        private java.nio.ByteBuffer read_buffer
      • key_agreement

        private javax.crypto.KeyAgreement key_agreement
      • dh_public_key_bytes

        private byte[] dh_public_key_bytes
      • shared_secret

        private byte[] shared_secret
      • secret_bytes

        private byte[] secret_bytes
      • initial_data_out

        private java.nio.ByteBuffer initial_data_out
      • initial_data_in

        private java.nio.ByteBuffer initial_data_in
      • 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
      • delay_outbound_4

        private boolean delay_outbound_4
      • processing_complete

        private boolean processing_complete
      • process_mon

        private final AEMonitor process_mon
    • Constructor Detail

      • ProtocolDecoderPHE

        public ProtocolDecoderPHE​(TransportHelper _transport,
                                  byte[][] _shared_secrets,
                                  java.nio.ByteBuffer _header,
                                  java.nio.ByteBuffer _initial_data,
                                  ProtocolDecoderAdapter _adapter)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getMaxIncomingInitialPacketSize

        public static int getMaxIncomingInitialPacketSize​(boolean min_overheads)
      • cryptoSetup

        private static boolean cryptoSetup()
      • isCryptoOK

        public static boolean isCryptoOK()
      • addSecretsSupport

        public static void addSecretsSupport​(byte[][] secrets)
      • removeSecretsSupport

        public static void removeSecretsSupport​(byte[][] secrets)
      • initCrypto

        protected void initCrypto()
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • completeDH

        protected void completeDH​(byte[] buffer)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • setupCrypto

        protected void setupCrypto()
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • handshakeComplete

        protected void handshakeComplete()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • process

        protected void process()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        protected void read​(java.nio.ByteBuffer buffer)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        protected void write​(java.nio.ByteBuffer buffer)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • selectSuccess

        public boolean selectSuccess​(TransportHelper transport,
                                     java.lang.Object attachment,
                                     boolean write_operation)
      • selectFailure

        public void selectFailure​(TransportHelper transport,
                                  java.lang.Object attachment,
                                  java.lang.Throwable msg)
      • bigIntegerToBytes

        protected byte[] bigIntegerToBytes​(java.math.BigInteger bi,
                                           int num_bytes)
      • bytesToBigInteger

        protected java.math.BigInteger bytesToBigInteger​(byte[] bytes,
                                                         int offset,
                                                         int len)
      • getPaddingMax

        protected int getPaddingMax()
      • getRandomPadding

        protected static byte[] getRandomPadding​(int max_len)
      • getZeroPadding

        protected static byte[] getZeroPadding​(int max_len)
      • generateDHKeyPair

        protected static java.security.KeyPair generateDHKeyPair​(TransportHelper transport,
                                                                 boolean outbound)
                                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • complete

        protected void complete()
      • failed

        protected void failed​(java.lang.Throwable cause)
      • getLastReadTime

        public long getLastReadTime()
      • getString

        public java.lang.String getString()