summaryrefslogtreecommitdiff
path: root/indra/test/llblowfish_tut.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/test/llblowfish_tut.cpp')
-rw-r--r--indra/test/llblowfish_tut.cpp53
1 files changed, 18 insertions, 35 deletions
diff --git a/indra/test/llblowfish_tut.cpp b/indra/test/llblowfish_tut.cpp
index 3081ac3855..2573cab81f 100644
--- a/indra/test/llblowfish_tut.cpp
+++ b/indra/test/llblowfish_tut.cpp
@@ -7,30 +7,25 @@
* openssl enc -bf-cbc -in blowfish.digits.txt -out blowfish.1.bin -K 00000000000000000000000000000000 -iv 0000000000000000 -p
* openssl enc -bf-cbc -in blowfish.digits.txt -out blowfish.2.bin -K 526a1e07a19dbaed84c4ff08a488d15e -iv 0000000000000000 -p
*
- * $LicenseInfo:firstyear=2007&license=viewergpl$
- *
- * Copyright (c) 2007, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * 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://secondlife.com/developers/opensource/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://secondlife.com/developers/opensource/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$
*/
@@ -57,8 +52,8 @@ namespace tut
mInputSize = 36;
}
- bool matchFile(const char* filename,
- const std::string& data)
+ bool matchFile(const std::string& filename,
+ const std::string& data)
{
LLFILE* fp = LLFile::fopen(filename, "rb");
if (!fp)
@@ -66,7 +61,7 @@ namespace tut
// sometimes test is run inside the indra directory
std::string path = "test/";
path += filename;
- fp = LLFile::fopen(path.c_str(), "rb");
+ fp = LLFile::fopen(path, "rb");
}
if (!fp)
{
@@ -93,9 +88,6 @@ namespace tut
template<> template<>
void blowfish_object::test<1>()
{
-#if !LL_LINUX
- skip_fail("Blowfish only supported on Linux.");
-#else
LLUUID blank;
LLBlowfishCipher cipher(&blank.mData[0], UUID_BYTES);
@@ -108,15 +100,11 @@ namespace tut
dst_len = cipher.requiredEncryptionSpace(8);
ensure("encryption space 8",
(dst_len == 16) );
-#endif // !LL_LINUX
}
template<> template<>
void blowfish_object::test<2>()
{
-#if !LL_LINUX
- skip_fail("Blowfish only supported on Linux.");
-#else
LLUUID blank;
LLBlowfishCipher cipher(&blank.mData[0], UUID_BYTES);
@@ -130,15 +118,11 @@ namespace tut
result.resize(count);
ensure("encrypt null key", matchFile("blowfish.1.bin", result));
-#endif // !LL_LINUX
}
template<> template<>
void blowfish_object::test<3>()
{
-#if !LL_LINUX
- skip_fail("Blowfish only supported on Linux.");
-#else
// same as base64 test id
LLUUID id("526a1e07-a19d-baed-84c4-ff08a488d15e");
LLBlowfishCipher cipher(&id.mData[0], UUID_BYTES);
@@ -153,6 +137,5 @@ namespace tut
result.resize(count);
ensure("encrypt real key", matchFile("blowfish.2.bin", result));
-#endif // !LL_LINUX
}
}