Signed-off-by: lwk <1076278852@qq.com>
This commit is contained in:
lwk 2022-03-24 11:21:51 +08:00
parent c7649988a0
commit 1b6ad445c8
9 changed files with 10 additions and 14 deletions

View File

@ -299,7 +299,7 @@ bool InitDeviceSessionManager(WorkQueue *queue, const char *pkgName, const char
return true;
}
bool DeInitDeviceSessionManager()
bool DeInitDeviceSessionManager(void)
{
DeviceSessionManager *instance = GetDeviceSessionManagerInstance();
int ret = RemoveSessionServer(instance->pkgName, instance->sessionName);

View File

@ -27,7 +27,7 @@ extern "C" {
bool InitDeviceSessionManager(WorkQueue *queue, const char *pkgName, const char *sessionName,
DeviceMessageReceiver messageReceiver, MessageSendResultNotifier sendResultNotifier);
bool DeInitDeviceSessionManager();
bool DeInitDeviceSessionManager(void);
void MessengerSendMsgTo(uint64_t transNo, const DeviceIdentify *devId, const uint8_t *msg, uint32_t msgLen);

View File

@ -81,7 +81,6 @@ void DestroyMessengerImpl(Messenger *messenger)
messenger->magicHead = 0;
DestroyWorkQueue(messenger->processQueue);
FREE(messenger);
return;
}
bool IsMessengerReadyImpl(const Messenger *messenger)

View File

@ -60,6 +60,7 @@ bool GetDateTimeByMillisecondSince1970(uint64_t input, DateTime *datetime)
datetime->msec = (uint16_t)(input % SEC_TO_MILLISEC);
return true;
}
bool GetDateTimeByMillisecondSinceBoot(uint64_t input, DateTime *datetime)
{
if (datetime == NULL) {

View File

@ -16,6 +16,7 @@
#include "utils_hexstring.h"
#include <stdbool.h>
#include <stdio.h>
#include "utils_log.h"
@ -36,7 +37,7 @@ static char HexToChar(uint8_t hex)
void ByteToHexString(const uint8_t *hex, uint32_t hexLen, uint8_t *str, uint32_t strLen)
{
if (strLen < hexLen * BYTE_TO_HEX_OPER_LENGTH) {
if (hex == NULL || str == NULL || strLen < hexLen * BYTE_TO_HEX_OPER_LENGTH) {
return;
}
@ -48,7 +49,7 @@ void ByteToHexString(const uint8_t *hex, uint32_t hexLen, uint8_t *str, uint32_t
int32_t HexStringToByte(const char *str, uint32_t strLen, uint8_t *hex, uint32_t hexLen)
{
if (strLen % BYTE_TO_HEX_OPER_LENGTH) { /* even number or not */
if (str == NULL || hex == NULL || strLen % BYTE_TO_HEX_OPER_LENGTH) { /* even number or not */
return ERR;
}
uint32_t outLen = strLen / BYTE_TO_HEX_OPER_LENGTH;

View File

@ -13,9 +13,6 @@
* limitations under the License.
*/
#ifndef WORKQUEUE_WORK_QUEUE_H
#define WORKQUEUE_WORK_QUEUE_H
#include "utils_work_queue.h"
#include <pthread.h>
@ -179,4 +176,3 @@ uint32_t QueueWork(WorkQueue *queue, WorkProcess process, uint8_t *data, uint32_
(void)pthread_cond_broadcast(&queue->cond);
return WORK_QUEUE_OK;
}
#endif

View File

@ -469,7 +469,7 @@ static int32_t ParseCredData(const char *credStr, struct CredData *credData)
static int32_t VerifyCredPubKeyChain(const struct PbkChain *pbkChain)
{
for (int i = 0; i < 3; i++) {
for (int i = 0; i < PBK_CHAIN_LEVEL; i++) {
if (EcdsaVerify(&(pbkChain[i].src), &(pbkChain[i].sig), &(pbkChain[i].pbk), pbkChain[i].algorithm) != SUCCESS) {
return ERR_ECC_VERIFY_ERR;
}

View File

@ -27,7 +27,7 @@
const char g_dslmKey[] = "dslm_key";
#define HICHIAN_INPUT_PARAM_STRING_LENGTH 512
#define HICHAIN_INPUT_PARAM_STRING_LENGTH 512
#define DSLM_CERT_CHAIN_BASE_LENGTH 4096
#define DSLM_INFO_MAX_LEN_UDID 68
@ -45,11 +45,11 @@ int32_t GetPkInfoListStr(bool isSelf, const char *udidStr, char **pkInfoList)
{
SECURITY_LOG_INFO("GetPkInfoListStr start");
char paramJson[HICHIAN_INPUT_PARAM_STRING_LENGTH] = {0};
char paramJson[HICHAIN_INPUT_PARAM_STRING_LENGTH] = {0};
char *resultBuffer = NULL;
uint32_t resultNum = 0;
int32_t ret = GenerateFuncParamJson(isSelf, udidStr, &paramJson[0], HICHIAN_INPUT_PARAM_STRING_LENGTH);
int32_t ret = GenerateFuncParamJson(isSelf, udidStr, &paramJson[0], HICHAIN_INPUT_PARAM_STRING_LENGTH);
if (ret != SUCCESS) {
SECURITY_LOG_INFO("GenerateFuncParamJson failed");
return ret;

View File

@ -96,5 +96,4 @@ void UnInitService(void)
{
DeinitDslmProcess();
DeinitMessenger();
return;
}