summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/Util.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceSSL/Util.h')
-rw-r--r--cpp/src/IceSSL/Util.h76
1 files changed, 38 insertions, 38 deletions
diff --git a/cpp/src/IceSSL/Util.h b/cpp/src/IceSSL/Util.h
index 5b8784e29e5..6204dedbb4d 100644
--- a/cpp/src/IceSSL/Util.h
+++ b/cpp/src/IceSSL/Util.h
@@ -10,27 +10,41 @@
#ifndef ICE_SSL_UTIL_H
#define ICE_SSL_UTIL_H
-#include <IceSSL/Config.h>
-#include <IceSSL/UtilF.h>
-#include <Ice/Network.h>
#include <IceUtil/Mutex.h>
#include <IceUtil/Shared.h>
-#include <IceUtil/ScopedArray.h>
+#include <IceUtil/Handle.h>
#include <IceSSL/Plugin.h>
-#include <list>
-
-#ifdef ICE_USE_OPENSSL
+#if defined(ICE_USE_OPENSSL)
# include <openssl/ssl.h>
-#else
+# include <list>
+#elif defined(ICE_USE_SECURE_TRANSPORT)
# include <Security/Security.h>
# include <CoreFoundation/CoreFoundation.h>
+#elif defined(ICE_USE_SCHANNEL)
+# include <wincrypt.h>
#endif
-#ifdef ICE_USE_OPENSSL
namespace IceSSL
{
+
+//
+// Constants for X509 certificate alt names (AltNameOther, AltNameORAddress, AltNameEDIPartyName and
+// AltNameObjectIdentifier) are not supported.
+//
+
+//const int AltNameOther = 0;
+const int AltNameEmail = 1;
+const int AltNameDNS = 2;
+//const int AltNameORAddress = 3;
+const int AltNameDirectory = 4;
+//const int AltNameEDIPartyName = 5;
+const int AltNameURL = 6;
+const int AltNAmeIP = 7;
+//const AltNameObjectIdentifier = 8;
+
+#ifdef ICE_USE_OPENSSL
# ifndef OPENSSL_NO_DH
class DHParams : public IceUtil::Shared, public IceUtil::Mutex
@@ -54,6 +68,7 @@ private:
DH* _dh2048;
DH* _dh4096;
};
+typedef IceUtil::Handle<DHParams> DHParamsPtr;
# endif
//
@@ -61,12 +76,8 @@ private:
//
std::string getSslErrors(bool);
-}
#elif defined(ICE_USE_SECURE_TRANSPORT)
-namespace IceSSL
-{
-
//
// Helper functions to use by Secure Transport.
//
@@ -80,51 +91,40 @@ toCFString(const std::string& s)
}
std::string errorToString(CFErrorRef);
-
std::string errorToString(OSStatus);
//
-// Read a while file into memory buffer and return the number of bytes read.
-//
-int readFile(const std::string&, IceUtil::ScopedArray<char>&);
-
-
-//
// Retrieve a certificate property
//
-CFDictionaryRef
-getCertificateProperty(SecCertificateRef, CFTypeRef);
-
+CFDictionaryRef getCertificateProperty(SecCertificateRef, CFTypeRef);
std::string keyLabel(SecCertificateRef);
//
// Read a private key from an file and optionaly import into a keychain.
//
-void loadPrivateKey(SecKeyRef*, const std::string&, CFDataRef, SecKeychainRef,
- const std::string&, const std::string&, const PasswordPromptPtr&,
- int);
+void loadPrivateKey(SecKeyRef*, const std::string&, CFDataRef, SecKeychainRef, const std::string&, const std::string&,
+ const PasswordPromptPtr&, int);
//
-// Read a certificate and key from an file and optionaly import then into a
-// keychain.
+// Read a certificate and key from an file and optionaly import then
+// into a keychain.
//
-void loadCertificate(SecCertificateRef*, CFDataRef*, SecKeyRef*, SecKeychainRef,
- const std::string&, const std::string& = "",
- const PasswordPromptPtr& = 0, int = 0);
+void loadCertificate(SecCertificateRef*, CFDataRef*, SecKeyRef*, SecKeychainRef, const std::string&,
+ const std::string& = "", const PasswordPromptPtr& = 0, int = 0);
-CFArrayRef loadCACertificates(const std::string&, const std::string& = "", const PasswordPromptPtr& = 0,
- int = 0);
-
-}
+CFArrayRef loadCACertificates(const std::string&, const std::string& = "", const PasswordPromptPtr& = 0, int = 0);
#endif
-namespace IceSSL
-{
+//
+// Read a file into memory buffer.
+//
+void readFile(const std::string&, std::vector<char>&);
//
-// Determine if a file or directory exists, with an optional default directory.
+// Determine if a file or directory exists, with an optional default
+// directory.
//
bool checkPath(std::string&, const std::string&, bool);