Fix array and opaque data impls
Closes #1 (closed). Closes #6 (closed).
I am not sure why this wasn't found in tests, but I think both impls for arrays are wrong:
- The FLA should not serialize its length according to the RFC.
- VLAs should encode their elements properly instead of just transmuting from its Rust repr (not only wrong but also unsound).
- VLA's lengths are measured in number of elements not number of bytes.
The padding to 4 bytes should be taken care of by the other primitives and their Xdr impl.
This introduces Xdr
impls for opaque data ([u8; N]
and Vec<u8>
), which the array impls partly have been confused with.
Edited by Martin Kröning