├── .gitattributes ├── .gitignore ├── README.md └── src ├── lib └── appstore_core.exp ├── shellcode.v12.suo ├── src ├── appstore │ ├── appstore.cc │ ├── appstore.vcxproj │ ├── appstore.vcxproj.filters │ └── appstore.vcxproj.user ├── appstore_core │ ├── appstore_core.vcxproj │ ├── appstore_core.vcxproj.filters │ ├── appstore_core.vcxproj.user │ ├── appstore_core_main.cc │ ├── appstore_core_main.h │ ├── appstore_http_protocol.cc │ ├── appstore_http_protocol.h │ ├── basictypes.h │ ├── dllexport.h │ ├── dllmain.cc │ └── strings.h ├── third_party │ ├── cookies │ │ ├── OWNERS │ │ ├── canonical_cookie.cc │ │ ├── canonical_cookie.h │ │ ├── canonical_cookie_unittest.cc │ │ ├── cookie_constants.cc │ │ ├── cookie_constants.h │ │ ├── cookie_constants_unittest.cc │ │ ├── cookie_monster.cc │ │ ├── cookie_monster.h │ │ ├── cookie_monster_perftest.cc │ │ ├── cookie_monster_store_test.cc │ │ ├── cookie_monster_store_test.h │ │ ├── cookie_monster_unittest.cc │ │ ├── cookie_options.h │ │ ├── cookie_store.cc │ │ ├── cookie_store.h │ │ ├── cookie_store_test_callbacks.cc │ │ ├── cookie_store_test_callbacks.h │ │ ├── cookie_store_test_helpers.cc │ │ ├── cookie_store_test_helpers.h │ │ ├── cookie_store_unittest.h │ │ ├── cookie_util.cc │ │ ├── cookie_util.h │ │ ├── cookie_util_unittest.cc │ │ ├── parsed_cookie.cc │ │ ├── parsed_cookie.h │ │ └── parsed_cookie_unittest.cc │ ├── glog │ │ ├── basictypes.h │ │ ├── logging.cc │ │ ├── logging.h │ │ └── scoped_ptr.h │ └── openssl │ │ ├── aes.h │ │ ├── asn1.h │ │ ├── asn1_mac.h │ │ ├── asn1t.h │ │ ├── bio.h │ │ ├── blowfish.h │ │ ├── bn.h │ │ ├── buffer.h │ │ ├── camellia.h │ │ ├── cast.h │ │ ├── cmac.h │ │ ├── cms.h │ │ ├── comp.h │ │ ├── conf.h │ │ ├── conf_api.h │ │ ├── crypto.h │ │ ├── des.h │ │ ├── des_old.h │ │ ├── dh.h │ │ ├── dsa.h │ │ ├── dso.h │ │ ├── dtls1.h │ │ ├── e_os2.h │ │ ├── ebcdic.h │ │ ├── ec.h │ │ ├── ecdh.h │ │ ├── ecdsa.h │ │ ├── engine.h │ │ ├── err.h │ │ ├── evp.h │ │ ├── hmac.h │ │ ├── idea.h │ │ ├── krb5_asn.h │ │ ├── kssl.h │ │ ├── lhash.h │ │ ├── md4.h │ │ ├── md5.h │ │ ├── mdc2.h │ │ ├── modes.h │ │ ├── obj_mac.h │ │ ├── objects.h │ │ ├── ocsp.h │ │ ├── opensslconf.h │ │ ├── opensslv.h │ │ ├── ossl_typ.h │ │ ├── pem.h │ │ ├── pem2.h │ │ ├── pkcs12.h │ │ ├── pkcs7.h │ │ ├── pqueue.h │ │ ├── rand.h │ │ ├── rc2.h │ │ ├── rc4.h │ │ ├── ripemd.h │ │ ├── rsa.h │ │ ├── safestack.h │ │ ├── seed.h │ │ ├── sha.h │ │ ├── srp.h │ │ ├── srtp.h │ │ ├── ssl.h │ │ ├── ssl2.h │ │ ├── ssl23.h │ │ ├── ssl3.h │ │ ├── stack.h │ │ ├── symhacks.h │ │ ├── tls1.h │ │ ├── ts.h │ │ ├── txt_db.h │ │ ├── ui.h │ │ ├── ui_compat.h │ │ ├── whrlpool.h │ │ ├── x509.h │ │ ├── x509_vfy.h │ │ └── x509v3.h └── win_itunes │ ├── itunes_client_interface.cc │ ├── itunes_client_interface.h │ ├── itunes_cookie_interface.cc │ ├── itunes_cookie_interface.h │ ├── itunes_download_info.cc │ ├── itunes_download_info.h │ ├── itunes_https.cc │ ├── itunes_https.h │ ├── itunes_https_configure.cc │ ├── itunes_https_configure.h │ ├── itunes_internal_interface.h │ ├── itunes_module.cc │ ├── itunes_module.h │ ├── itunes_module_state.cc │ ├── itunes_module_state.h │ ├── itunes_native_interface.cc │ ├── itunes_native_interface.h │ ├── strings.cc │ ├── strings.h │ ├── windows_hardware.cc │ ├── windows_hardware.h │ ├── windows_version.cc │ └── windows_version.h ├── vc.sln └── vc.v12.suo /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Get at least $100 to answer some of your questions and assist you. I am poor, sorry. 2 | Foo 3 | -------------------------------------------------------------------------------- /src/lib/appstore_core.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cxxrev0to1dev/apple_itunes_win/8530985b4c8747af125707a6604c996aa6c9c916/src/lib/appstore_core.exp -------------------------------------------------------------------------------- /src/shellcode.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cxxrev0to1dev/apple_itunes_win/8530985b4c8747af125707a6604c996aa6c9c916/src/shellcode.v12.suo -------------------------------------------------------------------------------- /src/src/appstore/appstore.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "appstore_core/appstore_core_main.h" 3 | #pragma comment(lib,"appstore_core.lib") 4 | 5 | int wmain(int argc, wchar_t* argv[]){ 6 | AppstoreCore::AppstoreCoreMain* appstore = new AppstoreCore::AppstoreCoreMain; 7 | appstore->SendAuthenticate("m", ""); 8 | appstore->SendBuy(""); 9 | return 0; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /src/src/appstore/appstore.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {1e8ec46e-6024-4692-a4fa-34ce6ec978fc} 6 | 7 | 8 | 9 | 10 | src 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/src/appstore/appstore.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/src/appstore_core/appstore_core.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/src/appstore_core/appstore_core_main.cc: -------------------------------------------------------------------------------- 1 | #include "appstore_core/appstore_core_main.h" 2 | #include "win_itunes/itunes_client_interface.h" 3 | #include "win_itunes/windows_hardware.h" 4 | #include "win_itunes/itunes_download_info.h" 5 | 6 | namespace AppstoreCore{ 7 | win_itunes::communicates *communicates = win_itunes::communicates::singleton(); 8 | AppstoreCoreMain::AppstoreCoreMain(){ 9 | communicates->ResetSapSetup(true); 10 | return; 11 | } 12 | bool AppstoreCoreMain::SendAuthenticate(const char* username, const char* password){ 13 | win_itunes::HardwareInfo hardware; 14 | //"DengTao", "128dba73ccf589225c29ad2c623da34f5521b1bd" 15 | return communicates->Authenticate(username, password, hardware.GetMachineName().c_str(), hardware.cookie().c_str()); 16 | } 17 | bool AppstoreCoreMain::SendBuy(const char* appid){ 18 | win_itunes::HardwareInfo hardware; 19 | communicates->SendMessage_buyProduct(appid, hardware.GetMachineName().c_str(), hardware.cookie().c_str(), win_itunes::iTunesDownloadInfo::GetInterface(), 0, true); 20 | return true; 21 | } 22 | } -------------------------------------------------------------------------------- /src/src/appstore_core/appstore_core_main.h: -------------------------------------------------------------------------------- 1 | #ifndef APPSTORE_CORE_APPSTORE_CORE_MAIN_H_ 2 | #define APPSTORE_CORE_APPSTORE_CORE_MAIN_H_ 3 | 4 | #include "appstore_core/dllexport.h" 5 | 6 | namespace AppstoreCore{ 7 | class AppstoreCoreMain { 8 | public: 9 | APPSTORE_CORE_API AppstoreCoreMain(void); 10 | APPSTORE_CORE_API bool SendAuthenticate(const char* username, const char* password); 11 | APPSTORE_CORE_API bool SendBuy(const char* appid); 12 | }; 13 | } 14 | 15 | #endif -------------------------------------------------------------------------------- /src/src/appstore_core/appstore_http_protocol.cc: -------------------------------------------------------------------------------- 1 | #include "appstore_core/appstore_http_protocol.h" 2 | 3 | namespace AppstoreCore{ 4 | AppstoreHTTPProtocol::AppstoreHTTPProtocol(){ 5 | common_headers_.resize(0); 6 | content_type_.resize(0); 7 | set_x_apple_actionsignature(nullptr); 8 | set_cookies(nullptr); 9 | } 10 | AppstoreHTTPProtocol::~AppstoreHTTPProtocol(){ 11 | common_headers_.resize(0); 12 | content_type_.resize(0); 13 | set_x_apple_actionsignature(nullptr); 14 | set_cookies(nullptr); 15 | } 16 | void AppstoreHTTPProtocol::reset_common_headers(){ 17 | common_headers_.resize(0); 18 | common_headers_.append(L"X-Apple-Client-Versions: GameCenter/2.0\r\n"); 19 | common_headers_.append(L"Accept: */*\r\n"); 20 | common_headers_.append(L"X-Apple-Store-Front: 143465-19,26\r\n"); 21 | common_headers_.append(L"X-Apple-Partner: origin.0\r\n"); 22 | common_headers_.append(L"Accept-Encoding: gzip, deflate\r\n"); 23 | common_headers_.append(L"Accept-Language: zh-Hans\r\n"); 24 | common_headers_.append(L"User-Agent: com.apple.Preferences/1 iOS/8.1.2 model/iPhone6,1 build/12B440 (6; dt:89)\r\n"); 25 | common_headers_.append(L"X-Apple-Connection-Type: WiFi\r\n"); 26 | common_headers_.append(L"Connection: keep-alive\r\n"); 27 | } 28 | void AppstoreHTTPProtocol::set_content_type(const wchar_t* default_plist){ 29 | content_type_.resize(0); 30 | if (default_plist == nullptr) 31 | content_type_.append(L"Content-Type: application/x-apple-plist\r\n"); 32 | else{ 33 | content_type_.append(L"Content-Type: "); 34 | content_type_.append(default_plist); 35 | content_type_.append(L"\r\n"); 36 | } 37 | } 38 | void AppstoreHTTPProtocol::set_x_apple_actionsignature(const wchar_t* x_apple_actionsignature){ 39 | x_apple_actionsignature_.resize(0); 40 | if (x_apple_actionsignature != nullptr){ 41 | x_apple_actionsignature_.append(L"X-Apple-ActionSignature: "); 42 | x_apple_actionsignature_.append(x_apple_actionsignature); 43 | x_apple_actionsignature_.append(L"\r\n"); 44 | } 45 | } 46 | void AppstoreHTTPProtocol::set_cookies(const wchar_t* cookies){ 47 | cookies_.resize(0); 48 | if (cookies != nullptr){ 49 | cookies_.append(L"Cookie: "); 50 | cookies_.append(cookies); 51 | cookies_.append(L"\r\n"); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/src/appstore_core/appstore_http_protocol.h: -------------------------------------------------------------------------------- 1 | #ifndef APPSTORE_CORE_APPSTORE_HTTP_PROTOCOL_H_ 2 | #define APPSTORE_CORE_APPSTORE_HTTP_PROTOCOL_H_ 3 | 4 | #include 5 | #include "appstore_core/dllexport.h" 6 | 7 | namespace AppstoreCore{ 8 | class AppstoreHTTPProtocol { 9 | public: 10 | AppstoreHTTPProtocol(); 11 | ~AppstoreHTTPProtocol(); 12 | void reset_common_headers(); 13 | void set_content_type(const wchar_t* default_plist); 14 | void set_x_apple_actionsignature(const wchar_t* x_apple_actionsignature); 15 | void set_cookies(const wchar_t* cookies); 16 | private: 17 | std::wstring common_headers_; 18 | std::wstring content_type_; 19 | std::wstring x_apple_actionsignature_; 20 | std::wstring cookies_; 21 | }; 22 | } 23 | 24 | #endif -------------------------------------------------------------------------------- /src/src/appstore_core/basictypes.h: -------------------------------------------------------------------------------- 1 | #ifndef PASSPORT_BASICTYPES_H_ 2 | #define PASSPORT_BASICTYPES_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #define _ATL_NOFORCE_MANIFEST 5 | #define _STL_NOFORCE_MANIFEST 6 | #define _CRT_NOFORCE_MANIFEST 7 | #define _ATL_APARTMENT_THREADED 8 | #define _ATL_NO_AUTOMATIC_NAMESPACE 9 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS 10 | #define _ATL_ALL_WARNINGS 11 | #define WIN32_LEAN_AND_MEAN 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #pragma comment(lib,"IPHLPAPI.lib") 26 | #pragma comment(lib,"Shell32.lib") 27 | #pragma comment(lib,"Ole32.lib") 28 | #pragma comment(lib,"Shlwapi.lib") 29 | #pragma comment(lib,"user32.lib") 30 | #pragma comment(lib,"gdi32.lib") 31 | #pragma comment(lib,"Advapi32.lib") 32 | #pragma comment(lib,"WinMM.lib") 33 | #pragma comment(lib,"Psapi.lib") 34 | #pragma comment(lib,"ws2_32.lib") 35 | #pragma comment(lib,"Winhttp.lib") 36 | #pragma comment(lib,"comctl32.lib") 37 | #pragma warning(disable:4702) 38 | #pragma warning(disable:4201) 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | using namespace std; 56 | #pragma warning(default:4201) 57 | #pragma warning(disable:4200) 58 | #if defined(_WINDLL)||defined(_USRDLL) 59 | #define WIN_DLL_API __declspec(dllexport) 60 | #else 61 | #define WIN_DLL_API __declspec(dllimport) 62 | #endif 63 | typedef unsigned char uint8; 64 | typedef unsigned short uint16; 65 | typedef unsigned int uint32; 66 | typedef unsigned long ulong; 67 | typedef long long llong; 68 | typedef unsigned long long ullong; 69 | #if !defined(uint64) 70 | typedef unsigned __int64 uint64; 71 | #endif 72 | #if !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_IX86) 73 | #define _X86_ 74 | #endif 75 | #if !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_AMD64) 76 | #define _AMD64_ 77 | #endif 78 | #if defined(_X86_) 79 | typedef uint32 uint; 80 | #elif (defined(_AMD64_)) 81 | typedef uint64 uint; 82 | #endif 83 | 84 | #ifndef HIDWORD 85 | #define HIDWORD(a) ((DWORD)((UINT64)(a) >> 32)) 86 | #define LODWORD(a) ((DWORD)((UINT64)(a) & 0xffffffff)) 87 | #endif 88 | struct MakeLongLong{ 89 | unsigned long high; 90 | unsigned long low; 91 | }; 92 | static std::wstring AUniocde(const std::string& str){ 93 | USES_CONVERSION; 94 | std::wstring dst = A2W(str.c_str()); 95 | return dst; 96 | } 97 | #define DISALLOW_EVIL_CONSTRUCTORS(TypeName) \ 98 | TypeName(const TypeName&); \ 99 | void operator=(const TypeName&) 100 | const unsigned long kMaxStackBufferLength = 1024; 101 | const unsigned long kMaxBufferLength = 4096; 102 | static const char kHTTPUserAgent[] = "iTunes/12.2.2 (Windows; Microsoft Windows 8 x64 Business Edition (Build 9200); x64) AppleWebKit/7600.5017.0.22"; 103 | ////////////////////////////////////////////////////////////////////////// 104 | #endif 105 | 106 | -------------------------------------------------------------------------------- /src/src/appstore_core/dllexport.h: -------------------------------------------------------------------------------- 1 | #ifndef APPSTORE_CORE_DLLEXPORT_H_ 2 | #define APPSTORE_CORE_DLLEXPORT_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #ifdef APPSTORE_CORE_EXPORTS 5 | #define APPSTORE_CORE_API __declspec(dllexport) 6 | #else 7 | #define APPSTORE_CORE_API __declspec(dllimport) 8 | #endif 9 | ////////////////////////////////////////////////////////////////////////// 10 | #endif -------------------------------------------------------------------------------- /src/src/appstore_core/dllmain.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | BOOL APIENTRY DllMain(HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserved) 4 | { 5 | switch (ul_reason_for_call) 6 | { 7 | case DLL_PROCESS_ATTACH: 8 | case DLL_THREAD_ATTACH: 9 | case DLL_THREAD_DETACH: 10 | case DLL_PROCESS_DETACH: 11 | break; 12 | } 13 | return TRUE; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/src/appstore_core/strings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class Strings 3 | { 4 | public: 5 | Strings(); 6 | ~Strings(); 7 | }; 8 | 9 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/OWNERS: -------------------------------------------------------------------------------- 1 | erikwright@chromium.org 2 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/cookie_constants.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | #include "cookies/cookie_constants.h" 7 | #include "third_party/glog/logging.h" 8 | 9 | 10 | namespace net { 11 | 12 | namespace { 13 | const char kPriorityLow[] = "low"; 14 | const char kPriorityMedium[] = "medium"; 15 | const char kPriorityHigh[] = "high"; 16 | } // namespace 17 | 18 | const std::string CookiePriorityToString(CookiePriority priority) { 19 | switch(priority) { 20 | case COOKIE_PRIORITY_HIGH: 21 | return kPriorityHigh; 22 | case COOKIE_PRIORITY_MEDIUM: 23 | return kPriorityMedium; 24 | case COOKIE_PRIORITY_LOW: 25 | return kPriorityLow; 26 | default: 27 | NOTREACHED(); 28 | } 29 | return std::string(); 30 | } 31 | 32 | CookiePriority StringToCookiePriority(const std::string& priority) { 33 | std::string priority_comp(priority); 34 | priority_comp = ToLower(priority_comp); 35 | 36 | if (priority_comp == kPriorityHigh) 37 | return COOKIE_PRIORITY_HIGH; 38 | if (priority_comp == kPriorityMedium) 39 | return COOKIE_PRIORITY_MEDIUM; 40 | if (priority_comp == kPriorityLow) 41 | return COOKIE_PRIORITY_LOW; 42 | 43 | return COOKIE_PRIORITY_DEFAULT; 44 | } 45 | std::string ToLower(const std::string& seque){ 46 | if (!seque.size()){ 47 | return ""; 48 | } 49 | std::string var_seque = seque; 50 | std::transform(var_seque.begin(), var_seque.end(), var_seque.begin(), ::tolower); 51 | return var_seque; 52 | } 53 | 54 | } // namespace net 55 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/cookie_constants.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef NET_COOKIES_COOKIE_CONSTANTS_H_ 6 | #define NET_COOKIES_COOKIE_CONSTANTS_H_ 7 | 8 | #include 9 | 10 | namespace net { 11 | 12 | enum CookiePriority { 13 | COOKIE_PRIORITY_LOW = 0, 14 | COOKIE_PRIORITY_MEDIUM = 1, 15 | COOKIE_PRIORITY_HIGH = 2, 16 | COOKIE_PRIORITY_DEFAULT = COOKIE_PRIORITY_MEDIUM 17 | }; 18 | 19 | // Returns the Set-Cookie header priority token corresponding to |priority|. 20 | const std::string CookiePriorityToString(CookiePriority priority); 21 | 22 | // Converts the Set-Cookie header priority token |priority| to a CookiePriority. 23 | // Defaults to COOKIE_PRIORITY_DEFAULT for empty or unrecognized strings. 24 | CookiePriority StringToCookiePriority(const std::string& priority); 25 | std::string ToLower(const std::string& seque); 26 | } // namespace net 27 | 28 | #endif // NET_COOKIES_COOKIE_CONSTANTS_H_ 29 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/cookie_constants_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "base/basictypes.h" 6 | #include "net/cookies/cookie_constants.h" 7 | #include "testing/gtest/include/gtest/gtest.h" 8 | 9 | namespace net { 10 | 11 | TEST(CookieConstantsTest, TestCookiePriority) { 12 | // Basic cases. 13 | EXPECT_EQ("low", CookiePriorityToString(COOKIE_PRIORITY_LOW)); 14 | EXPECT_EQ("medium", CookiePriorityToString(COOKIE_PRIORITY_MEDIUM)); 15 | EXPECT_EQ("high", CookiePriorityToString(COOKIE_PRIORITY_HIGH)); 16 | 17 | EXPECT_EQ(COOKIE_PRIORITY_LOW, StringToCookiePriority("low")); 18 | EXPECT_EQ(COOKIE_PRIORITY_MEDIUM, StringToCookiePriority("medium")); 19 | EXPECT_EQ(COOKIE_PRIORITY_HIGH, StringToCookiePriority("high")); 20 | 21 | // Case Insensitivity of StringToCookiePriority(). 22 | EXPECT_EQ(COOKIE_PRIORITY_LOW, StringToCookiePriority("LOW")); 23 | EXPECT_EQ(COOKIE_PRIORITY_MEDIUM, StringToCookiePriority("Medium")); 24 | EXPECT_EQ(COOKIE_PRIORITY_HIGH, StringToCookiePriority("hiGH")); 25 | 26 | // Value of default priority. 27 | EXPECT_EQ(COOKIE_PRIORITY_DEFAULT, COOKIE_PRIORITY_MEDIUM); 28 | 29 | // Numeric values. 30 | EXPECT_LT(COOKIE_PRIORITY_LOW, COOKIE_PRIORITY_MEDIUM); 31 | EXPECT_LT(COOKIE_PRIORITY_MEDIUM, COOKIE_PRIORITY_HIGH); 32 | 33 | // Unrecognized tokens are interpreted as COOKIE_PRIORITY_DEFAULT. 34 | const char* bad_tokens[] = {"", "lo", "lowerest", "high ", " high", "0"}; 35 | for (size_t i = 0; i < arraysize(bad_tokens); ++i) { 36 | EXPECT_EQ(COOKIE_PRIORITY_DEFAULT, StringToCookiePriority(bad_tokens[i])); 37 | } 38 | } 39 | 40 | } // namespace net 41 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/cookie_options.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // Brought to you by number 42. 6 | 7 | #ifndef NET_COOKIES_COOKIE_OPTIONS_H_ 8 | #define NET_COOKIES_COOKIE_OPTIONS_H_ 9 | 10 | namespace net { 11 | 12 | class CookieOptions { 13 | public: 14 | // Default is to exclude httponly, which means: 15 | // - reading operations will not return httponly cookies. 16 | // - writing operations will not write httponly cookies. 17 | CookieOptions() 18 | : exclude_httponly_(true), 19 | server_time_() { 20 | } 21 | 22 | void set_exclude_httponly() { exclude_httponly_ = true; } 23 | void set_include_httponly() { exclude_httponly_ = false; } 24 | bool exclude_httponly() const { return exclude_httponly_; } 25 | 26 | // |server_time| indicates what the server sending us the Cookie thought the 27 | // current time was when the cookie was produced. This is used to adjust for 28 | // clock skew between server and host. 29 | void set_server_time(const base::Time& server_time) { 30 | server_time_ = server_time; 31 | } 32 | bool has_server_time() const { return !server_time_.is_null(); } 33 | base::Time server_time() const { return server_time_; } 34 | 35 | private: 36 | bool exclude_httponly_; 37 | base::Time server_time_; 38 | }; 39 | } // namespace net 40 | 41 | #endif // NET_COOKIES_COOKIE_OPTIONS_H_ 42 | 43 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/cookie_store.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "net/cookies/cookie_store.h" 6 | 7 | #include "net/cookies/cookie_options.h" 8 | 9 | namespace net { 10 | 11 | CookieStore::CookieStore() {} 12 | 13 | CookieStore::~CookieStore() {} 14 | 15 | } // namespace net 16 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/cookie_store.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // Brought to you by number 42. 6 | 7 | #ifndef NET_COOKIES_COOKIE_STORE_H_ 8 | #define NET_COOKIES_COOKIE_STORE_H_ 9 | 10 | #include 11 | #include 12 | 13 | #include "base/basictypes.h" 14 | #include "base/callback.h" 15 | #include "base/memory/ref_counted.h" 16 | #include "base/time/time.h" 17 | #include "net/base/net_export.h" 18 | #include "net/cookies/canonical_cookie.h" 19 | #include "net/cookies/cookie_options.h" 20 | 21 | class GURL; 22 | 23 | namespace net { 24 | 25 | class CookieMonster; 26 | 27 | // An interface for storing and retrieving cookies. Implementations need to 28 | // be thread safe as its methods can be accessed from IO as well as UI threads. 29 | class NET_EXPORT CookieStore : public base::RefCountedThreadSafe { 30 | public: 31 | // Callback definitions. 32 | typedef base::Callback GetCookieListCallback; 33 | typedef base::Callback GetCookiesCallback; 34 | typedef base::Callback SetCookiesCallback; 35 | typedef base::Callback DeleteCallback; 36 | 37 | // Sets a single cookie. Expects a cookie line, like "a=1; domain=b.com". 38 | // 39 | // Fails either if the cookie is invalid or if this is a non-HTTPONLY cookie 40 | // and it would overwrite an existing HTTPONLY cookie. 41 | // Returns true if the cookie is successfully set. 42 | virtual void SetCookieWithOptionsAsync( 43 | const GURL& url, 44 | const std::string& cookie_line, 45 | const CookieOptions& options, 46 | const SetCookiesCallback& callback) = 0; 47 | 48 | // TODO(???): what if the total size of all the cookies >4k, can we have a 49 | // header that big or do we need multiple Cookie: headers? 50 | // Note: Some sites, such as Facebook, occasionally use Cookie headers >4k. 51 | // 52 | // Simple interface, gets a cookie string "a=b; c=d" for the given URL. 53 | // Use options to access httponly cookies. 54 | virtual void GetCookiesWithOptionsAsync( 55 | const GURL& url, 56 | const CookieOptions& options, 57 | const GetCookiesCallback& callback) = 0; 58 | 59 | // Returns all matching cookies without marking them as accessed, 60 | // including HTTP only cookies. 61 | virtual void GetAllCookiesForURLAsync( 62 | const GURL& url, 63 | const GetCookieListCallback& callback) = 0; 64 | 65 | // Deletes the passed in cookie for the specified URL. 66 | virtual void DeleteCookieAsync(const GURL& url, 67 | const std::string& cookie_name, 68 | const base::Closure& callback) = 0; 69 | 70 | // Deletes all of the cookies that have a creation_date greater than or equal 71 | // to |delete_begin| and less than |delete_end| 72 | // Returns the number of cookies that have been deleted. 73 | virtual void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin, 74 | const base::Time& delete_end, 75 | const DeleteCallback& callback) = 0; 76 | 77 | // Deletes all of the cookies that match the host of the given URL 78 | // regardless of path and that have a creation_date greater than or 79 | // equal to |delete_begin| and less then |delete_end|. This includes 80 | // all http_only and secure cookies, but does not include any domain 81 | // cookies that may apply to this host. 82 | // Returns the number of cookies deleted. 83 | virtual void DeleteAllCreatedBetweenForHostAsync( 84 | const base::Time delete_begin, 85 | const base::Time delete_end, 86 | const GURL& url, 87 | const DeleteCallback& callback) = 0; 88 | 89 | virtual void DeleteSessionCookiesAsync(const DeleteCallback&) = 0; 90 | 91 | // Returns the underlying CookieMonster. 92 | virtual CookieMonster* GetCookieMonster() = 0; 93 | 94 | protected: 95 | friend class base::RefCountedThreadSafe; 96 | CookieStore(); 97 | virtual ~CookieStore(); 98 | }; 99 | 100 | } // namespace net 101 | 102 | #endif // NET_COOKIES_COOKIE_STORE_H_ 103 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/cookie_store_test_callbacks.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "net/cookies/cookie_store_test_callbacks.h" 6 | 7 | #include "base/message_loop/message_loop.h" 8 | #include "base/threading/thread.h" 9 | #include "testing/gtest/include/gtest/gtest.h" 10 | 11 | namespace net { 12 | 13 | CookieCallback::CookieCallback(base::Thread* run_in_thread) 14 | : did_run_(false), 15 | run_in_thread_(run_in_thread), 16 | run_in_loop_(NULL), 17 | parent_loop_(base::MessageLoop::current()), 18 | loop_to_quit_(base::MessageLoop::current()) {} 19 | 20 | CookieCallback::CookieCallback() 21 | : did_run_(false), 22 | run_in_thread_(NULL), 23 | run_in_loop_(base::MessageLoop::current()), 24 | parent_loop_(NULL), 25 | loop_to_quit_(base::MessageLoop::current()) {} 26 | 27 | void CookieCallback::CallbackEpilogue() { 28 | base::MessageLoop* expected_loop = NULL; 29 | if (run_in_thread_) { 30 | DCHECK(!run_in_loop_); 31 | expected_loop = run_in_thread_->message_loop(); 32 | } else if (run_in_loop_) { 33 | expected_loop = run_in_loop_; 34 | } 35 | ASSERT_TRUE(expected_loop != NULL); 36 | 37 | did_run_ = true; 38 | EXPECT_EQ(expected_loop, base::MessageLoop::current()); 39 | loop_to_quit_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); 40 | } 41 | 42 | StringResultCookieCallback::StringResultCookieCallback() {} 43 | StringResultCookieCallback::StringResultCookieCallback( 44 | base::Thread* run_in_thread) 45 | : CookieCallback(run_in_thread) {} 46 | 47 | NoResultCookieCallback::NoResultCookieCallback() {} 48 | NoResultCookieCallback::NoResultCookieCallback(base::Thread* run_in_thread) 49 | : CookieCallback(run_in_thread) {} 50 | 51 | } // namespace net 52 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/cookie_store_test_callbacks.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef NET_COOKIES_COOKIE_STORE_TEST_CALLBACKS_H_ 6 | #define NET_COOKIES_COOKIE_STORE_TEST_CALLBACKS_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include "net/cookies/cookie_store.h" 12 | 13 | namespace base { 14 | class MessageLoop; 15 | class Thread; 16 | } 17 | 18 | namespace net { 19 | 20 | // Defines common behaviour for the callbacks from GetCookies, SetCookies, etc. 21 | // Asserts that the current thread is the expected invocation thread, sends a 22 | // quit to the thread in which it was constructed. 23 | class CookieCallback { 24 | public: 25 | // Indicates whether the callback has been called. 26 | bool did_run() { return did_run_; } 27 | 28 | protected: 29 | // Constructs a callback that expects to be called in the given thread and 30 | // will, upon execution, send a QUIT to the constructing thread. 31 | explicit CookieCallback(base::Thread* run_in_thread); 32 | 33 | // Constructs a callback that expects to be called in current thread and will 34 | // send a QUIT to the constructing thread. 35 | CookieCallback(); 36 | 37 | // Tests whether the current thread was the caller's thread. 38 | // Sends a QUIT to the constructing thread. 39 | void CallbackEpilogue(); 40 | 41 | private: 42 | bool did_run_; 43 | base::Thread* run_in_thread_; 44 | base::MessageLoop* run_in_loop_; 45 | base::MessageLoop* parent_loop_; 46 | base::MessageLoop* loop_to_quit_; 47 | }; 48 | 49 | // Callback implementations for the asynchronous CookieStore methods. 50 | 51 | template 52 | class ResultSavingCookieCallback : public CookieCallback { 53 | public: 54 | ResultSavingCookieCallback() { 55 | } 56 | explicit ResultSavingCookieCallback(base::Thread* run_in_thread) 57 | : CookieCallback(run_in_thread) { 58 | } 59 | 60 | void Run(T result) { 61 | result_ = result; 62 | CallbackEpilogue(); 63 | } 64 | 65 | const T& result() { return result_; } 66 | 67 | private: 68 | T result_; 69 | }; 70 | 71 | class StringResultCookieCallback : public CookieCallback { 72 | public: 73 | StringResultCookieCallback(); 74 | explicit StringResultCookieCallback(base::Thread* run_in_thread); 75 | 76 | void Run(const std::string& result) { 77 | result_ = result; 78 | CallbackEpilogue(); 79 | } 80 | 81 | const std::string& result() { return result_; } 82 | 83 | private: 84 | std::string result_; 85 | }; 86 | 87 | class NoResultCookieCallback : public CookieCallback { 88 | public: 89 | NoResultCookieCallback(); 90 | explicit NoResultCookieCallback(base::Thread* run_in_thread); 91 | 92 | void Run() { 93 | CallbackEpilogue(); 94 | } 95 | }; 96 | 97 | } // namespace net 98 | 99 | #endif // NET_COOKIES_COOKIE_STORE_TEST_CALLBACKS_H_ 100 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/cookie_store_test_helpers.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "net/cookies/cookie_store_test_helpers.h" 6 | 7 | #include "base/bind.h" 8 | #include "base/message_loop/message_loop.h" 9 | 10 | namespace net { 11 | 12 | const int kDelayedTime = 0; 13 | 14 | DelayedCookieMonster::DelayedCookieMonster() 15 | : cookie_monster_(new CookieMonster(NULL, NULL)), 16 | did_run_(false), 17 | result_(false) { 18 | } 19 | 20 | DelayedCookieMonster::~DelayedCookieMonster() { 21 | } 22 | 23 | void DelayedCookieMonster::SetCookiesInternalCallback(bool result) { 24 | result_ = result; 25 | did_run_ = true; 26 | } 27 | 28 | void DelayedCookieMonster::GetCookiesWithOptionsInternalCallback( 29 | const std::string& cookie) { 30 | cookie_ = cookie; 31 | did_run_ = true; 32 | } 33 | 34 | void DelayedCookieMonster::SetCookieWithOptionsAsync( 35 | const GURL& url, 36 | const std::string& cookie_line, 37 | const CookieOptions& options, 38 | const CookieMonster::SetCookiesCallback& callback) { 39 | did_run_ = false; 40 | cookie_monster_->SetCookieWithOptionsAsync( 41 | url, cookie_line, options, 42 | base::Bind(&DelayedCookieMonster::SetCookiesInternalCallback, 43 | base::Unretained(this))); 44 | DCHECK_EQ(did_run_, true); 45 | base::MessageLoop::current()->PostDelayedTask( 46 | FROM_HERE, 47 | base::Bind(&DelayedCookieMonster::InvokeSetCookiesCallback, 48 | base::Unretained(this), 49 | callback), 50 | base::TimeDelta::FromMilliseconds(kDelayedTime)); 51 | } 52 | 53 | void DelayedCookieMonster::GetCookiesWithOptionsAsync( 54 | const GURL& url, 55 | const CookieOptions& options, 56 | const CookieMonster::GetCookiesCallback& callback) { 57 | did_run_ = false; 58 | cookie_monster_->GetCookiesWithOptionsAsync( 59 | url, options, 60 | base::Bind(&DelayedCookieMonster::GetCookiesWithOptionsInternalCallback, 61 | base::Unretained(this))); 62 | DCHECK_EQ(did_run_, true); 63 | base::MessageLoop::current()->PostDelayedTask( 64 | FROM_HERE, 65 | base::Bind(&DelayedCookieMonster::InvokeGetCookieStringCallback, 66 | base::Unretained(this), 67 | callback), 68 | base::TimeDelta::FromMilliseconds(kDelayedTime)); 69 | } 70 | 71 | void DelayedCookieMonster::GetAllCookiesForURLAsync( 72 | const GURL& url, 73 | const GetCookieListCallback& callback) { 74 | cookie_monster_->GetAllCookiesForURLAsync(url, callback); 75 | } 76 | 77 | void DelayedCookieMonster::InvokeSetCookiesCallback( 78 | const CookieMonster::SetCookiesCallback& callback) { 79 | if (!callback.is_null()) 80 | callback.Run(result_); 81 | } 82 | 83 | void DelayedCookieMonster::InvokeGetCookieStringCallback( 84 | const CookieMonster::GetCookiesCallback& callback) { 85 | if (!callback.is_null()) 86 | callback.Run(cookie_); 87 | } 88 | 89 | bool DelayedCookieMonster::SetCookieWithOptions( 90 | const GURL& url, 91 | const std::string& cookie_line, 92 | const CookieOptions& options) { 93 | ADD_FAILURE(); 94 | return false; 95 | } 96 | 97 | std::string DelayedCookieMonster::GetCookiesWithOptions( 98 | const GURL& url, 99 | const CookieOptions& options) { 100 | ADD_FAILURE(); 101 | return std::string(); 102 | } 103 | 104 | void DelayedCookieMonster::DeleteCookie(const GURL& url, 105 | const std::string& cookie_name) { 106 | ADD_FAILURE(); 107 | } 108 | 109 | void DelayedCookieMonster::DeleteCookieAsync(const GURL& url, 110 | const std::string& cookie_name, 111 | const base::Closure& callback) { 112 | ADD_FAILURE(); 113 | } 114 | 115 | void DelayedCookieMonster::DeleteAllCreatedBetweenAsync( 116 | const base::Time& delete_begin, 117 | const base::Time& delete_end, 118 | const DeleteCallback& callback) { 119 | ADD_FAILURE(); 120 | } 121 | 122 | void DelayedCookieMonster::DeleteAllCreatedBetweenForHostAsync( 123 | const base::Time delete_begin, 124 | const base::Time delete_end, 125 | const GURL& url, 126 | const DeleteCallback& callback) { 127 | ADD_FAILURE(); 128 | } 129 | 130 | void DelayedCookieMonster::DeleteSessionCookiesAsync(const DeleteCallback&) { 131 | ADD_FAILURE(); 132 | } 133 | 134 | CookieMonster* DelayedCookieMonster::GetCookieMonster() { 135 | return cookie_monster_.get(); 136 | } 137 | 138 | } // namespace net 139 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/cookie_store_test_helpers.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ 6 | #define NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ 7 | 8 | #include "net/cookies/cookie_monster.h" 9 | 10 | #include 11 | #include 12 | 13 | #include "base/callback_forward.h" 14 | #include "testing/gtest/include/gtest/gtest.h" 15 | 16 | namespace net { 17 | 18 | class DelayedCookieMonster : public CookieStore { 19 | public: 20 | DelayedCookieMonster(); 21 | 22 | // Call the asynchronous CookieMonster function, expect it to immediately 23 | // invoke the internal callback. 24 | // Post a delayed task to invoke the original callback with the results. 25 | 26 | virtual void SetCookieWithOptionsAsync( 27 | const GURL& url, 28 | const std::string& cookie_line, 29 | const CookieOptions& options, 30 | const CookieMonster::SetCookiesCallback& callback) OVERRIDE; 31 | 32 | virtual void GetCookiesWithOptionsAsync( 33 | const GURL& url, 34 | const CookieOptions& options, 35 | const CookieMonster::GetCookiesCallback& callback) OVERRIDE; 36 | 37 | virtual void GetAllCookiesForURLAsync( 38 | const GURL& url, 39 | const GetCookieListCallback& callback) OVERRIDE; 40 | 41 | virtual bool SetCookieWithOptions(const GURL& url, 42 | const std::string& cookie_line, 43 | const CookieOptions& options); 44 | 45 | virtual std::string GetCookiesWithOptions(const GURL& url, 46 | const CookieOptions& options); 47 | 48 | virtual void DeleteCookie(const GURL& url, 49 | const std::string& cookie_name); 50 | 51 | virtual void DeleteCookieAsync(const GURL& url, 52 | const std::string& cookie_name, 53 | const base::Closure& callback) OVERRIDE; 54 | 55 | virtual void DeleteAllCreatedBetweenAsync( 56 | const base::Time& delete_begin, 57 | const base::Time& delete_end, 58 | const DeleteCallback& callback) OVERRIDE; 59 | 60 | virtual void DeleteAllCreatedBetweenForHostAsync( 61 | const base::Time delete_begin, 62 | const base::Time delete_end, 63 | const GURL& url, 64 | const DeleteCallback& callback) OVERRIDE; 65 | 66 | virtual void DeleteSessionCookiesAsync(const DeleteCallback&) OVERRIDE; 67 | 68 | virtual CookieMonster* GetCookieMonster() OVERRIDE; 69 | 70 | private: 71 | 72 | // Be called immediately from CookieMonster. 73 | 74 | void SetCookiesInternalCallback(bool result); 75 | 76 | void GetCookiesWithOptionsInternalCallback(const std::string& cookie); 77 | 78 | // Invoke the original callbacks. 79 | 80 | void InvokeSetCookiesCallback( 81 | const CookieMonster::SetCookiesCallback& callback); 82 | 83 | void InvokeGetCookieStringCallback( 84 | const CookieMonster::GetCookiesCallback& callback); 85 | 86 | friend class base::RefCountedThreadSafe; 87 | virtual ~DelayedCookieMonster(); 88 | 89 | scoped_refptr cookie_monster_; 90 | 91 | bool did_run_; 92 | bool result_; 93 | std::string cookie_; 94 | std::string cookie_line_; 95 | }; 96 | 97 | } // namespace net 98 | 99 | #endif // NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ 100 | -------------------------------------------------------------------------------- /src/src/third_party/cookies/cookie_util.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef NET_COOKIES_COOKIE_UTIL_H_ 6 | #define NET_COOKIES_COOKIE_UTIL_H_ 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "base/strings/string_piece.h" 13 | #include "base/time/time.h" 14 | #include "net/base/net_export.h" 15 | 16 | class GURL; 17 | 18 | namespace net { 19 | namespace cookie_util { 20 | 21 | // Returns the effective TLD+1 for a given host. This only makes sense for http 22 | // and https schemes. For other schemes, the host will be returned unchanged 23 | // (minus any leading period). 24 | NET_EXPORT std::string GetEffectiveDomain(const std::string& scheme, 25 | const std::string& host); 26 | 27 | // Determine the actual cookie domain based on the domain string passed 28 | // (if any) and the URL from which the cookie came. 29 | // On success returns true, and sets cookie_domain to either a 30 | // -host cookie domain (ex: "google.com") 31 | // -domain cookie domain (ex: ".google.com") 32 | NET_EXPORT bool GetCookieDomainWithString(const GURL& url, 33 | const std::string& domain_string, 34 | std::string* result); 35 | 36 | // Returns true if a domain string represents a host-only cookie, 37 | // i.e. it doesn't begin with a leading '.' character. 38 | NET_EXPORT bool DomainIsHostOnly(const std::string& domain_string); 39 | 40 | // Parses the string with the cookie time (very forgivingly). 41 | NET_EXPORT base::Time ParseCookieTime(const std::string& time_string); 42 | 43 | // Convenience for converting a cookie origin (domain and https pair) to a URL. 44 | NET_EXPORT GURL CookieOriginToURL(const std::string& domain, bool is_https); 45 | 46 | // A ParsedRequestCookie consists of the key and value of the cookie. 47 | typedef std::pair ParsedRequestCookie; 48 | typedef std::vector ParsedRequestCookies; 49 | 50 | // Assumes that |header_value| is the cookie header value of a HTTP Request 51 | // following the cookie-string schema of RFC 6265, section 4.2.1, and returns 52 | // cookie name/value pairs. If cookie values are presented in double quotes, 53 | // these will appear in |parsed_cookies| as well. Assumes that the cookie 54 | // header is written by Chromium and therefore well-formed. 55 | NET_EXPORT void ParseRequestCookieLine(const std::string& header_value, 56 | ParsedRequestCookies* parsed_cookies); 57 | 58 | // Writes all cookies of |parsed_cookies| into a HTTP Request header value 59 | // that belongs to the "Cookie" header. The entries of |parsed_cookies| must 60 | // already be appropriately escaped. 61 | NET_EXPORT std::string SerializeRequestCookieLine( 62 | const ParsedRequestCookies& parsed_cookies); 63 | 64 | } // namespace cookie_util 65 | } // namespace net 66 | 67 | #endif // NET_COOKIES_COOKIE_UTIL_H_ 68 | -------------------------------------------------------------------------------- /src/src/third_party/glog/basictypes.h: -------------------------------------------------------------------------------- 1 | // Copyright 2001 - 2003 Google Inc. All Rights Reserved 2 | 3 | #ifndef BASE_BASICTYPES_H__ 4 | #define BASE_BASICTYPES_H__ 5 | 6 | typedef unsigned char uint8; 7 | typedef unsigned short uint16; 8 | typedef unsigned int uint32; 9 | 10 | const uint8 kuint8max = (( uint8) 0xFF); 11 | const uint32 kuint32max = ((uint32) 0xFFFFFFFF); 12 | 13 | // The arraysize(arr) macro returns the # of elements in an array arr. 14 | // The expression is a compile-time constant, and therefore can be 15 | // used in defining new arrays, for example. If you use arraysize on 16 | // a pointer by mistake, you will get a compile-time error. 17 | // 18 | // One caveat is that arraysize() doesn't accept any array of an 19 | // anonymous type or a type defined inside a function. In these rare 20 | // cases, you have to use the unsafe ARRAYSIZE() macro below. This is 21 | // due to a limitation in C++'s template system. The limitation might 22 | // eventually be removed, but it hasn't happened yet. 23 | 24 | // This template function declaration is used in defining arraysize. 25 | // Note that the function doesn't need an implementation, as we only 26 | // use its type. 27 | template 28 | char (&ArraySizeHelper(T (&array)[N]))[N]; 29 | 30 | // That gcc wants both of these prototypes seems mysterious. VC, for 31 | // its part, can't decide which to use (another mystery). Matching of 32 | // template overloads: the final frontier. 33 | #ifndef _MSC_VER 34 | template 35 | char (&ArraySizeHelper(const T (&array)[N]))[N]; 36 | #endif 37 | 38 | #define arraysize(array) (sizeof(ArraySizeHelper(array))) 39 | 40 | // ARRAYSIZE performs essentially the same calculation as arraysize, 41 | // but can be used on anonymous types or types defined inside 42 | // functions. It's less safe than arraysize as it accepts some 43 | // (although not all) pointers. Therefore, you should use arraysize 44 | // whenever possible. 45 | // 46 | // The expression ARRAYSIZE(a) is a compile-time constant of type 47 | // size_t. 48 | // 49 | // ARRAYSIZE catches a few type errors. If you see a compiler error 50 | // 51 | // "warning: division by zero in ..." 52 | // 53 | // when using ARRAYSIZE, you are (wrongfully) giving it a pointer. 54 | // You should only use ARRAYSIZE on statically allocated arrays. 55 | // 56 | // The following comments are on the implementation details, and can 57 | // be ignored by the users. 58 | // 59 | // ARRAYSIZE(arr) works by inspecting sizeof(arr) (the # of bytes in 60 | // the array) and sizeof(*(arr)) (the # of bytes in one array 61 | // element). If the former is divisible by the latter, perhaps arr is 62 | // indeed an array, in which case the division result is the # of 63 | // elements in the array. Otherwise, arr cannot possibly be an array, 64 | // and we generate a compiler error to prevent the code from 65 | // compiling. 66 | // 67 | // Since the size of bool is implementation-defined, we need to cast 68 | // !(sizeof(a) & sizeof(*(a))) to size_t in order to ensure the final 69 | // result has type size_t. 70 | // 71 | // This macro is not perfect as it wrongfully accepts certain 72 | // pointers, namely where the pointer size is divisible by the pointee 73 | // size. Since all our code has to go through a 32-bit compiler, 74 | // where a pointer is 4 bytes, this means all pointers to a type whose 75 | // size is 3 or greater than 4 will be (righteously) rejected. 76 | // 77 | // Starting with Visual C++ 2005, WinNT.h includes ARRAYSIZE. 78 | #define ARRAYSIZE_UNSAFE(a) \ 79 | ((sizeof(a) / sizeof(*(a))) / \ 80 | static_cast(!(sizeof(a) % sizeof(*(a))))) 81 | 82 | // A macro to disallow the evil copy constructor and operator= functions 83 | // This should be used in the private: declarations for a class 84 | #define DISALLOW_EVIL_CONSTRUCTORS(TypeName) \ 85 | TypeName(const TypeName&); \ 86 | void operator=(const TypeName&) 87 | 88 | #endif // BASE_BASICTYPES_H__ 89 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/aes.h: -------------------------------------------------------------------------------- 1 | /* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ 2 | /* ==================================================================== 3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in 14 | * the documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * 3. All advertising materials mentioning features or use of this 18 | * software must display the following acknowledgment: 19 | * "This product includes software developed by the OpenSSL Project 20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 21 | * 22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 23 | * endorse or promote products derived from this software without 24 | * prior written permission. For written permission, please contact 25 | * openssl-core@openssl.org. 26 | * 27 | * 5. Products derived from this software may not be called "OpenSSL" 28 | * nor may "OpenSSL" appear in their names without prior written 29 | * permission of the OpenSSL Project. 30 | * 31 | * 6. Redistributions of any form whatsoever must retain the following 32 | * acknowledgment: 33 | * "This product includes software developed by the OpenSSL Project 34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 35 | * 36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 47 | * OF THE POSSIBILITY OF SUCH DAMAGE. 48 | * ==================================================================== 49 | * 50 | */ 51 | 52 | #ifndef HEADER_AES_H 53 | #define HEADER_AES_H 54 | 55 | #include 56 | 57 | #ifdef OPENSSL_NO_AES 58 | #error AES is disabled. 59 | #endif 60 | 61 | #include 62 | 63 | #define AES_ENCRYPT 1 64 | #define AES_DECRYPT 0 65 | 66 | /* Because array size can't be a const in C, the following two are macros. 67 | Both sizes are in bytes. */ 68 | #define AES_MAXNR 14 69 | #define AES_BLOCK_SIZE 16 70 | 71 | #ifdef __cplusplus 72 | extern "C" { 73 | #endif 74 | 75 | /* This should be a hidden type, but EVP requires that the size be known */ 76 | struct aes_key_st { 77 | #ifdef AES_LONG 78 | unsigned long rd_key[4 *(AES_MAXNR + 1)]; 79 | #else 80 | unsigned int rd_key[4 *(AES_MAXNR + 1)]; 81 | #endif 82 | int rounds; 83 | }; 84 | typedef struct aes_key_st AES_KEY; 85 | 86 | const char *AES_options(void); 87 | 88 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, 89 | AES_KEY *key); 90 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, 91 | AES_KEY *key); 92 | 93 | int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, 94 | AES_KEY *key); 95 | int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, 96 | AES_KEY *key); 97 | 98 | void AES_encrypt(const unsigned char *in, unsigned char *out, 99 | const AES_KEY *key); 100 | void AES_decrypt(const unsigned char *in, unsigned char *out, 101 | const AES_KEY *key); 102 | 103 | void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, 104 | const AES_KEY *key, const int enc); 105 | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, 106 | size_t length, const AES_KEY *key, 107 | unsigned char *ivec, const int enc); 108 | void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, 109 | size_t length, const AES_KEY *key, 110 | unsigned char *ivec, int *num, const int enc); 111 | void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, 112 | size_t length, const AES_KEY *key, 113 | unsigned char *ivec, int *num, const int enc); 114 | void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, 115 | size_t length, const AES_KEY *key, 116 | unsigned char *ivec, int *num, const int enc); 117 | void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, 118 | size_t length, const AES_KEY *key, 119 | unsigned char *ivec, int *num); 120 | void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, 121 | size_t length, const AES_KEY *key, 122 | unsigned char ivec[AES_BLOCK_SIZE], 123 | unsigned char ecount_buf[AES_BLOCK_SIZE], 124 | unsigned int *num); 125 | /* NB: the IV is _two_ blocks long */ 126 | void AES_ige_encrypt(const unsigned char *in, unsigned char *out, 127 | size_t length, const AES_KEY *key, 128 | unsigned char *ivec, const int enc); 129 | /* NB: the IV is _four_ blocks long */ 130 | void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, 131 | size_t length, const AES_KEY *key, 132 | const AES_KEY *key2, const unsigned char *ivec, 133 | const int enc); 134 | 135 | int AES_wrap_key(AES_KEY *key, const unsigned char *iv, 136 | unsigned char *out, 137 | const unsigned char *in, unsigned int inlen); 138 | int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, 139 | unsigned char *out, 140 | const unsigned char *in, unsigned int inlen); 141 | 142 | 143 | #ifdef __cplusplus 144 | } 145 | #endif 146 | 147 | #endif /* !HEADER_AES_H */ 148 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/blowfish.h: -------------------------------------------------------------------------------- 1 | /* crypto/bf/blowfish.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_BLOWFISH_H 60 | #define HEADER_BLOWFISH_H 61 | 62 | #include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | #ifdef OPENSSL_NO_BF 69 | #error BF is disabled. 70 | #endif 71 | 72 | #define BF_ENCRYPT 1 73 | #define BF_DECRYPT 0 74 | 75 | /* 76 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 77 | * ! BF_LONG has to be at least 32 bits wide. If it's wider, then ! 78 | * ! BF_LONG_LOG2 has to be defined along. ! 79 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 80 | */ 81 | 82 | #if defined(__LP32__) 83 | #define BF_LONG unsigned long 84 | #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 85 | #define BF_LONG unsigned long 86 | #define BF_LONG_LOG2 3 87 | /* 88 | * _CRAY note. I could declare short, but I have no idea what impact 89 | * does it have on performance on none-T3E machines. I could declare 90 | * int, but at least on C90 sizeof(int) can be chosen at compile time. 91 | * So I've chosen long... 92 | * 93 | */ 94 | #else 95 | #define BF_LONG unsigned int 96 | #endif 97 | 98 | #define BF_ROUNDS 16 99 | #define BF_BLOCK 8 100 | 101 | typedef struct bf_key_st 102 | { 103 | BF_LONG P[BF_ROUNDS+2]; 104 | BF_LONG S[4*256]; 105 | } BF_KEY; 106 | 107 | #ifdef OPENSSL_FIPS 108 | void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data); 109 | #endif 110 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data); 111 | 112 | void BF_encrypt(BF_LONG *data,const BF_KEY *key); 113 | void BF_decrypt(BF_LONG *data,const BF_KEY *key); 114 | 115 | void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, 116 | const BF_KEY *key, int enc); 117 | void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 118 | const BF_KEY *schedule, unsigned char *ivec, int enc); 119 | void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length, 120 | const BF_KEY *schedule, unsigned char *ivec, int *num, int enc); 121 | void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, long length, 122 | const BF_KEY *schedule, unsigned char *ivec, int *num); 123 | const char *BF_options(void); 124 | 125 | #ifdef __cplusplus 126 | } 127 | #endif 128 | 129 | #endif 130 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/buffer.h: -------------------------------------------------------------------------------- 1 | /* crypto/buffer/buffer.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_BUFFER_H 60 | #define HEADER_BUFFER_H 61 | 62 | #include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | #include 69 | 70 | #if !defined(NO_SYS_TYPES_H) 71 | #include 72 | #endif 73 | 74 | /* Already declared in ossl_typ.h */ 75 | /* typedef struct buf_mem_st BUF_MEM; */ 76 | 77 | struct buf_mem_st 78 | { 79 | size_t length; /* current number of bytes */ 80 | char *data; 81 | size_t max; /* size of buffer */ 82 | }; 83 | 84 | BUF_MEM *BUF_MEM_new(void); 85 | void BUF_MEM_free(BUF_MEM *a); 86 | int BUF_MEM_grow(BUF_MEM *str, size_t len); 87 | int BUF_MEM_grow_clean(BUF_MEM *str, size_t len); 88 | char * BUF_strdup(const char *str); 89 | char * BUF_strndup(const char *str, size_t siz); 90 | void * BUF_memdup(const void *data, size_t siz); 91 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); 92 | 93 | /* safe string functions */ 94 | size_t BUF_strlcpy(char *dst,const char *src,size_t siz); 95 | size_t BUF_strlcat(char *dst,const char *src,size_t siz); 96 | 97 | 98 | /* BEGIN ERROR CODES */ 99 | /* The following lines are auto generated by the script mkerr.pl. Any changes 100 | * made after this point may be overwritten when the script is next run. 101 | */ 102 | void ERR_load_BUF_strings(void); 103 | 104 | /* Error codes for the BUF functions. */ 105 | 106 | /* Function codes. */ 107 | #define BUF_F_BUF_MEMDUP 103 108 | #define BUF_F_BUF_MEM_GROW 100 109 | #define BUF_F_BUF_MEM_GROW_CLEAN 105 110 | #define BUF_F_BUF_MEM_NEW 101 111 | #define BUF_F_BUF_STRDUP 102 112 | #define BUF_F_BUF_STRNDUP 104 113 | 114 | /* Reason codes. */ 115 | 116 | #ifdef __cplusplus 117 | } 118 | #endif 119 | #endif 120 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/camellia.h: -------------------------------------------------------------------------------- 1 | /* crypto/camellia/camellia.h -*- mode:C; c-file-style: "eay" -*- */ 2 | /* ==================================================================== 3 | * Copyright (c) 2006 The OpenSSL Project. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in 14 | * the documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * 3. All advertising materials mentioning features or use of this 18 | * software must display the following acknowledgment: 19 | * "This product includes software developed by the OpenSSL Project 20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 21 | * 22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 23 | * endorse or promote products derived from this software without 24 | * prior written permission. For written permission, please contact 25 | * openssl-core@openssl.org. 26 | * 27 | * 5. Products derived from this software may not be called "OpenSSL" 28 | * nor may "OpenSSL" appear in their names without prior written 29 | * permission of the OpenSSL Project. 30 | * 31 | * 6. Redistributions of any form whatsoever must retain the following 32 | * acknowledgment: 33 | * "This product includes software developed by the OpenSSL Project 34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 35 | * 36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 47 | * OF THE POSSIBILITY OF SUCH DAMAGE. 48 | * ==================================================================== 49 | * 50 | */ 51 | 52 | #ifndef HEADER_CAMELLIA_H 53 | #define HEADER_CAMELLIA_H 54 | 55 | #include 56 | 57 | #ifdef OPENSSL_NO_CAMELLIA 58 | #error CAMELLIA is disabled. 59 | #endif 60 | 61 | #include 62 | 63 | #define CAMELLIA_ENCRYPT 1 64 | #define CAMELLIA_DECRYPT 0 65 | 66 | /* Because array size can't be a const in C, the following two are macros. 67 | Both sizes are in bytes. */ 68 | 69 | #ifdef __cplusplus 70 | extern "C" { 71 | #endif 72 | 73 | /* This should be a hidden type, but EVP requires that the size be known */ 74 | 75 | #define CAMELLIA_BLOCK_SIZE 16 76 | #define CAMELLIA_TABLE_BYTE_LEN 272 77 | #define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4) 78 | 79 | typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match with WORD */ 80 | 81 | struct camellia_key_st 82 | { 83 | union { 84 | double d; /* ensures 64-bit align */ 85 | KEY_TABLE_TYPE rd_key; 86 | } u; 87 | int grand_rounds; 88 | }; 89 | typedef struct camellia_key_st CAMELLIA_KEY; 90 | 91 | #ifdef OPENSSL_FIPS 92 | int private_Camellia_set_key(const unsigned char *userKey, const int bits, 93 | CAMELLIA_KEY *key); 94 | #endif 95 | int Camellia_set_key(const unsigned char *userKey, const int bits, 96 | CAMELLIA_KEY *key); 97 | 98 | void Camellia_encrypt(const unsigned char *in, unsigned char *out, 99 | const CAMELLIA_KEY *key); 100 | void Camellia_decrypt(const unsigned char *in, unsigned char *out, 101 | const CAMELLIA_KEY *key); 102 | 103 | void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out, 104 | const CAMELLIA_KEY *key, const int enc); 105 | void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out, 106 | size_t length, const CAMELLIA_KEY *key, 107 | unsigned char *ivec, const int enc); 108 | void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out, 109 | size_t length, const CAMELLIA_KEY *key, 110 | unsigned char *ivec, int *num, const int enc); 111 | void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out, 112 | size_t length, const CAMELLIA_KEY *key, 113 | unsigned char *ivec, int *num, const int enc); 114 | void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out, 115 | size_t length, const CAMELLIA_KEY *key, 116 | unsigned char *ivec, int *num, const int enc); 117 | void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out, 118 | size_t length, const CAMELLIA_KEY *key, 119 | unsigned char *ivec, int *num); 120 | void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, 121 | size_t length, const CAMELLIA_KEY *key, 122 | unsigned char ivec[CAMELLIA_BLOCK_SIZE], 123 | unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE], 124 | unsigned int *num); 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #endif /* !HEADER_Camellia_H */ 131 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/cast.h: -------------------------------------------------------------------------------- 1 | /* crypto/cast/cast.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_CAST_H 60 | #define HEADER_CAST_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | #include 67 | 68 | #ifdef OPENSSL_NO_CAST 69 | #error CAST is disabled. 70 | #endif 71 | 72 | #define CAST_ENCRYPT 1 73 | #define CAST_DECRYPT 0 74 | 75 | #define CAST_LONG unsigned int 76 | 77 | #define CAST_BLOCK 8 78 | #define CAST_KEY_LENGTH 16 79 | 80 | typedef struct cast_key_st 81 | { 82 | CAST_LONG data[32]; 83 | int short_key; /* Use reduced rounds for short key */ 84 | } CAST_KEY; 85 | 86 | #ifdef OPENSSL_FIPS 87 | void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); 88 | #endif 89 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); 90 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, const CAST_KEY *key, 91 | int enc); 92 | void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); 93 | void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); 94 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 95 | const CAST_KEY *ks, unsigned char *iv, int enc); 96 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, 97 | long length, const CAST_KEY *schedule, unsigned char *ivec, 98 | int *num, int enc); 99 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, 100 | long length, const CAST_KEY *schedule, unsigned char *ivec, 101 | int *num); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/cmac.h: -------------------------------------------------------------------------------- 1 | /* crypto/cmac/cmac.h */ 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 3 | * project. 4 | */ 5 | /* ==================================================================== 6 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. All advertising materials mentioning features or use of this 21 | * software must display the following acknowledgment: 22 | * "This product includes software developed by the OpenSSL Project 23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 24 | * 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 26 | * endorse or promote products derived from this software without 27 | * prior written permission. For written permission, please contact 28 | * licensing@OpenSSL.org. 29 | * 30 | * 5. Products derived from this software may not be called "OpenSSL" 31 | * nor may "OpenSSL" appear in their names without prior written 32 | * permission of the OpenSSL Project. 33 | * 34 | * 6. Redistributions of any form whatsoever must retain the following 35 | * acknowledgment: 36 | * "This product includes software developed by the OpenSSL Project 37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 38 | * 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50 | * OF THE POSSIBILITY OF SUCH DAMAGE. 51 | * ==================================================================== 52 | */ 53 | 54 | 55 | #ifndef HEADER_CMAC_H 56 | #define HEADER_CMAC_H 57 | 58 | #ifdef __cplusplus 59 | extern "C" { 60 | #endif 61 | 62 | #include 63 | 64 | /* Opaque */ 65 | typedef struct CMAC_CTX_st CMAC_CTX; 66 | 67 | CMAC_CTX *CMAC_CTX_new(void); 68 | void CMAC_CTX_cleanup(CMAC_CTX *ctx); 69 | void CMAC_CTX_free(CMAC_CTX *ctx); 70 | EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); 71 | int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); 72 | 73 | int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, 74 | const EVP_CIPHER *cipher, ENGINE *impl); 75 | int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); 76 | int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); 77 | int CMAC_resume(CMAC_CTX *ctx); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #endif 83 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/comp.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER_COMP_H 3 | #define HEADER_COMP_H 4 | 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef struct comp_ctx_st COMP_CTX; 12 | 13 | typedef struct comp_method_st 14 | { 15 | int type; /* NID for compression library */ 16 | const char *name; /* A text string to identify the library */ 17 | int (*init)(COMP_CTX *ctx); 18 | void (*finish)(COMP_CTX *ctx); 19 | int (*compress)(COMP_CTX *ctx, 20 | unsigned char *out, unsigned int olen, 21 | unsigned char *in, unsigned int ilen); 22 | int (*expand)(COMP_CTX *ctx, 23 | unsigned char *out, unsigned int olen, 24 | unsigned char *in, unsigned int ilen); 25 | /* The following two do NOTHING, but are kept for backward compatibility */ 26 | long (*ctrl)(void); 27 | long (*callback_ctrl)(void); 28 | } COMP_METHOD; 29 | 30 | struct comp_ctx_st 31 | { 32 | COMP_METHOD *meth; 33 | unsigned long compress_in; 34 | unsigned long compress_out; 35 | unsigned long expand_in; 36 | unsigned long expand_out; 37 | 38 | CRYPTO_EX_DATA ex_data; 39 | }; 40 | 41 | 42 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 43 | void COMP_CTX_free(COMP_CTX *ctx); 44 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 45 | unsigned char *in, int ilen); 46 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 47 | unsigned char *in, int ilen); 48 | COMP_METHOD *COMP_rle(void ); 49 | COMP_METHOD *COMP_zlib(void ); 50 | void COMP_zlib_cleanup(void); 51 | 52 | #ifdef HEADER_BIO_H 53 | #ifdef ZLIB 54 | BIO_METHOD *BIO_f_zlib(void); 55 | #endif 56 | #endif 57 | 58 | /* BEGIN ERROR CODES */ 59 | /* The following lines are auto generated by the script mkerr.pl. Any changes 60 | * made after this point may be overwritten when the script is next run. 61 | */ 62 | void ERR_load_COMP_strings(void); 63 | 64 | /* Error codes for the COMP functions. */ 65 | 66 | /* Function codes. */ 67 | #define COMP_F_BIO_ZLIB_FLUSH 99 68 | #define COMP_F_BIO_ZLIB_NEW 100 69 | #define COMP_F_BIO_ZLIB_READ 101 70 | #define COMP_F_BIO_ZLIB_WRITE 102 71 | 72 | /* Reason codes. */ 73 | #define COMP_R_ZLIB_DEFLATE_ERROR 99 74 | #define COMP_R_ZLIB_INFLATE_ERROR 100 75 | #define COMP_R_ZLIB_NOT_SUPPORTED 101 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | #endif 81 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/conf_api.h: -------------------------------------------------------------------------------- 1 | /* conf_api.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_CONF_API_H 60 | #define HEADER_CONF_API_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /* Up until OpenSSL 0.9.5a, this was new_section */ 70 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); 71 | /* Up until OpenSSL 0.9.5a, this was get_section */ 72 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); 73 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */ 74 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, 75 | const char *section); 76 | 77 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); 78 | char *_CONF_get_string(const CONF *conf, const char *section, 79 | const char *name); 80 | long _CONF_get_number(const CONF *conf, const char *section, const char *name); 81 | 82 | int _CONF_new_data(CONF *conf); 83 | void _CONF_free_data(CONF *conf); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | #define HEADER_EBCDIC_H 5 | 6 | #include 7 | 8 | /* Avoid name clashes with other applications */ 9 | #define os_toascii _openssl_os_toascii 10 | #define os_toebcdic _openssl_os_toebcdic 11 | #define ebcdic2ascii _openssl_ebcdic2ascii 12 | #define ascii2ebcdic _openssl_ascii2ebcdic 13 | 14 | extern const unsigned char os_toascii[256]; 15 | extern const unsigned char os_toebcdic[256]; 16 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 17 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/ecdh.h: -------------------------------------------------------------------------------- 1 | /* crypto/ecdh/ecdh.h */ 2 | /* ==================================================================== 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 4 | * 5 | * The Elliptic Curve Public-Key Crypto Library (ECC Code) included 6 | * herein is developed by SUN MICROSYSTEMS, INC., and is contributed 7 | * to the OpenSSL project. 8 | * 9 | * The ECC Code is licensed pursuant to the OpenSSL open source 10 | * license provided below. 11 | * 12 | * The ECDH software is originally written by Douglas Stebila of 13 | * Sun Microsystems Laboratories. 14 | * 15 | */ 16 | /* ==================================================================== 17 | * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. 18 | * 19 | * Redistribution and use in source and binary forms, with or without 20 | * modification, are permitted provided that the following conditions 21 | * are met: 22 | * 23 | * 1. Redistributions of source code must retain the above copyright 24 | * notice, this list of conditions and the following disclaimer. 25 | * 26 | * 2. Redistributions in binary form must reproduce the above copyright 27 | * notice, this list of conditions and the following disclaimer in 28 | * the documentation and/or other materials provided with the 29 | * distribution. 30 | * 31 | * 3. All advertising materials mentioning features or use of this 32 | * software must display the following acknowledgment: 33 | * "This product includes software developed by the OpenSSL Project 34 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 35 | * 36 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 37 | * endorse or promote products derived from this software without 38 | * prior written permission. For written permission, please contact 39 | * licensing@OpenSSL.org. 40 | * 41 | * 5. Products derived from this software may not be called "OpenSSL" 42 | * nor may "OpenSSL" appear in their names without prior written 43 | * permission of the OpenSSL Project. 44 | * 45 | * 6. Redistributions of any form whatsoever must retain the following 46 | * acknowledgment: 47 | * "This product includes software developed by the OpenSSL Project 48 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 49 | * 50 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 51 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 52 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 53 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 54 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 55 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 56 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 57 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 59 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 60 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 61 | * OF THE POSSIBILITY OF SUCH DAMAGE. 62 | * ==================================================================== 63 | * 64 | * This product includes cryptographic software written by Eric Young 65 | * (eay@cryptsoft.com). This product includes software written by Tim 66 | * Hudson (tjh@cryptsoft.com). 67 | * 68 | */ 69 | #ifndef HEADER_ECDH_H 70 | #define HEADER_ECDH_H 71 | 72 | #include 73 | 74 | #ifdef OPENSSL_NO_ECDH 75 | #error ECDH is disabled. 76 | #endif 77 | 78 | #include 79 | #include 80 | #ifndef OPENSSL_NO_DEPRECATED 81 | #include 82 | #endif 83 | 84 | #ifdef __cplusplus 85 | extern "C" { 86 | #endif 87 | 88 | const ECDH_METHOD *ECDH_OpenSSL(void); 89 | 90 | void ECDH_set_default_method(const ECDH_METHOD *); 91 | const ECDH_METHOD *ECDH_get_default_method(void); 92 | int ECDH_set_method(EC_KEY *, const ECDH_METHOD *); 93 | 94 | int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, 95 | void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)); 96 | 97 | int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new 98 | *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 99 | int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg); 100 | void *ECDH_get_ex_data(EC_KEY *d, int idx); 101 | 102 | 103 | /* BEGIN ERROR CODES */ 104 | /* The following lines are auto generated by the script mkerr.pl. Any changes 105 | * made after this point may be overwritten when the script is next run. 106 | */ 107 | void ERR_load_ECDH_strings(void); 108 | 109 | /* Error codes for the ECDH functions. */ 110 | 111 | /* Function codes. */ 112 | #define ECDH_F_ECDH_CHECK 102 113 | #define ECDH_F_ECDH_COMPUTE_KEY 100 114 | #define ECDH_F_ECDH_DATA_NEW_METHOD 101 115 | 116 | /* Reason codes. */ 117 | #define ECDH_R_KDF_FAILED 102 118 | #define ECDH_R_NON_FIPS_METHOD 103 119 | #define ECDH_R_NO_PRIVATE_VALUE 100 120 | #define ECDH_R_POINT_ARITHMETIC_FAILURE 101 121 | 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | #endif 126 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/hmac.h: -------------------------------------------------------------------------------- 1 | /* crypto/hmac/hmac.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | #ifndef HEADER_HMAC_H 59 | #define HEADER_HMAC_H 60 | 61 | #include 62 | 63 | #ifdef OPENSSL_NO_HMAC 64 | #error HMAC is disabled. 65 | #endif 66 | 67 | #include 68 | 69 | #define HMAC_MAX_MD_CBLOCK 128 /* largest known is SHA512 */ 70 | 71 | #ifdef __cplusplus 72 | extern "C" { 73 | #endif 74 | 75 | typedef struct hmac_ctx_st 76 | { 77 | const EVP_MD *md; 78 | EVP_MD_CTX md_ctx; 79 | EVP_MD_CTX i_ctx; 80 | EVP_MD_CTX o_ctx; 81 | unsigned int key_length; 82 | unsigned char key[HMAC_MAX_MD_CBLOCK]; 83 | } HMAC_CTX; 84 | 85 | #define HMAC_size(e) (EVP_MD_size((e)->md)) 86 | 87 | 88 | void HMAC_CTX_init(HMAC_CTX *ctx); 89 | void HMAC_CTX_cleanup(HMAC_CTX *ctx); 90 | 91 | #define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */ 92 | 93 | int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, 94 | const EVP_MD *md); /* deprecated */ 95 | int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, 96 | const EVP_MD *md, ENGINE *impl); 97 | int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); 98 | int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); 99 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, 100 | const unsigned char *d, size_t n, unsigned char *md, 101 | unsigned int *md_len); 102 | int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); 103 | 104 | void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); 105 | 106 | #ifdef __cplusplus 107 | } 108 | #endif 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/idea.h: -------------------------------------------------------------------------------- 1 | /* crypto/idea/idea.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_IDEA_H 60 | #define HEADER_IDEA_H 61 | 62 | #include /* IDEA_INT, OPENSSL_NO_IDEA */ 63 | 64 | #ifdef OPENSSL_NO_IDEA 65 | #error IDEA is disabled. 66 | #endif 67 | 68 | #define IDEA_ENCRYPT 1 69 | #define IDEA_DECRYPT 0 70 | 71 | #define IDEA_BLOCK 8 72 | #define IDEA_KEY_LENGTH 16 73 | 74 | #ifdef __cplusplus 75 | extern "C" { 76 | #endif 77 | 78 | typedef struct idea_key_st 79 | { 80 | IDEA_INT data[9][6]; 81 | } IDEA_KEY_SCHEDULE; 82 | 83 | const char *idea_options(void); 84 | void idea_ecb_encrypt(const unsigned char *in, unsigned char *out, 85 | IDEA_KEY_SCHEDULE *ks); 86 | #ifdef OPENSSL_FIPS 87 | void private_idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); 88 | #endif 89 | void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); 90 | void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); 91 | void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, 92 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,int enc); 93 | void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out, 94 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 95 | int *num,int enc); 96 | void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out, 97 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num); 98 | void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/md4.h: -------------------------------------------------------------------------------- 1 | /* crypto/md4/md4.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MD4_H 60 | #define HEADER_MD4_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | #ifdef OPENSSL_NO_MD4 70 | #error MD4 is disabled. 71 | #endif 72 | 73 | /* 74 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 75 | * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then ! 76 | * ! MD4_LONG_LOG2 has to be defined along. ! 77 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 78 | */ 79 | 80 | #if defined(__LP32__) 81 | #define MD4_LONG unsigned long 82 | #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 83 | #define MD4_LONG unsigned long 84 | #define MD4_LONG_LOG2 3 85 | /* 86 | * _CRAY note. I could declare short, but I have no idea what impact 87 | * does it have on performance on none-T3E machines. I could declare 88 | * int, but at least on C90 sizeof(int) can be chosen at compile time. 89 | * So I've chosen long... 90 | * 91 | */ 92 | #else 93 | #define MD4_LONG unsigned int 94 | #endif 95 | 96 | #define MD4_CBLOCK 64 97 | #define MD4_LBLOCK (MD4_CBLOCK/4) 98 | #define MD4_DIGEST_LENGTH 16 99 | 100 | typedef struct MD4state_st 101 | { 102 | MD4_LONG A,B,C,D; 103 | MD4_LONG Nl,Nh; 104 | MD4_LONG data[MD4_LBLOCK]; 105 | unsigned int num; 106 | } MD4_CTX; 107 | 108 | #ifdef OPENSSL_FIPS 109 | int private_MD4_Init(MD4_CTX *c); 110 | #endif 111 | int MD4_Init(MD4_CTX *c); 112 | int MD4_Update(MD4_CTX *c, const void *data, size_t len); 113 | int MD4_Final(unsigned char *md, MD4_CTX *c); 114 | unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); 115 | void MD4_Transform(MD4_CTX *c, const unsigned char *b); 116 | #ifdef __cplusplus 117 | } 118 | #endif 119 | 120 | #endif 121 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/md5.h: -------------------------------------------------------------------------------- 1 | /* crypto/md5/md5.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MD5_H 60 | #define HEADER_MD5_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | #ifdef OPENSSL_NO_MD5 70 | #error MD5 is disabled. 71 | #endif 72 | 73 | /* 74 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 75 | * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then ! 76 | * ! MD5_LONG_LOG2 has to be defined along. ! 77 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 78 | */ 79 | 80 | #if defined(__LP32__) 81 | #define MD5_LONG unsigned long 82 | #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 83 | #define MD5_LONG unsigned long 84 | #define MD5_LONG_LOG2 3 85 | /* 86 | * _CRAY note. I could declare short, but I have no idea what impact 87 | * does it have on performance on none-T3E machines. I could declare 88 | * int, but at least on C90 sizeof(int) can be chosen at compile time. 89 | * So I've chosen long... 90 | * 91 | */ 92 | #else 93 | #define MD5_LONG unsigned int 94 | #endif 95 | 96 | #define MD5_CBLOCK 64 97 | #define MD5_LBLOCK (MD5_CBLOCK/4) 98 | #define MD5_DIGEST_LENGTH 16 99 | 100 | typedef struct MD5state_st 101 | { 102 | MD5_LONG A,B,C,D; 103 | MD5_LONG Nl,Nh; 104 | MD5_LONG data[MD5_LBLOCK]; 105 | unsigned int num; 106 | } MD5_CTX; 107 | 108 | #ifdef OPENSSL_FIPS 109 | int private_MD5_Init(MD5_CTX *c); 110 | #endif 111 | int MD5_Init(MD5_CTX *c); 112 | int MD5_Update(MD5_CTX *c, const void *data, size_t len); 113 | int MD5_Final(unsigned char *md, MD5_CTX *c); 114 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); 115 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); 116 | #ifdef __cplusplus 117 | } 118 | #endif 119 | 120 | #endif 121 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/mdc2.h: -------------------------------------------------------------------------------- 1 | /* crypto/mdc2/mdc2.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MDC2_H 60 | #define HEADER_MDC2_H 61 | 62 | #include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | #ifdef OPENSSL_NO_MDC2 69 | #error MDC2 is disabled. 70 | #endif 71 | 72 | #define MDC2_BLOCK 8 73 | #define MDC2_DIGEST_LENGTH 16 74 | 75 | typedef struct mdc2_ctx_st 76 | { 77 | unsigned int num; 78 | unsigned char data[MDC2_BLOCK]; 79 | DES_cblock h,hh; 80 | int pad_type; /* either 1 or 2, default 1 */ 81 | } MDC2_CTX; 82 | 83 | 84 | #ifdef OPENSSL_FIPS 85 | int private_MDC2_Init(MDC2_CTX *c); 86 | #endif 87 | int MDC2_Init(MDC2_CTX *c); 88 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); 89 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); 90 | unsigned char *MDC2(const unsigned char *d, size_t n, 91 | unsigned char *md); 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif 98 | 99 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/modes.h: -------------------------------------------------------------------------------- 1 | /* ==================================================================== 2 | * Copyright (c) 2008 The OpenSSL Project. All rights reserved. 3 | * 4 | * Rights for redistribution and usage in source and binary 5 | * forms are granted according to the OpenSSL license. 6 | */ 7 | 8 | #include 9 | 10 | typedef void (*block128_f)(const unsigned char in[16], 11 | unsigned char out[16], 12 | const void *key); 13 | 14 | typedef void (*cbc128_f)(const unsigned char *in, unsigned char *out, 15 | size_t len, const void *key, 16 | unsigned char ivec[16], int enc); 17 | 18 | typedef void (*ctr128_f)(const unsigned char *in, unsigned char *out, 19 | size_t blocks, const void *key, 20 | const unsigned char ivec[16]); 21 | 22 | typedef void (*ccm128_f)(const unsigned char *in, unsigned char *out, 23 | size_t blocks, const void *key, 24 | const unsigned char ivec[16],unsigned char cmac[16]); 25 | 26 | void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out, 27 | size_t len, const void *key, 28 | unsigned char ivec[16], block128_f block); 29 | void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, 30 | size_t len, const void *key, 31 | unsigned char ivec[16], block128_f block); 32 | 33 | void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out, 34 | size_t len, const void *key, 35 | unsigned char ivec[16], unsigned char ecount_buf[16], 36 | unsigned int *num, block128_f block); 37 | 38 | void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out, 39 | size_t len, const void *key, 40 | unsigned char ivec[16], unsigned char ecount_buf[16], 41 | unsigned int *num, ctr128_f ctr); 42 | 43 | void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out, 44 | size_t len, const void *key, 45 | unsigned char ivec[16], int *num, 46 | block128_f block); 47 | 48 | void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out, 49 | size_t len, const void *key, 50 | unsigned char ivec[16], int *num, 51 | int enc, block128_f block); 52 | void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out, 53 | size_t length, const void *key, 54 | unsigned char ivec[16], int *num, 55 | int enc, block128_f block); 56 | void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out, 57 | size_t bits, const void *key, 58 | unsigned char ivec[16], int *num, 59 | int enc, block128_f block); 60 | 61 | size_t CRYPTO_cts128_encrypt_block(const unsigned char *in, unsigned char *out, 62 | size_t len, const void *key, 63 | unsigned char ivec[16], block128_f block); 64 | size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out, 65 | size_t len, const void *key, 66 | unsigned char ivec[16], cbc128_f cbc); 67 | size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, unsigned char *out, 68 | size_t len, const void *key, 69 | unsigned char ivec[16], block128_f block); 70 | size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out, 71 | size_t len, const void *key, 72 | unsigned char ivec[16], cbc128_f cbc); 73 | 74 | size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in, unsigned char *out, 75 | size_t len, const void *key, 76 | unsigned char ivec[16], block128_f block); 77 | size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out, 78 | size_t len, const void *key, 79 | unsigned char ivec[16], cbc128_f cbc); 80 | size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in, unsigned char *out, 81 | size_t len, const void *key, 82 | unsigned char ivec[16], block128_f block); 83 | size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out, 84 | size_t len, const void *key, 85 | unsigned char ivec[16], cbc128_f cbc); 86 | 87 | typedef struct gcm128_context GCM128_CONTEXT; 88 | 89 | GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block); 90 | void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx,void *key,block128_f block); 91 | void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv, 92 | size_t len); 93 | int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad, 94 | size_t len); 95 | int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, 96 | const unsigned char *in, unsigned char *out, 97 | size_t len); 98 | int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, 99 | const unsigned char *in, unsigned char *out, 100 | size_t len); 101 | int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, 102 | const unsigned char *in, unsigned char *out, 103 | size_t len, ctr128_f stream); 104 | int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, 105 | const unsigned char *in, unsigned char *out, 106 | size_t len, ctr128_f stream); 107 | int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag, 108 | size_t len); 109 | void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len); 110 | void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx); 111 | 112 | typedef struct ccm128_context CCM128_CONTEXT; 113 | 114 | void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx, 115 | unsigned int M, unsigned int L, void *key,block128_f block); 116 | int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, 117 | const unsigned char *nonce, size_t nlen, size_t mlen); 118 | void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, 119 | const unsigned char *aad, size_t alen); 120 | int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, 121 | const unsigned char *inp, unsigned char *out, size_t len); 122 | int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, 123 | const unsigned char *inp, unsigned char *out, size_t len); 124 | int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, 125 | const unsigned char *inp, unsigned char *out, size_t len, 126 | ccm128_f stream); 127 | int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, 128 | const unsigned char *inp, unsigned char *out, size_t len, 129 | ccm128_f stream); 130 | size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len); 131 | 132 | typedef struct xts128_context XTS128_CONTEXT; 133 | 134 | int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], 135 | const unsigned char *inp, unsigned char *out, size_t len, int enc); 136 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/opensslv.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_OPENSSLV_H 2 | #define HEADER_OPENSSLV_H 3 | 4 | /* Numeric release version identifier: 5 | * MNNFFPPS: major minor fix patch status 6 | * The status nibble has one of the values 0 for development, 1 to e for betas 7 | * 1 to 14, and f for release. The patch level is exactly that. 8 | * For example: 9 | * 0.9.3-dev 0x00903000 10 | * 0.9.3-beta1 0x00903001 11 | * 0.9.3-beta2-dev 0x00903002 12 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) 13 | * 0.9.3 0x0090300f 14 | * 0.9.3a 0x0090301f 15 | * 0.9.4 0x0090400f 16 | * 1.2.3z 0x102031af 17 | * 18 | * For continuity reasons (because 0.9.5 is already out, and is coded 19 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level 20 | * part is slightly different, by setting the highest bit. This means 21 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start 22 | * with 0x0090600S... 23 | * 24 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) 25 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for 26 | * major minor fix final patch/beta) 27 | */ 28 | #define OPENSSL_VERSION_NUMBER 0x1000108fL 29 | #ifdef OPENSSL_FIPS 30 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1h-fips 5 Jun 2014" 31 | #else 32 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1h 5 Jun 2014" 33 | #endif 34 | #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT 35 | 36 | 37 | /* The macros below are to be used for shared library (.so, .dll, ...) 38 | * versioning. That kind of versioning works a bit differently between 39 | * operating systems. The most usual scheme is to set a major and a minor 40 | * number, and have the runtime loader check that the major number is equal 41 | * to what it was at application link time, while the minor number has to 42 | * be greater or equal to what it was at application link time. With this 43 | * scheme, the version number is usually part of the file name, like this: 44 | * 45 | * libcrypto.so.0.9 46 | * 47 | * Some unixen also make a softlink with the major verson number only: 48 | * 49 | * libcrypto.so.0 50 | * 51 | * On Tru64 and IRIX 6.x it works a little bit differently. There, the 52 | * shared library version is stored in the file, and is actually a series 53 | * of versions, separated by colons. The rightmost version present in the 54 | * library when linking an application is stored in the application to be 55 | * matched at run time. When the application is run, a check is done to 56 | * see if the library version stored in the application matches any of the 57 | * versions in the version string of the library itself. 58 | * This version string can be constructed in any way, depending on what 59 | * kind of matching is desired. However, to implement the same scheme as 60 | * the one used in the other unixen, all compatible versions, from lowest 61 | * to highest, should be part of the string. Consecutive builds would 62 | * give the following versions strings: 63 | * 64 | * 3.0 65 | * 3.0:3.1 66 | * 3.0:3.1:3.2 67 | * 4.0 68 | * 4.0:4.1 69 | * 70 | * Notice how version 4 is completely incompatible with version, and 71 | * therefore give the breach you can see. 72 | * 73 | * There may be other schemes as well that I haven't yet discovered. 74 | * 75 | * So, here's the way it works here: first of all, the library version 76 | * number doesn't need at all to match the overall OpenSSL version. 77 | * However, it's nice and more understandable if it actually does. 78 | * The current library version is stored in the macro SHLIB_VERSION_NUMBER, 79 | * which is just a piece of text in the format "M.m.e" (Major, minor, edit). 80 | * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, 81 | * we need to keep a history of version numbers, which is done in the 82 | * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and 83 | * should only keep the versions that are binary compatible with the current. 84 | */ 85 | #define SHLIB_VERSION_HISTORY "" 86 | #define SHLIB_VERSION_NUMBER "1.0.0" 87 | 88 | 89 | #endif /* HEADER_OPENSSLV_H */ 90 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/pem2.h: -------------------------------------------------------------------------------- 1 | /* ==================================================================== 2 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * 3. All advertising materials mentioning features or use of this 17 | * software must display the following acknowledgment: 18 | * "This product includes software developed by the OpenSSL Project 19 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 20 | * 21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 22 | * endorse or promote products derived from this software without 23 | * prior written permission. For written permission, please contact 24 | * licensing@OpenSSL.org. 25 | * 26 | * 5. Products derived from this software may not be called "OpenSSL" 27 | * nor may "OpenSSL" appear in their names without prior written 28 | * permission of the OpenSSL Project. 29 | * 30 | * 6. Redistributions of any form whatsoever must retain the following 31 | * acknowledgment: 32 | * "This product includes software developed by the OpenSSL Project 33 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 46 | * OF THE POSSIBILITY OF SUCH DAMAGE. 47 | * ==================================================================== 48 | * 49 | * This product includes cryptographic software written by Eric Young 50 | * (eay@cryptsoft.com). This product includes software written by Tim 51 | * Hudson (tjh@cryptsoft.com). 52 | * 53 | */ 54 | 55 | /* 56 | * This header only exists to break a circular dependency between pem and err 57 | * Ben 30 Jan 1999. 58 | */ 59 | 60 | #ifdef __cplusplus 61 | extern "C" { 62 | #endif 63 | 64 | #ifndef HEADER_PEM_H 65 | void ERR_load_PEM_strings(void); 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/pqueue.h: -------------------------------------------------------------------------------- 1 | /* crypto/pqueue/pqueue.h */ 2 | /* 3 | * DTLS implementation written by Nagendra Modadugu 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * openssl-core@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | #ifndef HEADER_PQUEUE_H 61 | #define HEADER_PQUEUE_H 62 | 63 | #include 64 | #include 65 | #include 66 | 67 | typedef struct _pqueue *pqueue; 68 | 69 | typedef struct _pitem 70 | { 71 | unsigned char priority[8]; /* 64-bit value in big-endian encoding */ 72 | void *data; 73 | struct _pitem *next; 74 | } pitem; 75 | 76 | typedef struct _pitem *piterator; 77 | 78 | pitem *pitem_new(unsigned char *prio64be, void *data); 79 | void pitem_free(pitem *item); 80 | 81 | pqueue pqueue_new(void); 82 | void pqueue_free(pqueue pq); 83 | 84 | pitem *pqueue_insert(pqueue pq, pitem *item); 85 | pitem *pqueue_peek(pqueue pq); 86 | pitem *pqueue_pop(pqueue pq); 87 | pitem *pqueue_find(pqueue pq, unsigned char *prio64be); 88 | pitem *pqueue_iterator(pqueue pq); 89 | pitem *pqueue_next(piterator *iter); 90 | 91 | void pqueue_print(pqueue pq); 92 | int pqueue_size(pqueue pq); 93 | 94 | #endif /* ! HEADER_PQUEUE_H */ 95 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/rand.h: -------------------------------------------------------------------------------- 1 | /* crypto/rand/rand.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RAND_H 60 | #define HEADER_RAND_H 61 | 62 | #include 63 | #include 64 | #include 65 | 66 | #if defined(OPENSSL_SYS_WINDOWS) 67 | #include 68 | #endif 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif 73 | 74 | #if defined(OPENSSL_FIPS) 75 | #define FIPS_RAND_SIZE_T size_t 76 | #endif 77 | 78 | /* Already defined in ossl_typ.h */ 79 | /* typedef struct rand_meth_st RAND_METHOD; */ 80 | 81 | struct rand_meth_st 82 | { 83 | void (*seed)(const void *buf, int num); 84 | int (*bytes)(unsigned char *buf, int num); 85 | void (*cleanup)(void); 86 | void (*add)(const void *buf, int num, double entropy); 87 | int (*pseudorand)(unsigned char *buf, int num); 88 | int (*status)(void); 89 | }; 90 | 91 | #ifdef BN_DEBUG 92 | extern int rand_predictable; 93 | #endif 94 | 95 | int RAND_set_rand_method(const RAND_METHOD *meth); 96 | const RAND_METHOD *RAND_get_rand_method(void); 97 | #ifndef OPENSSL_NO_ENGINE 98 | int RAND_set_rand_engine(ENGINE *engine); 99 | #endif 100 | RAND_METHOD *RAND_SSLeay(void); 101 | void RAND_cleanup(void ); 102 | int RAND_bytes(unsigned char *buf,int num); 103 | int RAND_pseudo_bytes(unsigned char *buf,int num); 104 | void RAND_seed(const void *buf,int num); 105 | void RAND_add(const void *buf,int num,double entropy); 106 | int RAND_load_file(const char *file,long max_bytes); 107 | int RAND_write_file(const char *file); 108 | const char *RAND_file_name(char *file,size_t num); 109 | int RAND_status(void); 110 | int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); 111 | int RAND_egd(const char *path); 112 | int RAND_egd_bytes(const char *path,int bytes); 113 | int RAND_poll(void); 114 | 115 | #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) 116 | 117 | void RAND_screen(void); 118 | int RAND_event(UINT, WPARAM, LPARAM); 119 | 120 | #endif 121 | 122 | #ifdef OPENSSL_FIPS 123 | void RAND_set_fips_drbg_type(int type, int flags); 124 | int RAND_init_fips(void); 125 | #endif 126 | 127 | /* BEGIN ERROR CODES */ 128 | /* The following lines are auto generated by the script mkerr.pl. Any changes 129 | * made after this point may be overwritten when the script is next run. 130 | */ 131 | void ERR_load_RAND_strings(void); 132 | 133 | /* Error codes for the RAND functions. */ 134 | 135 | /* Function codes. */ 136 | #define RAND_F_RAND_GET_RAND_METHOD 101 137 | #define RAND_F_RAND_INIT_FIPS 102 138 | #define RAND_F_SSLEAY_RAND_BYTES 100 139 | 140 | /* Reason codes. */ 141 | #define RAND_R_DUAL_EC_DRBG_DISABLED 104 142 | #define RAND_R_ERROR_INITIALISING_DRBG 102 143 | #define RAND_R_ERROR_INSTANTIATING_DRBG 103 144 | #define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101 145 | #define RAND_R_PRNG_NOT_SEEDED 100 146 | 147 | #ifdef __cplusplus 148 | } 149 | #endif 150 | #endif 151 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/rc2.h: -------------------------------------------------------------------------------- 1 | /* crypto/rc2/rc2.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RC2_H 60 | #define HEADER_RC2_H 61 | 62 | #include /* OPENSSL_NO_RC2, RC2_INT */ 63 | #ifdef OPENSSL_NO_RC2 64 | #error RC2 is disabled. 65 | #endif 66 | 67 | #define RC2_ENCRYPT 1 68 | #define RC2_DECRYPT 0 69 | 70 | #define RC2_BLOCK 8 71 | #define RC2_KEY_LENGTH 16 72 | 73 | #ifdef __cplusplus 74 | extern "C" { 75 | #endif 76 | 77 | typedef struct rc2_key_st 78 | { 79 | RC2_INT data[64]; 80 | } RC2_KEY; 81 | 82 | #ifdef OPENSSL_FIPS 83 | void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); 84 | #endif 85 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); 86 | void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, 87 | int enc); 88 | void RC2_encrypt(unsigned long *data,RC2_KEY *key); 89 | void RC2_decrypt(unsigned long *data,RC2_KEY *key); 90 | void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 91 | RC2_KEY *ks, unsigned char *iv, int enc); 92 | void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, 93 | long length, RC2_KEY *schedule, unsigned char *ivec, 94 | int *num, int enc); 95 | void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, 96 | long length, RC2_KEY *schedule, unsigned char *ivec, 97 | int *num); 98 | 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/rc4.h: -------------------------------------------------------------------------------- 1 | /* crypto/rc4/rc4.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RC4_H 60 | #define HEADER_RC4_H 61 | 62 | #include /* OPENSSL_NO_RC4, RC4_INT */ 63 | #ifdef OPENSSL_NO_RC4 64 | #error RC4 is disabled. 65 | #endif 66 | 67 | #include 68 | 69 | #ifdef __cplusplus 70 | extern "C" { 71 | #endif 72 | 73 | typedef struct rc4_key_st 74 | { 75 | RC4_INT x,y; 76 | RC4_INT data[256]; 77 | } RC4_KEY; 78 | 79 | 80 | const char *RC4_options(void); 81 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 82 | void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 83 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, 84 | unsigned char *outdata); 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/ripemd.h: -------------------------------------------------------------------------------- 1 | /* crypto/ripemd/ripemd.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RIPEMD_H 60 | #define HEADER_RIPEMD_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | #ifdef OPENSSL_NO_RIPEMD 70 | #error RIPEMD is disabled. 71 | #endif 72 | 73 | #if defined(__LP32__) 74 | #define RIPEMD160_LONG unsigned long 75 | #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 76 | #define RIPEMD160_LONG unsigned long 77 | #define RIPEMD160_LONG_LOG2 3 78 | #else 79 | #define RIPEMD160_LONG unsigned int 80 | #endif 81 | 82 | #define RIPEMD160_CBLOCK 64 83 | #define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) 84 | #define RIPEMD160_DIGEST_LENGTH 20 85 | 86 | typedef struct RIPEMD160state_st 87 | { 88 | RIPEMD160_LONG A,B,C,D,E; 89 | RIPEMD160_LONG Nl,Nh; 90 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; 91 | unsigned int num; 92 | } RIPEMD160_CTX; 93 | 94 | #ifdef OPENSSL_FIPS 95 | int private_RIPEMD160_Init(RIPEMD160_CTX *c); 96 | #endif 97 | int RIPEMD160_Init(RIPEMD160_CTX *c); 98 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); 99 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); 100 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, 101 | unsigned char *md); 102 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/seed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Neither the name of author nor the names of its contributors may 10 | * be used to endorse or promote products derived from this software 11 | * without specific prior written permission. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 17 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 | * SUCH DAMAGE. 24 | * 25 | */ 26 | /* ==================================================================== 27 | * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. 28 | * 29 | * Redistribution and use in source and binary forms, with or without 30 | * modification, are permitted provided that the following conditions 31 | * are met: 32 | * 33 | * 1. Redistributions of source code must retain the above copyright 34 | * notice, this list of conditions and the following disclaimer. 35 | * 36 | * 2. Redistributions in binary form must reproduce the above copyright 37 | * notice, this list of conditions and the following disclaimer in 38 | * the documentation and/or other materials provided with the 39 | * distribution. 40 | * 41 | * 3. All advertising materials mentioning features or use of this 42 | * software must display the following acknowledgment: 43 | * "This product includes software developed by the OpenSSL Project 44 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 45 | * 46 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 47 | * endorse or promote products derived from this software without 48 | * prior written permission. For written permission, please contact 49 | * openssl-core@openssl.org. 50 | * 51 | * 5. Products derived from this software may not be called "OpenSSL" 52 | * nor may "OpenSSL" appear in their names without prior written 53 | * permission of the OpenSSL Project. 54 | * 55 | * 6. Redistributions of any form whatsoever must retain the following 56 | * acknowledgment: 57 | * "This product includes software developed by the OpenSSL Project 58 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 59 | * 60 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 61 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 62 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 63 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 64 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 65 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 66 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 67 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 68 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 69 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 70 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 71 | * OF THE POSSIBILITY OF SUCH DAMAGE. 72 | * ==================================================================== 73 | * 74 | * This product includes cryptographic software written by Eric Young 75 | * (eay@cryptsoft.com). This product includes software written by Tim 76 | * Hudson (tjh@cryptsoft.com). 77 | * 78 | */ 79 | 80 | 81 | #ifndef HEADER_SEED_H 82 | #define HEADER_SEED_H 83 | 84 | #include 85 | #include 86 | #include 87 | 88 | #ifdef OPENSSL_NO_SEED 89 | #error SEED is disabled. 90 | #endif 91 | 92 | #ifdef AES_LONG /* look whether we need 'long' to get 32 bits */ 93 | # ifndef SEED_LONG 94 | # define SEED_LONG 1 95 | # endif 96 | #endif 97 | 98 | #if !defined(NO_SYS_TYPES_H) 99 | # include 100 | #endif 101 | 102 | #define SEED_BLOCK_SIZE 16 103 | #define SEED_KEY_LENGTH 16 104 | 105 | 106 | #ifdef __cplusplus 107 | extern "C" { 108 | #endif 109 | 110 | 111 | typedef struct seed_key_st { 112 | #ifdef SEED_LONG 113 | unsigned long data[32]; 114 | #else 115 | unsigned int data[32]; 116 | #endif 117 | } SEED_KEY_SCHEDULE; 118 | 119 | #ifdef OPENSSL_FIPS 120 | void private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], SEED_KEY_SCHEDULE *ks); 121 | #endif 122 | void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], SEED_KEY_SCHEDULE *ks); 123 | 124 | void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], unsigned char d[SEED_BLOCK_SIZE], const SEED_KEY_SCHEDULE *ks); 125 | void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE], unsigned char d[SEED_BLOCK_SIZE], const SEED_KEY_SCHEDULE *ks); 126 | 127 | void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out, const SEED_KEY_SCHEDULE *ks, int enc); 128 | void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, 129 | size_t len, const SEED_KEY_SCHEDULE *ks, unsigned char ivec[SEED_BLOCK_SIZE], int enc); 130 | void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out, 131 | size_t len, const SEED_KEY_SCHEDULE *ks, unsigned char ivec[SEED_BLOCK_SIZE], int *num, int enc); 132 | void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, 133 | size_t len, const SEED_KEY_SCHEDULE *ks, unsigned char ivec[SEED_BLOCK_SIZE], int *num); 134 | 135 | #ifdef __cplusplus 136 | } 137 | #endif 138 | 139 | #endif /* HEADER_SEED_H */ 140 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/srp.h: -------------------------------------------------------------------------------- 1 | /* crypto/srp/srp.h */ 2 | /* Written by Christophe Renou (christophe.renou@edelweb.fr) with 3 | * the precious help of Peter Sylvester (peter.sylvester@edelweb.fr) 4 | * for the EdelKey project and contributed to the OpenSSL project 2004. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * licensing@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | #ifndef __SRP_H__ 60 | #define __SRP_H__ 61 | 62 | #ifndef OPENSSL_NO_SRP 63 | 64 | #include 65 | #include 66 | 67 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | 71 | #include 72 | #include 73 | #include 74 | 75 | typedef struct SRP_gN_cache_st 76 | { 77 | char *b64_bn; 78 | BIGNUM *bn; 79 | } SRP_gN_cache; 80 | 81 | 82 | DECLARE_STACK_OF(SRP_gN_cache) 83 | 84 | typedef struct SRP_user_pwd_st 85 | { 86 | char *id; 87 | BIGNUM *s; 88 | BIGNUM *v; 89 | const BIGNUM *g; 90 | const BIGNUM *N; 91 | char *info; 92 | } SRP_user_pwd; 93 | 94 | DECLARE_STACK_OF(SRP_user_pwd) 95 | 96 | typedef struct SRP_VBASE_st 97 | { 98 | STACK_OF(SRP_user_pwd) *users_pwd; 99 | STACK_OF(SRP_gN_cache) *gN_cache; 100 | /* to simulate a user */ 101 | char *seed_key; 102 | BIGNUM *default_g; 103 | BIGNUM *default_N; 104 | } SRP_VBASE; 105 | 106 | 107 | /*Structure interne pour retenir les couples N et g*/ 108 | typedef struct SRP_gN_st 109 | { 110 | char *id; 111 | BIGNUM *g; 112 | BIGNUM *N; 113 | } SRP_gN; 114 | 115 | DECLARE_STACK_OF(SRP_gN) 116 | 117 | SRP_VBASE *SRP_VBASE_new(char *seed_key); 118 | int SRP_VBASE_free(SRP_VBASE *vb); 119 | int SRP_VBASE_init(SRP_VBASE *vb, char * verifier_file); 120 | SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username); 121 | char *SRP_create_verifier(const char *user, const char *pass, char **salt, 122 | char **verifier, const char *N, const char *g); 123 | int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, BIGNUM **verifier, BIGNUM *N, BIGNUM *g); 124 | 125 | 126 | #define SRP_NO_ERROR 0 127 | #define SRP_ERR_VBASE_INCOMPLETE_FILE 1 128 | #define SRP_ERR_VBASE_BN_LIB 2 129 | #define SRP_ERR_OPEN_FILE 3 130 | #define SRP_ERR_MEMORY 4 131 | 132 | #define DB_srptype 0 133 | #define DB_srpverifier 1 134 | #define DB_srpsalt 2 135 | #define DB_srpid 3 136 | #define DB_srpgN 4 137 | #define DB_srpinfo 5 138 | #undef DB_NUMBER 139 | #define DB_NUMBER 6 140 | 141 | #define DB_SRP_INDEX 'I' 142 | #define DB_SRP_VALID 'V' 143 | #define DB_SRP_REVOKED 'R' 144 | #define DB_SRP_MODIF 'v' 145 | 146 | 147 | /* see srp.c */ 148 | char * SRP_check_known_gN_param(BIGNUM* g, BIGNUM* N); 149 | SRP_gN *SRP_get_default_gN(const char * id) ; 150 | 151 | /* server side .... */ 152 | BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b, BIGNUM *N); 153 | BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v); 154 | int SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N); 155 | BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N) ; 156 | 157 | 158 | 159 | /* client side .... */ 160 | BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass); 161 | BIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g); 162 | BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x, BIGNUM *a, BIGNUM *u); 163 | int SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N); 164 | 165 | #define SRP_MINIMAL_N 1024 166 | 167 | #ifdef __cplusplus 168 | } 169 | #endif 170 | 171 | #endif 172 | #endif 173 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/ssl23.h: -------------------------------------------------------------------------------- 1 | /* ssl/ssl23.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_SSL23_H 60 | #define HEADER_SSL23_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | /*client */ 67 | /* write to server */ 68 | #define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT) 69 | #define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT) 70 | /* read from server */ 71 | #define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT) 72 | #define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT) 73 | 74 | /* server */ 75 | /* read from client */ 76 | #define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT) 77 | #define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT) 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #endif 83 | 84 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/stack.h: -------------------------------------------------------------------------------- 1 | /* crypto/stack/stack.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_STACK_H 60 | #define HEADER_STACK_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | typedef struct stack_st 67 | { 68 | int num; 69 | char **data; 70 | int sorted; 71 | 72 | int num_alloc; 73 | int (*comp)(const void *, const void *); 74 | } _STACK; /* Use STACK_OF(...) instead */ 75 | 76 | #define M_sk_num(sk) ((sk) ? (sk)->num:-1) 77 | #define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) 78 | 79 | int sk_num(const _STACK *); 80 | void *sk_value(const _STACK *, int); 81 | 82 | void *sk_set(_STACK *, int, void *); 83 | 84 | _STACK *sk_new(int (*cmp)(const void *, const void *)); 85 | _STACK *sk_new_null(void); 86 | void sk_free(_STACK *); 87 | void sk_pop_free(_STACK *st, void (*func)(void *)); 88 | int sk_insert(_STACK *sk, void *data, int where); 89 | void *sk_delete(_STACK *st, int loc); 90 | void *sk_delete_ptr(_STACK *st, void *p); 91 | int sk_find(_STACK *st, void *data); 92 | int sk_find_ex(_STACK *st, void *data); 93 | int sk_push(_STACK *st, void *data); 94 | int sk_unshift(_STACK *st, void *data); 95 | void *sk_shift(_STACK *st); 96 | void *sk_pop(_STACK *st); 97 | void sk_zero(_STACK *st); 98 | int (*sk_set_cmp_func(_STACK *sk, int (*c)(const void *, const void *))) 99 | (const void *, const void *); 100 | _STACK *sk_dup(_STACK *st); 101 | void sk_sort(_STACK *st); 102 | int sk_is_sorted(const _STACK *st); 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/txt_db.h: -------------------------------------------------------------------------------- 1 | /* crypto/txt_db/txt_db.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_TXT_DB_H 60 | #define HEADER_TXT_DB_H 61 | 62 | #include 63 | #ifndef OPENSSL_NO_BIO 64 | #include 65 | #endif 66 | #include 67 | #include 68 | 69 | #define DB_ERROR_OK 0 70 | #define DB_ERROR_MALLOC 1 71 | #define DB_ERROR_INDEX_CLASH 2 72 | #define DB_ERROR_INDEX_OUT_OF_RANGE 3 73 | #define DB_ERROR_NO_INDEX 4 74 | #define DB_ERROR_INSERT_INDEX_CLASH 5 75 | 76 | #ifdef __cplusplus 77 | extern "C" { 78 | #endif 79 | 80 | typedef OPENSSL_STRING *OPENSSL_PSTRING; 81 | DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) 82 | 83 | typedef struct txt_db_st 84 | { 85 | int num_fields; 86 | STACK_OF(OPENSSL_PSTRING) *data; 87 | LHASH_OF(OPENSSL_STRING) **index; 88 | int (**qual)(OPENSSL_STRING *); 89 | long error; 90 | long arg1; 91 | long arg2; 92 | OPENSSL_STRING *arg_row; 93 | } TXT_DB; 94 | 95 | #ifndef OPENSSL_NO_BIO 96 | TXT_DB *TXT_DB_read(BIO *in, int num); 97 | long TXT_DB_write(BIO *out, TXT_DB *db); 98 | #else 99 | TXT_DB *TXT_DB_read(char *in, int num); 100 | long TXT_DB_write(char *out, TXT_DB *db); 101 | #endif 102 | int TXT_DB_create_index(TXT_DB *db,int field,int (*qual)(OPENSSL_STRING *), 103 | LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); 104 | void TXT_DB_free(TXT_DB *db); 105 | OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, OPENSSL_STRING *value); 106 | int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value); 107 | 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | 112 | #endif 113 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/ui_compat.h: -------------------------------------------------------------------------------- 1 | /* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ 2 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL 3 | * project 2001. 4 | */ 5 | /* ==================================================================== 6 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. All advertising materials mentioning features or use of this 21 | * software must display the following acknowledgment: 22 | * "This product includes software developed by the OpenSSL Project 23 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 24 | * 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 26 | * endorse or promote products derived from this software without 27 | * prior written permission. For written permission, please contact 28 | * openssl-core@openssl.org. 29 | * 30 | * 5. Products derived from this software may not be called "OpenSSL" 31 | * nor may "OpenSSL" appear in their names without prior written 32 | * permission of the OpenSSL Project. 33 | * 34 | * 6. Redistributions of any form whatsoever must retain the following 35 | * acknowledgment: 36 | * "This product includes software developed by the OpenSSL Project 37 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 38 | * 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50 | * OF THE POSSIBILITY OF SUCH DAMAGE. 51 | * ==================================================================== 52 | * 53 | * This product includes cryptographic software written by Eric Young 54 | * (eay@cryptsoft.com). This product includes software written by Tim 55 | * Hudson (tjh@cryptsoft.com). 56 | * 57 | */ 58 | 59 | #ifndef HEADER_UI_COMPAT_H 60 | #define HEADER_UI_COMPAT_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /* The following functions were previously part of the DES section, 70 | and are provided here for backward compatibility reasons. */ 71 | 72 | #define des_read_pw_string(b,l,p,v) \ 73 | _ossl_old_des_read_pw_string((b),(l),(p),(v)) 74 | #define des_read_pw(b,bf,s,p,v) \ 75 | _ossl_old_des_read_pw((b),(bf),(s),(p),(v)) 76 | 77 | int _ossl_old_des_read_pw_string(char *buf,int length,const char *prompt,int verify); 78 | int _ossl_old_des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #endif 84 | -------------------------------------------------------------------------------- /src/src/third_party/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_WHRLPOOL_H 2 | #define HEADER_WHRLPOOL_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define WHIRLPOOL_DIGEST_LENGTH (512/8) 12 | #define WHIRLPOOL_BBLOCK 512 13 | #define WHIRLPOOL_COUNTER (256/8) 14 | 15 | typedef struct { 16 | union { 17 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 18 | /* double q is here to ensure 64-bit alignment */ 19 | double q[WHIRLPOOL_DIGEST_LENGTH/sizeof(double)]; 20 | } H; 21 | unsigned char data[WHIRLPOOL_BBLOCK/8]; 22 | unsigned int bitoff; 23 | size_t bitlen[WHIRLPOOL_COUNTER/sizeof(size_t)]; 24 | } WHIRLPOOL_CTX; 25 | 26 | #ifndef OPENSSL_NO_WHIRLPOOL 27 | #ifdef OPENSSL_FIPS 28 | int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 29 | #endif 30 | int WHIRLPOOL_Init (WHIRLPOOL_CTX *c); 31 | int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes); 32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,const void *inp,size_t bits); 33 | int WHIRLPOOL_Final (unsigned char *md,WHIRLPOOL_CTX *c); 34 | unsigned char *WHIRLPOOL(const void *inp,size_t bytes,unsigned char *md); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_client_interface.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_ITUNES_ITUNES_CLIENT_INTERFACE_H_ 2 | #define WIN_ITUNES_ITUNES_CLIENT_INTERFACE_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #include 5 | #include "appstore_core/basictypes.h" 6 | #include "win_itunes/itunes_download_info.h" 7 | ////////////////////////////////////////////////////////////////////////// 8 | namespace win_itunes{ 9 | namespace internal{ 10 | unsigned long GetKbSyncId(); 11 | std::string GetLoginText(const std::string& apple_id,const std::string& password); 12 | std::string GetKeyValue(const std::string& key,const std::string h_table); 13 | class GenerateAuthenticateOsGUID 14 | { 15 | public: 16 | explicit GenerateAuthenticateOsGUID(){ 17 | char buffer[MAX_PATH] = {0}; 18 | DWORD buf_len = MAX_PATH; 19 | GetComputerNameA(buffer,&buf_len); 20 | machine_name_ = buffer; 21 | machine_guid_ = "8EFFF7FD.86E7195C.00000000.39CF53B5.2350EAA0.C3A8E888.7FAFF8CE"; 22 | } 23 | std::string machine_name() const{ 24 | //test:2015/3/19 25 | //return "WIN-4GI25B3ETJE"; 26 | return machine_name_; 27 | } 28 | std::string machine_guid() const{ 29 | //test:2015/3/19 30 | //return "8EFFF7FD.86E7195C.00000000.39CF53B5.2350EAA0.C3A8E888.7FAFF8CE"; 31 | return machine_guid_; 32 | } 33 | private: 34 | std::string machine_name_; 35 | std::string machine_guid_; 36 | DISALLOW_EVIL_CONSTRUCTORS(GenerateAuthenticateOsGUID); 37 | }; 38 | class KbSyncIdParameter 39 | { 40 | public: 41 | static void Initialize(); 42 | static DWORD GetKbsyncIDAddress(); 43 | static const char* AllPCMd5(); 44 | static const char* LocalPCMd5(); 45 | }; 46 | } 47 | class communicates 48 | { 49 | public: 50 | static communicates* singleton(); 51 | void ResetSapSetup(bool x_act_sig); 52 | bool ConsolePrint(const char* file, const char* os_name = NULL, const char* os_guid = NULL); 53 | bool Authenticate(const char* username,const char* password,const char* os_name,const char* os_guid); 54 | bool SendMessage_pendingSongs(const char* os_name, const char* os_guid); 55 | bool SendMessageLookupPurchasesAppIdList(); 56 | bool SendMessageLookupPurchasesAppInfo(const char* app_id); 57 | bool SendMessage_buyProduct(const char* product_id, const char* os_name, const char* os_guid, iTunesDownloadInfo* download_info, const int try_count = 1, bool expense = false); 58 | bool SongDownloadDone(const char* product_id, const char* hardware_cookie_guid, iTunesDownloadInfo* download_info); 59 | private: 60 | void SapSessionInitialize(); 61 | void SapSetupInitialize(bool x_act_sig_flag); 62 | communicates(void); 63 | ~communicates(void); 64 | DISALLOW_EVIL_CONSTRUCTORS(communicates); 65 | }; 66 | class CalcCallback 67 | { 68 | public: 69 | CalcCallback(); 70 | ~CalcCallback(); 71 | void Initialize(); 72 | bool SapSetupInitialize(const int x_aa_sig,const char* sign_cert,char* buffer,size_t length); 73 | bool CalcXAppleActionSignature(char* buffer,size_t length); 74 | bool CalcXAppleActionSignature(const char* x_aa_sig,const size_t length); 75 | bool CalcXAppleActionSignature(const char* x_aa_sig,const size_t x_aa_sig_length,char* buffer,size_t length); 76 | private: 77 | DISALLOW_EVIL_CONSTRUCTORS(CalcCallback); 78 | }; 79 | } 80 | ////////////////////////////////////////////////////////////////////////// 81 | #endif 82 | -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_cookie_interface.cc: -------------------------------------------------------------------------------- 1 | #include "win_itunes/itunes_cookie_interface.h" 2 | 3 | namespace win_itunes{ 4 | iTunesCookieInterface* iTunesCookieInterface::GetInstance(){ 5 | static iTunesCookieInterface* info; 6 | if(!info){ 7 | iTunesCookieInterface* new_info = new iTunesCookieInterface(); 8 | if(InterlockedCompareExchangePointer(reinterpret_cast(&info),new_info,NULL)){ 9 | delete new_info; 10 | } 11 | } 12 | return info; 13 | } 14 | void iTunesCookieInterface::set_login_cookie_flag(bool flag){ 15 | login_cookie_flag_ = flag; 16 | } 17 | bool iTunesCookieInterface::login_cookie_flag() const{ 18 | return login_cookie_flag_; 19 | } 20 | void iTunesCookieInterface::set_signup_wizard_cookie_flag(bool flag){ 21 | signup_wizard_cookie_flag_ = flag; 22 | } 23 | bool iTunesCookieInterface::signup_wizard_cookie_flag() const{ 24 | return signup_wizard_cookie_flag_; 25 | } 26 | void iTunesCookieInterface::set_x_apple_actionsignature(const std::string& text){ 27 | x_apple_actionsignature_ = text; 28 | } 29 | std::string iTunesCookieInterface::x_apple_actionsignature() const{ 30 | return x_apple_actionsignature_; 31 | } 32 | void iTunesCookieInterface::set_x_apple_store_front(const std::string& text){ 33 | x_apple_store_front_ = text; 34 | } 35 | std::string iTunesCookieInterface::x_apple_store_front() const{ 36 | return x_apple_store_front_; 37 | } 38 | void iTunesCookieInterface::set_x_dsid(const std::string& dsid){ 39 | x_dsid_ = dsid; 40 | } 41 | std::string iTunesCookieInterface::x_dsid() const{ 42 | return x_dsid_; 43 | } 44 | void iTunesCookieInterface::set_x_token(const std::string& token){ 45 | x_token_ = token; 46 | } 47 | std::string iTunesCookieInterface::x_token() const{ 48 | return x_token_; 49 | } 50 | void iTunesCookieInterface::set_credit_display(const std::string& credit){ 51 | credit_display_ = credit; 52 | } 53 | std::string iTunesCookieInterface::credit_display() const{ 54 | return credit_display_; 55 | } 56 | void iTunesCookieInterface::set_kbsync(const std::string& kbsync_str){ 57 | kbsync_ = kbsync_str; 58 | } 59 | std::string iTunesCookieInterface::kbsync() const{ 60 | return kbsync_; 61 | } 62 | void iTunesCookieInterface::set_x_apple_md_m(const std::string& k){ 63 | x_apple_md_m_ = k; 64 | } 65 | std::string iTunesCookieInterface::x_apple_md_m() const{ 66 | return x_apple_md_m_; 67 | } 68 | void iTunesCookieInterface::set_x_apple_md(const std::string& k){ 69 | x_apple_md_ = k; 70 | } 71 | std::string iTunesCookieInterface::x_apple_md() const{ 72 | return x_apple_md_; 73 | } 74 | void iTunesCookieInterface::set_auth_response_header(const std::string& k){ 75 | auth_response_header_ = k; 76 | } 77 | std::string iTunesCookieInterface::auth_response_header() const{ 78 | return auth_response_header_; 79 | } 80 | void iTunesCookieInterface::set_buy_product_state(BuyProductStateTable state){ 81 | buy_product_state_ = state; 82 | } 83 | iTunesCookieInterface::BuyProductStateTable iTunesCookieInterface::buy_product_state() const{ 84 | return buy_product_state_; 85 | } 86 | iTunesCookieInterface::iTunesCookieInterface(void){ 87 | set_login_cookie_flag(false); 88 | set_signup_wizard_cookie_flag(false); 89 | set_x_apple_actionsignature(""); 90 | set_x_apple_store_front(""); 91 | set_x_dsid(""); 92 | set_x_token(""); 93 | set_credit_display(""); 94 | set_kbsync(""); 95 | set_x_apple_md_m(""); 96 | set_x_apple_md(""); 97 | set_auth_response_header(""); 98 | set_buy_product_state(iTunesCookieInterface::INIT); 99 | set_x_apple_md_data(""); 100 | } 101 | iTunesCookieInterface::~iTunesCookieInterface(void){ 102 | set_login_cookie_flag(false); 103 | set_signup_wizard_cookie_flag(false); 104 | set_x_apple_actionsignature(""); 105 | set_x_apple_store_front(""); 106 | set_x_dsid(""); 107 | set_x_token(""); 108 | set_credit_display(""); 109 | set_kbsync(""); 110 | set_x_apple_md_m(""); 111 | set_x_apple_md(""); 112 | set_auth_response_header(""); 113 | set_buy_product_state(iTunesCookieInterface::INIT); 114 | set_x_apple_md_data(""); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_cookie_interface.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_ITUNES_ITUNES_COOKIE_INTERFACE_H_ 2 | #define WIN_ITUNES_ITUNES_COOKIE_INTERFACE_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #include "appstore_core/basictypes.h" 5 | ////////////////////////////////////////////////////////////////////////// 6 | namespace win_itunes{ 7 | class iTunesCookieInterface 8 | { 9 | public: 10 | enum BuyProductStateTable{ 11 | INIT, 12 | FIRST_BUY_BEGIN, 13 | FIRST_BUY_END 14 | }; 15 | static iTunesCookieInterface* GetInstance(); 16 | void set_login_cookie_flag(bool flag); 17 | bool login_cookie_flag() const; 18 | void set_signup_wizard_cookie_flag(bool flag); 19 | bool signup_wizard_cookie_flag() const; 20 | void set_x_apple_actionsignature(const std::string& text); 21 | std::string x_apple_actionsignature() const; 22 | void set_x_apple_store_front(const std::string& text); 23 | std::string x_apple_store_front() const; 24 | void set_x_dsid(const std::string& dsid); 25 | std::string x_dsid() const; 26 | void set_x_token(const std::string& token); 27 | std::string x_token() const; 28 | void set_credit_display(const std::string& credit); 29 | std::string credit_display() const; 30 | void set_kbsync(const std::string& kbsync_str); 31 | std::string kbsync() const; 32 | void set_x_apple_md_m(const std::string& k); 33 | std::string x_apple_md_m() const; 34 | void set_x_apple_md(const std::string& k); 35 | std::string x_apple_md() const; 36 | void set_auth_response_header(const std::string& k); 37 | std::string auth_response_header() const; 38 | void set_buy_product_state(BuyProductStateTable state); 39 | BuyProductStateTable buy_product_state() const; 40 | inline void set_x_apple_md_data(const std::string& buy_k){ 41 | x_apple_md_data_ = buy_k; 42 | } 43 | inline std::string x_apple_md_data() const{ 44 | return x_apple_md_data_; 45 | } 46 | private: 47 | iTunesCookieInterface(void); 48 | ~iTunesCookieInterface(void); 49 | DISALLOW_EVIL_CONSTRUCTORS(iTunesCookieInterface); 50 | bool login_cookie_flag_; 51 | bool signup_wizard_cookie_flag_; 52 | BuyProductStateTable buy_product_state_; 53 | std::string x_apple_actionsignature_; 54 | std::string x_apple_store_front_; 55 | std::string x_dsid_; 56 | std::string x_token_; 57 | std::string credit_display_; 58 | std::string kbsync_; 59 | std::string x_apple_md_m_; 60 | std::string x_apple_md_; 61 | std::string auth_response_header_; 62 | std::string x_apple_md_data_; 63 | }; 64 | } 65 | ////////////////////////////////////////////////////////////////////////// 66 | #endif 67 | -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_download_info.cc: -------------------------------------------------------------------------------- 1 | #include "win_itunes/itunes_download_info.h" 2 | 3 | namespace win_itunes{ 4 | iTunesDownloadInfo* iTunesDownloadInfo::GetInterface(bool free_exit){ 5 | static iTunesDownloadInfo* ref_instance; 6 | if(!ref_instance){ 7 | iTunesDownloadInfo* new_instance = new iTunesDownloadInfo; 8 | if(InterlockedCompareExchangePointer(reinterpret_cast(&ref_instance),new_instance,NULL)){ 9 | delete new_instance; 10 | } 11 | } 12 | if(free_exit){ 13 | delete ref_instance; 14 | ref_instance = NULL; 15 | } 16 | return ref_instance; 17 | } 18 | void iTunesDownloadInfo::DIAllocate(){ 19 | DIRelease(); 20 | download_key_ = reinterpret_cast(malloc(kMaxStackBufferLength+256)); 21 | memset(download_key_,0,kMaxStackBufferLength+256); 22 | download_url_ = reinterpret_cast(malloc(kMaxStackBufferLength+256)); 23 | memset(download_url_,0,kMaxStackBufferLength+256); 24 | download_id_ = reinterpret_cast(malloc(kMaxStackBufferLength+256)); 25 | memset(download_id_,0,kMaxStackBufferLength+256); 26 | } 27 | void iTunesDownloadInfo::DIRelease(){ 28 | if(download_key_){ 29 | free(download_key_); 30 | download_key_ = NULL; 31 | } 32 | if(download_url_){ 33 | free(download_url_); 34 | download_url_ = NULL; 35 | } 36 | if(download_id_){ 37 | free(download_id_); 38 | download_id_ = NULL; 39 | } 40 | } 41 | void iTunesDownloadInfo::set_download_key(const char* key,size_t length){ 42 | if(!length||key==NULL){ 43 | return; 44 | } 45 | memset(download_key_,0,kMaxStackBufferLength+256); 46 | strncpy(download_key_,key,length); 47 | } 48 | void iTunesDownloadInfo::set_download_url(const char* url,size_t length){ 49 | if(!length||url==NULL){ 50 | return; 51 | } 52 | memset(download_url_,0,kMaxStackBufferLength+256); 53 | strncpy(download_url_,url,length); 54 | } 55 | void iTunesDownloadInfo::set_download_id(const char* id,size_t length){ 56 | if(!length||id==NULL){ 57 | return; 58 | } 59 | memset(download_id_,0,kMaxStackBufferLength+256); 60 | strncpy(download_id_,id,length); 61 | } 62 | const char* iTunesDownloadInfo::download_key()const{ 63 | return download_key_; 64 | } 65 | const char* iTunesDownloadInfo::download_url()const{ 66 | return download_url_; 67 | } 68 | const char* iTunesDownloadInfo::download_id()const{ 69 | return download_id_; 70 | } 71 | } -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_download_info.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_ITUNES_ITUNES_DOWNLOAD_INFO_H_ 2 | #define WIN_ITUNES_ITUNES_DOWNLOAD_INFO_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #include "appstore_core/basictypes.h" 5 | ////////////////////////////////////////////////////////////////////////// 6 | namespace win_itunes{ 7 | class iTunesDownloadInfo 8 | { 9 | public: 10 | static iTunesDownloadInfo* GetInterface(bool free_exit = false); 11 | virtual void DIAllocate(); 12 | virtual void DIRelease(); 13 | void set_download_key(const char* key,size_t length); 14 | void set_download_url(const char* url,size_t length); 15 | void set_download_id(const char* id,size_t length); 16 | const char* download_key()const; 17 | const char* download_url()const; 18 | const char* download_id()const; 19 | private: 20 | iTunesDownloadInfo() :download_key_(NULL), 21 | download_url_(NULL), download_id_(NULL){ 22 | 23 | } 24 | ~iTunesDownloadInfo(){ 25 | 26 | } 27 | char* download_url_; 28 | char* download_key_; 29 | char* download_id_; 30 | DISALLOW_EVIL_CONSTRUCTORS(iTunesDownloadInfo); 31 | }; 32 | } 33 | ////////////////////////////////////////////////////////////////////////// 34 | #endif -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_https.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_ITUNES_ITUNES_HTTPS_H_ 2 | #define WIN_ITUNES_ITUNES_HTTPS_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #include "appstore_core/basictypes.h" 5 | //#include "passport/itunes_client_interface.h" 6 | ////////////////////////////////////////////////////////////////////////// 7 | namespace win_itunes{ 8 | namespace internal{ 9 | enum iTunesExtHeader{ 10 | apple_itunes = -1, 11 | apple_authenticate, 12 | apple_signSapSetup 13 | }; 14 | std::string ReadHTTPS(const wchar_t* domain,const wchar_t* path,const wchar_t* header,iTunesExtHeader options = apple_itunes,const wchar_t* referer=NULL,const char* port=NULL); 15 | std::string SendHTTPS(const wchar_t* domain,const wchar_t* path,const void* src,const size_t length,iTunesExtHeader options,const wchar_t* header,const wchar_t* referer=NULL,const char* post = NULL); 16 | } 17 | } 18 | ////////////////////////////////////////////////////////////////////////// 19 | #endif -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_https_configure.cc: -------------------------------------------------------------------------------- 1 | #include "win_itunes/itunes_https_configure.h" 2 | 3 | namespace win_itunes{ 4 | namespace internal{ 5 | void FreeConfig(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG* config) { 6 | if (config->lpszAutoConfigUrl) 7 | GlobalFree(config->lpszAutoConfigUrl); 8 | if (config->lpszProxy) 9 | GlobalFree(config->lpszProxy); 10 | if (config->lpszProxyBypass) 11 | GlobalFree(config->lpszProxyBypass); 12 | } 13 | 14 | void FreeInfo(WINHTTP_PROXY_INFO* info) { 15 | if (info->lpszProxy) 16 | GlobalFree(info->lpszProxy); 17 | if (info->lpszProxyBypass) 18 | GlobalFree(info->lpszProxyBypass); 19 | } 20 | bool ConfigureSSL(HINTERNET internet){ 21 | DWORD protocols = 0; 22 | protocols |= WINHTTP_FLAG_SECURE_PROTOCOL_SSL2; 23 | protocols |= WINHTTP_FLAG_SECURE_PROTOCOL_SSL3; 24 | protocols |= WINHTTP_FLAG_SECURE_PROTOCOL_TLS1; 25 | protocols |= WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1; 26 | protocols |= WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; 27 | BOOL rv = WinHttpSetOption(internet, WINHTTP_OPTION_SECURE_PROTOCOLS,&protocols,sizeof(protocols)); 28 | return (rv==TRUE); 29 | } 30 | bool ApplyProxy(HINTERNET internet,const wchar_t* proxy_str,bool is_direct){ 31 | WINHTTP_PROXY_INFO pi; 32 | if(is_direct){ 33 | pi.dwAccessType = WINHTTP_ACCESS_TYPE_NO_PROXY; 34 | pi.lpszProxy = WINHTTP_NO_PROXY_NAME; 35 | pi.lpszProxyBypass = WINHTTP_NO_PROXY_BYPASS; 36 | } 37 | else{ 38 | pi.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; 39 | pi.lpszProxy = const_cast(proxy_str); 40 | pi.lpszProxyBypass = WINHTTP_NO_PROXY_BYPASS; 41 | } 42 | BOOL rv = WinHttpSetOption(internet,WINHTTP_OPTION_PROXY,&pi,sizeof(pi)); 43 | return (rv==TRUE); 44 | } 45 | 46 | bool ConfigureProxy(HINTERNET internet){ 47 | WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ie_config = {0}; 48 | if(!WinHttpGetIEProxyConfigForCurrentUser(&ie_config)){ 49 | return false; 50 | } 51 | WINHTTP_AUTOPROXY_OPTIONS options = {0}; 52 | options.fAutoLogonIfChallenged = TRUE; 53 | if(ie_config.fAutoDetect){ 54 | options.lpszAutoConfigUrl = ie_config.lpszAutoConfigUrl; 55 | options.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL; 56 | } 57 | else{ 58 | options.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT; 59 | options.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP|WINHTTP_AUTO_DETECT_TYPE_DNS_A; 60 | } 61 | std::wstring query_url(L"http://www.baidu.com"); 62 | WINHTTP_PROXY_INFO info = {0}; 63 | BOOL rv = WinHttpGetProxyForUrl(internet,query_url.c_str(),&options,&info); 64 | WINHTTP_PROXY_INFO pi; 65 | switch(info.dwAccessType){ 66 | case WINHTTP_ACCESS_TYPE_NO_PROXY: 67 | ApplyProxy(internet,NULL,TRUE); 68 | break; 69 | case WINHTTP_ACCESS_TYPE_NAMED_PROXY: 70 | ApplyProxy(internet,ie_config.lpszProxy,FALSE); 71 | break; 72 | default: 73 | pi.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; 74 | pi.lpszProxy = ie_config.lpszProxy; 75 | pi.lpszProxyBypass = ie_config.lpszProxyBypass; 76 | rv = WinHttpSetOption(internet,WINHTTP_OPTION_PROXY,&pi,sizeof(pi)); 77 | break; 78 | } 79 | FreeConfig(&ie_config); 80 | FreeInfo(&info); 81 | return (rv==TRUE); 82 | } 83 | 84 | // bool ConfigureProxy(HINTERNET request) 85 | // { 86 | // WINHTTP_PROXY_INFO proxyInfo = {0}; 87 | // proxyInfo.lpszProxy = new WCHAR[PROXY_STR_MAX_LEN]; 88 | // proxyInfo.lpszProxyBypass = new WCHAR[PROXY_STR_MAX_LEN]; 89 | // 90 | // proxyInfo.dwAccessType = proxy.dwAccessType; 91 | // swprintf_s(proxyInfo.lpszProxy, PROXY_STR_MAX_LEN, proxy.proxyStr); 92 | // swprintf_s(proxyInfo.lpszProxyBypass, PROXY_STR_MAX_LEN, proxy.proxyPassBy); // *.local; 93 | // 94 | // BOOL rv = WinHttpSetOption(request,WINHTTP_OPTION_PROXY,&proxyInfo,sizeof(proxyInfo)); 95 | // delete[] proxyInfo.lpszProxy; 96 | // delete[] proxyInfo.lpszProxyBypass; 97 | // 98 | // //DWORD dw = sizeof(proxyInfo); 99 | // //WinHttpQueryOption(request, WINHTTP_OPTION_PROXY, &proxyInfo, &dw); 100 | // return rv; 101 | // } 102 | 103 | } 104 | } -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_https_configure.h: -------------------------------------------------------------------------------- 1 | #ifndef PASSPORT_ITUNES_HTTPS_CONFIGURE_H_ 2 | #define PASSPORT_ITUNES_HTTPS_CONFIGURE_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #include "appstore_core/basictypes.h" 5 | ////////////////////////////////////////////////////////////////////////// 6 | namespace win_itunes{ 7 | namespace internal{ 8 | void FreeConfig(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG* config); 9 | void FreeInfo(WINHTTP_PROXY_INFO* info); 10 | bool ConfigureSSL(HINTERNET internet); 11 | bool ApplyProxy(HINTERNET internet,const wchar_t* proxy_str,bool is_direct); 12 | bool ConfigureProxy(HINTERNET internet); 13 | bool ConfigureProxy(HINTERNET request); 14 | } 15 | } 16 | #endif -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_internal_interface.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_ITUNES_ITUNES_INTERNAL_INTERFACE_H_ 2 | #define WIN_ITUNES_ITUNES_INTERNAL_INTERFACE_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #include "appstore_core/basictypes.h" 5 | ////////////////////////////////////////////////////////////////////////// 6 | namespace win_itunes{ 7 | class iTunesInternalInterface{ 8 | public: 9 | static iTunesInternalInterface* Instance(){ 10 | static iTunesInternalInterface* info; 11 | if(!info){ 12 | iTunesInternalInterface* new_info = new iTunesInternalInterface; 13 | if(InterlockedCompareExchangePointer(reinterpret_cast(&info),new_info,NULL)){ 14 | delete new_info; 15 | } 16 | } 17 | return info; 18 | } 19 | int (__cdecl *lpfnKbsync)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 20 | int (__cdecl *lpfnCigHash)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 21 | int (__cdecl *lpfnKbsyncID)(unsigned long, unsigned long, unsigned long, unsigned long); 22 | int (__cdecl *lpfnWriteSIDD)(unsigned long, unsigned long, unsigned long); 23 | int (__cdecl *lpfnWriteSIDB)(unsigned long, unsigned long, unsigned long); 24 | int (__cdecl *lpfnDeAuthSIDB)(unsigned long, unsigned long, unsigned long, unsigned long); 25 | int (__cdecl *lpfnGenerateAFSyncRS)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 26 | int (__cdecl *lpfnVerifyAFSyncRQ)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 27 | int (__cdecl *lpfnSetAFSyncRQ)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 28 | int (__cdecl *lpfnCalcUnkP1)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 29 | int (__cdecl *lpfnPreAuthByDSID)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 30 | int (__cdecl *lpfnSapInit)(void); 31 | int (__cdecl *lpfnSapGetP1)(unsigned long, unsigned long); 32 | int (__cdecl *lpfnSapCalcBuffer)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 33 | int (__cdecl *lpfnSapGetAS)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 34 | int (__cdecl *lpfnSapGetASFD)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 35 | int (__cdecl *lpfnSapGetASFD_a)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 36 | int (__cdecl *lpfnGetCltDat)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 37 | int (__cdecl *lpfnTranSetInf)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 38 | int (__cdecl *lpfnUpdCDID)(unsigned long); 39 | int (__cdecl *lpfnGetMD)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 40 | int (__cdecl *lpfnInitHost)(unsigned long, unsigned long, unsigned long, unsigned long); 41 | int (__cdecl *lpfnEstablishKey)(unsigned long, unsigned long, unsigned long); 42 | unsigned long kb_seed; 43 | private: 44 | iTunesInternalInterface(){} 45 | ~iTunesInternalInterface(){} 46 | DISALLOW_EVIL_CONSTRUCTORS(iTunesInternalInterface); 47 | }; 48 | template 49 | unsigned long ToDword(const T* k){ 50 | return reinterpret_cast(k); 51 | } 52 | template 53 | unsigned long ToDword(T* k){ 54 | return reinterpret_cast(k); 55 | } 56 | template 57 | unsigned long ToDword(const T k){ 58 | return reinterpret_cast(k); 59 | } 60 | } 61 | ////////////////////////////////////////////////////////////////////////// 62 | #endif -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_module.cc: -------------------------------------------------------------------------------- 1 | #include "win_itunes/itunes_module.h" 2 | #include 3 | #include 4 | #include 5 | #pragma comment(lib,"shell32.lib") 6 | #include 7 | #include "win_itunes/itunes_native_interface.h" 8 | 9 | namespace win_itunes{ 10 | iTunesModule::iTunesModule(void){ 11 | set_core_foundation_dll(L""); 12 | set_air_traffic_host_dll(L""); 13 | set_asmapi_interface_dll(L""); 14 | set_itunes_mobile_device_dll(L""); 15 | set_mobile_device_dll(L""); 16 | AddEnvironmentVariable(iTunesWinPath()); 17 | iTunesPathInit(); 18 | } 19 | iTunesModule::~iTunesModule(void){ 20 | set_core_foundation_dll(L""); 21 | set_air_traffic_host_dll(L""); 22 | set_asmapi_interface_dll(L""); 23 | set_itunes_mobile_device_dll(L""); 24 | set_mobile_device_dll(L""); 25 | } 26 | std::wstring iTunesModule::iTunesDll(const std::wstring& dll_name){ 27 | std::wstring itunes = (iTunesWinPath() + dll_name); 28 | if (!PathFileExistsW(itunes.c_str())){ 29 | itunes = internal::GetDirectory().append(L"itunes.dll"); 30 | } 31 | return itunes; 32 | } 33 | std::wstring iTunesModule::iTunesSCInfo(){ 34 | return (GetSpecialPath(CSIDL_COMMON_APPDATA, L"\\Apple Computer\\iTunes\\SC Info")); 35 | } 36 | void iTunesModule::iTunesPathInit(){ 37 | set_core_foundation_dll(iTunesFrameworkSupport(L"CoreFoundation.dll", true)); 38 | AddEnvironmentVariable(core_foundation_dll()); 39 | set_air_traffic_host_dll(iTunesGetSharedDll(L"AirTrafficHostDLL")); 40 | AddEnvironmentVariable(air_traffic_host_dll()); 41 | set_asmapi_interface_dll(iTunesGetSharedDll(L"ASMapiInterfaceDLL")); 42 | AddEnvironmentVariable(asmapi_interface_dll()); 43 | set_itunes_mobile_device_dll(iTunesGetSharedDll(L"iTunesMobileDeviceDLL")); 44 | AddEnvironmentVariable(itunes_mobile_device_dll()); 45 | set_mobile_device_dll(iTunesGetSharedDll(L"MobileDeviceDLL")); 46 | AddEnvironmentVariable(mobile_device_dll()); 47 | } 48 | void iTunesModule::AddEnvironmentVariable(const std::wstring& path){ 49 | wchar_t env_path[4096] = { 0 }; 50 | GetEnvironmentVariableW(L"PATH", env_path, 4095); 51 | std::wstring new_env_path = (std::wstring(env_path) + std::wstring(L";")) + path; 52 | size_t posiltion = new_env_path.find_last_of('\\'); 53 | if (posiltion != std::wstring::npos){ 54 | new_env_path[posiltion] = 0; 55 | } 56 | SetEnvironmentVariable(L"PATH", new_env_path.c_str()); 57 | } 58 | std::wstring iTunesModule::iTunesGetSharedDll(const std::wstring dll_name){ 59 | void* hSetting = NULL; 60 | unsigned long length = 0; 61 | wchar_t* path = new wchar_t[MAX_PATH*sizeof(wchar_t)]; 62 | if (path == NULL){ 63 | return L""; 64 | } 65 | if (::RegCreateKeyW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Apple Inc.\\Apple Mobile Device Support\\Shared", reinterpret_cast(&hSetting)) != ERROR_SUCCESS){ 66 | return L""; 67 | } 68 | if (::RegQueryValueExW(reinterpret_cast(hSetting), dll_name.c_str(), NULL, NULL, NULL, &length) != ERROR_SUCCESS){ 69 | return L""; 70 | } 71 | ::RegQueryValueEx(reinterpret_cast(hSetting), dll_name.c_str(), NULL, NULL, (LPBYTE)path, &length); 72 | ::RegCloseKey(reinterpret_cast(hSetting)); 73 | std::wstring shared_dll(path); 74 | delete[] path; 75 | return shared_dll; 76 | } 77 | std::wstring iTunesModule::iTunesFrameworkSupport(const std::wstring dll_name, bool env_able){ 78 | void* hSetting = NULL; 79 | unsigned long length = 0; 80 | wchar_t* pCoreFoundationPath = new wchar_t[MAX_PATH*sizeof(wchar_t)]; 81 | if (pCoreFoundationPath == NULL){ 82 | return L""; 83 | } 84 | if (::RegCreateKeyW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Apple Inc.\\Apple Application Support", reinterpret_cast(&hSetting)) != ERROR_SUCCESS){ 85 | return L""; 86 | } 87 | if (::RegQueryValueExW(reinterpret_cast(hSetting), L"InstallDir", NULL, NULL, NULL, &length) != ERROR_SUCCESS){ 88 | return L""; 89 | } 90 | ::RegQueryValueExW(reinterpret_cast(hSetting), L"InstallDir", NULL, NULL, (LPBYTE)pCoreFoundationPath, &length); 91 | ::RegCloseKey(reinterpret_cast(hSetting)); 92 | if (env_able){ 93 | AddEnvironmentVariable(pCoreFoundationPath); 94 | } 95 | if (pCoreFoundationPath[wcslen(pCoreFoundationPath) - 1] != '\\'){ 96 | wcscat(pCoreFoundationPath, L"\\"); 97 | } 98 | wcscat(pCoreFoundationPath, dll_name.c_str()); 99 | std::wstring support_dll(pCoreFoundationPath); 100 | delete[] pCoreFoundationPath; 101 | return support_dll; 102 | } 103 | std::wstring iTunesModule::iTunesWinPath(){ 104 | wchar_t path[MAX_PATH] = { 0 }; 105 | SHGetSpecialFolderPathW(NULL, path, CSIDL_PROGRAM_FILES, FALSE); 106 | return (std::wstring(path) + std::wstring(L"\\iTunes\\")); 107 | } 108 | std::wstring iTunesModule::GetSpecialPath(const unsigned long& type_path, const std::wstring& name){ 109 | wchar_t path[MAX_PATH] = { 0 }; 110 | SHGetSpecialFolderPathW(NULL, path, type_path, FALSE); 111 | return (std::wstring(path) + name); 112 | } 113 | } -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_module.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_ITUNES_ITUNES_MODULE_H_ 2 | #define WIN_ITUNES_ITUNES_MODULE_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #include 5 | ////////////////////////////////////////////////////////////////////////// 6 | namespace win_itunes{ 7 | class iTunesModule 8 | { 9 | public: 10 | iTunesModule(void); 11 | ~iTunesModule(void); 12 | std::wstring iTunesDll(const std::wstring& dll_name); 13 | std::wstring iTunesSCInfo(); 14 | std::wstring core_foundation_dll() const{ 15 | const std::wstring data = core_foundation_dll_; 16 | return data; 17 | } 18 | std::wstring air_traffic_host_dll() const{ 19 | const std::wstring data = air_traffic_host_dll_; 20 | return data; 21 | } 22 | std::wstring asmapi_interface_dll() const{ 23 | const std::wstring data = asmapi_interface_dll_; 24 | return data; 25 | } 26 | std::wstring itunes_mobile_device_dll() const{ 27 | const std::wstring data = itunes_mobile_device_dll_; 28 | return data; 29 | } 30 | std::wstring mobile_device_dll() const{ 31 | const std::wstring data = mobile_device_dll_; 32 | return data; 33 | } 34 | private: 35 | void iTunesPathInit(); 36 | void AddEnvironmentVariable(const std::wstring& path); 37 | std::wstring iTunesGetSharedDll(const std::wstring dll_name); 38 | std::wstring iTunesFrameworkSupport(const std::wstring dll_name, bool env_able); 39 | std::wstring iTunesWinPath(); 40 | std::wstring GetSpecialPath(const unsigned long& type_path, const std::wstring& name); 41 | void set_core_foundation_dll(std::wstring path){ 42 | core_foundation_dll_.resize(0); 43 | core_foundation_dll_ = path; 44 | } 45 | void set_air_traffic_host_dll(std::wstring path){ 46 | air_traffic_host_dll_.resize(0); 47 | air_traffic_host_dll_ = path; 48 | } 49 | void set_asmapi_interface_dll(std::wstring path){ 50 | asmapi_interface_dll_.resize(0); 51 | asmapi_interface_dll_ = path; 52 | } 53 | void set_itunes_mobile_device_dll(std::wstring path){ 54 | itunes_mobile_device_dll_.resize(0); 55 | itunes_mobile_device_dll_ = path; 56 | } 57 | void set_mobile_device_dll(std::wstring path){ 58 | mobile_device_dll_.resize(0); 59 | mobile_device_dll_ = path; 60 | } 61 | std::wstring core_foundation_dll_; 62 | std::wstring air_traffic_host_dll_; 63 | std::wstring asmapi_interface_dll_; 64 | std::wstring itunes_mobile_device_dll_; 65 | std::wstring mobile_device_dll_; 66 | }; 67 | } 68 | ////////////////////////////////////////////////////////////////////////// 69 | #endif -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_module_state.cc: -------------------------------------------------------------------------------- 1 | #include "win_itunes/itunes_module_state.h" 2 | #include 3 | #include "win_itunes/itunes_module.h" 4 | 5 | namespace win_itunes{ 6 | bool iTunesModuleState::iTunesIsInstalled(){ 7 | iTunesModule module; 8 | if (GetModuleHandleW(L"iTunes.dll") != NULL){ 9 | return true; 10 | } 11 | return (LoadLibraryW(module.iTunesDll(L"iTunes.dll").c_str()) != NULL); 12 | } 13 | bool iTunesModuleState::AppleApplicationSupportIsInstalled(){ 14 | iTunesModule module; 15 | if (GetModuleHandleW(L"CoreFoundation.dll") != NULL){ 16 | return true; 17 | } 18 | return (LoadLibraryW(module.core_foundation_dll().c_str()) != NULL); 19 | } 20 | bool iTunesModuleState::AppleMobileDeviceSupportIsInstalled(){ 21 | iTunesModule module; 22 | if (GetModuleHandleW(L"iTunesMobileDevice.dll") != NULL){ 23 | return true; 24 | } 25 | return (LoadLibraryW(module.itunes_mobile_device_dll().c_str()) != NULL); 26 | } 27 | } -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_module_state.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_ITUNES_ITUNES_MODULE_STATE_H_ 2 | #define WIN_ITUNES_ITUNES_MODULE_STATE_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | namespace win_itunes{ 5 | class iTunesModuleState 6 | { 7 | public: 8 | iTunesModuleState(){} 9 | ~iTunesModuleState(){} 10 | bool iTunesIsInstalled(); 11 | bool AppleApplicationSupportIsInstalled(); 12 | bool AppleMobileDeviceSupportIsInstalled(); 13 | }; 14 | } 15 | ////////////////////////////////////////////////////////////////////////// 16 | #endif -------------------------------------------------------------------------------- /src/src/win_itunes/itunes_native_interface.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_ITUNES_ITUNES_NATIVE_INTERFACE_H_ 2 | #define WIN_ITUNES_ITUNES_NATIVE_INTERFACE_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #include "appstore_core/basictypes.h" 5 | ////////////////////////////////////////////////////////////////////////// 6 | namespace win_itunes{ 7 | namespace internal{ 8 | std::wstring GetSoftwareReleaseVersion(const wchar_t* full_path); 9 | std::wstring GetAppleMobileDeviceSupportDll(const std::wstring dll_name); 10 | std::wstring GetAppleApplicationSupportDll(const std::wstring dll_name); 11 | std::wstring GetITunesInstallDll(const std::wstring dll_name); 12 | std::wstring GetDirectory(); 13 | } 14 | class iTunesNativeInterface 15 | { 16 | public: 17 | static iTunesNativeInterface* GetInstance(); 18 | void Init(); 19 | private: 20 | enum CustomizeModule{ kCoreFP, kiTunesMobileDeviceDLL }; 21 | iTunesNativeInterface(void); 22 | ~iTunesNativeInterface(void); 23 | bool HKLMCustomizeModule(const CustomizeModule& customize_module, const wchar_t* module_name); 24 | bool IsMachineAmd64(const wchar_t* file,const wchar_t* dir); 25 | bool iTunesDllVersion(const wchar_t* version); 26 | bool AirTrafficHostDllVersion(const wchar_t* version); 27 | bool Loads(); 28 | DISALLOW_EVIL_CONSTRUCTORS(iTunesNativeInterface); 29 | }; 30 | } 31 | ////////////////////////////////////////////////////////////////////////// 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /src/src/win_itunes/strings.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_ITUNES_STRINGS_ 2 | #define WIN_ITUNES_STRINGS_ 3 | 4 | #include "appstore_core/basictypes.h" 5 | 6 | namespace Strings{ 7 | std::vector SplitMakePair(const std::wstring & str, const std::wstring& s1, const std::wstring& s2); 8 | std::wstring SplitDetail(const std::wstring& str, const std::wstring& detail); 9 | std::vector SplitArray(const std::wstring & str, const std::wstring & delimiters); 10 | std::string HexStrFormByteArray(unsigned char *data, int len); 11 | std::string Md5(const void* str, size_t length, size_t block_length = 0); 12 | std::string StringReplace(std::string& str, const std::string& from, const std::string& to); 13 | size_t EVPLength(const std::string& str); 14 | std::wstring AsciiToUnicode(const std::string &str); 15 | std::string UnicodeToAscii(const std::wstring &wstr); 16 | std::string UnicodeToUft8(const std::wstring& str); 17 | std::wstring Utf8ToUnicode(const std::string &str); 18 | std::string GBKToUtf8(const std::string &str); 19 | std::string Utf8ToGBK(const std::string &str); 20 | std::wstring ToUpper(const std::wstring& seque); 21 | std::wstring ToLower(const std::wstring& seque); 22 | std::string ToUpper(const std::string& seque); 23 | std::string ToLower(const std::string& seque); 24 | } 25 | 26 | #endif -------------------------------------------------------------------------------- /src/src/win_itunes/windows_hardware.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_ITUNES_WINDOWS_HARDWARE_H_ 2 | #define WIN_ITUNES_WINDOWS_HARDWARE_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #include 5 | ////////////////////////////////////////////////////////////////////////// 6 | namespace win_itunes{ 7 | class HardwareInfo 8 | { 9 | public: 10 | HardwareInfo(); 11 | ~HardwareInfo(); 12 | bool GetAdapterSerial(std::string& out); 13 | bool GetVolumeSerial(std::string& out); 14 | bool GetSystemBios(std::string& out); 15 | bool GetProcessorName(std::string& out); 16 | bool GetWinProductId(std::string& out); 17 | bool GetWinComputerName(std::string& out); 18 | std::string GetMachineName(); 19 | std::wstring HwProfile(); 20 | std::string cookie() const; 21 | private: 22 | void set_cookie(const std::string hardware_cookie); 23 | std::string cookie_; 24 | }; 25 | std::string GetHardwareCookie(); 26 | } 27 | ////////////////////////////////////////////////////////////////////////// 28 | #endif -------------------------------------------------------------------------------- /src/src/win_itunes/windows_version.cc: -------------------------------------------------------------------------------- 1 | #include "win_itunes/windows_version.h" 2 | 3 | namespace win_itunes{ 4 | WinVersion::WinVersion(void){ 5 | set_os_version(); 6 | set_os_info(); 7 | } 8 | WinVersion::~WinVersion(void){ 9 | set_os_version(true); 10 | set_os_info(true); 11 | } 12 | bool WinVersion::IsAmd64() const{ 13 | return (os_info().dwOemId == PROCESSOR_ARCHITECTURE_AMD64); 14 | } 15 | bool WinVersion::IsX64Os() const{ 16 | return (os_info().dwOemId == PROCESSOR_ARCHITECTURE_AMD64 || os_info().dwOemId == PROCESSOR_ARCHITECTURE_IA64); 17 | } 18 | bool WinVersion::IsWinXP() const{ 19 | return (os_version().dwMajorVersion == 5 && os_version().dwMinorVersion == 1); 20 | } 21 | bool WinVersion::IsWin2003() const{ 22 | return (os_version().dwMajorVersion == 5 && os_version().dwMinorVersion == 2 && !GetSystemMetrics(SM_SERVERR2)); 23 | } 24 | bool WinVersion::IsWin2003_R2() const{ 25 | return (os_version().dwMajorVersion == 5 && os_version().dwMinorVersion == 2 && GetSystemMetrics(SM_SERVERR2)); 26 | } 27 | bool WinVersion::IsVista() const{ 28 | return (os_version().dwMajorVersion == 6 && os_version().dwMinorVersion == 0); 29 | } 30 | bool WinVersion::IsWin7() const{ 31 | return (os_version().dwMajorVersion == 6 && os_version().dwMinorVersion == 1); 32 | } 33 | bool WinVersion::IsWin8() const{ 34 | return (os_version().dwMajorVersion == 6 && os_version().dwMinorVersion == 2); 35 | } 36 | bool WinVersion::IsWin8_1() const{ 37 | return (os_version().dwMajorVersion == 6 && os_version().dwMinorVersion == 3); 38 | } 39 | bool WinVersion::IsWinNT5() const{ 40 | return (os_version().dwMajorVersion == 5 && os_version().wProductType == VER_NT_WORKSTATION); 41 | } 42 | bool WinVersion::IsWinNT6() const{ 43 | return (os_version().dwMajorVersion == 6 && os_version().wProductType == VER_NT_WORKSTATION); 44 | } 45 | } -------------------------------------------------------------------------------- /src/src/win_itunes/windows_version.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_ITUNES_WINDOWS_VERSION_H_ 2 | #define WIN_ITUNES_WINDOWS_VERSION_H_ 3 | ////////////////////////////////////////////////////////////////////////// 4 | #include 5 | ////////////////////////////////////////////////////////////////////////// 6 | namespace win_itunes{ 7 | class WinVersion 8 | { 9 | public: 10 | WinVersion(void); 11 | ~WinVersion(void); 12 | bool IsAmd64() const; 13 | bool IsX64Os() const; 14 | bool IsWinXP() const; 15 | bool IsWin2003() const; 16 | bool IsWin2003_R2() const; 17 | bool IsVista() const; 18 | bool IsWin7() const; 19 | bool IsWin8() const; 20 | bool IsWin8_1() const; 21 | bool IsWinNT5() const; 22 | bool IsWinNT6() const; 23 | private: 24 | inline OSVERSIONINFOEXW os_version() const{ 25 | const OSVERSIONINFOEXW c_os_version = os_version_; 26 | return c_os_version; 27 | } 28 | inline SYSTEM_INFO os_info() const{ 29 | const SYSTEM_INFO os_info = os_info_; 30 | return os_info; 31 | } 32 | inline void set_os_version(const bool only_init = false){ 33 | memset(&os_version_, 0, sizeof(os_version_)); 34 | if (!only_init){ 35 | os_version_.dwOSVersionInfoSize = sizeof(os_version_); 36 | GetVersionExW(reinterpret_cast(&os_version_)); 37 | } 38 | } 39 | inline void set_os_info(const bool only_init = false){ 40 | memset(&os_info_, 0, sizeof(os_info_)); 41 | if (!only_init){ 42 | GetNativeSystemInfo(&os_info_); 43 | } 44 | } 45 | OSVERSIONINFOEXW os_version_; 46 | SYSTEM_INFO os_info_; 47 | }; 48 | } 49 | ////////////////////////////////////////////////////////////////////////// 50 | #endif -------------------------------------------------------------------------------- /src/vc.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "appstore_core", "src\appstore_core\appstore_core.vcxproj", "{C565EE39-10F3-461B-85EF-096AFA8EA0E3}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "appstore", "src\appstore\appstore.vcxproj", "{AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Mixed Platforms = Debug|Mixed Platforms 13 | Debug|Win32 = Debug|Win32 14 | Debug|x64 = Debug|x64 15 | Release|Mixed Platforms = Release|Mixed Platforms 16 | Release|Win32 = Release|Win32 17 | Release|x64 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 21 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 22 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Debug|Win32.ActiveCfg = Debug|Win32 23 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Debug|Win32.Build.0 = Debug|Win32 24 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Debug|x64.ActiveCfg = Debug|x64 25 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Debug|x64.Build.0 = Debug|x64 26 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 27 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Release|Mixed Platforms.Build.0 = Release|Win32 28 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Release|Win32.ActiveCfg = Release|Win32 29 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Release|Win32.Build.0 = Release|Win32 30 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Release|x64.ActiveCfg = Release|x64 31 | {C565EE39-10F3-461B-85EF-096AFA8EA0E3}.Release|x64.Build.0 = Release|x64 32 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 33 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Debug|Mixed Platforms.Build.0 = Debug|Win32 34 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Debug|Win32.ActiveCfg = Debug|Win32 35 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Debug|Win32.Build.0 = Debug|Win32 36 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Debug|x64.ActiveCfg = Debug|x64 37 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Debug|x64.Build.0 = Debug|x64 38 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Release|Mixed Platforms.ActiveCfg = Release|Win32 39 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Release|Mixed Platforms.Build.0 = Release|Win32 40 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Release|Win32.ActiveCfg = Release|Win32 41 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Release|Win32.Build.0 = Release|Win32 42 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Release|x64.ActiveCfg = Release|x64 43 | {AF19C30A-5FDC-4B26-ACDE-F1FEBC8C4A98}.Release|x64.Build.0 = Release|x64 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | EndGlobal 49 | -------------------------------------------------------------------------------- /src/vc.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cxxrev0to1dev/apple_itunes_win/8530985b4c8747af125707a6604c996aa6c9c916/src/vc.v12.suo --------------------------------------------------------------------------------