From: Bhanu Singh Rao Date: Wed, 22 May 2013 17:48:55 +0000 (+0530) Subject: Fix self-signed p12 certificate installation issue. X-Git-Tag: submit/tizen_2.2/20130714.152805~176^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06a0273bbfa2f4adef705b44202b09eb5e3b73f8;p=framework%2Fosp%2Fappfw.git Fix self-signed p12 certificate installation issue. Change-Id: I27b455b81c5255fda627d107335501e33c99f3e7 Signed-off-by: Bhanu Singh Rao --- diff --git a/src/security/cert/FSecCert_CertList.cpp b/src/security/cert/FSecCert_CertList.cpp index 5f40195..47d8ca1 100644 --- a/src/security/cert/FSecCert_CertList.cpp +++ b/src/security/cert/FSecCert_CertList.cpp @@ -317,6 +317,7 @@ _CertList::ParseIssuerName() __tbsCertList.SetIssuerName(pName); + free(pName); return E_SUCCESS; } diff --git a/src/security/cert/FSecCert_Certificate.cpp b/src/security/cert/FSecCert_Certificate.cpp index b4ad103..131d520 100644 --- a/src/security/cert/FSecCert_Certificate.cpp +++ b/src/security/cert/FSecCert_Certificate.cpp @@ -803,7 +803,12 @@ _X509Certificate::ParseSubjectName(void) __tbsCert.SetSubjectName(pSubject); - if (X509_check_issued(pX509Certificate, pX509Certificate) == X509_V_OK) + byte* pIssuerName = null; + + pIssuerName = reinterpret_cast< byte* >(X509_NAME_oneline(pX509Certificate->cert_info->issuer, null, 0)); + SysTryReturnResult(NID_SEC_CERT, pIssuerName != null, E_PARSING_FAILED, "Failed to get certificate issuer name."); + + if (strcmp(reinterpret_cast< const char* >(pSubject), reinterpret_cast< const char* >(pIssuerName)) == 0) { __x509IsSelfSign = true; } @@ -813,6 +818,7 @@ _X509Certificate::ParseSubjectName(void) } free(pSubject); + free(pIssuerName); return r; }