diff options
author | Jose <jose@zeroc.com> | 2019-05-03 14:26:26 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-05-03 14:26:26 +0200 |
commit | 2b53106e6f81bd9129067def75a55538f44347a5 (patch) | |
tree | bc4c58e3a8077e44ce8b17c83869f16e12f36a6b /cpp/src/IceSSL/SecureTransportUtil.cpp | |
parent | Filter UDP and Properties test with iOS (diff) | |
download | ice-2b53106e6f81bd9129067def75a55538f44347a5.tar.bz2 ice-2b53106e6f81bd9129067def75a55538f44347a5.tar.xz ice-2b53106e6f81bd9129067def75a55538f44347a5.zip |
Fix C++ warnings
Diffstat (limited to 'cpp/src/IceSSL/SecureTransportUtil.cpp')
-rw-r--r-- | cpp/src/IceSSL/SecureTransportUtil.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cpp/src/IceSSL/SecureTransportUtil.cpp b/cpp/src/IceSSL/SecureTransportUtil.cpp index a3ae427d516..5d20a56ee05 100644 --- a/cpp/src/IceSSL/SecureTransportUtil.cpp +++ b/cpp/src/IceSSL/SecureTransportUtil.cpp @@ -112,7 +112,7 @@ isCA(SecCertificateRef cert) if(property) { CFArrayRef propertyValues = static_cast<CFArrayRef>(CFDictionaryGetValue(property.get(), kSecPropertyKeyValue)); - for(int i = 0, size = CFArrayGetCount(propertyValues); i < size; ++i) + for(CFIndex i = 0, size = CFArrayGetCount(propertyValues); i < size; ++i) { CFDictionaryRef dict = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(propertyValues, i)); CFStringRef label = static_cast<CFStringRef>(CFDictionaryGetValue(dict, kSecPropertyKeyLabel)); @@ -243,7 +243,7 @@ openKeychain(const std::string& path, const std::string& keychainPassword) if(err == noErr) { const char* pass = keychainPassword.empty() ? 0 : keychainPassword.c_str(); - if((err = SecKeychainUnlock(keychain.get(), keychainPassword.size(), pass, pass != 0))) + if((err = SecKeychainUnlock(keychain.get(), static_cast<int>(keychainPassword.size()), pass, pass != 0))) { throw PluginInitializationException(__FILE__, __LINE__, "IceSSL: unable to unlock keychain:\n" + sslErrorToString(err)); @@ -253,7 +253,7 @@ openKeychain(const std::string& path, const std::string& keychainPassword) { const char* pass = keychainPassword.empty() ? 0 : keychainPassword.c_str(); keychain.reset(0); - if((err = SecKeychainCreate(keychainPath.c_str(), keychainPassword.size(), pass, pass == 0, 0, &keychain.get()))) + if((err = SecKeychainCreate(keychainPath.c_str(), static_cast<int>(keychainPassword.size()), pass, pass == 0, 0, &keychain.get()))) { throw PluginInitializationException(__FILE__, __LINE__, "IceSSL: unable to create keychain:\n" + sslErrorToString(err)); @@ -354,9 +354,9 @@ loadPrivateKey(const string& file, SecCertificateRef cert, SecKeychainRef keycha // private key into the keychain and add the certificate. // UniqueRef<CFArrayRef> items(loadKeychainItems(file, kSecItemTypePrivateKey, keychain, password, prompt, retryMax)); - int count = CFArrayGetCount(items.get()); + CFIndex count = CFArrayGetCount(items.get()); UniqueRef<SecKeyRef> key; - for(int i = 0; i < count; ++i) + for(CFIndex i = 0; i < count; ++i) { SecKeychainItemRef itemRef = static_cast<SecKeychainItemRef>(const_cast<void*>(CFArrayGetValueAtIndex(items.get(), 0))); @@ -405,7 +405,7 @@ loadPrivateKey(const string& file, SecCertificateRef cert, SecKeychainRef keycha SecKeychainAttribute attr; attr.tag = kSecKeyLabel; attr.data = const_cast<UInt8*>(CFDataGetBytePtr(hash.get())); - attr.length = CFDataGetLength(hash.get()); + attr.length = static_cast<int>(CFDataGetLength(hash.get())); attributes.push_back(attr); } @@ -421,13 +421,13 @@ loadPrivateKey(const string& file, SecCertificateRef cert, SecKeychainRef keycha SecKeychainAttribute attr; attr.tag = kSecKeyPrintName; attr.data = const_cast<char*>(label.c_str()); - attr.length = label.size(); + attr.length = static_cast<int>(label.size()); attributes.push_back(attr); } SecKeychainAttributeList attrs; attrs.attr = &attributes[0]; - attrs.count = attributes.size(); + attrs.count = static_cast<int>(attributes.size()); SecKeychainItemModifyAttributesAndData(reinterpret_cast<SecKeychainItemRef>(key.get()), &attrs, 0, 0); UniqueRef<SecIdentityRef> identity; @@ -637,7 +637,7 @@ IceSSL::SecureTransport::loadCACertificates(const string& file) #else UniqueRef<CFArrayRef> items(loadKeychainItems(file, kSecItemTypeCertificate, 0, "", 0, 0)); UniqueRef<CFArrayRef> certificateAuthorities(CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks)); - int count = CFArrayGetCount(items.get()); + CFIndex count = CFArrayGetCount(items.get()); for(CFIndex i = 0; i < count; ++i) { SecCertificateRef cert = @@ -800,7 +800,7 @@ IceSSL::SecureTransport::findCertificateChain(const std::string& keychainPath, "IceSSL: error evaluating trust:\n" + sslErrorToString(err)); } - int chainLength = SecTrustGetCertificateCount(trust.get()); + CFIndex chainLength = SecTrustGetCertificateCount(trust.get()); UniqueRef<CFArrayRef> items(CFArrayCreateMutable(kCFAllocatorDefault, chainLength, &kCFTypeArrayCallBacks)); for(int i = 0; i < chainLength; ++i) { |