This commit is contained in:
Ken McMillan 2018-10-03 14:31:55 -07:00
Родитель 9cfbf9f104
Коммит 7bcdf6ab39
6 изменённых файлов: 34 добавлений и 9 удалений

Просмотреть файл

@ -69,6 +69,19 @@ Issue:
On further inspection, the junk seems to be another QUIC packet. Somehow, On further inspection, the junk seems to be another QUIC packet. Somehow,
picoquic is cramming multiple QUIC packets into a single UDP packet. picoquic is cramming multiple QUIC packets into a single UDP packet.
Event file: anomaly6.iev
Picoquic log file: anomaly6.log
QUIC version: draft 14
Implementation:
picoquic
Issue:
Client sends a MAX_STREAM_ID frame with stream id 0, which is a client, not
a server stream id. Server (picoquicdemo) responds with connection close and
error code of STREAM_ID_ERROR. However, specification does not state that it
is an error to send a stream id that is not an id of the peer, and does not
state that STREAM_ID_ERROR should be returned in this case.

Просмотреть файл

@ -353,9 +353,9 @@ before tls_send_event(src:ip.endpoint, dst:ip.endpoint, scid:cid, dcid:cid, data
}; };
crypto_data_end(src,scid,e) := crypto_data(src,scid,e).end; crypto_data_end(src,scid,e) := crypto_data(src,scid,e).end;
# require conn_open(src,dcid); # [3] # require conn_open(src,dcid); # [3]
var hs : tls.handshakes; var res := tls.handshake_parser.deserialize(crypto_data(src,scid,e),crypto_handler_pos(src,scid,e));
call hs,crypto_handler_pos(src,scid,e) var hs := res.value;
:= tls.handshake_parser.deserialize(data,crypto_handler_pos(src,scid,e)); # [1] crypto_handler_pos(src,scid,e) := res.pos;
var idx := hs.begin; var idx := hs.begin;
while idx < hs.end { while idx < hs.end {
var h := hs.value(idx); var h := hs.value(idx);

Просмотреть файл

@ -115,7 +115,7 @@ implement botan.lower.send(tls_id:botan.id,bytes:stream_data) {
client.enc_level := client.enc_level.next; client.enc_level := client.enc_level.next;
}; };
if tls_id = server.tls_id { if tls_id = server.tls_id {
call tls_send_event(server.ep, client.ep, the_cid, 0, msgs, server.enc_level)' call tls_send_event(server.ep, client.ep, the_cid, 0, msgs, server.enc_level);
server.enc_level := server.enc_level.next; server.enc_level := server.enc_level.next;
} }
} }

Просмотреть файл

@ -186,6 +186,13 @@ object tls_ser = {}
} }
virtual bool open_list_elem() { virtual bool open_list_elem() {
if (fence.size() == 0) { // tricky: see if input contains a full message
if (!more(4)) {
return false;
}
unsigned len = (inp[pos+1] << 16) + (inp[pos+2] << 8) + inp[pos];
return inp.size() >= pos + len + 4;
}
return more(1); return more(1);
} }
void close_list_elem() {} void close_list_elem() {}

Просмотреть файл

@ -23,7 +23,7 @@ object tls = { ...
# ============= # =============
instance handshakes : vector(handshake) instance handshakes : vector(handshake)
instance handshake_parser : deserializer(stream_idx,stream_data,handshakes,tls_deser) instance handshake_parser : deserializer(stream_pos,stream_data,handshakes,tls_deser)
# Protocol event # Protocol event
# ============== # ==============

Просмотреть файл

@ -17,17 +17,22 @@
module deserializer(index,bytes,datatype,deser) = { module deserializer(index,bytes,datatype,deser) = {
action deserialize(x:bytes,pos:index) returns (y:datatype,pos:index) type result = struct {
pos : index,
value : datatype
}
action deserialize(x:bytes,pos:index) returns (res:result)
implementation { implementation {
implement deserialize { <<< implement deserialize { <<<
std::vector<char> buf(x.size()); std::vector<char> buf(x.size() - pos);
std::copy(x.begin()+pos,x.end(),buf.begin()); std::copy(x.begin()+pos,x.end(),buf.begin());
`deser` ds(buf); `deser` ds(buf);
try { try {
__deser(ds,y); __deser(ds,res.value);
pos += ds.pos; res.pos = pos + ds.pos;
} }
// If deserialization failure, print out the packet for // If deserialization failure, print out the packet for