diff options
author | Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> | 2019-01-28 20:33:16 +0530 |
---|---|---|
committer | Tom Joseph <tomjoseph@in.ibm.com> | 2019-01-31 10:49:10 +0000 |
commit | 161f20d59d205dd5b7702975984dca5b8d6f599c (patch) | |
tree | 717dea5c3315fe4186ae17d223621a483431de6e /user_channel/passwd_mgr.cpp | |
parent | f301f045677d23cc7e7e783fb5d48fb259de594b (diff) | |
download | phosphor-host-ipmid-161f20d59d205dd5b7702975984dca5b8d6f599c.tar.gz phosphor-host-ipmid-161f20d59d205dd5b7702975984dca5b8d6f599c.zip |
Removal of excess 16 bytes padding
Cipher block padding is applied twice(once manually, and
once through EVP_CipherFinal()) causing excess 16 bytes of
data. Manual padding is removed to fix the issue.
Unit-Test:
1. Verified that files are padded correctly without
excess 16 bytes. Also, verified the password update and
RMCP+ login using ipmitool
ipmitool user set password <userid> <password>
ipmitool -I lanplus -H 127.0.0.1 -U <userid> -P <password>
raw 6 1
2. Also verified renaming of user name and login
after that
Resolves openbmc/openbmc#3463
Change-Id: Idec14b100bf7558137ff14601eb590b50cdbd7bf
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
Diffstat (limited to 'user_channel/passwd_mgr.cpp')
-rw-r--r-- | user_channel/passwd_mgr.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/user_channel/passwd_mgr.cpp b/user_channel/passwd_mgr.cpp index d4ff39f..525b2b7 100644 --- a/user_channel/passwd_mgr.cpp +++ b/user_channel/passwd_mgr.cpp @@ -41,11 +41,6 @@ static const size_t maxKeySize = 8; #define META_PASSWD_SIG "=OPENBMC=" -static inline size_t blockRound(size_t odd, size_t blk) -{ - return ((odd) + (((blk) - ((odd) & ((blk)-1))) & ((blk)-1))); -} - /* * Meta data struct for encrypted password file */ @@ -389,10 +384,7 @@ int PasswdMgr::updatePasswdSpecialFile(const std::string& userName, } linePtr = strtok_r(NULL, "\n", &nToken); } - - // Round of to block size and padding remaing bytes with zero. - inBytesLen = blockRound(bytesWritten, EVP_CIPHER_block_size(cipher)); - std::memset(&inBytes[0] + bytesWritten, 0, inBytesLen - bytesWritten); + inBytesLen = bytesWritten; } if (!isUsrFound) { |