|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--net.vattp.data.RecvThread
Field Summary | |
private static int |
HASH_BLOCK_SIZE
|
private static int |
HEADER_INT_LENGTH
|
private static int |
HEADER_INVALID
|
private static int |
HEADER_VLEN_HMAC
|
private static int |
HEADER_VLEN_SHA1
|
private int |
myBufferLength
|
private boolean |
myChangeProtocolIsOk
|
private DataPath |
myDataPath
|
private byte[] |
myHeader
|
private InputStream |
myInputStream
|
private boolean |
myIsAggragating
|
private boolean |
myIsCompressingMsgLengths
|
private boolean |
myIsDoingHMAC
|
private boolean |
myIsDoingMac
|
private boolean |
myIsStandardCBC
|
private byte[] |
myMAC
|
private byte[] |
myMACKey
|
private Vector |
myMessagesToPass
|
private byte[] |
mySequence
|
private MessageDigest |
mySHA1
|
private boolean |
myTerminateFlag
|
private long |
myTotalTime
|
private MsgTransformer |
myTransform
|
private Vat |
myVat
The vat we will synchronize with when calling the DataPath |
private static int |
NOTIFY_EVERY
Notify DataPath every NOTIFY_EVERY bytes of receive progress |
private static int[] |
theHeaderLengths
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
RecvThread(InputStream inputStream,
DataPath connection,
String remoteAddr,
Vat vat)
Construct a new RecvThread. |
Method Summary | |
private void |
callDataPath(DataCommThunk thunk)
Call a method in our VatTPMgr |
(package private) void |
changeProtocol(AuthSecrets protocolParms)
Change the authorization protocol being used to receive messages on the connection. |
private byte[] |
computeMAC(Vector messages)
|
private void |
fillArray(byte[] b,
int off,
int len)
|
(package private) byte[] |
getSequence()
Get the current message sequence number |
private void |
increment(byte[] value)
|
private static boolean |
isEqual(byte[] a,
byte[] b)
isEqual - Compare two byte arrays. |
private byte[] |
md5Hash(int pad,
byte[] data,
MessageDigest md5)
Calculate the MD5 hash of some data with a specific padding. |
private void |
readAndProcessMessage()
Process input data. |
private static void |
replicate(byte[] a,
byte v)
replicate - Copy a single byte to all elements of a byte array. |
void |
run()
The actual connection receive thread -- the asynchronous part. |
private MessageDigest |
setSHA1(AuthSecrets macParms)
|
(package private) void |
shutdown()
Shutdown this thread. |
private void |
traceDebugMsg(byte[] msg,
int off,
int len,
String note)
|
private void |
traceErrorMsg(byte[] msg,
int off,
int len,
String note)
|
private static void |
xor(byte[] a,
byte[] b)
xor - Exclusive OR two byte arrays. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final int HEADER_INVALID
private static final int HEADER_INT_LENGTH
private static final int HEADER_VLEN_SHA1
private static final int HEADER_VLEN_HMAC
private static final int[] theHeaderLengths
private static final int NOTIFY_EVERY
private final InputStream myInputStream
private DataPath myDataPath
private boolean myTerminateFlag
private int myBufferLength
private final Vat myVat
private byte[] myHeader
private boolean myChangeProtocolIsOk
private boolean myIsAggragating
private final Vector myMessagesToPass
private MsgTransformer myTransform
private boolean myIsStandardCBC
private static final int HASH_BLOCK_SIZE
private boolean myIsDoingMac
private boolean myIsDoingHMAC
private byte[] myMACKey
private MessageDigest mySHA1
private byte[] myMAC
private byte[] mySequence
private boolean myIsCompressingMsgLengths
private long myTotalTime
Constructor Detail |
public RecvThread(InputStream inputStream, DataPath connection, String remoteAddr, Vat vat)
inputStream
- stream to read data from.connection
- a RawConnection to send problem reports to.Method Detail |
private void callDataPath(DataCommThunk thunk)
thunk
- a Thunk that will perform the call. The thunk will
be called after the Vat lock is obtained.void changeProtocol(AuthSecrets protocolParms)
protocolParms
- is the parameter bundle for the protocol suite to
use. This routine must, of course, support the selected
suite.private byte[] computeMAC(Vector messages) throws IOException
IOException
private void fillArray(byte[] b, int off, int len) throws IOException
IOException
byte[] getSequence()
private void increment(byte[] value)
private static boolean isEqual(byte[] a, byte[] b)
a
- is the first input array.b
- is the second input array.
private static void xor(byte[] a, byte[] b)
a
- is the input and output array.b
- is the array which is XORed with a.private static void replicate(byte[] a, byte v)
a
- is the byte array.v
- is the byte to be replicated.private byte[] md5Hash(int pad, byte[] data, MessageDigest md5)
The padding allows different values to be obtained from the same data by varing the padding value. We use it to get the different authentication values from the same Diffie Hellman shared secret.
pad
- The int (treated as a byte) to be used to pad the MD5
calculation.data
- The data to be hashed.md5
- The message digest object to be used.
private void readAndProcessMessage() throws IOException
IOException
public void run()
run
in interface Runnable
run
in class Thread
java.lang.Thread#start()
,
java.lang.Thread#stop()
,
java.lang.Thread#Thread(java.lang.ThreadGroup,
java.lang.Runnable, java.lang.String)
,
java.lang.Runnable#run()
private MessageDigest setSHA1(AuthSecrets macParms)
void shutdown()
private void traceDebugMsg(byte[] msg, int off, int len, String note)
private void traceErrorMsg(byte[] msg, int off, int len, String note)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |