* adopt changes from 182b05bd * add checks on optional IEs * add checks on encoded buffer sizes
182b05bd