citronneur / rdp-rs

Remote Desktop Protocol in RUST
MIT License
223 stars 39 forks source link

Invalid TPKT size was detected #22

Open HsuJv opened 1 year ago

HsuJv commented 1 year ago

Hi @citronneur ,

Thanks for your amazing work to bringing us this crate. I'm trying to build a wasm application based on your work. But got some unexpected error "Invalid minimal size for TPKT" I tried to ignore it and it seems can restore itself. But when looking through your mstsc-rs code, it seems the program shall be terminated when the error occurs https://github.com/citronneur/rdp-rs/blob/7ac880d7efb7f05efef3c84476f7c24f4053e0ea/src/bin/mstsc-rs.rs#L325-L344

See the screenshot which shows it continues to work when the error shows up. Worked but lots of error

Do you have any idea about this error? 'cuz I cannot observe it when using the mstsc-rs which makes me confused.

BTW, the errors happens at line 142 #1, 159 #2, 166 #3 with the tuple (action, length) shown in the screenshot https://github.com/citronneur/rdp-rs/blob/7ac880d7efb7f05efef3c84476f7c24f4053e0ea/src/core/tpkt.rs#L124-L172

Thanks in advance

HsuJv commented 1 year ago

Just for your information I tried to propagate the warning from the library itself to the web console and got the following result error more It seems that the tpkt error is not predictive and has nothing to do with the previous warning.

App build from https://github.com/HsuJv/webgateway/tree/main/webrdp if you want to review the client-side code