diff --git a/common/src/interfaces/access_control_profile.cpp b/common/src/interfaces/access_control_profile.cpp index 07fc60a00e264814952b77ae57195b48f85b0899..a77bd79162d5e9b20b54039667bcfb150ffde75b 100644 --- a/common/src/interfaces/access_control_profile.cpp +++ b/common/src/interfaces/access_control_profile.cpp @@ -260,13 +260,10 @@ std::string AccessControlProfile::dump() const cJSON_AddNumberToObject(json, ACCESS_CONTROL_ID.c_str(), accessControlId_); cJSON_AddNumberToObject(json, ACCESSER_ID.c_str(), accesserId_); cJSON_AddNumberToObject(json, ACCESSEE_ID.c_str(), accesseeId_); - cJSON_AddStringToObject(json, SESSION_KEY.c_str(), sessionKey_.c_str()); cJSON_AddNumberToObject(json, BIND_TYPE.c_str(), bindType_); cJSON_AddNumberToObject(json, AUTHENTICATION_TYPE.c_str(), authenticationType_); cJSON_AddNumberToObject(json, BIND_LEVEL.c_str(), bindLevel_); cJSON_AddNumberToObject(json, STATUS.c_str(), status_); - cJSON_AddNumberToObject(json, VALID_PERIOD.c_str(), validPeriod_); - cJSON_AddNumberToObject(json, LAST_AUTH_TIME.c_str(), lastAuthTime_); cJSON_AddStringToObject(json, TRUST_DEVICE_ID.c_str(), ProfileUtils::GetAnonyString(trustDeviceId_).c_str()); cJSON_AddNumberToObject(json, DEVICE_ID_TYPE.c_str(), deviceIdType_); cJSON_AddStringToObject(json, DEVICE_ID_HASH.c_str(), deviceIdHash_.c_str()); diff --git a/common/src/interfaces/accessee.cpp b/common/src/interfaces/accessee.cpp index ede7575598937c0bf3245a3d1a4ea370bc167d23..d647404c689299b7b512f060b54ba665d013f570 100644 --- a/common/src/interfaces/accessee.cpp +++ b/common/src/interfaces/accessee.cpp @@ -266,7 +266,6 @@ std::string Accessee::dump() const cJSON_AddStringToObject(json, ACCESSEE_DEVICE_NAME.c_str(), ProfileUtils::GetAnonyString(accesseeDeviceName_).c_str()); cJSON_AddStringToObject(json, ACCESSEE_SERVICE_NAME.c_str(), accesseeServiceName_.c_str()); - cJSON_AddNumberToObject(json, ACCESSEE_CREDENTIAL_ID.c_str(), accesseeCredentialId_); cJSON_AddStringToObject(json, ACCESSEE_CREDENTIAL_ID_STR.c_str(), accesseeCredentialIdStr_.c_str()); cJSON_AddNumberToObject(json, ACCESSEE_STATUS.c_str(), accesseeStatus_); cJSON_AddNumberToObject(json, ACCESSEE_SESSION_KEY_ID.c_str(), accesseeSessionKeyId_); diff --git a/common/src/interfaces/accesser.cpp b/common/src/interfaces/accesser.cpp index aa7b4faa9b68f746f7ed552fb7d9a7dbc4108464..04346db5ec00d36f51deb36a351af62f7f44817b 100644 --- a/common/src/interfaces/accesser.cpp +++ b/common/src/interfaces/accesser.cpp @@ -264,7 +264,6 @@ std::string Accesser::dump() const cJSON_AddStringToObject(json, ACCESSER_DEVICE_NAME.c_str(), ProfileUtils::GetAnonyString(accesserDeviceName_).c_str()); cJSON_AddStringToObject(json, ACCESSER_SERVICE_NAME.c_str(), accesserServiceName_.c_str()); - cJSON_AddNumberToObject(json, ACCESSER_CREDENTIAL_ID.c_str(), accesserCredentialId_); cJSON_AddStringToObject(json, ACCESSER_CREDENTIAL_ID_STR.c_str(), accesserCredentialIdStr_.c_str()); cJSON_AddNumberToObject(json, ACCESSER_STATUS.c_str(), accesserStatus_); cJSON_AddNumberToObject(json, ACCESSER_SESSION_KEY_ID.c_str(), accesserSessionKeyId_); diff --git a/old/services/core/src/distributed_device_profile_stub.cpp b/old/services/core/src/distributed_device_profile_stub.cpp index bc257720e28d015f62677b1854c62949d5f1053e..ad9dcc14fa1a4d648b5e9a6b9afb5cf73fdd05fa 100644 --- a/old/services/core/src/distributed_device_profile_stub.cpp +++ b/old/services/core/src/distributed_device_profile_stub.cpp @@ -759,15 +759,18 @@ int32_t DistributedDeviceProfileStub::PutSessionKeyInner(MessageParcel& data, Me int32_t sessionKeyId = 0; READ_HELPER(data, Uint32, userId); if (!IpcUtils::UnMarshalling(data, sessionKey)) { + sessionKey.clear(); HILOGE("dp ipc write parcel fail"); return DP_WRITE_PARCEL_FAIL; } int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutSessionKey(userId, sessionKey, sessionKeyId); if (!reply.WriteInt32(ret)) { + sessionKey.clear(); HILOGE("Write reply failed"); return DP_WRITE_PARCEL_FAIL; } WRITE_HELPER(reply, Int32, sessionKeyId); + sessionKey.clear(); return DP_SUCCESS; } @@ -781,13 +784,16 @@ int32_t DistributedDeviceProfileStub::GetSessionKeyInner(MessageParcel& data, Me READ_HELPER(data, Int32, sessionKeyId); int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetSessionKey(userId, sessionKeyId, sessionKey); if (!reply.WriteInt32(ret)) { + sessionKey.clear(); HILOGE("Write reply failed"); return DP_WRITE_PARCEL_FAIL; } if (!IpcUtils::Marshalling(reply, sessionKey)) { + sessionKey.clear(); HILOGE("dp ipc write parcel fail"); return DP_WRITE_PARCEL_FAIL; } + sessionKey.clear(); return DP_SUCCESS; } @@ -800,14 +806,17 @@ int32_t DistributedDeviceProfileStub::UpdateSessionKeyInner(MessageParcel& data, READ_HELPER(data, Uint32, userId); READ_HELPER(data, Int32, sessionKeyId); if (!IpcUtils::UnMarshalling(data, sessionKey)) { + sessionKey.clear(); HILOGE("dp ipc write parcel fail"); return DP_WRITE_PARCEL_FAIL; } int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().UpdateSessionKey(userId, sessionKeyId, sessionKey); if (!reply.WriteInt32(ret)) { + sessionKey.clear(); HILOGE("Write reply failed"); return DP_WRITE_PARCEL_FAIL; } + sessionKey.clear(); return DP_SUCCESS; } diff --git a/services/core/src/distributed_device_profile_stub_new.cpp b/services/core/src/distributed_device_profile_stub_new.cpp index 19e7fb23ff69d54af18a357638707bf0f44230c6..ec4f631a56cb06dd60a57b3732e0d79977cf7eb6 100644 --- a/services/core/src/distributed_device_profile_stub_new.cpp +++ b/services/core/src/distributed_device_profile_stub_new.cpp @@ -391,15 +391,18 @@ int32_t DistributedDeviceProfileStubNew::PutSessionKeyInner(MessageParcel& data, int32_t sessionKeyId = 0; READ_HELPER(data, Uint32, userId); if (!IpcUtils::UnMarshalling(data, sessionKey)) { + sessionKey.clear(); HILOGE("dp ipc write parcel fail"); return DP_WRITE_PARCEL_FAIL; } int32_t ret = PutSessionKey(userId, sessionKey, sessionKeyId); if (!reply.WriteInt32(ret)) { + sessionKey.clear(); HILOGE("Write reply failed"); return DP_WRITE_PARCEL_FAIL; } WRITE_HELPER(reply, Int32, sessionKeyId); + sessionKey.clear(); return DP_SUCCESS; } @@ -413,13 +416,16 @@ int32_t DistributedDeviceProfileStubNew::GetSessionKeyInner(MessageParcel& data, READ_HELPER(data, Int32, sessionKeyId); int32_t ret = GetSessionKey(userId, sessionKeyId, sessionKey); if (!reply.WriteInt32(ret)) { + sessionKey.clear(); HILOGE("Write reply failed"); return DP_WRITE_PARCEL_FAIL; } if (!IpcUtils::Marshalling(reply, sessionKey)) { + sessionKey.clear(); HILOGE("dp ipc write parcel fail"); return DP_WRITE_PARCEL_FAIL; } + sessionKey.clear(); return DP_SUCCESS; } @@ -432,14 +438,17 @@ int32_t DistributedDeviceProfileStubNew::UpdateSessionKeyInner(MessageParcel& da READ_HELPER(data, Uint32, userId); READ_HELPER(data, Int32, sessionKeyId); if (!IpcUtils::UnMarshalling(data, sessionKey)) { + sessionKey.clear(); HILOGE("dp ipc write parcel fail"); return DP_WRITE_PARCEL_FAIL; } int32_t ret = UpdateSessionKey(userId, sessionKeyId, sessionKey); if (!reply.WriteInt32(ret)) { + sessionKey.clear(); HILOGE("Write reply failed"); return DP_WRITE_PARCEL_FAIL; } + sessionKey.clear(); return DP_SUCCESS; }