From fd3628ef45a8160f2434e0d8b747d31d65685340 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 14 Apr 2017 16:05:59 -0400 Subject: Change certificate store infrastructure to key off of the Subject Key Id rather than sha1 hash, since that is rarely used in modern certs. The previous form was storing trusted certs using an empty sha1 hash value as the key, which meant most certificates matched... not good. Modify the LLCertException to pass certificate information back as LLSD rather than an LLPointer, because when the exception is being thown from the certificate constructor that results in one of a couple of other exceptions (even refcounting won't save you when the problem is that the thing you're pointing to never finished coming into being properly). Update the certificates in the llsechandler_basic_test to modern conventions, and extend the classes to allow for an optional validation date so that the test can use a fixed date. Also make all the certificates include the plain text form for ease of reference. --- indra/newview/llxmlrpctransaction.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'indra/newview/llxmlrpctransaction.cpp') diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index f8b38669b6..dcde89d02f 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -206,7 +206,7 @@ public: std::string mResponseText; XMLRPC_REQUEST mResponse; std::string mCertStore; - LLPointer mErrorCert; + LLSD mErrorCertData; Impl(const std::string& uri, XMLRPC_REQUEST request, bool useGzip); Impl(const std::string& uri, @@ -247,14 +247,8 @@ void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle, // (a non cert error), then generate the error message as // appropriate mImpl->setHttpStatus(status); - LLCertificate *errordata = static_cast(status.getErrorData()); - - if (errordata) - { - mImpl->mErrorCert = LLPointer(errordata); - status.setErrorData(NULL); - errordata->unref(); - } + LLSD errordata = status.getErrorData(); + mImpl->mErrorCertData = errordata; LL_WARNS() << "LLXMLRPCTransaction error " << status.toHex() << ": " << status.toString() << LL_ENDL; @@ -565,9 +559,9 @@ std::string LLXMLRPCTransaction::statusMessage() return impl.mStatusMessage; } -LLPointer LLXMLRPCTransaction::getErrorCert() +LLSD LLXMLRPCTransaction::getErrorCertData() { - return impl.mErrorCert; + return impl.mErrorCertData; } std::string LLXMLRPCTransaction::statusURI() -- cgit v1.2.3