APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.ssl

pack-priv final Class DTLSInputRecord

extends InputRecord
implements DTLSRecord
Class Inheritance
All Implemented Interfaces
sun.security.ssl.DTLSRecord, sun.security.ssl.Record
Imports
java.io.IOException, java.nio.ByteBuffer, java.security.GeneralSecurityException, java.util.*, javax.crypto.BadPaddingException, javax.net.ssl.SSLException, .SSLProtocolException, sun.security.ssl.SSLCipher.SSLReadCipher

DTLS InputRecord implementation for SSLEngine.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
private static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private int
private DTLSInputRecord.DTLSReassembler
private SSLContextImpl
Inherited from sun.security.ssl.InputRecord:
fragmentSizehandshakeHashhelloVersionisClosedreadCipherrecordLocktc

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Plaintext
pack-priv int
private int
pack-priv void
public void
close()

Overrides sun.security.ssl.InputRecord.close.

Implements java.io.Closeable.close.

Prevent any more data from being read into this record, and flag the record as holding no data.

pack-priv Plaintext[]
decode(ByteBuffer[] srcs, int srcsOffset, int srcsLength)

Implements abstract sun.security.ssl.InputRecord.decode.

pack-priv Plaintext[]
pack-priv int
pack-priv void
pack-priv void
pack-priv boolean
private static DTLSInputRecord.HandshakeFragment
parseHandshakeMessage(byte contentType, byte majorVersion, byte minorVersion, byte[] recordEnS, int recordEpoch, long recordSeq, ByteBuffer plaintextFragment)

public void
public void
private static DTLSInputRecord.HandshakeFragment

Returns:

a truncated handshake fragment that is sized to look like a complete message, but actually contains only up to the compression methods (no extensions)
truncateChFragment
(DTLSInputRecord.HandshakeFragment
the fragment actually received by the DTLSReassembler
srcFrag
,
int
the size of the new, cloned/truncated handshake fragment
limit
)

Turn a sufficiently-large initial ClientHello fragment into one that stops immediately after the compression methods.

Inherited from sun.security.ssl.InputRecord:
bytesInCompletePacketchangeFragmentSizeconvertToClientHelloextractisClosedseqNumIsHugesetDeliverStreamsetHelloVersionsetReceiverStream

Field Detail

readEpochback to summary
private int readEpoch
reassemblerback to summary
private DTLSInputRecord.DTLSReassembler reassembler
sslContextback to summary
private SSLContextImpl sslContext

Constructor Detail

DTLSInputRecordback to summary
pack-priv DTLSInputRecord(HandshakeHash handshakeHash)

Method Detail

acquirePlaintextback to summary
pack-priv Plaintext acquirePlaintext() throws SSLProtocolException

Overrides sun.security.ssl.InputRecord.acquirePlaintext.

Annotations
@Override
bytesInCompletePacketback to summary
pack-priv int bytesInCompletePacket(ByteBuffer[] srcs, int srcsOffset, int srcsLength) throws IOException

Overrides sun.security.ssl.InputRecord.bytesInCompletePacket.

Annotations
@Override
bytesInCompletePacketback to summary
private int bytesInCompletePacket(ByteBuffer packet) throws SSLException
changeReadCiphersback to summary
pack-priv void changeReadCiphers(SSLCipher.SSLReadCipher readCipher)

Overrides sun.security.ssl.InputRecord.changeReadCiphers.

Annotations
@Override
closeback to summary
public void close() throws IOException

Overrides sun.security.ssl.InputRecord.close.

Implements java.io.Closeable.close.

Doc from sun.security.ssl.InputRecord.close.

Prevent any more data from being read into this record, and flag the record as holding no data.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Closeable.close.

if an I/O error occurs

decodeback to summary
pack-priv Plaintext[] decode(ByteBuffer[] srcs, int srcsOffset, int srcsLength) throws IOException, BadPaddingException

Implements abstract sun.security.ssl.InputRecord.decode.

