summaryrefslogtreecommitdiff
path: root/indra/newview/llsecapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llsecapi.cpp')
-rw-r--r--indra/newview/llsecapi.cpp57
1 files changed, 45 insertions, 12 deletions
diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp
index ba343f5387..89b799f297 100644
--- a/indra/newview/llsecapi.cpp
+++ b/indra/newview/llsecapi.cpp
@@ -35,6 +35,7 @@
#include "llsecapi.h"
#include "llsechandler_basic.h"
#include <openssl/evp.h>
+#include <openssl/err.h>
#include <map>
#include "llhttpclient.h"
@@ -45,9 +46,9 @@ LLPointer<LLSecAPIHandler> gSecAPIHandler;
void initializeSecHandler()
{
+ ERR_load_crypto_strings();
OpenSSL_add_all_algorithms();
- OpenSSL_add_all_ciphers();
- OpenSSL_add_all_digests();
+
gHandlerMap[BASIC_SECHANDLER] = new LLSecAPIBasicHandler();
@@ -143,19 +144,51 @@ int secapiSSLCertVerifyCallback(X509_STORE_CTX *ctx, void *param)
LLSD LLCredential::getLoginParams()
{
LLSD result = LLSD::emptyMap();
- if (mIdentifier["type"].asString() == "agent")
+ try
{
- // legacy credential
- result["passwd"] = "$1$" + mAuthenticator["secret"].asString();
- result["first"] = mIdentifier["first_name"];
- result["last"] = mIdentifier["last_name"];
-
+ if (mIdentifier["type"].asString() == "agent")
+ {
+ // legacy credential
+ result["passwd"] = "$1$" + mAuthenticator["secret"].asString();
+ result["first"] = mIdentifier["first_name"];
+ result["last"] = mIdentifier["last_name"];
+
+ }
+ else if (mIdentifier["type"].asString() == "account")
+ {
+ result["username"] = mIdentifier["account_name"];
+ result["passwd"] = mAuthenticator["secret"];
+
+ }
}
- else if (mIdentifier["type"].asString() == "account")
+ catch (...)
{
- result["username"] = mIdentifier["account_name"];
- result["passwd"] = mAuthenticator["secret"];
-
+ // we could have corrupt data, so simply return a null login param if so
+ LL_WARNS("AppInit") << "Invalid credential" << LL_ENDL;
}
return result;
}
+
+void LLCredential::identifierType(std::string &idType)
+{
+ if(mIdentifier.has("type"))
+ {
+ idType = mIdentifier["type"].asString();
+ }
+ else {
+ idType = std::string();
+
+ }
+}
+
+void LLCredential::authenticatorType(std::string &idType)
+{
+ if(mAuthenticator.has("type"))
+ {
+ idType = mAuthenticator["type"].asString();
+ }
+ else {
+ idType = std::string();
+
+ }
+}