qsslsocket_shared_mac - fix a warning and compilation errors

SecTrustSettingsDomain is now (in the latest SDK) an enum, not a typedef
for integer type.

Change-Id: I1ad891190116cb27e10e38167fc15b4ee16a28f4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This commit is contained in:
Timur Pocheptsov 2015-11-25 14:55:29 +01:00
parent 299358dcc5
commit 5d94b679de

View File

@ -91,7 +91,7 @@ bool hasTrustedSslServerPolicy(SecPolicyRef policy, CFDictionaryRef props) {
bool isCaCertificateTrusted(SecCertificateRef cfCert, int domain)
{
QCFType<CFArrayRef> cfTrustSettings;
OSStatus status = SecTrustSettingsCopyTrustSettings(cfCert, domain, &cfTrustSettings);
OSStatus status = SecTrustSettingsCopyTrustSettings(cfCert, SecTrustSettingsDomain(domain), &cfTrustSettings);
if (status == noErr) {
CFIndex size = CFArrayGetCount(cfTrustSettings);
// if empty, trust for everything (as per the Security Framework documentation)
@ -125,8 +125,8 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
QCFType<CFArrayRef> cfCerts;
// iterate through all enum members, order:
// kSecTrustSettingsDomainUser, kSecTrustSettingsDomainAdmin, kSecTrustSettingsDomainSystem
for (int dom = kSecTrustSettingsDomainUser; dom <= kSecTrustSettingsDomainSystem; dom++) {
OSStatus status = SecTrustSettingsCopyCertificates(dom, &cfCerts);
for (int dom = kSecTrustSettingsDomainUser; dom <= int(kSecTrustSettingsDomainSystem); dom++) {
OSStatus status = SecTrustSettingsCopyCertificates(SecTrustSettingsDomain(dom), &cfCerts);
if (status == noErr) {
const CFIndex size = CFArrayGetCount(cfCerts);
for (CFIndex i = 0; i < size; ++i) {