Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alchemy/viewer
  • Miezhiko/alchemy-next
  • JennaHuntsman/xdg-integration
  • logue/alchemy-next
  • FelixWolf/alchemy-viewer
  • XenHat/xdg-integration
6 results
Show changes
Commits on Source (12)
Showing
with 178 additions and 305 deletions
......@@ -231,6 +231,70 @@
<key>version</key>
<string>1.78.0</string>
</map>
<key>c-ares</key>
<map>
<key>canonical_repo</key>
<string>https://git.alchemyviewer.org/alchemy/thirdparty/3p-c-ares</string>
<key>copyright</key>
<string>Copyright (c) 1996 - 2018, Daniel Stenberg, (daniel@haxx.se), and many contributors</string>
<key>description</key>
<string>Library for transferring data specified with URL syntax</string>
<key>license</key>
<string>curl</string>
<key>license_file</key>
<string>LICENSES/c-ares.txt</string>
<key>name</key>
<string>c-ares</string>
<key>platforms</key>
<map>
<key>darwin64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>14d2d1664450fca1fe667d88802bbf581498f80e221bc8faf24a3e407459b21be5a25f22c8b32039f2e3494663b1246b7f9c9a51b2d323791b9d59ba4dabba8e</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/177/packages/generic/c-ares/1.18.1.1381/c_ares-1.18.1-darwin64-1381.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>af10b515ba01ee4f3f816605aaca405b31897a43a32f24385261cfe446671fc222c4c8db7135800307d31b54a91f3ef883f214aa93d12f9bf78dd590714354dd</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/177/packages/generic/c-ares/1.18.1.1381/c_ares-1.18.1-linux64-1381.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>091d861970c73dafb08a35a806545f5d83e1b0ab41f699cd314c4b5f5283a2c886617ca6989deef7c51d7f1f9762966984e2a59ad34b978ce8a60935ce3c6d38</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/177/packages/generic/c-ares/1.18.1.1381/c_ares-1.18.1-windows64-1381.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>source_type</key>
<string>git</string>
<key>version</key>
<string>1.18.1</string>
</map>
<key>colladadom</key>
<map>
<key>copyright</key>
......@@ -338,11 +402,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>f8146bb5c8ed17867dec424bc8af4f11f245f86899525324c05b27e774a8def44424dbf19c0001e0f2275e8f46bf9e28bb6cc0ac8cc0e06444c6b69f8e34b144</string>
<string>4640e06bc5637729e31e3f01b082587409413493bdf2524e158f23c63a0da461add982fa2378ed95cef7092d0dfbc9efcba70f325ea0923060e0475b48242a1c</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/89/packages/generic/curl/7.81.0.1366/curl-7.81.0-darwin64-1366.tar.zst</string>
<string>https://git.alchemyviewer.org/api/v4/projects/89/packages/generic/curl/7.81.0.1390/curl-7.81.0-darwin64-1390.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
......@@ -352,11 +416,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>8ddf37d9862ada64b70b6e2da7be9cc47de11913aeae7f9bfacb67da5cd97aff031351c82c7d8a32f6fa0cf5380e4615e3845498a0faa8877948b86f4998d05c</string>
<string>009cd83fa8402f07cc0ba4b9f16d59c3dcc3214db15e33a7e64d3ed26b3ba80a02c2f5166341df537943657cd31aa5bec90177eaf5ceebdc5c586c806bfa244c</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/89/packages/generic/curl/7.81.0.1366/curl-7.81.0-linux64-1366.tar.zst</string>
<string>https://git.alchemyviewer.org/api/v4/projects/89/packages/generic/curl/7.81.0.1390/curl-7.81.0-linux64-1390.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
......@@ -366,11 +430,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>3c4a83ab006ef466b7cdba6246f7c60bdf34e0fc13d45f6318ec25b35a77e988d617336a0b833f29b7b4996ae5c9be6c63d2cd647b6a8813f45ab55a4b1f2679</string>
<string>58162176b33ad415ca3ba80af6021d3d9b9aebdb526dc57fc9c882c81a7979094f06b25285225e3a3d8baceb26f47e3af3c22d7fb6d14d22b2bfa551b42ec007</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/89/packages/generic/curl/7.81.0.1366/curl-7.81.0-windows64-1366.tar.zst</string>
<string>https://git.alchemyviewer.org/api/v4/projects/89/packages/generic/curl/7.81.0.1390/curl-7.81.0-windows64-1390.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
......@@ -460,11 +524,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>b952aa00580ab401d09db89db2cb36c813eb90aa59d5a25d04a948467e6e7dd8241f4c42bdac41081e144c4a2df3a5252ff852e37983b4afb6eb5eda38746dbe</string>
<string>8a4883961184641b3717bf66148d7357c188fe21686cafd770f2da3c283b442cd9f5cd1711f762da83b2202f6f9aadabae7ff029faf9e18b2eb9c8e303d3e86c</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/103/packages/generic/dullahan/0.0.0.1321/dullahan-1.12.2_96.0.17_g20e2617_chromium-96.0.4664.93-darwin64-1321.tar.zst</string>
<string>https://git.alchemyviewer.org/api/v4/projects/103/packages/generic/dullahan/0.0.0.1391/dullahan-1.12.2_97.1.5_g2b00258_chromium-97.0.4692.71-darwin64-1391.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
......@@ -474,11 +538,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>0c9565b81400202d556e1693b9f2404014a335132bd4062710581142f381200968c7f677a2737404dda9b38fdf6aa7ae676ffbf5883fca2b3934c4423a830492</string>
<string>3c858fd39504f6726c32e589f67a171e459e41773d89075ac385fe0c8040ad4db730d53bb33440841d5127a10aac540d0f650d87c5aaffcdd3ad807bfc0a9682</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/103/packages/generic/dullahan/0.0.0.1321/dullahan-1.12.2_96.0.17_g20e2617_chromium-96.0.4664.93-linux64-1321.tar.zst</string>
<string>https://git.alchemyviewer.org/api/v4/projects/103/packages/generic/dullahan/0.0.0.1391/dullahan-1.12.2_97.1.5_g2b00258_chromium-97.0.4692.71-linux64-1391.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
......@@ -488,18 +552,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>b66c639cb056b99472dc1acff5c153d9023cad0ef6e1df791bc03904996f9d2ffb26fefefb6543e04c5cd58aed9010ccf44c2a905aa82422698fd3c0cc00302f</string>
<string>70932e853bd602811c660df2816c7cb9694c3f5ce99c7e98204302d735e47b416cf1fe8acd705eea567459f89b6277b6ba002a30554e4ecc9674322048f23879</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/103/packages/generic/dullahan/0.0.0.1321/dullahan-1.12.2_96.0.17_g20e2617_chromium-96.0.4664.93-windows64-1321.tar.zst</string>
<string>https://git.alchemyviewer.org/api/v4/projects/103/packages/generic/dullahan/0.0.0.1391/dullahan-1.12.2_97.1.5_g2b00258_chromium-97.0.4692.71-windows64-1391.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>1.12.2_96.0.17_g20e2617_chromium-96.0.4664.93</string>
<string>1.12.2_97.1.5_g2b00258_chromium-97.0.4692.71</string>
</map>
<key>expat</key>
<map>
......@@ -1844,11 +1908,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>fd7035dda263ccb99ce4c3d1dabf65874ca726a06ea289b5cd3d07e61499be2ea0b4bd7b9813b7e3d2ee1dc3336559152338fe3c147fb6bc13ea473374c2add7</string>
<string>d5043562c3886a27971d9fd446be0d76f1a99a8622be20fb003c1dffcc1048f246a7af68c2d52d7cba1ecbe145279b61f58d865bb915b92a67ee7112177ada00</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/164/packages/generic/sentry/1.0.0.1368/sentry-1.0.0-darwin64-1368.tar.zst</string>
<string>https://git.alchemyviewer.org/api/v4/projects/164/packages/generic/sentry/1.0.0.1393/sentry-1.0.0-darwin64-1393.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
......@@ -1858,11 +1922,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>7a90f7cde61fca9562efdc705ed824483e3b87e44a8e617a5653c9b8db312dcfec7f5beafc57438301d65ffc71d6538cacd8d8748242534b00e11a44caf0c09f</string>
<string>9a70c31be25489bbd2f789643cde1bb4d7386c1c5f643f460de4e4695e0ab981a4a0f2b6b28c41fb56e8d6f3bf6b37a24b1a55d67ff473fdc3efc5fc1951d3ad</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/164/packages/generic/sentry/1.0.0.1368/sentry-1.0.0-linux64-1368.tar.zst</string>
<string>https://git.alchemyviewer.org/api/v4/projects/164/packages/generic/sentry/1.0.0.1393/sentry-1.0.0-linux64-1393.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
......@@ -1872,11 +1936,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>936c11f28b0f638329b5ce2c4cebdcda5b52ac1574d43d9c922db025245dfa7e981ceeb30f32af49e60ef8d990b76741324c45e71cf64f074866424782b5cd86</string>
<string>72f60766f1eb0aed9c4b7a90ece0bf1206e35903e632fee8358ae1a026f62918b287866c7cf361fff573efcbca4da4f56ad2aa6090e6051689881175ee41ec13</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://git.alchemyviewer.org/api/v4/projects/164/packages/generic/sentry/1.0.0.1368/sentry-1.0.0-windows64-1368.tar.zst</string>
<string>https://git.alchemyviewer.org/api/v4/projects/164/packages/generic/sentry/1.0.0.1393/sentry-1.0.0-windows64-1393.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
......
......@@ -8,15 +8,30 @@ set(CURL_FIND_REQUIRED ON)
if (USESYSTEMLIBS)
include(FindCURL)
else (USESYSTEMLIBS)
use_prebuilt_binary(c-ares)
use_prebuilt_binary(curl)
if (WINDOWS)
set(CURL_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libcurld.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libcurl.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libcaresd.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libcares.lib
Normaliz.lib
Iphlpapi.lib
)
else (WINDOWS)
set(CURL_LIBRARIES libcurl.a)
endif (WINDOWS)
elseif(DARWIN)
set(CURL_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libcurld.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libcurl.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libcares.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libcares.a
resolv
)
else ()
set(CURL_LIBRARIES libcurl.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libcares.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libcares.a
)
endif ()
set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (USESYSTEMLIBS)
......@@ -511,7 +511,6 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
check_curl_easy_setopt(mCurlHandle, CURLOPT_NOPROGRESS, 1);
check_curl_easy_setopt(mCurlHandle, CURLOPT_URL, mReqURL.c_str());
check_curl_easy_setopt(mCurlHandle, CURLOPT_PRIVATE, getHandle());
//check_curl_easy_setopt(mCurlHandle, CURLOPT_ACCEPT_ENCODING, "gzip,deflate");
check_curl_easy_setopt(mCurlHandle, CURLOPT_AUTOREFERER, 1);
check_curl_easy_setopt(mCurlHandle, CURLOPT_MAXREDIRS, HTTP_REDIRECTS_DEFAULT);
......@@ -649,12 +648,12 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
break;
}
if (!mReqHeaders || !mReqHeaders->find("Connection"))
if (!mReqHeaders || !mReqHeaders->find(HTTP_OUT_HEADER_CONNECTION))
{
mCurlHeaders = curl_slist_append(mCurlHeaders, "Connection: keep-alive");
}
if (!mReqHeaders || !mReqHeaders->find("Keep-Alive"))
if (!mReqHeaders || !mReqHeaders->find(HTTP_OUT_HEADER_KEEP_ALIVE))
{
mCurlHeaders = curl_slist_append(mCurlHeaders, "Keep-Alive: 300");
}
......
......@@ -284,8 +284,6 @@ CURL *getCurlTemplateHandle()
check_curl_code(result, CURLOPT_NOSIGNAL);
result = curl_easy_setopt(curlpTemplateHandle, CURLOPT_NOPROGRESS, 1);
check_curl_code(result, CURLOPT_NOPROGRESS);
//result = curl_easy_setopt(curlpTemplateHandle, CURLOPT_ACCEPT_ENCODING, "gzip,deflate");
//check_curl_code(result, CURLOPT_ACCEPT_ENCODING);
result = curl_easy_setopt(curlpTemplateHandle, CURLOPT_AUTOREFERER, 1);
check_curl_code(result, CURLOPT_AUTOREFERER);
result = curl_easy_setopt(curlpTemplateHandle, CURLOPT_FOLLOWLOCATION, 1);
......
......@@ -51,7 +51,7 @@ void HttpHeaders::append(const std::string & name, const std::string & value)
}
}
mHeaders.push_back(value_type(name, value));
mHeaders.emplace_back(name, value);
}
......@@ -66,7 +66,7 @@ void HttpHeaders::append(const char * name, const char * value)
}
}
mHeaders.push_back(value_type(name, value));
mHeaders.emplace_back(name, value);
}
......@@ -108,7 +108,7 @@ void HttpHeaders::appendNormal(const char * header, size_t size)
name.assign(header, size);
}
mHeaders.push_back(value_type(name, value));
mHeaders.emplace_back(name, value);
}
......
......@@ -88,6 +88,7 @@ const std::string HTTP_OUT_HEADER_VARY("Vary");
const std::string HTTP_OUT_HEADER_VIA("Via");
const std::string HTTP_OUT_HEADER_WARNING("Warning");
const std::string HTTP_OUT_HEADER_WWW_AUTHENTICATE("WWW-Authenticate");
const std::string HTTP_OUT_HEADER_SL_UDP_LISTEN_PORT("X-SecondLife-UDP-Listen-Port");
// Incoming headers are normalized to lower-case.
const std::string HTTP_IN_HEADER_ACCEPT_LANGUAGE("accept-language");
......
......@@ -178,6 +178,7 @@ extern const std::string HTTP_OUT_HEADER_VARY;
extern const std::string HTTP_OUT_HEADER_VIA;
extern const std::string HTTP_OUT_HEADER_WARNING;
extern const std::string HTTP_OUT_HEADER_WWW_AUTHENTICATE;
extern const std::string HTTP_OUT_HEADER_SL_UDP_LISTEN_PORT;
// Incoming headers are normalized to lower-case.
extern const std::string HTTP_IN_HEADER_ACCEPT_LANGUAGE;
......
......@@ -41,11 +41,9 @@
#include "test_httpstatus.hpp"
#include "test_refcounted.hpp"
#include "test_httpoperation.hpp"
// As of 2019-06-28, test_httprequest.hpp consistently crashes on Mac Release
// builds for reasons not yet diagnosed.
#if ! (LL_DARWIN && LL_RELEASE)
#include "test_httprequest.hpp"
#endif
#include "test_httpheaders.hpp"
#include "test_httprequestqueue.hpp"
#include "_httpservice.h"
......
......@@ -1568,10 +1568,6 @@ void HttpRequestTestObjectType::test<16>()
regex_container_t::value_type(
boost::regex("X-Reflect-accept", boost::regex::icase),
boost::regex("\\*/\\*", boost::regex::icase)));
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-accept-encoding", boost::regex::icase),
boost::regex("((gzip|deflate),\\s*)+(gzip|deflate)", boost::regex::icase))); // close enough
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-keep-alive", boost::regex::icase),
......@@ -1642,10 +1638,6 @@ void HttpRequestTestObjectType::test<16>()
regex_container_t::value_type(
boost::regex("X-Reflect-accept", boost::regex::icase),
boost::regex("image/x-j2c", boost::regex::icase)));
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-accept-encoding", boost::regex::icase),
boost::regex("((gzip|deflate),\\s*)+(gzip|deflate)", boost::regex::icase))); // close enough
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-keep-alive", boost::regex::icase),
......@@ -1813,10 +1805,6 @@ void HttpRequestTestObjectType::test<17>()
regex_container_t::value_type(
boost::regex("X-Reflect-accept", boost::regex::icase),
boost::regex("\\*/\\*", boost::regex::icase)));
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-accept-encoding", boost::regex::icase),
boost::regex("((gzip|deflate),\\s*)+(gzip|deflate)", boost::regex::icase))); // close enough
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-keep-alive", boost::regex::icase),
......@@ -1998,10 +1986,6 @@ void HttpRequestTestObjectType::test<18>()
regex_container_t::value_type(
boost::regex("X-Reflect-accept", boost::regex::icase),
boost::regex("\\*/\\*", boost::regex::icase)));
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-accept-encoding", boost::regex::icase),
boost::regex("((gzip|deflate),\\s*)+(gzip|deflate)", boost::regex::icase))); // close enough
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-keep-alive", boost::regex::icase),
......@@ -2184,10 +2168,6 @@ void HttpRequestTestObjectType::test<19>()
regex_container_t::value_type(
boost::regex("X-Reflect-accept", boost::regex::icase),
boost::regex("text/plain", boost::regex::icase)));
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-accept-encoding", boost::regex::icase),
boost::regex("deflate", boost::regex::icase))); // close enough
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-keep-alive", boost::regex::icase),
......@@ -2372,10 +2352,6 @@ void HttpRequestTestObjectType::test<20>()
regex_container_t::value_type(
boost::regex("X-Reflect-accept", boost::regex::icase),
boost::regex("text/html", boost::regex::icase)));
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-accept-encoding", boost::regex::icase),
boost::regex("((gzip|deflate),\\s*)+(gzip|deflate)", boost::regex::icase))); // close enough
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-keep-alive", boost::regex::icase),
......@@ -2575,10 +2551,6 @@ void HttpRequestTestObjectType::test<21>()
regex_container_t::value_type(
boost::regex("X-Reflect-accept", boost::regex::icase),
boost::regex("\\*/\\*", boost::regex::icase)));
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-accept-encoding", boost::regex::icase),
boost::regex("((gzip|deflate),\\s*)+(gzip|deflate)", boost::regex::icase))); // close enough
handler.mHeadersRequired.push_back(
regex_container_t::value_type(
boost::regex("X-Reflect-keep-alive", boost::regex::icase),
......
......@@ -32,7 +32,6 @@ set(llmessage_SOURCE_FILES
llassetstorage.cpp
llavatarname.cpp
llavatarnamecache.cpp
llblowfishcipher.cpp
llbuffer.cpp
llbufferstream.cpp
llcachename.cpp
......@@ -110,7 +109,6 @@ set(llmessage_HEADER_FILES
llassetstorage.h
llavatarname.h
llavatarnamecache.h
llblowfishcipher.h
llbuffer.h
llbufferstream.h
llcachename.h
......
/**
* @file llblowfishcipher.cpp
* @brief Wrapper around OpenSSL Blowfish encryption algorithm.
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* 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.
*
* 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.
*
* 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
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "llblowfishcipher.h"
#include <openssl/evp.h>
LLBlowfishCipher::LLBlowfishCipher(const U8* secret, size_t secret_size)
: LLCipher()
{
llassert(secret);
mSecretSize = secret_size;
mSecret = new U8[mSecretSize];
memcpy(mSecret, secret, mSecretSize);
}
LLBlowfishCipher::~LLBlowfishCipher()
{
delete [] mSecret;
mSecret = NULL;
}
// virtual
U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
{
if (!src || !src_len || !dst || !dst_len) return 0;
if (src_len > dst_len) return 0;
// OpenSSL uses "cipher contexts" to hold encryption parameters.
EVP_CIPHER_CTX* context = EVP_CIPHER_CTX_new();
if (!context)
{
LL_WARNS() << "LLBlowfishCipher::encrypt EVP_CIPHER_CTX initiation failure" << LL_ENDL;
return 0;
}
// We want a blowfish cyclic block chain cipher, but need to set
// the key length before we pass in a key, so call EncryptInit
// first with NULLs.
EVP_EncryptInit_ex(context, EVP_bf_cbc(), NULL, NULL, NULL);
EVP_CIPHER_CTX_set_key_length(context, (int)mSecretSize);
// Complete initialization. Per EVP_EncryptInit man page, the
// cipher pointer must be NULL. Apparently initial_vector must
// be 8 bytes for blowfish, as this is the block size.
unsigned char initial_vector[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
EVP_EncryptInit_ex(context, NULL, NULL, mSecret, initial_vector);
int blocksize = EVP_CIPHER_CTX_block_size(context);
int keylen = EVP_CIPHER_CTX_key_length(context);
int iv_length = EVP_CIPHER_CTX_iv_length(context);
LL_DEBUGS() << "LLBlowfishCipher blocksize " << blocksize
<< " keylen " << keylen
<< " iv_len " << iv_length
<< LL_ENDL;
int output_len = 0;
int temp_len = 0;
if (!EVP_EncryptUpdate(context,
dst,
&output_len,
src,
src_len))
{
LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << LL_ENDL;
goto ERROR_STATE;
}
// There may be some final data left to encrypt if the input is
// not an exact multiple of the block size.
if (!EVP_EncryptFinal_ex(context, (unsigned char*)(dst + output_len), &temp_len))
{
LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << LL_ENDL;
goto ERROR_STATE;
}
output_len += temp_len;
EVP_CIPHER_CTX_free(context);
return output_len;
ERROR_STATE:
EVP_CIPHER_CTX_free(context);
return 0;
}
// virtual
U32 LLBlowfishCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
{
if (!src || !src_len || !dst || !dst_len) return 0;
if (src_len > dst_len) return 0;
EVP_CIPHER_CTX* context = EVP_CIPHER_CTX_new();
EVP_DecryptInit_ex(context, EVP_bf_cbc(), NULL, NULL, NULL);
EVP_CIPHER_CTX_set_key_length(context, (int)mSecretSize);
unsigned char initial_vector[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
EVP_DecryptInit_ex(context, NULL, NULL, mSecret, initial_vector);
int blocksize = EVP_CIPHER_CTX_block_size(context);
int keylen = EVP_CIPHER_CTX_key_length(context);
int iv_length = EVP_CIPHER_CTX_iv_length(context);
LL_DEBUGS() << "LLBlowfishCipher blocksize " << blocksize
<< " keylen " << keylen
<< " iv_len " << iv_length
<< LL_ENDL;
int out_len = 0;
int tmp_len = 0;
if (!EVP_DecryptUpdate(context, dst, &out_len, src, src_len))
{
LL_WARNS() << "LLBlowfishCipher::decrypt EVP_DecryptUpdate failure" << LL_ENDL;
goto ERROR_STATE;
}
if (!EVP_DecryptFinal_ex(context, dst + out_len, &tmp_len))
{
LL_WARNS() << "LLBlowfishCipher::decrypt EVP_DecryptFinal failure" << LL_ENDL;
goto ERROR_STATE;
}
out_len += tmp_len;
EVP_CIPHER_CTX_free(context);
return out_len;
ERROR_STATE:
EVP_CIPHER_CTX_free(context);
return 0;
}
// virtual
U32 LLBlowfishCipher::requiredEncryptionSpace(U32 len) const
{
// *HACK: We know blowfish uses an 8 byte block size.
// Oddly, sometimes EVP_Encrypt produces an extra block
// if the input is an exact multiple of the block size.
// So round up.
const U32 BLOCK_SIZE = 8;
len += BLOCK_SIZE;
len -= (len % BLOCK_SIZE);
return len;
}
/**
* @file llblowfishcipher.h
* @brief A symmetric block cipher, designed in 1993 by Bruce Schneier.
* We use it because it has an 8 byte block size, allowing encryption of
* two UUIDs and a timestamp (16x2 + 4 = 36 bytes) with only 40 bytes of
* output. AES has a block size of 32 bytes, so this would require 64 bytes.
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* 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.
*
* 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.
*
* 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
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LLBLOWFISHCIPHER_H
#define LLBLOWFISHCIPHER_H
#include "llcipher.h"
class LLBlowfishCipher : public LLCipher
{
public:
// Secret may be up to 56 bytes in length per Blowfish spec.
LLBlowfishCipher(const U8* secret, size_t secret_size);
virtual ~LLBlowfishCipher();
// See llcipher.h for documentation.
/*virtual*/ U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len);
/*virtual*/ U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len);
/*virtual*/ U32 requiredEncryptionSpace(U32 src_len) const;
#ifdef _DEBUG
static BOOL testHarness();
#endif
private:
U8* mSecret;
size_t mSecretSize;
};
#endif // LL_LLCRYPTO_H
......@@ -1181,9 +1181,9 @@ void HttpCoroutineAdapter::checkDefaultHeaders(LLCore::HttpHeaders::ptr_t &heade
headers->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML);
}
if (!headers->find("X-SecondLife-UDP-Listen-Port") && gMessageSystem)
if (!headers->find(HTTP_OUT_HEADER_SL_UDP_LISTEN_PORT) && gMessageSystem)
{
headers->append("X-SecondLife-UDP-Listen-Port", llformat("%d", gMessageSystem->mPort));
headers->append(HTTP_OUT_HEADER_SL_UDP_LISTEN_PORT, llformat("%d", gMessageSystem->mPort));
}
}
......
......@@ -59,6 +59,7 @@ target_link_libraries(SLPlugin
)
if (WINDOWS)
target_link_libraries(SLPlugin wer)
set_target_properties(SLPlugin
PROPERTIES
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\""
......
......@@ -75,7 +75,8 @@ static void crash_handler(int sig)
#endif
#if LL_WINDOWS
#include <windows.h>
#include "llwin32headerslean.h"
#include <Werapi.h>
////////////////////////////////////////////////////////////////////////////////
// Our exception handler - will probably just exit and the host application
// will miss the heartbeat and log the error in the usual fashion.
......@@ -88,26 +89,61 @@ LONG WINAPI myWin32ExceptionHandler( struct _EXCEPTION_POINTERS* exception_infop
return EXCEPTION_EXECUTE_HANDLER;
}
// Taken from : http://blog.kalmbachnet.de/?postid=75
// The MSVC 2005 CRT forces the call of the default-debugger (normally Dr.Watson)
// Taken from : http://blog.kalmbach-software.de/2013/05/23/improvedpreventsetunhandledexceptionfilter/
// The MSVC 2005 and above CRT forces the call of the default-debugger (normally Dr.Watson)
// even with the other exception handling code. This (terrifying) piece of code
// patches things so that doesn't happen.
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI MyDummySetUnhandledExceptionFilter(
LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter )
static BOOL PreventSetUnhandledExceptionFilter()
{
return NULL;
}
HMODULE hKernel32 = LoadLibrary(TEXT("kernel32.dll"));
if (hKernel32 == nullptr) return FALSE;
LPVOID pOrgEntry = reinterpret_cast<LPVOID>(GetProcAddress(hKernel32, "SetUnhandledExceptionFilter"));
if (pOrgEntry == nullptr) return FALSE;
#ifdef _M_IX86
// Code for x86:
// 33 C0 xor eax,eax
// C2 04 00 ret 4
unsigned char szExecute[] = { 0x33, 0xC0, 0xC2, 0x04, 0x00 };
#elif _M_X64
// 33 C0 xor eax,eax
unsigned char szExecute[] = { 0x33, 0xC0, 0xC3 };
#else
#error "The following code only works for x86 and x64!"
#endif
BOOL PreventSetUnhandledExceptionFilter()
{
// remove the scary stuff that also isn't supported on 64 bit Windows
return TRUE;
DWORD oldProtect;
BOOL bRet = VirtualProtect(pOrgEntry, sizeof(szExecute), PAGE_EXECUTE_READWRITE, &oldProtect);
memcpy(pOrgEntry, szExecute, sizeof(szExecute));
VirtualProtect(pOrgEntry, sizeof(szExecute), oldProtect, &oldProtect);
return bRet;
}
////////////////////////////////////////////////////////////////////////////////
// Hook our exception handler and replace the system one
void initExceptionHandler()
{
TCHAR szExeFileName[MAX_PATH];
GetModuleFileName(nullptr, szExeFileName, MAX_PATH);
std::wstring exename(szExeFileName);
size_t path_end = exename.find_last_of('\\');
if (path_end != std::string::npos)
{
exename = exename.substr(path_end + 1, std::string::npos);
if (S_OK == WerAddExcludedApplication(exename.c_str(), FALSE))
{
LL_INFOS() << "WerAddExcludedApplication() succeeded for " << ll_convert_wide_to_string(exename) << LL_ENDL;
}
else
{
LL_INFOS() << "WerAddExcludedApplication() failed for " << ll_convert_wide_to_string(exename) << LL_ENDL;
}
}
SetErrorMode(GetErrorMode() | SEM_NOGPFAULTERRORBOX);
LPTOP_LEVEL_EXCEPTION_FILTER prev_filter;
// save old exception handler in case we need to restore it at the end
......
......@@ -1182,6 +1182,8 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
skin_info.mBindShapeMatrix.loadu(trans);
}
// Build the joint to node mapping array and update joint aliases (mJointMap)
buildJointToNodeMappingFromScene(root);
//Some collada setup for accessing the skeleton
U32 skeleton_count = dae->getDatabase()->getElementCount( NULL, "skeleton" );
......@@ -1411,7 +1413,6 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
//(which means we have all the joint sthat are required for an avatar versus
//a skinned asset attached to a node in a file that contains an entire skeleton,
//but does not use the skeleton).
buildJointToNodeMappingFromScene( root );
critiqueRigForUploadApplicability( model->mSkinInfo.mJointNames );
if ( !missingSkeletonOrScene )
......@@ -1654,7 +1655,11 @@ void LLDAELoader::processJointToNodeMapping( domNode* pNode )
std::string nodeName = pNode->getName();
if ( !nodeName.empty() )
{
mJointsFromNode.push_front( pNode->getName() );
mJointsFromNode.push_front(nodeName);
// Alias joint node SIDs to joint names for compatibility
const auto nodeSID = std::string(pNode->getSid());
if (!nodeSID.empty())
mJointMap[nodeSID] = mJointMap[nodeName];
}
//2. Handle the kiddo's
processChildJoints( pNode );
......
......@@ -1356,6 +1356,7 @@ LLSecAPIBasicHandler::~LLSecAPIBasicHandler()
_writeProtectedData();
}
#if LEGACY_PASSWORD_STORAGE
// compat_rc4 reads old rc4 encrypted files
void compat_rc4(llifstream &protected_data_stream, std::string &decrypted_data)
{
......@@ -1394,6 +1395,7 @@ void compat_rc4(llifstream &protected_data_stream, std::string &decrypted_data)
EVP_CIPHER_CTX_free(ctx);
}
#endif
void LLSecAPIBasicHandler::_readProtectedData(unsigned char *unique_id, U32 id_len)
{
......@@ -1452,6 +1454,7 @@ void LLSecAPIBasicHandler::_readProtectedData(unsigned char *unique_id, U32 id_l
if (parser->parse(parse_stream, mProtectedDataMap,
LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
{
#if LEGACY_PASSWORD_STORAGE
// clear and reset to try compat
parser->reset();
decrypted_data.clear();
......@@ -1466,6 +1469,10 @@ void LLSecAPIBasicHandler::_readProtectedData(unsigned char *unique_id, U32 id_l
// everything failed abort
LLTHROW(LLProtectedDataException("Config file cannot be decrypted."));
}
#else
// everything failed abort
LLTHROW(LLProtectedDataException("Config file cannot be decrypted."));
#endif
}
}
}
......
......@@ -734,6 +734,8 @@ namespace tut
template<> template<>
void sechandler_basic_test_object::test<3>()
{
skip("Broken with openssl 3.0");
std::string protected_data = "sUSh3wj77NG9oAMyt3XIhaej3KLZhLZWFZvI6rIGmwUUOmmelrRg0NI9rkOj8ZDpTPxpwToaBT5u"
"GQhakdaGLJznr9bHr4/6HIC1bouKj4n2rs4TL6j2WSjto114QdlNfLsE8cbbE+ghww58g8SeyLQO"
"nyzXoz+/PBz0HD5SMFDuObccoPW24gmqYySz8YoEWhSwO0pUtEEqOjVRsAJgF5wLAtJZDeuilGsq"
......@@ -849,6 +851,8 @@ namespace tut
template<> template<>
void sechandler_basic_test_object::test<4>()
{
skip("Broken with openssl 3.0");
LLPointer<LLSecAPIBasicHandler> handler = new LLSecAPIBasicHandler("sechandler_settings.tmp", "test_password.dat");
handler->init();
......
......@@ -35,7 +35,6 @@ include_directories(SYSTEM
set(test_SOURCE_FILES
io.cpp
llapp_tut.cpp
llblowfish_tut.cpp
llbuffer_tut.cpp
lldoubledispatch_tut.cpp
llevents_tut.cpp
......
.A3LE ``K@;M[B>C'
\ No newline at end of file