Authentic but invalid frames should throw FormatException.

This commit is contained in:
akwizgran
2012-08-29 18:52:55 +01:00
parent cea76cce7e
commit c8038a5865

View File

@@ -115,7 +115,7 @@ class IncomingEncryptionLayer implements FrameReader {
// Decode and validate the header // Decode and validate the header
finalFrame = FrameEncoder.isFinalFrame(frame); finalFrame = FrameEncoder.isFinalFrame(frame);
if(!finalFrame && ciphertextLength < frameLength) if(!finalFrame && ciphertextLength < frameLength)
throw new EOFException(); throw new FormatException();
int payloadLength = FrameEncoder.getPayloadLength(frame); int payloadLength = FrameEncoder.getPayloadLength(frame);
if(payloadLength > plaintextLength - HEADER_LENGTH) if(payloadLength > plaintextLength - HEADER_LENGTH)
throw new FormatException(); throw new FormatException();