WVDrmPlugin signRSA: check arguments before caller
Merge of http://go/wvgerrit/97444 Bug: 153356263 Test: VtsHalDrmV1_0Target Test: VtsHalDrmV1_3Target Change-Id: Ic27056d86804972859a85c0eb2a0e79a0563d040
This commit is contained in:
@@ -1732,6 +1732,12 @@ Return<void> WVDrmPlugin::signRSA(
|
||||
const hidl_vec<uint8_t>& wrappedKey,
|
||||
signRSA_cb _hidl_cb) {
|
||||
|
||||
if (sessionId.size() == 0 || algorithm.size() == 0 ||
|
||||
message.size() == 0 || wrappedKey.size() == 0) {
|
||||
_hidl_cb(Status::BAD_VALUE, hidl_vec<uint8_t>());
|
||||
return Void();
|
||||
}
|
||||
|
||||
const auto& self = android::hardware::IPCThreadState::self();
|
||||
const char* sid = self->getCallingSid();
|
||||
if (!sid || (!strstr(sid, "mediashell_app") && !strstr(sid, "mediadrmserver"))) {
|
||||
@@ -1740,11 +1746,6 @@ Return<void> WVDrmPlugin::signRSA(
|
||||
return Void();
|
||||
}
|
||||
|
||||
if (sessionId.size() == 0 || algorithm.size() == 0 ||
|
||||
message.size() == 0 || wrappedKey.size() == 0) {
|
||||
_hidl_cb(Status::BAD_VALUE, hidl_vec<uint8_t>());
|
||||
return Void();
|
||||
}
|
||||
const std::string algo(algorithm.c_str());
|
||||
std::vector<uint8_t> signature;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user