Fix keyname generation issue
The keyname binded to keyring return a wrong string when there are binary char larger than 127, the sign extension will introduce unexpect FFFFFF string to the keyname. Bug: 65423023 Test: local build with boot test and device encryption status check. Change-Id: I26482c98ac1858a63b9f5c3f84a8699fd6a21cd7 Signed-off-by: Ai, Ting A <ting.a.ai@intel.com> Signed-off-by: Chen, Luhai <luhai.chen@intel.com>
This commit is contained in:
parent
7056de1b42
commit
5744dfe3cc
1 changed files with 1 additions and 1 deletions
|
@ -98,7 +98,7 @@ static char const* const NAME_PREFIXES[] = {
|
||||||
static std::string keyname(const std::string& prefix, const std::string& raw_ref) {
|
static std::string keyname(const std::string& prefix, const std::string& raw_ref) {
|
||||||
std::ostringstream o;
|
std::ostringstream o;
|
||||||
o << prefix << ":";
|
o << prefix << ":";
|
||||||
for (auto i : raw_ref) {
|
for (unsigned char i : raw_ref) {
|
||||||
o << std::hex << std::setw(2) << std::setfill('0') << (int)i;
|
o << std::hex << std::setw(2) << std::setfill('0') << (int)i;
|
||||||
}
|
}
|
||||||
return o.str();
|
return o.str();
|
||||||
|
|
Loading…
Reference in a new issue