kytos / python-openflow

Low level OpenFlow messages parser used by Kytos SDN Platform
https://kytos.io/
MIT License
46 stars 35 forks source link

Length fields are not being checked #314

Open erickvermot opened 7 years ago

erickvermot commented 7 years ago

length fields are not beeing checked. (pg 50) - "OpenFlow is a simple binary protocol, therefore invalid OpenFlow messages generated by OpenFlow implementations will in general result in the message having the wrong length or some fields having invalid values (see 7.1.3). It is recommended to monitor those conditions to detect non-compliant implementations."

erickvermot commented 7 years ago

I propose some simple length and bit checks on unpack methods like in the examples bellow. Do you guys want this kind of implementation? @diraol @beraldoleal ?

should I continue making theese kind of changes? or is this not what you have in mind?

erickvermot commented 7 years ago
beraldoleal commented 7 years ago

I agree, we must check this validations.

However we have already an issue for a more open discussion, please see #96 .

We need to find a solution for a more generic implementation. I'm removing the milestone for now. But for sure we need to think this soon.

erickvermot commented 7 years ago

( update: I realized now buffer is not beeing sliced prior to unpacking the attributes... So with this approach, my method may not work very well...) I'll leave this for now so we can discuss later.