feat: integrate MCP and ES3C28P audio support with upstream compatibility updates
This commit is contained in:
@@ -107,6 +107,23 @@ static bool decrypt(const std::string& ssidInput, std::string& ssidOutput) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Strip PKCS#7 padding
|
||||
if (result_length > 0) {
|
||||
uint8_t pad_val = result[result_length - 1];
|
||||
if (pad_val >= 1 && pad_val <= 16 && pad_val <= result_length) {
|
||||
bool valid_padding = true;
|
||||
for (size_t i = result_length - pad_val; i < result_length; ++i) {
|
||||
if (result[i] != pad_val) {
|
||||
valid_padding = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (valid_padding) {
|
||||
result[result_length - pad_val] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ssidOutput = reinterpret_cast<char*>(result);
|
||||
free(result);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user