Annotations
@Override
decodeback to summary
pack-priv Plaintext[] decode(ByteBuffer packet) throws SSLProtocolException
estimateFragmentSizeback to summary
pack-priv int estimateFragmentSize(int packetSize)

Overrides sun.security.ssl.InputRecord.estimateFragmentSize.

Annotations
@Override
expectingFinishFlightback to summary
pack-priv void expectingFinishFlight()

Overrides sun.security.ssl.InputRecord.expectingFinishFlight.

Annotations
@Override
finishHandshakeback to summary
pack-priv void finishHandshake()

Overrides sun.security.ssl.InputRecord.finishHandshake.

Annotations
@Override
isEmptyback to summary
pack-priv boolean isEmpty()

Overrides sun.security.ssl.InputRecord.isEmpty.

Annotations
@Override
parseHandshakeMessageback to summary
private static DTLSInputRecord.HandshakeFragment parseHandshakeMessage(byte contentType, byte majorVersion, byte minorVersion, byte[] recordEnS, int recordEpoch, long recordSeq, ByteBuffer plaintextFragment) throws SSLProtocolException
setSSLContextback to summary
public void setSSLContext(SSLContextImpl sslContext)
setTransportContextback to summary
public void setTransportContext(TransportContext tc)
truncateChFragmentback to summary
private static DTLSInputRecord.HandshakeFragment truncateChFragment(DTLSInputRecord.HandshakeFragment srcFrag, int limit)

Turn a sufficiently-large initial ClientHello fragment into one that stops immediately after the compression methods. This is only used for the initial CH message fragment at offset 0.

Parameters
srcFrag:DTLSInputRecord.HandshakeFragment

the fragment actually received by the DTLSReassembler

limit:int

the size of the new, cloned/truncated handshake fragment

Returns:DTLSInputRecord.HandshakeFragment

a truncated handshake fragment that is sized to look like a complete message, but actually contains only up to the compression methods (no extensions)

sun.security.ssl back to summary

pack-priv final Class DTLSInputRecord.DTLSReassembler

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv TreeSet<DTLSInputRecord.RecordFragment>
pack-priv boolean
pack-priv boolean
pack-priv final int
pack-priv DTLSInputRecord.HandshakeFlight
pack-priv boolean
pack-priv int
pack-priv long
pack-priv DTLSInputRecord.HandshakeFlight

Constructor Summary

AccessConstructor and Description
pack-priv
DTLSReassembler(int handshakeEpoch)

Method Summary

Modifier and TypeMethod and Description
private Plaintext
private Plaintext
pack-priv Plaintext
private void
private void
pack-priv void
pack-priv boolean
private void
private boolean
hasCompleted(byte handshakeType)

private boolean
hasCompleted(Set<DTLSInputRecord.RecordFragment> fragments, int presentMsgSeq, int endMsgSeq)

private boolean
private boolean
private boolean
private boolean
pack-priv void
pack-priv void
pack-priv void
private void
private DTLSInputRecord.HandshakeFragment
valHello(DTLSInputRecord.HandshakeFragment hsf, boolean firstHello)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferedFragmentsback to summary
pack-priv TreeSet<DTLSInputRecord.RecordFragment> bufferedFragments
expectCCSFlightback to summary
pack-priv boolean expectCCSFlight
flightIsReadyback to summary
pack-priv boolean flightIsReady
handshakeEpochback to summary
pack-priv final int handshakeEpoch
handshakeFlightback to summary
pack-priv DTLSInputRecord.HandshakeFlight handshakeFlight
needToCheckFlightback to summary
pack-priv boolean needToCheckFlight
nextRecordEpochback to summary
pack-priv int nextRecordEpoch
nextRecordSeqback to summary
pack-priv long nextRecordSeq
precedingFlightback to summary
pack-priv DTLSInputRecord.HandshakeFlight precedingFlight

Constructor Detail

DTLSReassemblerback to summary
pack-priv DTLSReassembler(int handshakeEpoch)

