nrkno / sofie-emberplus-connection

Ember+ Connection: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
20 stars 15 forks source link

Fix/indefinite length #14

Closed sparkpunkd closed 4 years ago

sparkpunkd commented 4 years ago

Some Lawo EmberPlus packets were encountered that use two encoding patterns that the library itself does not follow, so were not picked up in round trip testing. These are:

  1. Use of indefinite length almost everywhere, requiring the decoder to forward compute most lengths. The ASN.1 decoder library includes the terminating bytes 0x00 0x00 in its length and the decoder was not compensating for these.
  2. A Qualified Node at the root of a tree only used to contain children and so lacking any contents.

This PR adds a test for the above based on Lawo data and attempts to fix both issues.