diff --git a/frameworks/adapter/v1.0/src/certificate_openssl_common.c b/frameworks/adapter/v1.0/src/certificate_openssl_common.c index 77e687c..75135e6 100644 --- a/frameworks/adapter/v1.0/src/certificate_openssl_common.c +++ b/frameworks/adapter/v1.0/src/certificate_openssl_common.c @@ -356,7 +356,7 @@ bool CheckIsSelfSigned(const X509 *cert) } ret = (X509_NAME_cmp(issuer, subject) == 0); - LOGI("CheckIsSelfSigned() ret: %d .", ret); + LOGI("The ret of whether the cert is self signed is %d.", ret); return ret; } diff --git a/frameworks/adapter/v1.0/src/x509_cert_chain_openssl.c b/frameworks/adapter/v1.0/src/x509_cert_chain_openssl.c index a010c20..9fbe5a4 100644 --- a/frameworks/adapter/v1.0/src/x509_cert_chain_openssl.c +++ b/frameworks/adapter/v1.0/src/x509_cert_chain_openssl.c @@ -322,7 +322,6 @@ static EVP_PKEY *ConvertByteArrayToPubKey(const uint8_t *pubKeyBytes, size_t len LOGE("ConvertByteArrayToPubkey invalid params."); return NULL; } - LOGI("pubkeyBytes len: %d .", len); EVP_PKEY *pubKey = d2i_PUBKEY(NULL, &pubKeyBytes, len); // pubkey DER format. if (pubKey == NULL) { LOGE("d2i_PUBKEY() failed!"); @@ -1097,7 +1096,7 @@ static BIO *CreateConnectBio(char *host, char *port, int ssl) } bio = BIO_new_ssl_connect(sslCtx); if (BIO_set_conn_hostname(bio, host) != 1) { - LOGE("Set host name %s failed.", host); + LOGE("Set host name failed."); return NULL; } } else { @@ -1111,17 +1110,17 @@ static BIO *CreateConnectBio(char *host, char *port, int ssl) if (port != NULL) { if (BIO_set_conn_port(bio, port) != 1) { - LOGE("Set port %s failed.", port); + LOGE("Set port failed."); return NULL; } } else if (ssl) { if (BIO_set_conn_port(bio, HTTPS_PORT) != 1) { - LOGE("Set port %s failed.", HTTPS_PORT); + LOGE("Set port failed."); return NULL; } } else { if (BIO_set_conn_port(bio, HTTP_PORT) != 1) { - LOGE("Set port %s failed.", HTTP_PORT); + LOGE("Set port failed."); return NULL; } } diff --git a/frameworks/adapter/v1.0/src/x509_crl_openssl.c b/frameworks/adapter/v1.0/src/x509_crl_openssl.c index bd463e3..b6c9602 100644 --- a/frameworks/adapter/v1.0/src/x509_crl_openssl.c +++ b/frameworks/adapter/v1.0/src/x509_crl_openssl.c @@ -864,8 +864,9 @@ static CfResult Comparex509CertX509Openssl(HcfX509CrlSpi *self, const HcfCertifi bool bRet = IsRevoked(self, x509Cert); if (!bRet) { *out = false; + LOGI("Crl revoked is false!"); } - LOGI("x509Crl match x509Cert %d!", *out); + LOGI("x509Crl match x509Cert!"); return CF_SUCCESS; } diff --git a/frameworks/adapter/v1.0/src/x509_distinguished_name_openssl.c b/frameworks/adapter/v1.0/src/x509_distinguished_name_openssl.c index 703a483..cf3fa09 100644 --- a/frameworks/adapter/v1.0/src/x509_distinguished_name_openssl.c +++ b/frameworks/adapter/v1.0/src/x509_distinguished_name_openssl.c @@ -114,7 +114,6 @@ static CfResult GetDataByEntryOpenssl(int32_t count, CfArray *outArr, X509_NAME_ CfArrayDataClearAndFree(outArr); return CF_ERR_CRYPTO_OPERATION; } - LOGI("i2d_ASN1_OBJECT %s, %d", (const char *)p, len); CfResult res = DeepCopyDataToOut((const char *)p, len, &(outArr->data[i])); if (res != CF_SUCCESS) { LOGE("DeepCopyDataToOut error"); @@ -242,7 +241,7 @@ static CfResult CollectAndParseName(const char *cp, char *work, int chtype, X509 const char *t = cp; t++; if (*cp == '\\' && *t == '\0') { - LOGE("Escape character at end of name string\n"); + LOGE("Escape character at end of name string"); return CF_INVALID_PARAMS; } if (*cp == '\\') { @@ -272,17 +271,17 @@ static X509_NAME *ParseName(const char *cp, int chtype, const char *desc) X509_NAME *name = X509_NAME_new(); if (name == NULL) { - LOGE("Out of memory\n"); + LOGE("Out of memory"); return NULL; } char *work = OPENSSL_strdup(cp); if (work == NULL) { - LOGE("Error copying name input\n"); + LOGE("Error copying name input"); goto err; } if (CollectAndParseName(cp, work, chtype, name) != CF_SUCCESS) { - LOGE("Error CollectAndParseName\n"); + LOGE("Error CollectAndParseName"); goto err; } diff --git a/frameworks/js/napi/certificate/inc/napi_cert_defines.h b/frameworks/js/napi/certificate/inc/napi_cert_defines.h index a205ef7..2c58875 100644 --- a/frameworks/js/napi/certificate/inc/napi_cert_defines.h +++ b/frameworks/js/napi/certificate/inc/napi_cert_defines.h @@ -44,7 +44,6 @@ const std::string CERT_TAG_CERT_MATCH_PARAMS = "certMatchParameters"; const std::string CERT_TAG_MAX_LENGTH = "maxLength"; const std::string CERT_TAG_VALIDATE_PARAMS = "validationParameters"; const std::string CERT_TAG_KEYSTORE = "keystore"; -const std::string CERT_TAG_PWD = "pwd"; enum ResultCode { JS_SUCCESS = 0, diff --git a/frameworks/js/napi/certificate/src/napi_x509_cert_chain.cpp b/frameworks/js/napi/certificate/src/napi_x509_cert_chain.cpp index 28d1840..532542d 100644 --- a/frameworks/js/napi/certificate/src/napi_x509_cert_chain.cpp +++ b/frameworks/js/napi/certificate/src/napi_x509_cert_chain.cpp @@ -503,7 +503,7 @@ static void CreateTrustAnchorsWithKeyStoreExecute(napi_env env, void *data) context->async->errCode = HcfCreateTrustAnchorWithKeyStore(context->keyStore, context->pwd, &context->trustAnchorArray); if (context->async->errCode != CF_SUCCESS) { - context->async->errMsg = "KeyStore and Password mismatch!"; + context->async->errMsg = "Failed to create trust anchor from p12!"; } }