Method Detail

acquireCachedMessageback to summary
private Plaintext acquireCachedMessage() throws SSLProtocolException
acquireHandshakeMessageback to summary
private Plaintext acquireHandshakeMessage()
acquirePlaintextback to summary
pack-priv Plaintext acquirePlaintext() throws SSLProtocolException
bufferFragmentback to summary
private void bufferFragment(DTLSInputRecord.RecordFragment rf)
cleanUpRetransmitback to summary
private void cleanUpRetransmit(DTLSInputRecord.RecordFragment rf)
expectingFinishFlightback to summary
pack-priv void expectingFinishFlight()
flightIsReadyback to summary
pack-priv boolean flightIsReady()
handshakeHashingback to summary
private void handshakeHashing(DTLSInputRecord.HandshakeFragment hsFrag, Plaintext plaintext)
hasCompletedback to summary
private boolean hasCompleted(byte handshakeType)
hasCompletedback to summary
private boolean hasCompleted(Set<DTLSInputRecord.RecordFragment> fragments, int presentMsgSeq, int endMsgSeq)
hasFinishedMessageback to summary
private boolean hasFinishedMessage()
isDesirableback to summary
private boolean isDesirable(DTLSInputRecord.RecordFragment rf) throws SSLProtocolException
isEmptyback to summary
private boolean isEmpty()
needClientVerifyback to summary
private boolean needClientVerify(Set<DTLSInputRecord.RecordFragment> fragments)
queueUpChangeCipherSpecback to summary
pack-priv void queueUpChangeCipherSpec(DTLSInputRecord.RecordFragment rf) throws SSLProtocolException
queueUpFragmentback to summary
pack-priv void queueUpFragment(DTLSInputRecord.RecordFragment rf) throws SSLProtocolException
queueUpHandshakeback to summary
pack-priv void queueUpHandshake(DTLSInputRecord.HandshakeFragment hsf) throws SSLProtocolException
resetHandshakeFlightback to summary
private void resetHandshakeFlight(DTLSInputRecord.HandshakeFlight prev)
valHelloback to summary
private DTLSInputRecord.HandshakeFragment valHello(DTLSInputRecord.HandshakeFragment hsf, boolean firstHello)
sun.security.ssl back to summary

private final Class DTLSInputRecord.HandshakeFlight

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv byte
pack-priv static final byte
pack-priv HashMap<Byte, List<DTLSInputRecord.HoleDescriptor>>
pack-priv int
pack-priv int
pack-priv long
pack-priv HashMap<Byte, Integer>
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

pack-priv boolean
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

flightEpochback to summary
pack-priv int flightEpoch
handshakeTypeback to summary
pack-priv byte handshakeType
HF_UNKNOWNback to summary
pack-priv static final byte HF_UNKNOWN
holesMapback to summary
pack-priv HashMap<Byte, List<DTLSInputRecord.HoleDescriptor>> holesMap
maxMessageSeqback to summary
pack-priv int maxMessageSeq
maxRecordEpochback to summary
pack-priv int maxRecordEpoch
maxRecordSeqback to summary
pack-priv long maxRecordSeq
messageSeqMapback to summary
pack-priv HashMap<Byte, Integer> messageSeqMap
minMessageSeqback to summary
pack-priv int minMessageSeq

Constructor Detail

HandshakeFlightback to summary
pack-priv HandshakeFlight()

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Annotations
@Override
isRetransmitOfback to summary
pack-priv boolean isRetransmitOf(DTLSInputRecord.HandshakeFlight hs)
sun.security.ssl back to summary

private final Class DTLSInputRecord.HandshakeFragment

extends RecordFragment
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int
pack-priv byte
pack-priv int
pack-priv int
Inherited from sun.security.ssl.DTLSInputRecord.RecordFragment:
contentTypefragmentisCiphertextmajorVersionminorVersionrecordEnSrecordEpochrecordSeq

