Align MetaPassStruct for cross-arch consistency
Increase reserved field from 2 to 6 bytes to ensure natural alignment of
subsequent size_t fields on both 32-bit and 64-bit architectures.
This avoids compiler-inserted padding and ensures consistent
struct layout for serialization and IPC.
No functional changes beyond layout fix
Change-Id: Icc53e2fdd6cceac33f63343f5be537b704742eaa
Signed-off-by: Vijaysankar R <vijaysankarr@ami.com>
diff --git a/user_channel/passwd_mgr.cpp b/user_channel/passwd_mgr.cpp
index 929a83c..6e515da 100644
--- a/user_channel/passwd_mgr.cpp
+++ b/user_channel/passwd_mgr.cpp
@@ -51,7 +51,7 @@
struct MetaPassStruct
{
char signature[10];
- unsigned char reseved[2];
+ unsigned char reseved[6];
size_t hashSize;
size_t ivSize;
size_t dataSize;
@@ -534,7 +534,8 @@
OPENSSL_cleanse(key.data(), keyLen);
// Update the meta password structure.
- MetaPassStruct metaData = {META_PASSWD_SIG, {0, 0}, 0, 0, 0, 0, 0};
+ MetaPassStruct metaData = {
+ META_PASSWD_SIG, {0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0};
metaData.hashSize = hashLen;
metaData.ivSize = ivLen;
metaData.dataSize = bytesWritten;