Merge branch 'topic/bernhard/heartbeat' into topic/bernhard/ssl-analyzer

Conflicts:
	src/analyzer/protocol/ssl/ssl-analyzer.pac
	src/analyzer/protocol/ssl/ssl-protocol.pac
This commit is contained in:
Bernhard Amann 2014-04-21 10:34:36 -07:00
commit 8ce3cf65f2
6 changed files with 151 additions and 2 deletions

View file

@ -39,13 +39,13 @@ type SSLRecord(is_orig: bool) = record {
$context.connection.determine_ssl_version(head0, head1, head2);
content_type : int = case version of {
UNKNOWN_VERSION -> 0;
# UNKNOWN_VERSION -> 0; assume tls on unknown version
SSLv20 -> head2+300;
default -> head0;
};
length : int = case version of {
UNKNOWN_VERSION -> 0;
# UNKNOWN_VERSION -> 0; assume tls on unknown version
SSLv20 -> (((head0 & 0x7f) << 8) | head1) - 3;
default -> (head3 << 8) | head4;
};
@ -62,6 +62,7 @@ type PlaintextRecord(rec: SSLRecord) = case rec.content_type of {
CHANGE_CIPHER_SPEC -> ch_cipher : ChangeCipherSpec(rec);
ALERT -> alert : Alert(rec);
HANDSHAKE -> handshake : Handshake(rec);
HEARTBEAT -> heartbeat: Heartbeat(rec);
APPLICATION_DATA -> app_data : ApplicationData(rec);
V2_ERROR -> v2_error : V2Error(rec);
V2_CLIENT_HELLO -> v2_client_hello : V2ClientHello(rec);
@ -164,6 +165,16 @@ type ApplicationData(rec: SSLRecord) = record {
data : bytestring &restofdata &transient;
};
######################################################################
# V3 Heartbeat
######################################################################
type Heartbeat(rec: SSLRecord) = record {
type : uint8;
payload_length : uint16;
data : bytestring &restofdata;
};
######################################################################
# Handshake Protocol (7.4.)
######################################################################