Fix self-signed p12 certificate installation issue.
authorBhanu Singh Rao <bhanu.singh@samsung.com>
Wed, 22 May 2013 17:48:55 +0000 (23:18 +0530)
committerBhanu Singh Rao <bhanu.singh@samsung.com>
Wed, 22 May 2013 17:48:55 +0000 (23:18 +0530)
Change-Id: I27b455b81c5255fda627d107335501e33c99f3e7
Signed-off-by: Bhanu Singh Rao <bhanu.singh@samsung.com>
src/security/cert/FSecCert_CertList.cpp
src/security/cert/FSecCert_Certificate.cpp

index 5f40195..47d8ca1 100644 (file)
@@ -317,6 +317,7 @@ _CertList::ParseIssuerName()
 
        __tbsCertList.SetIssuerName(pName);
 
+       free(pName);
        return E_SUCCESS;
 }
 
index b4ad103..131d520 100644 (file)
@@ -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;
 }