__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;
}
}
free(pSubject);
+ free(pIssuerName);
return r;
}