Prevent attach execution with empty key filename.
authorcantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Thu, 7 Jun 2007 00:09:53 +0000 (00:09 +0000)
committercantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Thu, 7 Jun 2007 00:09:53 +0000 (00:09 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@339 de75baf8-a10c-0410-a50a-987c0e22f00f

xmltooling/security/impl/FilesystemCredentialResolver.cpp

index efc7436..b7cff3f 100644 (file)
@@ -549,7 +549,10 @@ void FilesystemCredentialResolver::attach(SSL_CTX* ctx) const
 #ifdef _DEBUG
     NDC ndc("attach");
 #endif
-    
+
+    if (m_keypath.empty())
+        throw XMLSecurityException("No key available, unable to attach private key to SSL context.");
+
     // Attach key.
     SSL_CTX_set_default_passwd_cb(ctx, passwd_callback);
     SSL_CTX_set_default_passwd_cb_userdata(ctx, const_cast<char*>(m_keypass.c_str()));