Constructor Summary

AccessConstructor and Description
pack-priv
HandshakeFragment(byte[] fragment, byte contentType, byte majorVersion, byte minorVersion, byte[] recordEnS, int recordEpoch, long recordSeq, byte handshakeType, int messageLength, int messageSeq, int fragmentOffset, int fragmentLength)

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(DTLSInputRecord.RecordFragment o)

Overrides sun.security.ssl.DTLSInputRecord.RecordFragment.compareTo.

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

Inherited from sun.security.ssl.DTLSInputRecord.RecordFragment:
compareToSequence

Field Detail

fragmentLengthback to summary
pack-priv int fragmentLength
fragmentOffsetback to summary
pack-priv int fragmentOffset
handshakeTypeback to summary
pack-priv byte handshakeType
messageLengthback to summary
pack-priv int messageLength
messageSeqback to summary
pack-priv int messageSeq

Constructor Detail

HandshakeFragmentback to summary
pack-priv HandshakeFragment(byte[] fragment, byte contentType, byte majorVersion, byte minorVersion, byte[] recordEnS, int recordEpoch, long recordSeq, byte handshakeType, int messageLength, int messageSeq, int fragmentOffset, int fragmentLength)

Method Detail

compareToback to summary
public int compareTo(DTLSInputRecord.RecordFragment o)

Overrides sun.security.ssl.DTLSInputRecord.RecordFragment.compareTo.

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
sun.security.ssl back to summary

private final Class DTLSInputRecord.HoleDescriptor

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
HoleDescriptor(int offset, int limit)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

limitback to summary
pack-priv int limit
offsetback to summary
pack-priv int offset

Constructor Detail

HoleDescriptorback to summary
pack-priv HoleDescriptor(int offset, int limit)
sun.security.ssl back to summary

private Class DTLSInputRecord.RecordFragment

extends Object
implements Comparable<DTLSInputRecord.RecordFragment>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Known Direct Subclasses
sun.security.ssl.DTLSInputRecord.HandshakeFragment

Field Summary

Modifier and TypeField and Description
pack-priv byte
pack-priv byte[]
pack-priv boolean
pack-priv byte
pack-priv byte
pack-priv byte[]
pack-priv int
pack-priv long

Constructor Summary

AccessConstructor and Description
pack-priv
RecordFragment(ByteBuffer fragBuf, byte contentType, byte majorVersion, byte minorVersion, byte[] recordEnS, int recordEpoch, long recordSeq, boolean isCiphertext)

pack-priv
RecordFragment(byte[] fragment, byte contentType, byte majorVersion, byte minorVersion, byte[] recordEnS, int recordEpoch, long recordSeq, boolean isCiphertext)

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(DTLSInputRecord.RecordFragment o)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

pack-priv int
compareToSequence(int epoch, long seq)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contentTypeback to summary
pack-priv byte contentType
fragmentback to summary
pack-priv byte[] fragment
isCiphertextback to summary
pack-priv boolean isCiphertext
majorVersionback to summary
pack-priv byte majorVersion
minorVersionback to summary
pack-priv byte minorVersion
recordEnSback to summary
pack-priv byte[] recordEnS
recordEpochback to summary
pack-priv int recordEpoch
recordSeqback to summary
pack-priv long recordSeq

Constructor Detail

RecordFragmentback to summary
pack-priv RecordFragment(ByteBuffer fragBuf, byte contentType, byte majorVersion, byte minorVersion, byte[] recordEnS, int recordEpoch, long recordSeq, boolean isCiphertext)
RecordFragmentback to summary
pack-priv RecordFragment(byte[] fragment, byte contentType, byte majorVersion, byte minorVersion, byte[] recordEnS, int recordEpoch, long recordSeq, boolean isCiphertext)

Method Detail

compareToback to summary
public int compareTo(DTLSInputRecord.RecordFragment o)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
compareToSequenceback to summary
pack-priv int compareToSequence(int epoch, long seq)