From 0d41befe26ae2c7848539507cc2f29cea0e47140 Mon Sep 17 00:00:00 2001 From: "jc815.lee" Date: Tue, 30 Jul 2013 20:24:09 +0900 Subject: [PATCH] sync with private [model] [binary_type] [customer] [issue#] [problem] [cause] [solution] [team] [request] [horizontal_expansion] Change-Id: If11b6fb60e0203a36c47f377d79a73bc1ccda4e1 Signed-off-by: jc815.lee --- srcs/cert-service-process.c | 8 ++++---- srcs/cert-service-store.c | 12 ++++++------ srcs/cert-service-util.c | 20 ++++++++++---------- srcs/cert-service.c | 14 +++++++------- srcs/dpkg-pki-sig.c | 2 +- vcore/src/vcore/pkcs12.c | 2 +- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/srcs/cert-service-process.c b/srcs/cert-service-process.c index 725f986..8afba16 100644 --- a/srcs/cert-service-process.c +++ b/srcs/cert-service-process.c @@ -490,7 +490,7 @@ int VerifyCallbackfunc(int ok, X509_STORE_CTX* store) X509_NAME_oneline(X509_get_subject_name(store->current_cert), buf, 256); else strncpy(buf, "test", 4); - SLOGD("[%s] Certificate %i: %s\n", __func__, verify_context->depth, buf); + SECURE_SLOGD("[%s] Certificate %i: %s\n", __func__, verify_context->depth, buf); return ok; } @@ -1312,7 +1312,7 @@ int _search_certificate(cert_svc_filename_list** fileNames, search_field fldName while(1) { if((lstat(p->filename, &file_info)) < 0) { // get file information - SLOGE("[ERR][%s] Fail to get file(%s) information.\n", __func__, p->filename); + SECURE_SLOGE("[ERR][%s] Fail to get file(%s) information.\n", __func__, p->filename); ret = CERT_SVC_ERR_INVALID_OPERATION; goto err; } @@ -1330,7 +1330,7 @@ int _search_certificate(cert_svc_filename_list** fileNames, search_field fldName // load content into buffer if((ret = cert_svc_util_load_file_to_buffer(p->filename, certBuf)) != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR][%s] Fail to load file to buffer, filename: [%s], ret: [%d]\n", __func__, p->filename, ret); + SECURE_SLOGE("[ERR][%s] Fail to load file to buffer, filename: [%s], ret: [%d]\n", __func__, p->filename, ret); free(certBuf); certBuf = NULL; goto fail_to_load_file; @@ -1345,7 +1345,7 @@ int _search_certificate(cert_svc_filename_list** fileNames, search_field fldName // load content into descriptor buffer if((ret = _extract_certificate_data(certBuf, certDesc)) != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR][%s] Fail to extract certificate data, filename: [%s], ret: [%d]\n", __func__, p->filename, ret); + SECURE_SLOGE("[ERR][%s] Fail to extract certificate data, filename: [%s], ret: [%d]\n", __func__, p->filename, ret); goto fail_to_extract_file; } diff --git a/srcs/cert-service-store.c b/srcs/cert-service-store.c index 2c9aafe..c582d6c 100644 --- a/srcs/cert-service-store.c +++ b/srcs/cert-service-store.c @@ -97,12 +97,12 @@ int _add_certificate_to_store(const char* filePath, const char* location) /* file open and write */ if(!(fp_in = fopen(filePath, "rb"))) { - SLOGE("[ERR][%s] Fail to open file, [%s]\n", __func__, filePath); + SECURE_SLOGE("[ERR][%s] Fail to open file, [%s]\n", __func__, filePath); ret = CERT_SVC_ERR_FILE_IO; goto err; } if(!(fp_out = fopen(fileFullPath, "wb"))) { - SLOGE("[ERR][%s] Fail to open file, [%s]\n", __func__, fileFullPath); + SECURE_SLOGE("[ERR][%s] Fail to open file, [%s]\n", __func__, fileFullPath); if(errno == EACCES) ret = CERT_SVC_ERR_PERMISSION_DENIED; else @@ -111,7 +111,7 @@ int _add_certificate_to_store(const char* filePath, const char* location) } if((ret = cert_svc_util_get_file_size(filePath, &inFileLen)) != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR][%s] Fail to get file size, [%s]\n", __func__, filePath); + SECURE_SLOGE("[ERR][%s] Fail to get file size, [%s]\n", __func__, filePath); goto err; } @@ -124,12 +124,12 @@ int _add_certificate_to_store(const char* filePath, const char* location) memset(fileContent, 0x00, inFileLen); if(fread(fileContent, sizeof(char), inFileLen, fp_in) != inFileLen) { - SLOGE("[ERR][%s] Fail to read file, [%s]\n", __func__, filePath); + SECURE_SLOGE("[ERR][%s] Fail to read file, [%s]\n", __func__, filePath); ret = CERT_SVC_ERR_FILE_IO; goto err; } if(fwrite(fileContent, sizeof(char), inFileLen, fp_out) != inFileLen) { - SLOGE("[ERR][%s] Fail to write file, [%s]\n", __func__, fileFullPath); + SECURE_SLOGE("[ERR][%s] Fail to write file, [%s]\n", __func__, fileFullPath); ret = CERT_SVC_ERR_FILE_IO; goto err; } @@ -167,7 +167,7 @@ int _delete_certificate_from_store(const char* fileName, const char* location) /* delete designated certificate */ if(unlink(fileFullPath) == -1) { - SLOGE("[ERR][%s] Fail to delete file, [%s]\n", __func__, fileName); + SECURE_SLOGE("[ERR][%s] Fail to delete file, [%s]\n", __func__, fileName); if(errno == EACCES) ret = CERT_SVC_ERR_PERMISSION_DENIED; else diff --git a/srcs/cert-service-util.c b/srcs/cert-service-util.c index 6cc7a59..af65f84 100644 --- a/srcs/cert-service-util.c +++ b/srcs/cert-service-util.c @@ -160,7 +160,7 @@ int cert_svc_util_get_file_size(const char* filepath, unsigned long int* length) FILE* fp_in = NULL; if(!(fp_in = fopen(filepath, "r"))) { - SLOGE("[ERR][%s] Fail to open file, [%s]\n", __func__, filepath); + SECURE_SLOGE("[ERR][%s] Fail to open file, [%s]\n", __func__, filepath); ret = CERT_SVC_ERR_FILE_IO; goto err; } @@ -182,7 +182,7 @@ int cert_svc_util_get_extension(const char* filePath, cert_svc_mem_buff* certBuf X509 *x = NULL; if ((in = fopen(filePath, "r")) == NULL) { - SLOGE("[ERR] Error opening file %s\n", filePath); + SECURE_SLOGE("[ERR] Error opening file %s\n", filePath); ret = CERT_SVC_ERR_FILE_IO; goto end; } @@ -206,7 +206,7 @@ int cert_svc_util_get_extension(const char* filePath, cert_svc_mem_buff* certBuf goto end; } - SLOGE("[ERR] Unknown file type: %s\n", filePath); + SECURE_SLOGE("[ERR] Unknown file type: %s\n", filePath); ret = CERT_SVC_ERR_FILE_IO; end: @@ -230,14 +230,14 @@ int cert_svc_util_load_file_to_buffer(const char* filePath, cert_svc_mem_buff* c /* get file size */ if((ret = cert_svc_util_get_file_size(filePath, &fileSize)) != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR][%s] Fail to get file size, [%s]\n", __func__, filePath); + SECURE_SLOGE("[ERR][%s] Fail to get file size, [%s]\n", __func__, filePath); goto err; } certBuf->size = fileSize; /* open file and write to buffer */ if(!(fp_in = fopen(filePath, "rb"))) { - SLOGE("[ERR][%s] Fail to open file, [%s]\n", __func__, filePath); + SECURE_SLOGE("[ERR][%s] Fail to open file, [%s]\n", __func__, filePath); ret = CERT_SVC_ERR_FILE_IO; goto err; } @@ -249,7 +249,7 @@ int cert_svc_util_load_file_to_buffer(const char* filePath, cert_svc_mem_buff* c } memset(content, 0x00, (fileSize + 1)); //ensuring that content[] will be NULL terminated if(fread(content, sizeof(unsigned char), fileSize, fp_in) != fileSize) { - SLOGE("[ERR][%s] Fail to read file, [%s]\n", __func__, filePath); + SECURE_SLOGE("[ERR][%s] Fail to read file, [%s]\n", __func__, filePath); ret = CERT_SVC_ERR_FILE_IO; goto err; } @@ -257,7 +257,7 @@ int cert_svc_util_load_file_to_buffer(const char* filePath, cert_svc_mem_buff* c /* find out certificate type */ memset(certBuf->type, 0x00, 4); if (cert_svc_util_get_extension(filePath, certBuf) != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR] cert_svc_util_get_extension failed to identify %s\n", filePath); + SECURE_SLOGE("[ERR] cert_svc_util_get_extension failed to identify %s\n", filePath); ret = CERT_SVC_ERR_FILE_IO; goto err; } @@ -265,13 +265,13 @@ int cert_svc_util_load_file_to_buffer(const char* filePath, cert_svc_mem_buff* c /* load file into buffer */ if(!strncmp(certBuf->type, "PEM", sizeof(certBuf->type))) { // PEM format if((ret = get_content_into_buf_PEM(content, certBuf)) != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR][%s] Fail to load file to buffer, [%s]\n", __func__, filePath); + SECURE_SLOGE("[ERR][%s] Fail to load file to buffer, [%s]\n", __func__, filePath); goto err; } } else if(!strncmp(certBuf->type, "DER", sizeof(certBuf->type))) { // DER format if((ret = get_content_into_buf_DER(content, certBuf)) != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR][%s] Fail to load file to buffer, [%s]\n", __func__, filePath); + SECURE_SLOGE("[ERR][%s] Fail to load file to buffer, [%s]\n", __func__, filePath); goto err; } } @@ -364,7 +364,7 @@ int cert_svc_util_load_PFX_file_to_buffer(const char* filePath, cert_svc_mem_buf /* open file and write to buffer */ if(!(fp_in = fopen(filePath, "rb"))) { - SLOGE("[ERR][%s] Fail to open file, [%s]\n", __func__, filePath); + SECURE_SLOGE("[ERR][%s] Fail to open file, [%s]\n", __func__, filePath); ret = CERT_SVC_ERR_FILE_IO; goto err; } diff --git a/srcs/cert-service.c b/srcs/cert-service.c index 2690b63..3e27d80 100644 --- a/srcs/cert-service.c +++ b/srcs/cert-service.c @@ -63,10 +63,10 @@ int cert_svc_add_certificate_to_store(const char* filePath, const char* location ret = _add_certificate_to_store(_filePath, location); if(ret != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR][%s] Fail to store certificate, [%s]\n", __func__, _filePath); + SECURE_SLOGE("[ERR][%s] Fail to store certificate, [%s]\n", __func__, _filePath); goto err; } - SLOGD("[%s] Success to add certificate [%s].\n", __func__, filePath); + SECURE_SLOGD("[%s] Success to add certificate [%s].\n", __func__, filePath); err: return ret; @@ -85,10 +85,10 @@ int cert_svc_delete_certificate_from_store(const char* fileName, const char* loc ret = _delete_certificate_from_store(fileName, location); if(ret != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR][%s] Fail to delete certificate, [%s]\n", __func__, fileName); + SECURE_SLOGE("[ERR][%s] Fail to delete certificate, [%s]\n", __func__, fileName); goto err; } - SLOGD("[%s] Success to delete certificate [%s].\n", __func__, fileName); + SECURE_SLOGD("[%s] Success to delete certificate [%s].\n", __func__, fileName); err: return ret; @@ -367,7 +367,7 @@ int cert_svc_load_file_to_context(CERT_CONTEXT* ctx, const char* filePath) /* get content to (*ctx)->certBuf */ if((ret = cert_svc_util_load_file_to_buffer(filePath, ctx->certBuf)) != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR][%s] Fail to load file, filepath: [%s], ret: [%d]\n", __func__, filePath, ret); + SECURE_SLOGE("[ERR][%s] Fail to load file, filepath: [%s], ret: [%d]\n", __func__, filePath, ret); ret = CERT_SVC_ERR_INVALID_OPERATION; goto err; } @@ -479,7 +479,7 @@ int cert_svc_push_file_into_context(CERT_CONTEXT *ctx, const char* filePath) /* get content to ctx->certBuf */ if((ret = cert_svc_util_load_file_to_buffer(filePath, new->certificate)) != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR][%s] Fail to load file, filepath: [%s], ret: [%d]\n", __func__, filePath, ret); + SECURE_SLOGE("[ERR][%s] Fail to load file, filepath: [%s], ret: [%d]\n", __func__, filePath, ret); release_cert_list(new); ret = CERT_SVC_ERR_INVALID_OPERATION; goto err; @@ -530,7 +530,7 @@ int cert_svc_load_PFX_file_to_context(CERT_CONTEXT* ctx, unsigned char** private /* get content to ctx->certBuf */ if((ret = cert_svc_util_load_PFX_file_to_buffer(filePath, ctx->certBuf, ctx->certLink, privateKey, priKeyLen, passPhrase)) != CERT_SVC_ERR_NO_ERROR) { - SLOGE("[ERR][%s] Fail to load file, filepath: [%s], ret: [%d]\n", __func__, filePath, ret); + SECURE_SLOGE("[ERR][%s] Fail to load file, filepath: [%s], ret: [%d]\n", __func__, filePath, ret); ret = CERT_SVC_ERR_INVALID_OPERATION; goto err; } diff --git a/srcs/dpkg-pki-sig.c b/srcs/dpkg-pki-sig.c index 1d3906f..3a46500 100644 --- a/srcs/dpkg-pki-sig.c +++ b/srcs/dpkg-pki-sig.c @@ -374,7 +374,7 @@ int package_sign(int argc, const char** argv) int ret = DPS_OPERATION_SUCCESS; int ch = 0, i = 0; int certwrite = 0; - unsigned long int privlen = 0; + unsigned long int privlen = 0; unsigned long int encodedlen = 0; unsigned long int certlen = 0; unsigned long int sigfilelen = 0; diff --git a/vcore/src/vcore/pkcs12.c b/vcore/src/vcore/pkcs12.c index ce0c2f7..ef95212 100755 --- a/vcore/src/vcore/pkcs12.c +++ b/vcore/src/vcore/pkcs12.c @@ -302,7 +302,7 @@ int c_certsvc_pkcs12_import(const char *path, const char *password, const gchar result = CERTSVC_SUCCESS; #if 1 - LOGD("( %s, %s)", path, password); + SECURE_LOGD("( %s, %s)", path, password); void* pSymAddr = NULL; void* pInitAddr = NULL; typedef int (*InsertPkcs12FuncPointer)(const char*, const char*); -- 2.7.4