From 39f241aad283d2f051ae7f093bbd650f16486df0 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Thu, 15 Jul 2010 11:29:55 -0700 Subject: Fix for SNOW-742 compile & link errors under certain gcc versions due to violation of One Definition Rule. reviewed by Moss. --- indra/newview/tests/llsecapi_test.cpp | 92 ++++++----------------------------- 1 file changed, 16 insertions(+), 76 deletions(-) (limited to 'indra/newview/tests/llsecapi_test.cpp') diff --git a/indra/newview/tests/llsecapi_test.cpp b/indra/newview/tests/llsecapi_test.cpp index caa1461987..8f2f299fc4 100644 --- a/indra/newview/tests/llsecapi_test.cpp +++ b/indra/newview/tests/llsecapi_test.cpp @@ -35,6 +35,7 @@ #include "../llviewernetwork.h" #include "../test/lltut.h" #include "../llsecapi.h" +#include "../llsechandler_basic.h" #include "../../llxml/llcontrol.h" @@ -56,82 +57,21 @@ std::string LLControlGroup::getString(const std::string& name) LLControlGroup gSavedSettings("test"); -class LLSecAPIBasicHandler : public LLSecAPIHandler -{ -protected: - LLPointer mCertChain; - LLPointer mCert; - LLPointer mCertStore; - LLSD mLLSD; - -public: - LLSecAPIBasicHandler() {} - - virtual ~LLSecAPIBasicHandler() {} - - // instantiate a certificate from a pem string - virtual LLPointer getCertificate(const std::string& pem_cert) - { - return mCert; - } - - - // instiate a certificate from an openssl X509 structure - virtual LLPointer getCertificate(X509* openssl_cert) - { - return mCert; - } - - - // instantiate a chain from an X509_STORE_CTX - virtual LLPointer getCertificateChain(const X509_STORE_CTX* chain) - { - return mCertChain; - } - - // instantiate a cert store given it's id. if a persisted version - // exists, it'll be loaded. If not, one will be created (but not - // persisted) - virtual LLPointer getCertificateStore(const std::string& store_id) - { - return mCertStore; - } - - // persist data in a protected store - virtual void setProtectedData(const std::string& data_type, - const std::string& data_id, - const LLSD& data) {} - - // retrieve protected data - virtual LLSD getProtectedData(const std::string& data_type, - const std::string& data_id) - { - return mLLSD; - } - - virtual void deleteProtectedData(const std::string& data_type, - const std::string& data_id) - { - } - - virtual LLPointer createCredential(const std::string& grid, - const LLSD& identifier, - const LLSD& authenticator) - { - LLPointer cred = NULL; - return cred; - } - - virtual LLPointer loadCredential(const std::string& grid) - { - LLPointer cred = NULL; - return cred; - } - - virtual void saveCredential(LLPointer cred, bool save_authenticator) {} - - virtual void deleteCredential(LLPointer cred) {} -}; + +LLSecAPIBasicHandler::LLSecAPIBasicHandler() {} +void LLSecAPIBasicHandler::init() {} +LLSecAPIBasicHandler::~LLSecAPIBasicHandler() {} +LLPointer LLSecAPIBasicHandler::getCertificate(const std::string& pem_cert) { return NULL; } +LLPointer LLSecAPIBasicHandler::getCertificate(X509* openssl_cert) { return NULL; } +LLPointer LLSecAPIBasicHandler::getCertificateChain(const X509_STORE_CTX* chain) { return NULL; } +LLPointer LLSecAPIBasicHandler::getCertificateStore(const std::string& store_id) { return NULL; } +void LLSecAPIBasicHandler::setProtectedData(const std::string& data_type, const std::string& data_id, const LLSD& data) {} +LLSD LLSecAPIBasicHandler::getProtectedData(const std::string& data_type, const std::string& data_id) { return LLSD(); } +void LLSecAPIBasicHandler::deleteProtectedData(const std::string& data_type, const std::string& data_id) {} +LLPointer LLSecAPIBasicHandler::createCredential(const std::string& grid, const LLSD& identifier, const LLSD& authenticator) { return NULL; } +LLPointer LLSecAPIBasicHandler::loadCredential(const std::string& grid) { return NULL; } +void LLSecAPIBasicHandler::saveCredential(LLPointer cred, bool save_authenticator) {} +void LLSecAPIBasicHandler::deleteCredential(LLPointer cred) {} // ------------------------------------------------------------------------------------------- // TUT -- cgit v1.2.3 From 06b0d72efa96b6a0ed665f7cd46f358c48929e7b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 13 Aug 2010 07:24:57 -0400 Subject: Change license from GPL to LGPL (version 2.1) --- indra/newview/tests/llsecapi_test.cpp | 36 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/newview/tests/llsecapi_test.cpp') diff --git a/indra/newview/tests/llsecapi_test.cpp b/indra/newview/tests/llsecapi_test.cpp index caa1461987..d5b6555b6e 100644 --- a/indra/newview/tests/llsecapi_test.cpp +++ b/indra/newview/tests/llsecapi_test.cpp @@ -4,31 +4,25 @@ * @date 2009-02-10 * @brief Test the sec api functionality * - * $LicenseInfo:firstyear=2009&license=viewergpl$ - * - * Copyright (c) 2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden LregisterSecAPIab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #include "../llviewerprecompiledheaders.h" -- cgit v1.2.3 From 98cc2365034a93c69704daa69efb389799cc9627 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 24 Aug 2010 18:44:39 +0100 Subject: Backed out changeset a62bf7c0af21 Backing out this merge that I pushed (prematurely) to the wrong place. --- indra/newview/tests/llsecapi_test.cpp | 92 +++++++++++++++++++++++++++++------ 1 file changed, 76 insertions(+), 16 deletions(-) (limited to 'indra/newview/tests/llsecapi_test.cpp') diff --git a/indra/newview/tests/llsecapi_test.cpp b/indra/newview/tests/llsecapi_test.cpp index 90cacfe3c9..d5b6555b6e 100644 --- a/indra/newview/tests/llsecapi_test.cpp +++ b/indra/newview/tests/llsecapi_test.cpp @@ -29,7 +29,6 @@ #include "../llviewernetwork.h" #include "../test/lltut.h" #include "../llsecapi.h" -#include "../llsechandler_basic.h" #include "../../llxml/llcontrol.h" @@ -51,21 +50,82 @@ std::string LLControlGroup::getString(const std::string& name) LLControlGroup gSavedSettings("test"); - -LLSecAPIBasicHandler::LLSecAPIBasicHandler() {} -void LLSecAPIBasicHandler::init() {} -LLSecAPIBasicHandler::~LLSecAPIBasicHandler() {} -LLPointer LLSecAPIBasicHandler::getCertificate(const std::string& pem_cert) { return NULL; } -LLPointer LLSecAPIBasicHandler::getCertificate(X509* openssl_cert) { return NULL; } -LLPointer LLSecAPIBasicHandler::getCertificateChain(const X509_STORE_CTX* chain) { return NULL; } -LLPointer LLSecAPIBasicHandler::getCertificateStore(const std::string& store_id) { return NULL; } -void LLSecAPIBasicHandler::setProtectedData(const std::string& data_type, const std::string& data_id, const LLSD& data) {} -LLSD LLSecAPIBasicHandler::getProtectedData(const std::string& data_type, const std::string& data_id) { return LLSD(); } -void LLSecAPIBasicHandler::deleteProtectedData(const std::string& data_type, const std::string& data_id) {} -LLPointer LLSecAPIBasicHandler::createCredential(const std::string& grid, const LLSD& identifier, const LLSD& authenticator) { return NULL; } -LLPointer LLSecAPIBasicHandler::loadCredential(const std::string& grid) { return NULL; } -void LLSecAPIBasicHandler::saveCredential(LLPointer cred, bool save_authenticator) {} -void LLSecAPIBasicHandler::deleteCredential(LLPointer cred) {} +class LLSecAPIBasicHandler : public LLSecAPIHandler +{ +protected: + LLPointer mCertChain; + LLPointer mCert; + LLPointer mCertStore; + LLSD mLLSD; + +public: + LLSecAPIBasicHandler() {} + + virtual ~LLSecAPIBasicHandler() {} + + // instantiate a certificate from a pem string + virtual LLPointer getCertificate(const std::string& pem_cert) + { + return mCert; + } + + + // instiate a certificate from an openssl X509 structure + virtual LLPointer getCertificate(X509* openssl_cert) + { + return mCert; + } + + + // instantiate a chain from an X509_STORE_CTX + virtual LLPointer getCertificateChain(const X509_STORE_CTX* chain) + { + return mCertChain; + } + + // instantiate a cert store given it's id. if a persisted version + // exists, it'll be loaded. If not, one will be created (but not + // persisted) + virtual LLPointer getCertificateStore(const std::string& store_id) + { + return mCertStore; + } + + // persist data in a protected store + virtual void setProtectedData(const std::string& data_type, + const std::string& data_id, + const LLSD& data) {} + + // retrieve protected data + virtual LLSD getProtectedData(const std::string& data_type, + const std::string& data_id) + { + return mLLSD; + } + + virtual void deleteProtectedData(const std::string& data_type, + const std::string& data_id) + { + } + + virtual LLPointer createCredential(const std::string& grid, + const LLSD& identifier, + const LLSD& authenticator) + { + LLPointer cred = NULL; + return cred; + } + + virtual LLPointer loadCredential(const std::string& grid) + { + LLPointer cred = NULL; + return cred; + } + + virtual void saveCredential(LLPointer cred, bool save_authenticator) {} + + virtual void deleteCredential(LLPointer cred) {} +}; // ------------------------------------------------------------------------------------------- // TUT -- cgit v1.2.3 From 88edd15674ca62bcb26bd28c38bfba25ef72e90c Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Thu, 15 Jul 2010 11:29:55 -0700 Subject: Fix for SNOW-742 compile & link errors under certain gcc versions due to violation of One Definition Rule. reviewed by Moss. --- indra/newview/tests/llsecapi_test.cpp | 92 ++++++----------------------------- 1 file changed, 16 insertions(+), 76 deletions(-) (limited to 'indra/newview/tests/llsecapi_test.cpp') diff --git a/indra/newview/tests/llsecapi_test.cpp b/indra/newview/tests/llsecapi_test.cpp index caa1461987..8f2f299fc4 100644 --- a/indra/newview/tests/llsecapi_test.cpp +++ b/indra/newview/tests/llsecapi_test.cpp @@ -35,6 +35,7 @@ #include "../llviewernetwork.h" #include "../test/lltut.h" #include "../llsecapi.h" +#include "../llsechandler_basic.h" #include "../../llxml/llcontrol.h" @@ -56,82 +57,21 @@ std::string LLControlGroup::getString(const std::string& name) LLControlGroup gSavedSettings("test"); -class LLSecAPIBasicHandler : public LLSecAPIHandler -{ -protected: - LLPointer mCertChain; - LLPointer mCert; - LLPointer mCertStore; - LLSD mLLSD; - -public: - LLSecAPIBasicHandler() {} - - virtual ~LLSecAPIBasicHandler() {} - - // instantiate a certificate from a pem string - virtual LLPointer getCertificate(const std::string& pem_cert) - { - return mCert; - } - - - // instiate a certificate from an openssl X509 structure - virtual LLPointer getCertificate(X509* openssl_cert) - { - return mCert; - } - - - // instantiate a chain from an X509_STORE_CTX - virtual LLPointer getCertificateChain(const X509_STORE_CTX* chain) - { - return mCertChain; - } - - // instantiate a cert store given it's id. if a persisted version - // exists, it'll be loaded. If not, one will be created (but not - // persisted) - virtual LLPointer getCertificateStore(const std::string& store_id) - { - return mCertStore; - } - - // persist data in a protected store - virtual void setProtectedData(const std::string& data_type, - const std::string& data_id, - const LLSD& data) {} - - // retrieve protected data - virtual LLSD getProtectedData(const std::string& data_type, - const std::string& data_id) - { - return mLLSD; - } - - virtual void deleteProtectedData(const std::string& data_type, - const std::string& data_id) - { - } - - virtual LLPointer createCredential(const std::string& grid, - const LLSD& identifier, - const LLSD& authenticator) - { - LLPointer cred = NULL; - return cred; - } - - virtual LLPointer loadCredential(const std::string& grid) - { - LLPointer cred = NULL; - return cred; - } - - virtual void saveCredential(LLPointer cred, bool save_authenticator) {} - - virtual void deleteCredential(LLPointer cred) {} -}; + +LLSecAPIBasicHandler::LLSecAPIBasicHandler() {} +void LLSecAPIBasicHandler::init() {} +LLSecAPIBasicHandler::~LLSecAPIBasicHandler() {} +LLPointer LLSecAPIBasicHandler::getCertificate(const std::string& pem_cert) { return NULL; } +LLPointer LLSecAPIBasicHandler::getCertificate(X509* openssl_cert) { return NULL; } +LLPointer LLSecAPIBasicHandler::getCertificateChain(const X509_STORE_CTX* chain) { return NULL; } +LLPointer LLSecAPIBasicHandler::getCertificateStore(const std::string& store_id) { return NULL; } +void LLSecAPIBasicHandler::setProtectedData(const std::string& data_type, const std::string& data_id, const LLSD& data) {} +LLSD LLSecAPIBasicHandler::getProtectedData(const std::string& data_type, const std::string& data_id) { return LLSD(); } +void LLSecAPIBasicHandler::deleteProtectedData(const std::string& data_type, const std::string& data_id) {} +LLPointer LLSecAPIBasicHandler::createCredential(const std::string& grid, const LLSD& identifier, const LLSD& authenticator) { return NULL; } +LLPointer LLSecAPIBasicHandler::loadCredential(const std::string& grid) { return NULL; } +void LLSecAPIBasicHandler::saveCredential(LLPointer cred, bool save_authenticator) {} +void LLSecAPIBasicHandler::deleteCredential(LLPointer cred) {} // ------------------------------------------------------------------------------------------- // TUT -- cgit v1.2.3