ipmid: Fix group / OEM parsing

The types of the fields being unpacked are larger than what the spec
requires for the sizing. This means our unpacker tries to unpack 4 bytes
for the group (which is supposed to be 1 byte) and 4 bytes for the oem
(which is only 3 bytes). This breaks oem commands that take no arguments
since our parser will reject those commands for being too short. It also
breaks the response, since it adds more bytes than needed.

Change-Id: I4f4710a6a2720574efb86635827f737be48d296a
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/ipmid-new.cpp b/ipmid-new.cpp
index 2654d61..97c6e79 100644
--- a/ipmid-new.cpp
+++ b/ipmid-new.cpp
@@ -271,19 +271,20 @@
 message::Response::ptr executeIpmiGroupCommand(message::Request::ptr request)
 {
     // look up the group for this request
-    Group group;
-    if (0 != request->payload.unpack(group))
+    uint8_t bytes;
+    if (0 != request->payload.unpack(bytes))
     {
         return errorResponse(request, ccReqDataLenInvalid);
     }
     // The handler will need to unpack group as well; we just need it for lookup
     request->payload.reset();
+    auto group = static_cast<Group>(bytes);
     message::Response::ptr response =
         executeIpmiCommandCommon(groupHandlerMap, group, request);
     // if the handler should add the group; executeIpmiCommandCommon does not
     if (response->cc != ccSuccess && response->payload.size() == 0)
     {
-        response->pack(group);
+        response->pack(bytes);
     }
     return response;
 }
@@ -291,18 +292,19 @@
 message::Response::ptr executeIpmiOemCommand(message::Request::ptr request)
 {
     // look up the iana for this request
-    Iana iana;
-    if (0 != request->payload.unpack(iana))
+    uint24_t bytes;
+    if (0 != request->payload.unpack(bytes))
     {
         return errorResponse(request, ccReqDataLenInvalid);
     }
     request->payload.reset();
+    auto iana = static_cast<Iana>(bytes);
     message::Response::ptr response =
         executeIpmiCommandCommon(oemHandlerMap, iana, request);
     // if the handler should add the iana; executeIpmiCommandCommon does not
     if (response->cc != ccSuccess && response->payload.size() == 0)
     {
-        response->pack(iana);
+        response->pack(bytes);
     }
     return response;
 }