}
len += 4 + 4; /* ipmi_bootdev, ipmi_bootdev_persistent */
+ len += 4; /* ipmi_bootdev_mailbox */
len += 4; /* allow_writes */
/* enum + password + password */
return 4 + 4 + optional_strlen(msg->set_password.password) +
4 + optional_strlen(msg->set_password.new_password);
+ case AUTH_MSG_DECRYPT:
+ /* enum + password + device id */
+ return 4 + 4 + optional_strlen(msg->decrypt_dev.password) +
+ 4 + optional_strlen(msg->decrypt_dev.device_id);
default:
pb_log("%s: invalid input\n", __func__);
return 0;
pos += 4;
*(uint32_t *)pos = config->ipmi_bootdev_persistent;
pos += 4;
+ *(uint32_t *)pos = config->ipmi_bootdev_mailbox;
+ pos += 4;
*(uint32_t *)pos = config->allow_writes;
pos += 4;
pos += pb_protocol_serialise_string(pos,
msg->set_password.new_password);
break;
+ case AUTH_MSG_DECRYPT:
+ pos += pb_protocol_serialise_string(pos,
+ msg->decrypt_dev.password);
+ pos += pb_protocol_serialise_string(pos,
+ msg->decrypt_dev.device_id);
+ break;
default:
pb_log("%s: invalid msg\n", __func__);
return -1;
if (read_u32(&pos, &len, &tmp))
goto out;
config->ipmi_bootdev_persistent = !!tmp;
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+ config->ipmi_bootdev_mailbox = !!tmp;
if (read_u32(&pos, &len, &tmp))
goto out;
&msg->set_password.new_password))
return -1;
break;
+ case AUTH_MSG_DECRYPT:
+ if (read_string(msg, &pos, &len, &msg->decrypt_dev.password))
+ return -1;
+ if (read_string(msg, &pos, &len,
+ &msg->decrypt_dev.device_id))
+ return -1;
+ break;
default:
pb_log("%s: unable to parse\n", __func__);
return -1;