sarnau / Inside-The-Loxone-Miniserver

Inside The Loxone Miniserver – various documentation about the Loxone Link/Tree protocol and hardware
195 stars 53 forks source link

Unpack of LoxCC corruption with large base64 content #32

Closed christianTF closed 2 years ago

christianTF commented 2 years ago

Hi Markus,

I've re-created a new issue for the Unpack LoxCC corruption issue (loadMiniserverConfigurationFile.py) as the unpack from Inside-The-Loxone-Miniserver is a base component of the LoxBerry Plugin Stats4Lox, that directly parses the Loxone XML on the LoxBerry to show the elements the user can collect for statistics.
We noticed problems with the unpack algo with users that have large base64 content in their LoxPlan file, like a company logo, or own SVG icons. In this case, the unpack generates a corrupt XML file.

I've reproduced the issue on my Test-Miniserver and have uploaded all the data I could fetch:

In this issue included:

We and our users would be very pleased if you could figure out what the issue is with the LoxCC unpack routine.

For any tests I can support you, I am available for testing. Also my Test-Miniserver can be used for any testing purposes.

Thanks a lot! Christian

s4l_loxplan_ms3.Loxone.unpacked_corrupt.zip s4l_loxplan_ms3_downloaded_from_ms.zip sps0.LoxCC_in_MS_ZIP.zip Test-Miniserver.loxplan_from_PC.zip unpack_loxcc_py3.zip

PS: The corruption issue is the same with the Python2 and Python3 variant of loadMiniserverConfigurationFile.py

sarnau commented 2 years ago

I fixed this issue – either it was an oversight or they changed it for a better compression ratio. Either way. I've also added additional checks for the CRC and generated file size.

christianTF commented 2 years ago

Thanks Markus, tested and works perfect!! :relaxed:

sarnau commented 2 years ago

Looks like it was an oversight – really weird, that I missed that. Anyway, with the CRC32 now being checked, the validity can now be guaranteed.

mschlenstedt commented 2 years ago

Thanks a lot!