调整subjectName长度限制

Signed-off-by: 张余 <1459392684@qq.com>
This commit is contained in:
张余 2024-07-30 16:48:55 +08:00
parent 65a112752b
commit 4b9bf00b7b
3 changed files with 7 additions and 3 deletions

View File

@ -41,8 +41,8 @@ extern "C" {
#define MAX_COUNT_CERTIFICATE 256
#define MAX_LEN_URI 256
#define MAX_AUTH_LEN_URI 256
#define MAX_LEN_CERT_ALIAS 65 /* include 1 byte: the terminator('\0') */
#define MAX_LEN_SUBJECT_NAME 256
#define MAX_LEN_CERT_ALIAS 129 /* include 1 byte: the terminator('\0') */
#define MAX_LEN_SUBJECT_NAME 1025 /* include 1 byte: the terminator('\0') */
#define MAX_LEN_PACKGE_NAME 64
#define MAX_LEN_MAC_KEY 64
#define MAX_UINT32_LEN 16

View File

@ -26,6 +26,8 @@
#include "cm_mem.h"
#include "os_account_manager.h"
#define MAX_SIZE_CAPACITY 409600
using namespace OHOS;
void CmSendResponse(const struct CmContext *context, int32_t result, const struct CmBlob *response)
@ -43,6 +45,7 @@ void CmSendResponse(const struct CmContext *context, int32_t result, const struc
if (response == nullptr) {
reply->WriteUint32(0);
} else {
reply->SetMaxCapacity(MAX_SIZE_CAPACITY);
reply->WriteUint32(response->size);
reply->WriteBuffer(response->data, static_cast<size_t>(response->size));
}

View File

@ -421,7 +421,8 @@ HWTEST_F(CmSysAppCertTest, SysAppCertTest018, TestSize.Level0)
char retUriBuf[MAX_LEN_URI] = {0};
struct CmBlob sysKeyUri = { sizeof(retUriBuf), reinterpret_cast<uint8_t *>(retUriBuf) };
uint8_t certAliasBuf[] = "12345678901234567890123456789012345678901234567890123456789012345";
uint8_t certAliasBuf[] = "123456789012345678901234567890123456789012345678901234567890 \
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789";
struct CmBlob certAlias018 = { sizeof(certAliasBuf), certAliasBuf }; /* certAlias size beyond max */
struct CmAppCertParam appCertParam = { (struct CmBlob *)&g_eccAppCert, (struct CmBlob *)&g_appCertPwd,