├── .gitattributes ├── .gitignore ├── LICENSE.txt ├── NTFSParserDLL ├── NTFS.h ├── NTFSParserDLL.cpp ├── NTFSParserDLL.h ├── NTFSParserDLL.vcxproj ├── NTFSParserDLL.vcxproj.filters ├── NTFS_Attribute.h ├── NTFS_Common.h ├── NTFS_DataType.h ├── NTFS_FileRecord.h ├── ReadMe.txt └── dllmain.cpp ├── README.md ├── artifact_parser_helper ├── IIJCheckList.reb ├── README.md ├── artifact_parser_helper.bat ├── artifact_parser_helper.ini ├── bulk_artifact_parser_helper.bat ├── check_parsed_artifacts.ps1 ├── task_parser.py ├── to_get_attribs.json └── xml_evtx_parse.py ├── libressl-2.5.5-windows ├── include │ ├── openssl │ │ ├── aes.h │ │ ├── asn1.h │ │ ├── asn1_mac.h │ │ ├── asn1t.h │ │ ├── bio.h │ │ ├── blowfish.h │ │ ├── bn.h │ │ ├── buffer.h │ │ ├── camellia.h │ │ ├── cast.h │ │ ├── chacha.h │ │ ├── cmac.h │ │ ├── comp.h │ │ ├── conf.h │ │ ├── conf_api.h │ │ ├── crypto.h │ │ ├── curve25519.h │ │ ├── des.h │ │ ├── dh.h │ │ ├── dsa.h │ │ ├── dso.h │ │ ├── dtls1.h │ │ ├── ec.h │ │ ├── ecdh.h │ │ ├── ecdsa.h │ │ ├── engine.h │ │ ├── err.h │ │ ├── evp.h │ │ ├── gost.h │ │ ├── hmac.h │ │ ├── idea.h │ │ ├── lhash.h │ │ ├── md4.h │ │ ├── md5.h │ │ ├── modes.h │ │ ├── obj_mac.h │ │ ├── objects.h │ │ ├── ocsp.h │ │ ├── opensslconf.h │ │ ├── opensslfeatures.h │ │ ├── opensslv.h │ │ ├── ossl_typ.h │ │ ├── pem.h │ │ ├── pem2.h │ │ ├── pkcs12.h │ │ ├── pkcs7.h │ │ ├── poly1305.h │ │ ├── rand.h │ │ ├── rc2.h │ │ ├── rc4.h │ │ ├── ripemd.h │ │ ├── rsa.h │ │ ├── safestack.h │ │ ├── sha.h │ │ ├── srtp.h │ │ ├── ssl.h │ │ ├── ssl2.h │ │ ├── ssl23.h │ │ ├── ssl3.h │ │ ├── stack.h │ │ ├── tls1.h │ │ ├── ts.h │ │ ├── txt_db.h │ │ ├── ui.h │ │ ├── ui_compat.h │ │ ├── whrlpool.h │ │ ├── x509.h │ │ ├── x509_vfy.h │ │ └── x509v3.h │ └── tls.h ├── x64 │ ├── libcrypto-41.dll │ ├── libcrypto-41.exp │ ├── libcrypto-41.lib │ ├── libssl-43.dll │ ├── libssl-43.exp │ ├── libssl-43.lib │ ├── libtls-15.dll │ ├── libtls-15.exp │ ├── libtls-15.lib │ ├── ocspcheck.exe │ └── openssl.exe └── x86 │ ├── libcrypto-41.dll │ ├── libcrypto-41.exp │ ├── libcrypto-41.lib │ ├── libssl-43.dll │ ├── libssl-43.exp │ ├── libssl-43.lib │ ├── libtls-15.dll │ ├── libtls-15.exp │ ├── libtls-15.lib │ ├── ocspcheck.exe │ └── openssl.exe ├── triage-collector.sln ├── triage-collector ├── ConfigParser.cpp ├── ConfigParser.h ├── WriteWrapper.cpp ├── WriteWrapper.h ├── globals.h ├── inipp.h ├── resource.h ├── triage-collector.cpp ├── triage-collector.h ├── triage-collector.ico ├── triage-collector.ini ├── triage-collector.rc ├── triage-collector.vcxproj ├── triage-collector.vcxproj.filters ├── util.cpp └── util.h ├── winpmem-2.1.post4.exe ├── winpmem.exe ├── winpmem_mini_x64_rc2.exe └── winpmem_mini_x86.exe /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | triage-collector/x64/ 19 | triage-collector/x86/ 20 | NTFSParserDLL/x64/ 21 | NTFSParserDLL/x86/ 22 | build/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opensdf 80 | *.sdf 81 | *.cachefile 82 | 83 | # Visual Studio profiler 84 | *.psess 85 | *.vsp 86 | *.vspx 87 | 88 | # TFS 2012 Local Workspace 89 | $tf/ 90 | 91 | # Guidance Automation Toolkit 92 | *.gpState 93 | 94 | # ReSharper is a .NET coding add-in 95 | _ReSharper*/ 96 | *.[Rr]e[Ss]harper 97 | *.DotSettings.user 98 | 99 | # JustCode is a .NET coding add-in 100 | .JustCode 101 | 102 | # TeamCity is a build add-in 103 | _TeamCity* 104 | 105 | # DotCover is a Code Coverage Tool 106 | *.dotCover 107 | 108 | # NCrunch 109 | _NCrunch_* 110 | .*crunch*.local.xml 111 | 112 | # MightyMoose 113 | *.mm.* 114 | AutoTest.Net/ 115 | 116 | # Web workbench (sass) 117 | .sass-cache/ 118 | 119 | # Installshield output folder 120 | [Ee]xpress/ 121 | 122 | # DocProject is a documentation generator add-in 123 | DocProject/buildhelp/ 124 | DocProject/Help/*.HxT 125 | DocProject/Help/*.HxC 126 | DocProject/Help/*.hhc 127 | DocProject/Help/*.hhk 128 | DocProject/Help/*.hhp 129 | DocProject/Help/Html2 130 | DocProject/Help/html 131 | 132 | # Click-Once directory 133 | publish/ 134 | 135 | # Publish Web Output 136 | *.[Pp]ublish.xml 137 | *.azurePubxml 138 | ## TODO: Comment the next line if you want to checkin your 139 | ## web deploy settings but do note that will include unencrypted 140 | ## passwords 141 | #*.pubxml 142 | 143 | *.publishproj 144 | 145 | # NuGet Packages 146 | *.nupkg 147 | # The packages folder can be ignored because of Package Restore 148 | **/packages/* 149 | # except build/, which is used as an MSBuild target. 150 | !**/packages/build/ 151 | # Uncomment if necessary however generally it will be regenerated when needed 152 | #!**/packages/repositories.config 153 | 154 | # Windows Azure Build Output 155 | csx/ 156 | *.build.csdef 157 | 158 | # Windows Store app package directory 159 | AppPackages/ 160 | 161 | # Visual Studio cache files 162 | # files ending in .cache can be ignored 163 | *.[Cc]ache 164 | # but keep track of directories ending in .cache 165 | !*.[Cc]ache/ 166 | 167 | # Others 168 | ClientBin/ 169 | [Ss]tyle[Cc]op.* 170 | ~$* 171 | *~ 172 | *.dbmdl 173 | *.dbproj.schemaview 174 | *.pfx 175 | *.publishsettings 176 | node_modules/ 177 | orleans.codegen.cs 178 | 179 | # RIA/Silverlight projects 180 | Generated_Code/ 181 | 182 | # Backup & report files from converting an old project file 183 | # to a newer Visual Studio version. Backup files are not needed, 184 | # because we have git ;-) 185 | _UpgradeReport_Files/ 186 | Backup*/ 187 | UpgradeLog*.XML 188 | UpgradeLog*.htm 189 | 190 | # SQL Server files 191 | *.mdf 192 | *.ldf 193 | 194 | # Business Intelligence projects 195 | *.rdl.data 196 | *.bim.layout 197 | *.bim_*.settings 198 | 199 | # Microsoft Fakes 200 | FakesAssemblies/ 201 | 202 | # Node.js Tools for Visual Studio 203 | .ntvs_analysis.dat 204 | 205 | # Visual Studio 6 build log 206 | *.plg 207 | 208 | # Visual Studio 6 workspace options file 209 | *.opt 210 | 211 | # LightSwitch generated files 212 | GeneratedArtifacts/ 213 | _Pvt_Extensions/ 214 | ModelManifest.xml 215 | /triage-collector.VC.db 216 | /triage-collector.VC.VC.opendb 217 | 218 | triage-collector.svg 219 | -------------------------------------------------------------------------------- /NTFSParserDLL/NTFS.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NTFS include files 3 | * 4 | * Copyright(C) 2010 cyb70289 5 | * 6 | * This program/include file is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License as published 8 | * by the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program/include file is distributed in the hope that it will be 12 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 13 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | */ 16 | 17 | #ifndef __NTFS_H_CYB70289 18 | #define __NTFS_H_CYB70289 19 | 20 | #pragma pack(8) 21 | 22 | #include "NTFS_Common.h" 23 | #include "NTFS_FileRecord.h" 24 | #include "NTFS_Attribute.h" 25 | 26 | #pragma pack() 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /NTFSParserDLL/NTFSParserDLL.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is modified from the following code: 3 | * 4 | * https://github.com/clymb3r/PowerShell/blob/master/Invoke-NinjaCopy/NTFSParser/NTFSParserDLL/NTFSParserDLL.cpp 5 | * 6 | * Copyright(C) 2013 Joe Bialek Twitter:@JosephBialek 7 | * 8 | * This program/include file is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program/include file is distributed in the hope that it will be 14 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | */ 18 | // 19 | // This code uses libraries released under GPLv2(or later) written by cyb70289 20 | 21 | #include 22 | #include "NTFSParserDLL.h" 23 | 24 | using namespace std; 25 | 26 | HANDLE StealthOpenFile(char* filePathCStr) 27 | { 28 | FileInfo_t* fileInfo = new FileInfo_t; 29 | 30 | // for multibyte files 31 | size_t len = strlen(filePathCStr); 32 | wchar_t* wcbuf = (wchar_t*)malloc(len * 2 + 2); 33 | memset(wcbuf, 0, len * 2 + 2); 34 | if (wcbuf == NULL) { return NULL; } 35 | int ret = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, filePathCStr, len, wcbuf, len); 36 | wstring wfilePath = wstring(wcbuf); 37 | string filePath = string(filePathCStr); 38 | 39 | _TCHAR volumeName = filePath.at(0); 40 | 41 | BOOL isADS = false; 42 | string ads_s; 43 | _TCHAR *ads; 44 | size_t idx_ads; 45 | 46 | if ((idx_ads = filePath.find_first_of(':', 2)) != wstring::npos) { 47 | isADS = true; 48 | ads_s = filePath.substr(idx_ads + 1); 49 | ads = new _TCHAR[ads_s.size()]; 50 | filePath = filePath.substr(0, idx_ads); 51 | sprintf(ads, "%s", ads_s.c_str()); 52 | } 53 | 54 | fileInfo->volume = new CNTFSVolume(volumeName); 55 | if (!fileInfo->volume->IsVolumeOK()) 56 | { 57 | free(wcbuf); 58 | return NULL; 59 | } 60 | 61 | //Parse root directory 62 | fileInfo->fileRecord = new CFileRecord(fileInfo->volume); 63 | fileInfo->fileRecord->SetAttrMask(MASK_INDEX_ROOT | MASK_INDEX_ALLOCATION); 64 | 65 | if (!fileInfo->fileRecord->ParseFileRecord(MFT_IDX_ROOT)) 66 | { 67 | free(wcbuf); 68 | return NULL; 69 | } 70 | if (!fileInfo->fileRecord->ParseAttrs()) 71 | { 72 | free(wcbuf); 73 | return NULL; 74 | } 75 | 76 | //Find subdirectory 77 | fileInfo->indexEntry = new CIndexEntry; 78 | size_t dirs = wfilePath.find(L"\\", 0); 79 | size_t dire = wfilePath.find(L"\\", dirs+1); 80 | 81 | while (dire != wstring::npos) 82 | { 83 | string pathname = filePath.substr(dirs+1, dire-dirs-1); 84 | const _TCHAR* pathnameCStr = (const _TCHAR*)pathname.c_str(); 85 | if (fileInfo->fileRecord->FindSubEntry(pathnameCStr, *(fileInfo->indexEntry))) 86 | { 87 | if (!fileInfo->fileRecord->ParseFileRecord(fileInfo->indexEntry->GetFileReference())) 88 | { 89 | free(wcbuf); 90 | return NULL; 91 | } 92 | 93 | if (!fileInfo->fileRecord->ParseAttrs()) 94 | { 95 | if (fileInfo->fileRecord->IsCompressed()) 96 | { 97 | free(wcbuf); 98 | return NULL; 99 | } 100 | else if (fileInfo->fileRecord->IsEncrypted()) 101 | { 102 | free(wcbuf); 103 | return NULL; 104 | } 105 | else 106 | { 107 | free(wcbuf); 108 | return NULL; 109 | } 110 | } 111 | } 112 | else 113 | { 114 | free(wcbuf); 115 | return NULL; 116 | } 117 | 118 | 119 | dirs = dire; 120 | dire = wfilePath.find(L"\\", dirs+1); 121 | } 122 | 123 | string fileName = filePath.substr(dirs+1, filePath.size()-1); 124 | const _TCHAR* fileNameCStr = (const _TCHAR*)fileName.c_str(); 125 | if (fileInfo->fileRecord->FindSubEntry(fileNameCStr, *(fileInfo->indexEntry))) 126 | { 127 | if (!fileInfo->fileRecord->ParseFileRecord(fileInfo->indexEntry->GetFileReference())) 128 | { 129 | free(wcbuf); 130 | return NULL; 131 | } 132 | 133 | fileInfo->fileRecord->SetAttrMask(MASK_DATA); 134 | if (!fileInfo->fileRecord->ParseAttrs()) 135 | { 136 | free(wcbuf); 137 | return NULL; 138 | } 139 | 140 | if (isADS) { 141 | fileInfo->data = (CAttrBase*)fileInfo->fileRecord->FindStream(ads); 142 | } 143 | else { 144 | fileInfo->data = (CAttrBase*)fileInfo->fileRecord->FindStream(); 145 | } 146 | 147 | free(wcbuf); 148 | return fileInfo; 149 | } 150 | 151 | free(wcbuf); 152 | return NULL; 153 | } 154 | 155 | // add filesize argument 156 | DWORD StealthReadFile(FileInfo_t * fileInfo, BYTE * buffer, DWORD bufferSize, ULONGLONG offset, DWORD * bytesRead, ULONGLONG * dataRemaining, ULONGLONG fileSize) 157 | { 158 | if (fileInfo->data) 159 | { 160 | // ULONGLONG dataLength = (ULONGLONG)fileInfo->data->GetDataSize(); 161 | ULONGLONG dataLength = fileSize; // changed for datarun around multiple record 162 | ULONGLONG fullDataLength = dataLength; 163 | 164 | dataLength = dataLength - offset; 165 | if (dataLength > bufferSize) 166 | { 167 | dataLength = bufferSize; 168 | } 169 | if (dataLength > MAXUINT32) 170 | { 171 | return 1; 172 | } 173 | 174 | DWORD len; 175 | if (fileInfo->data->ReadData(offset, buffer, (DWORD)dataLength, &len) && len == (DWORD)dataLength) 176 | { 177 | *bytesRead = len; 178 | *dataRemaining = fullDataLength - len - offset; 179 | return 0; //Success 180 | } 181 | else if (fileInfo->data->ReadData(offset, buffer, 1, &len)) 182 | { 183 | return 3; 184 | } 185 | return 4; 186 | } 187 | return 2; 188 | } 189 | 190 | 191 | void StealthCloseFile(FileInfo_t * fileInfo) 192 | { 193 | delete (fileInfo->data); 194 | delete (fileInfo->indexEntry); 195 | delete (fileInfo->volume); 196 | delete fileInfo; 197 | } 198 | -------------------------------------------------------------------------------- /NTFSParserDLL/NTFSParserDLL.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NTFS.h" 4 | #include "NTFS_DataType.h" 5 | 6 | extern "C" HANDLE __declspec(dllexport) StealthOpenFile(char* filePathCStr); 7 | extern "C" DWORD __declspec(dllexport) StealthReadFile(FileInfo_t * fileInfo, BYTE * buffer, DWORD bufferSize, ULONGLONG offset, DWORD * bytesRead, ULONGLONG * dataRemaining, ULONGLONG fileSize); 8 | extern "C" void __declspec(dllexport) StealthCloseFile(FileInfo_t * fileInfo); 9 | -------------------------------------------------------------------------------- /NTFSParserDLL/NTFSParserDLL.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | Header Files 38 | 39 | 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | -------------------------------------------------------------------------------- /NTFSParserDLL/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | DYNAMIC LINK LIBRARY : NTFSParserDLL Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this NTFSParserDLL DLL for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your NTFSParserDLL application. 9 | 10 | 11 | NTFSParserDLL.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | NTFSParserDLL.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | NTFSParserDLL.cpp 25 | This is the main DLL source file. 26 | 27 | When created, this DLL does not export any symbols. As a result, it 28 | will not produce a .lib file when it is built. If you wish this project 29 | to be a project dependency of some other project, you will either need to 30 | add code to export some symbols from the DLL so that an export library 31 | will be produced, or you can set the Ignore Input Library property to Yes 32 | on the General propert page of the Linker folder in the project's Property 33 | Pages dialog box. 34 | 35 | ///////////////////////////////////////////////////////////////////////////// 36 | Other standard files: 37 | 38 | StdAfx.h, StdAfx.cpp 39 | These files are used to build a precompiled header (PCH) file 40 | named NTFSParserDLL.pch and a precompiled types file named StdAfx.obj. 41 | 42 | ///////////////////////////////////////////////////////////////////////////// 43 | Other notes: 44 | 45 | AppWizard uses "TODO:" comments to indicate parts of the source code you 46 | should add to or customize. 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | -------------------------------------------------------------------------------- /NTFSParserDLL/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright(C) 2013 Joe Bialek Twitter:@JosephBialek 4 | * 5 | * This program/include file is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as published 7 | * by the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program/include file is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | // 16 | // This code uses libraries released under GPLv2(or later) written by cyb70289 17 | 18 | // dllmain.cpp : Defines the entry point for the DLL application. 19 | #include 20 | 21 | BOOL APIENTRY DllMain( HMODULE hModule, 22 | DWORD ul_reason_for_call, 23 | LPVOID lpReserved 24 | ) 25 | { 26 | switch (ul_reason_for_call) 27 | { 28 | case DLL_PROCESS_ATTACH: 29 | case DLL_THREAD_ATTACH: 30 | case DLL_THREAD_DETACH: 31 | case DLL_PROCESS_DETACH: 32 | break; 33 | } 34 | return TRUE; 35 | } 36 | 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # triage-collector 2 | 3 | triage-collector is a triage collection tool for fast forensic. 4 | It collects various artifacts on Windows. You can extend additional artifacts 5 | without compilation as well as pre-defined artifacts. 6 | 7 | * RAM 8 | * with WinPmem 9 | * with Magnet DumpIt for Windows (needed to place the binary and uncomment the line and comment out the WinPmem lines in triage-collector.ini) 10 | * NTFS 11 | * $MFT 12 | * $Logfile 13 | * $SECURE:$SDS 14 | * $UsnJrnl:$J 15 | * swap files 16 | * pagefile.sys 17 | * swapfile.sys 18 | * Prefetch 19 | * Event log 20 | * Registry 21 | * Amcache.hve 22 | * SAM, SECURITY, SOFTWARE, SYSTEM, DEFAULT 23 | * NTUser.dat, UsrClass.dat 24 | * for users and service profiles 25 | * TxR transaction logs 26 | * WMI 27 | * SRUM 28 | * Web 29 | * History (Chrome) 30 | * cookies.sqlite, places.sqlite (Firefox) 31 | * WebCacheV01.dat (IE and Edge) 32 | * History (Edge) 33 | * Windows.old (if this folder exists) 34 | * User-defined data (under each user and the root directory) 35 | * Pre-defined rules 36 | * startup 37 | * tasks 38 | * Intune 39 | * SUM 40 | * Windows Timeline 41 | * ntds.dit 42 | * sysvol 43 | * RDP cache 44 | * PowerShell Console History 45 | * $Recycle.bin 46 | * Thumb cache and Icon cache 47 | * Search Indexor 48 | * Thunderbird (needed to uncomment the line) 49 | * Outlook (needed to uncomment the line) 50 | * PCA (Program Compatibility Assistant) 51 | * BITS database 52 | 53 | triage-collector was based on cdir-collector. Since the author ignored my PR, I decided to fork it and modified it a lot. 54 | The differences between this and the original cdir-collector v1.3.6 are: 55 | * To support arbitrally file acquisition 56 | * Pre-defined artifacts are listed above. 57 | * To support additional artifacts 58 | * swap files 59 | * NTFS $Logfile 60 | * TxR registry transaction 61 | * To support recursive acquisition 62 | * To support 64bit on the triage-collector and ntfsparsedll binaries 63 | * To support acquireing multi-byte files 64 | * To load appropriate winpmem binary automatically according to the platform of the running OS 65 | * New ini parser named inipp 66 | * New ini format 67 | * Refactored many functions 68 | * Changed the import method of the functions on ntfsparsedll 69 | 70 | Since I modified and newly created many functions, please test it before using it. 71 | 72 | ## Download 73 | 74 | Binary is available on the following link. 75 | 76 | https://github.com/herosi/triage-collector/releases 77 | 78 | ## Build 79 | 80 | If you want to customise and build binary from source code, try to use Visual Studio 2019. 81 | 82 | Component of triage-collector: 83 | * triage-collector.ini 84 | * triage-collector.exe 85 | * NTFSParserDLL.dll 86 | * libcrypto-41.dll 87 | * libssl-43.dll 88 | * winpmem_mini_x64_rc2.exe 89 | * winpmem_mini_x86.exe 90 | * winpmem.exe (old stuff, optional) 91 | * winpmem-2.1.post4.exe (old stuff, optional) 92 | 93 | ## How to use 94 | 95 | All of component files place into USB stick or file server, then double-click triage-collector.exe. triage-collector requires administrative privilege. 96 | It creates "COMPUTERNAME_YYYYMMDDhhmmss" folder then collected data are stored on this folder. 97 | 98 | If you edit triage-collector.ini, you can switch the acquisition of each data type. You can also add user-defined rules in "[Users]" and "[System]" section. 99 | 100 | ## Third Party 101 | 102 | triage-collector depends on the following library/tools. 103 | 104 | * Library: NTFSParserDLL, LibreSSL and inipp, 105 | * Tool: winpmem 106 | - winpmem.exe is a part of c-aff4 project (https://github.com/Velocidex/c-aff4). 107 | - winpmem_mini_x64_rc2.exe and winpmem_mini_x86.exe are from https://github.com/Velocidex/WinPmem 108 | - winpmem-2.1.post4.exe is a part of rekall project (https://github.com/google/rekall). 109 | 110 | * Tool: Magnet DumpIt for Windows (optional) 111 | You can download Magnet DumpIt for Windows from https://www.magnetforensics.com/resources/magnet-dumpit-for-windows/ 112 | 113 | * Icon logo 114 | Created my logo at LogoMakr.com/app 115 | -------------------------------------------------------------------------------- /artifact_parser_helper/README.md: -------------------------------------------------------------------------------- 1 | # Artifact Parser Helper 2 | 3 | ** DO NOT use this batch file if you do not understand what it does. ** 4 | ** This is just attached for me and those who can understand what it does. ** 5 | ** DO NOT ask me about this. ** 6 | 7 | ## Usage 8 | ``` 9 | cd triage-collector_x64\artifact_parser_helper 10 | .\artifact_parser_helper.bat path_to_input_dir path_to_outut_dir [path_to_ini_file] [codepage] [drive_letter] 11 | ``` 12 | 13 | ## Requirement 14 | [RECmd](https://ericzimmerman.github.io/) 15 | [AmcacheParser](https://ericzimmerman.github.io/) 16 | [AppCompatCacheParser](https://ericzimmerman.github.io/) 17 | [SBECmd](https://ericzimmerman.github.io/) 18 | [RegRipper3](https://github.com/keydet89/RegRipper3.0) 19 | [yarp](https://github.com/msuhanov/yarp) 20 | 21 | [registryFlush.py](https://github.com/Silv3rHorn/4n6_misc/blob/master/registryFlush.py) (to process jornal logs for regripper) 22 | 23 | [EvtxECmd](https://ericzimmerman.github.io/) 24 | [hayabusa](https://github.com/Yamato-Security/hayabusa) 25 | [takajo](https://github.com/Yamato-Security/takajo) 26 | [chainsaw](https://github.com/WithSecureLabs/chainsaw) 27 | [Zircolite](https://github.com/wagga40/Zircolite) 28 | [evtxexport](https://github.com/libyal/libevtx) 29 | [evtx_dump](https://github.com/omerbenamram/evtx) by omerbenamram 30 | [EVTXtract](https://github.com/williballenthin/EVTXtract) 31 | xml_evtx_parse.py for evtx_dump and EVTXtract to convert xml into csv (attached) 32 | Get-WinEvent from PowerShell 33 | 34 | [MFTECmd](https://ericzimmerman.github.io/) 35 | [NTFS_Log_Tracker_CMD](https://sites.google.com/site/forensicnote/ntfs-log-tracker) 36 | [mactime.pl](https://www.sleuthkit.org/) (from SleuthKit) 37 | 38 | [srum_dump2](https://github.com/MarkBaggett/srum-dump) 39 | [SrumECmd](https://ericzimmerman.github.io/) 40 | [SumECmd](https://ericzimmerman.github.io/) 41 | [PECmd](https://ericzimmerman.github.io/) 42 | [JLECmd](https://ericzimmerman.github.io/) 43 | [LECmd](https://ericzimmerman.github.io/) 44 | [RBCmd](https://ericzimmerman.github.io/) 45 | [WxTCmd](https://ericzimmerman.github.io/) 46 | [BrowsingHistoryView](https://www.nirsoft.net/utils/browsing_history_view.html) 47 | [flare-wmi](https://github.com/mandiant/flare-wmi) 48 | [thumbcache_viewer_cmd.exe](https://thumbcacheviewer.github.io/) 49 | [sidr](https://github.com/strozfriedberg/sidr) 50 | [BitsParser](https://github.com/digitalsleuth/BitsParser) 51 | [jq](https://jqlang.github.io/jq/) 52 | 53 | [bmc-tools.py](https://github.com/ANSSI-FR/bmc-tools) 54 | [rdpieces.pl](https://github.com/brimorlabs/rdpieces) 55 | task_parser.py (attached) 56 | 57 | ** And of course, you need to resolve the dependencies of the tools above. ** 58 | 59 | -------------------------------------------------------------------------------- /artifact_parser_helper/artifact_parser_helper.ini: -------------------------------------------------------------------------------- 1 | [Common] 2 | ; if codepage is not set, the default codepage of the sytem will be set. 3 | ;codepage=932 4 | 5 | [Parser] 6 | ; NTFS metadata with MFTECmd 7 | MFTECmd_MFT=true 8 | MFTECmd_MFT_TL=true 9 | MFTECmd_Log=true 10 | MFTECmd_J=false 11 | MFTECmd_SDS=true 12 | 13 | ; NTFS metadata with NTFS Log Tracker 14 | NLT_Log=true 15 | NLT_J=true 16 | 17 | ; Event log 18 | PSGetWinEvent=true 19 | EvtxECmd=true 20 | HAYABUSA=true 21 | TAKAJO=true 22 | CHAINSAW=false 23 | ZIRCOLITE=false 24 | evtx_dump=true 25 | evtxtract=true 26 | evtxexport_txt=false 27 | evtxexport_xml=false 28 | 29 | ; Registry 30 | RegRipper=true 31 | RECmd=true 32 | RECmd_IIJ=true 33 | AmcacheParser=true 34 | AppCompatCacheParser=true 35 | SBECmd=true 36 | YarpTimeline=true 37 | YarpPrint=true 38 | 39 | ; SRUM 40 | SrumECmd=true 41 | srumdump=true 42 | 43 | ; RDP cache 44 | BmcTools=true 45 | Rdpieces=true 46 | 47 | ; Prefetch 48 | PECmd=true 49 | 50 | ; Sum 51 | SumECmd=true 52 | 53 | ; Jump List 54 | JLECmd=true 55 | 56 | ; Recent 57 | LECmd=true 58 | 59 | ; Recycle Bin 60 | RBCmd=true 61 | 62 | ; Windows Timeline 63 | WxTCmd=true 64 | 65 | ; Web Browser History 66 | BrowsingHistoryView=true 67 | 68 | ; flare-wmi 69 | WMI=true 70 | 71 | ; thumb cache and icon cache 72 | THUMBCACHE=true 73 | 74 | ; tasks 75 | TASKS=true 76 | 77 | ; Search Indexor 78 | SIDR=true 79 | 80 | ; BITS database 81 | BitsParser=true 82 | 83 | [RECmd] 84 | REBatchFolder=C:\tools\EzTools\net6\RECmd\BatchExamples 85 | ; set RECmd batch files without the extension with a space separator 86 | REBatches=AllRegExecutablesFoundOrRun Kroll_Batch RegistryASEPs UserActivity 87 | IIJ_REBatchFolder=. 88 | IIJ_REBatches=IIJCheckList 89 | 90 | [yarp] 91 | YARPPath=C:\tools\tvenv\Scripts 92 | 93 | [BitsParser] 94 | BPPath=C:\tools\BitsParser 95 | 96 | [RegFlush] 97 | RFPath=C:\tools 98 | 99 | [chainsaw] 100 | CSPath=C:\tools\chainsaw 101 | 102 | [zircolite] 103 | ZLPath=C:\tools\zircolite_win 104 | 105 | -------------------------------------------------------------------------------- /artifact_parser_helper/bulk_artifact_parser_helper.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set indir=%~1 4 | set outdir=%~2 5 | set inifile=%~3 6 | 7 | 8 | if x"%inifile%" == x"" ( 9 | set inifile=.\artifact_parser_helper.ini 10 | ) 11 | 12 | 13 | for /f "delims=" %%f in ('dir /b "%indir%"') do ( 14 | echo %%f 15 | if exist "%indir%\%%f\triage-collector" ( 16 | artifact_parser_helper.bat "%indir%\%%f\triage-collector" "%outdir%\%%f\parsed_artifacts" "%inifile%" 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /artifact_parser_helper/task_parser.py: -------------------------------------------------------------------------------- 1 | import xml.dom.minidom 2 | import sys 3 | import os 4 | import datetime 5 | import platform 6 | 7 | def creation_date(path_to_file): 8 | """ 9 | Try to get the date that a file was created, falling back to when it was 10 | last modified if that isn't possible. 11 | See http://stackoverflow.com/a/39501288/1709587 for explanation. 12 | """ 13 | if platform.system() == 'Windows': 14 | return os.path.getctime(path_to_file) 15 | else: 16 | stat = os.stat(path_to_file) 17 | try: 18 | return stat.st_birthtime 19 | except AttributeError: 20 | # We're probably on Linux. No easy way to get creation dates here, 21 | # so we'll settle for when its content was last modified. 22 | return stat.st_mtime 23 | 24 | def parse_task(dom): 25 | reginfo = dom.getElementsByTagName("RegistrationInfo") 26 | edt = reginfo[0].getElementsByTagName("Date") 27 | dt = "" 28 | if len(edt) > 0: 29 | dt = edt[0].firstChild.data 30 | eauthor = reginfo[0].getElementsByTagName("Author") 31 | author = "" 32 | if len(eauthor) > 0: 33 | author = eauthor[0].firstChild.data 34 | 35 | uri = "" 36 | euri = reginfo[0].getElementsByTagName("URI") 37 | if len(euri) > 0: 38 | uri = euri[0].firstChild.data 39 | 40 | actions = dom.getElementsByTagName("Actions") 41 | cmd = "" 42 | args = "" 43 | for exec in actions[0].getElementsByTagName("Exec"): 44 | ecmd = exec.getElementsByTagName("Command") 45 | if len(ecmd) > 0: 46 | cmd = ecmd[0].firstChild.data 47 | eargs = exec.getElementsByTagName("Arguments") 48 | if len(eargs) > 0 and eargs[0] and eargs[0].firstChild: 49 | args = eargs[0].firstChild.data 50 | 51 | clsid = "" 52 | ecom = actions[0].getElementsByTagName("ComHandler") 53 | if len(ecom) > 0: 54 | eclsid = ecom[0].getElementsByTagName("ClassId") 55 | if len(eclsid) > 0 and eclsid[0] and eclsid[0].firstChild: 56 | clsid = eclsid[0].firstChild.data 57 | 58 | return dt, uri, author, cmd, args, clsid 59 | 60 | def find_all_files(directory): 61 | for cur_dir, dirs, files in os.walk(directory): 62 | for file in files: 63 | yield os.path.join(cur_dir, file) 64 | 65 | def get_file_cmtime(fname): 66 | return creation_date(fname), os.path.getmtime(fname) 67 | 68 | 69 | def print_result(input): 70 | dom = xml.dom.minidom.parse(input) 71 | result = [datetime.datetime.fromtimestamp(x).strftime('%Y/%m/%d %H:%M:%S.%f') for x in get_file_cmtime(input)] 72 | result.extend(parse_task(dom)) 73 | result.append(input) 74 | print("\t".join(result)) 75 | 76 | def __main__(): 77 | print("File Creation\tFile Modification\tTask Creation\tTask URI\tTask Author\tCommand\tArgs\tCLSID\tFile Name") 78 | input = sys.argv[1] 79 | if os.path.isfile(input): 80 | print_result(input) 81 | elif os.path.isdir(input): 82 | for file in find_all_files(input): 83 | # print(file) 84 | print_result(file) 85 | 86 | if __name__ == "__main__": 87 | __main__() 88 | 89 | #print("%s\t%s\t%s\t%s\t%s" % (dt.firstChild.data, uri.firstChild.data, author.firstChild.data, cmd, args)) 90 | -------------------------------------------------------------------------------- /artifact_parser_helper/to_get_attribs.json: -------------------------------------------------------------------------------- 1 | { 2 | "4624,Security": { 3 | "attrib_names" : [ 4 | "TargetUserSid", "TargetUserName", "TargetDomainName", 5 | "LogonGuid", "IpAddress", "IpPort", 6 | "WorkstationName", "TargetLogonId", "LogonType", 7 | "ProcessId", "ProcessName", 8 | "LogonProcessName", "AuthenticationPackageName", 9 | "RestrictedAdminMode", "TargetLinkedLogonId", "ImpersonationLevel", 10 | "ElevatedToken" 11 | ], 12 | "attrib_name": "Name" 13 | }, 14 | "4648,Security": { 15 | "attrib_names" : [ 16 | "TargetUserSid", "TargetUserName", "TargetDomainName", 17 | "TargetLogonGuid", "IpAddress", "IpPort", 18 | "TargetServerName", 19 | "TargetLogonId", "LogonType", 20 | "ProcessId", "ProcessName", 21 | "TargetInfo" 22 | ], 23 | "attrib_name": "Name" 24 | }, 25 | "4672,Security": { 26 | "attrib_names" : [ 27 | "SubjectUserSid", "SubjectUserName", "SubjectDomainName", 28 | "SubjectLogonGuid", "PrivilegeList" 29 | ], 30 | "attrib_name": "Name" 31 | }, 32 | "4768,Security": { 33 | "attrib_names": [ 34 | "TargetSid", "TargetUserName", "TargetDomainName", 35 | "LogonGuid", "IpAddress", "IpPort", 36 | "TicketEncryptionType", "TicketOptions", 37 | "ServiceName", "ServiceSid" 38 | ], 39 | "attrib_name": "Name" 40 | }, 41 | "4742,Security": {}, 42 | "4769,Security": { 43 | "attrib_names": [ 44 | "TargetSidDummy", "TargetUserName", "TargetDomainName", 45 | "LogonGuid", "IpAddress", "IpPort", 46 | "TicketEncryptionType", "TicketOptions", 47 | "ServiceName", "ServiceSid" 48 | ], 49 | "attrib_name": "Name" 50 | }, 51 | "4728,Security": { 52 | }, 53 | "4770,Security": { 54 | "attrib_names": [ 55 | "TargetSidDummy", "TargetUserName", "TargetDomainName", 56 | "LogonGuid", "IpAddress", "IpPort", 57 | "TicketEncryptionType", "TicketOptions", 58 | "ServiceName", "ServiceSid" 59 | ], 60 | "attrib_name": "Name" 61 | }, 62 | "4776,Security": { 63 | "attrib_names": [ 64 | "TargetSid_Dummy", "TargetUserName", "TargetDomainName_Dummy", 65 | "LogonGuid_Dummy", "Workstation", "Status", 66 | "PackageName" 67 | ], 68 | "attrib_name": "Name" 69 | }, 70 | "4662,Security": { 71 | }, 72 | "106,Microsoft-Windows-TaskScheduler/Operational": { 73 | "attrib_names": [ 74 | "TaskName", "UserContext" 75 | ], 76 | "attrib_name": "Name" 77 | }, 78 | "110,Microsoft-Windows-TaskScheduler/Operational": { 79 | "attrib_names": [ 80 | "TaskName", "UserContext", "InstanceId" 81 | ], 82 | "attrib_name": "Name" 83 | }, 84 | "140,Microsoft-Windows-TaskScheduler/Operational": { 85 | "attrib_names": [ 86 | "TaskName", "UserName" 87 | ], 88 | "attrib_name": "Name" 89 | }, 90 | "141,Microsoft-Windows-TaskScheduler/Operational": { 91 | "attrib_names": [ 92 | "TaskName", "UserName" 93 | ], 94 | "attrib_name": "Name" 95 | }, 96 | "21,Microsoft-Windows-TerminalServices-LocalSessionManager/Operational": {}, 97 | "22,Microsoft-Windows-TerminalServices-LocalSessionManager/Operational": {}, 98 | "24,Microsoft-Windows-TerminalServices-LocalSessionManager/Operational": {}, 99 | "25,Microsoft-Windows-TerminalServices-LocalSessionManager/Operational": {}, 100 | "1149,Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational": { 101 | "tag_names": [ 102 | "Dummy1", "Param1", "Param2", 103 | "Dummy4", "Param3" 104 | ], 105 | "ns": "Event_NS" 106 | }, 107 | "1102,Microsoft-Windows-TerminalServices-RDPClient/Operational": { 108 | "attrib_names": [ 109 | "Dummy1", "Dummy2", "Dummy3", "Dummy4", "Dummy5", "Dummy6", "Value" 110 | ], 111 | "attrib_name": "Name" 112 | }, 113 | "1024,Microsoft-Windows-TerminalServices-RDPClient/Operational": {}, 114 | "1029,Microsoft-Windows-TerminalServices-RDPClient/Operational": {}, 115 | "5860,Microsoft-Windows-WMI-Activity/Operational": {}, 116 | "5861,Microsoft-Windows-WMI-Activity/Operational": {}, 117 | "5857,Microsoft-Windows-WMI-Activity/Operational": {}, 118 | "5858,Microsoft-Windows-WMI-Activity/Operational": {}, 119 | "91,Microsoft-Windows-WinRM/Operational":{}, 120 | "6,Microsoft-Windows-WinRM/Operational":{ 121 | "attrib_names": [ 122 | "connection" 123 | ], 124 | "attrib_name": "Name" 125 | }, 126 | "4103,Microsoft-Windows-PowerShell/Operational": { 127 | "attrib_names": [ 128 | "ContextInfo", "Payload", "UserData" 129 | ], 130 | "attrib_name": "Name" 131 | }, 132 | "4104,Microsoft-Windows-PowerShell/Operational": { 133 | "attrib_names": [ 134 | "Path", "MessageNumber", "MessageTotal" 135 | ], 136 | "attrib_name": "Name" 137 | }, 138 | "53504,Microsoft-Windows-PowerShell/Operational": { 139 | "attrib_names": [ 140 | "param1", "param2" 141 | ], 142 | "attrib_name": "Name" 143 | }, 144 | "400,Windows PowerShell": { 145 | }, 146 | "403,Windows PowerShell": { 147 | }, 148 | "800,Windows PowerShell": {}, 149 | "7045,System": { 150 | "attrib_names": [ 151 | "AccountName", "ImagePath", "ServiceName", "ServiceType", "StartType" 152 | ], 153 | "attrib_name": "Name" 154 | }, 155 | "1014,System": { 156 | "attrib_names": [ 157 | "QueryName", "Address", "AddressLength" 158 | ], 159 | "attrib_name": "Name" 160 | }, 161 | "5145,Security": {}, 162 | "4656,Security": {}, 163 | "1102,Security": {}, 164 | "104,System": {}, 165 | "9707,Microsoft-Windows-Shell-Core/Operational": {}, 166 | "9708,Microsoft-Windows-Shell-Core/Operational": {}, 167 | "10,Microsoft-Windows-Sysmon/Operational": {} 168 | } 169 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/aes.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: aes.h,v 1.14 2014/07/09 09:10:07 miod Exp $ */ 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 | unsigned int rd_key[4 *(AES_MAXNR + 1)]; 78 | int rounds; 79 | }; 80 | typedef struct aes_key_st AES_KEY; 81 | 82 | const char *AES_options(void); 83 | 84 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, 85 | AES_KEY *key); 86 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, 87 | AES_KEY *key); 88 | 89 | void AES_encrypt(const unsigned char *in, unsigned char *out, 90 | const AES_KEY *key); 91 | void AES_decrypt(const unsigned char *in, unsigned char *out, 92 | const AES_KEY *key); 93 | 94 | void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, 95 | const AES_KEY *key, const int enc); 96 | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, 97 | size_t length, const AES_KEY *key, unsigned char *ivec, const int enc); 98 | void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, 99 | size_t length, const AES_KEY *key, unsigned char *ivec, int *num, 100 | const int enc); 101 | void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, 102 | size_t length, const AES_KEY *key, unsigned char *ivec, int *num, 103 | const int enc); 104 | void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, 105 | size_t length, const AES_KEY *key, unsigned char *ivec, int *num, 106 | const int enc); 107 | void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, 108 | size_t length, const AES_KEY *key, unsigned char *ivec, int *num); 109 | void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, 110 | size_t length, const AES_KEY *key, unsigned char ivec[AES_BLOCK_SIZE], 111 | unsigned char ecount_buf[AES_BLOCK_SIZE], unsigned int *num); 112 | /* NB: the IV is _two_ blocks long */ 113 | void AES_ige_encrypt(const unsigned char *in, unsigned char *out, 114 | size_t length, const AES_KEY *key, unsigned char *ivec, const int enc); 115 | 116 | int AES_wrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, 117 | const unsigned char *in, unsigned int inlen); 118 | int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, 119 | const unsigned char *in, unsigned int inlen); 120 | 121 | 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | 126 | #endif /* !HEADER_AES_H */ 127 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/blowfish.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: blowfish.h,v 1.14 2014/07/10 09:01:04 miod Exp $ */ 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 | #define BF_LONG unsigned int 83 | 84 | #define BF_ROUNDS 16 85 | #define BF_BLOCK 8 86 | 87 | typedef struct bf_key_st 88 | { 89 | BF_LONG P[BF_ROUNDS+2]; 90 | BF_LONG S[4*256]; 91 | } BF_KEY; 92 | 93 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data); 94 | 95 | void BF_encrypt(BF_LONG *data,const BF_KEY *key); 96 | void BF_decrypt(BF_LONG *data,const BF_KEY *key); 97 | 98 | void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, 99 | const BF_KEY *key, int enc); 100 | void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 101 | const BF_KEY *schedule, unsigned char *ivec, int enc); 102 | void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length, 103 | const BF_KEY *schedule, unsigned char *ivec, int *num, int enc); 104 | void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, long length, 105 | const BF_KEY *schedule, unsigned char *ivec, int *num); 106 | const char *BF_options(void); 107 | 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | 112 | #endif 113 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/buffer.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: buffer.h,v 1.15 2015/06/24 10:05:14 jsing Exp $ */ 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 | #if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__OpenBSD__) 62 | #define __bounded__(x, y, z) 63 | #endif 64 | 65 | #include 66 | 67 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | 71 | #include 72 | #include 73 | 74 | /* Already declared in ossl_typ.h */ 75 | /* typedef struct buf_mem_st BUF_MEM; */ 76 | 77 | struct buf_mem_st { 78 | size_t length; /* current number of bytes */ 79 | char *data; 80 | size_t max; /* size of buffer */ 81 | }; 82 | 83 | BUF_MEM *BUF_MEM_new(void); 84 | void BUF_MEM_free(BUF_MEM *a); 85 | int BUF_MEM_grow(BUF_MEM *str, size_t len); 86 | int BUF_MEM_grow_clean(BUF_MEM *str, size_t len); 87 | 88 | #ifndef LIBRESSL_INTERNAL 89 | char * BUF_strdup(const char *str); 90 | char * BUF_strndup(const char *str, size_t siz); 91 | void * BUF_memdup(const void *data, size_t siz); 92 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); 93 | 94 | /* safe string functions */ 95 | size_t BUF_strlcpy(char *dst, const char *src, size_t siz) 96 | __attribute__ ((__bounded__(__string__,1,3))); 97 | size_t BUF_strlcat(char *dst, const char *src, size_t siz) 98 | __attribute__ ((__bounded__(__string__,1,3))); 99 | #endif 100 | 101 | /* BEGIN ERROR CODES */ 102 | /* The following lines are auto generated by the script mkerr.pl. Any changes 103 | * made after this point may be overwritten when the script is next run. 104 | */ 105 | void ERR_load_BUF_strings(void); 106 | 107 | /* Error codes for the BUF functions. */ 108 | 109 | /* Function codes. */ 110 | #define BUF_F_BUF_MEMDUP 103 111 | #define BUF_F_BUF_MEM_GROW 100 112 | #define BUF_F_BUF_MEM_GROW_CLEAN 105 113 | #define BUF_F_BUF_MEM_NEW 101 114 | #define BUF_F_BUF_STRDUP 102 115 | #define BUF_F_BUF_STRNDUP 104 116 | 117 | /* Reason codes. */ 118 | 119 | #ifdef __cplusplus 120 | } 121 | #endif 122 | #endif 123 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/camellia.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: camellia.h,v 1.5 2014/11/13 20:01:58 miod Exp $ */ 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 | union { 83 | double d; /* ensures 64-bit align */ 84 | KEY_TABLE_TYPE rd_key; 85 | } u; 86 | int grand_rounds; 87 | }; 88 | typedef struct camellia_key_st CAMELLIA_KEY; 89 | 90 | int Camellia_set_key(const unsigned char *userKey, const int bits, 91 | CAMELLIA_KEY *key); 92 | 93 | void Camellia_encrypt(const unsigned char *in, unsigned char *out, 94 | const CAMELLIA_KEY *key); 95 | void Camellia_decrypt(const unsigned char *in, unsigned char *out, 96 | const CAMELLIA_KEY *key); 97 | 98 | void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out, 99 | const CAMELLIA_KEY *key, const int enc); 100 | void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out, 101 | size_t length, const CAMELLIA_KEY *key, 102 | unsigned char *ivec, const int enc); 103 | void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out, 104 | size_t length, const CAMELLIA_KEY *key, 105 | unsigned char *ivec, int *num, const int enc); 106 | void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out, 107 | size_t length, const CAMELLIA_KEY *key, 108 | unsigned char *ivec, int *num, const int enc); 109 | void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out, 110 | size_t length, const CAMELLIA_KEY *key, 111 | unsigned char *ivec, int *num, const int enc); 112 | void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out, 113 | size_t length, const CAMELLIA_KEY *key, 114 | unsigned char *ivec, int *num); 115 | void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, 116 | size_t length, const CAMELLIA_KEY *key, 117 | unsigned char ivec[CAMELLIA_BLOCK_SIZE], 118 | unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE], 119 | unsigned int *num); 120 | 121 | #ifdef __cplusplus 122 | } 123 | #endif 124 | 125 | #endif /* !HEADER_Camellia_H */ 126 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/cast.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: cast.h,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ 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 | #include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 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 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); 87 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, const CAST_KEY *key, 88 | int enc); 89 | void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); 90 | void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); 91 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 92 | const CAST_KEY *ks, unsigned char *iv, int enc); 93 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, 94 | long length, const CAST_KEY *schedule, unsigned char *ivec, 95 | int *num, int enc); 96 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, 97 | long length, const CAST_KEY *schedule, unsigned char *ivec, 98 | int *num); 99 | 100 | #ifdef __cplusplus 101 | } 102 | #endif 103 | 104 | #endif 105 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/chacha.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: chacha.h,v 1.7 2015/12/09 14:07:55 bcook Exp $ */ 2 | /* 3 | * Copyright (c) 2014 Joel Sing 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #ifndef HEADER_CHACHA_H 19 | #define HEADER_CHACHA_H 20 | 21 | #include 22 | 23 | #if defined(OPENSSL_NO_CHACHA) 24 | #error ChaCha is disabled. 25 | #endif 26 | 27 | #include 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct { 35 | unsigned int input[16]; 36 | unsigned char ks[64]; 37 | unsigned char unused; 38 | } ChaCha_ctx; 39 | 40 | void ChaCha_set_key(ChaCha_ctx *ctx, const unsigned char *key, 41 | unsigned int keybits); 42 | void ChaCha_set_iv(ChaCha_ctx *ctx, const unsigned char *iv, 43 | const unsigned char *counter); 44 | void ChaCha(ChaCha_ctx *ctx, unsigned char *out, const unsigned char *in, 45 | size_t len); 46 | 47 | void CRYPTO_chacha_20(unsigned char *out, const unsigned char *in, size_t len, 48 | const unsigned char key[32], const unsigned char iv[8], uint64_t counter); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* HEADER_CHACHA_H */ 55 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/cmac.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: cmac.h,v 1.3 2014/06/21 13:42:14 jsing Exp $ */ 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 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/comp.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: comp.h,v 1.8 2014/11/03 16:58:28 tedu Exp $ */ 2 | 3 | #ifndef HEADER_COMP_H 4 | #define HEADER_COMP_H 5 | 6 | #include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | typedef struct comp_ctx_st COMP_CTX; 13 | 14 | typedef struct comp_method_st { 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, unsigned char *out, unsigned int olen, 20 | unsigned char *in, unsigned int ilen); 21 | int (*expand)(COMP_CTX *ctx, unsigned char *out, unsigned int olen, 22 | unsigned char *in, unsigned int ilen); 23 | /* The following two do NOTHING, but are kept for backward compatibility */ 24 | long (*ctrl)(void); 25 | long (*callback_ctrl)(void); 26 | } COMP_METHOD; 27 | 28 | struct comp_ctx_st { 29 | COMP_METHOD *meth; 30 | unsigned long compress_in; 31 | unsigned long compress_out; 32 | unsigned long expand_in; 33 | unsigned long expand_out; 34 | 35 | CRYPTO_EX_DATA ex_data; 36 | }; 37 | 38 | 39 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 40 | void COMP_CTX_free(COMP_CTX *ctx); 41 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 42 | unsigned char *in, int ilen); 43 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 44 | unsigned char *in, int ilen); 45 | COMP_METHOD *COMP_rle(void ); 46 | COMP_METHOD *COMP_zlib(void ); 47 | void COMP_zlib_cleanup(void); 48 | 49 | #ifdef HEADER_BIO_H 50 | #ifdef ZLIB 51 | BIO_METHOD *BIO_f_zlib(void); 52 | #endif 53 | #endif 54 | 55 | void ERR_load_COMP_strings(void); 56 | 57 | /* Error codes for the COMP functions. */ 58 | 59 | /* Function codes. */ 60 | #define COMP_F_BIO_ZLIB_FLUSH 99 61 | #define COMP_F_BIO_ZLIB_NEW 100 62 | #define COMP_F_BIO_ZLIB_READ 101 63 | #define COMP_F_BIO_ZLIB_WRITE 102 64 | 65 | /* Reason codes. */ 66 | #define COMP_R_ZLIB_DEFLATE_ERROR 99 67 | #define COMP_R_ZLIB_INFLATE_ERROR 100 68 | #define COMP_R_ZLIB_NOT_SUPPORTED 101 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | #endif 74 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/conf_api.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: conf_api.h,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ 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 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/curve25519.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Google Inc. 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 | * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | 17 | #ifndef HEADER_CURVE25519_H 18 | #define HEADER_CURVE25519_H 19 | 20 | #include 21 | 22 | #include 23 | 24 | #if defined(__cplusplus) 25 | extern "C" { 26 | #endif 27 | 28 | /* 29 | * Curve25519. 30 | * 31 | * Curve25519 is an elliptic curve. See https://tools.ietf.org/html/rfc7748. 32 | */ 33 | 34 | /* 35 | * X25519. 36 | * 37 | * X25519 is the Diffie-Hellman primitive built from curve25519. It is 38 | * sometimes referred to as curve25519, but X25519 is a more precise name. 39 | * See http://cr.yp.to/ecdh.html and https://tools.ietf.org/html/rfc7748. 40 | */ 41 | 42 | #define X25519_KEY_LENGTH 32 43 | 44 | /* 45 | * X25519_keypair sets |out_public_value| and |out_private_key| to a freshly 46 | * generated, public/private key pair. 47 | */ 48 | void X25519_keypair(uint8_t out_public_value[X25519_KEY_LENGTH], 49 | uint8_t out_private_key[X25519_KEY_LENGTH]); 50 | 51 | /* 52 | * X25519 writes a shared key to |out_shared_key| that is calculated from the 53 | * given private key and the peer's public value. It returns one on success and 54 | * zero on error. 55 | * 56 | * Don't use the shared key directly, rather use a KDF and also include the two 57 | * public values as inputs. 58 | */ 59 | int X25519(uint8_t out_shared_key[X25519_KEY_LENGTH], 60 | const uint8_t private_key[X25519_KEY_LENGTH], 61 | const uint8_t peers_public_value[X25519_KEY_LENGTH]); 62 | 63 | #if defined(__cplusplus) 64 | } /* extern C */ 65 | #endif 66 | 67 | #endif /* HEADER_CURVE25519_H */ 68 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/dtls1.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: dtls1.h,v 1.21 2017/01/22 07:16:39 beck Exp $ */ 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_DTLS1_H 61 | #define HEADER_DTLS1_H 62 | 63 | #if defined(_WIN32) 64 | #include 65 | #else 66 | #include 67 | #endif 68 | 69 | #include 70 | #include 71 | #include 72 | 73 | #include 74 | #include 75 | 76 | #ifdef __cplusplus 77 | extern "C" { 78 | #endif 79 | 80 | #define DTLS1_VERSION 0xFEFF 81 | 82 | /* lengths of messages */ 83 | #define DTLS1_COOKIE_LENGTH 256 84 | 85 | #define DTLS1_RT_HEADER_LENGTH 13 86 | 87 | #define DTLS1_HM_HEADER_LENGTH 12 88 | 89 | #define DTLS1_HM_BAD_FRAGMENT -2 90 | #define DTLS1_HM_FRAGMENT_RETRY -3 91 | 92 | #define DTLS1_CCS_HEADER_LENGTH 1 93 | 94 | #ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE 95 | #define DTLS1_AL_HEADER_LENGTH 7 96 | #else 97 | #define DTLS1_AL_HEADER_LENGTH 2 98 | #endif 99 | 100 | #ifndef OPENSSL_NO_SSL_INTERN 101 | 102 | 103 | typedef struct dtls1_bitmap_st { 104 | unsigned long map; /* track 32 packets on 32-bit systems 105 | and 64 - on 64-bit systems */ 106 | unsigned char max_seq_num[8]; /* max record number seen so far, 107 | 64-bit value in big-endian 108 | encoding */ 109 | } DTLS1_BITMAP; 110 | 111 | struct dtls1_retransmit_state { 112 | EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */ 113 | EVP_MD_CTX *write_hash; /* used for mac generation */ 114 | SSL_SESSION *session; 115 | unsigned short epoch; 116 | }; 117 | 118 | struct hm_header_st { 119 | unsigned char type; 120 | unsigned long msg_len; 121 | unsigned short seq; 122 | unsigned long frag_off; 123 | unsigned long frag_len; 124 | unsigned int is_ccs; 125 | struct dtls1_retransmit_state saved_retransmit_state; 126 | }; 127 | 128 | struct ccs_header_st { 129 | unsigned char type; 130 | unsigned short seq; 131 | }; 132 | 133 | struct dtls1_timeout_st { 134 | /* Number of read timeouts so far */ 135 | unsigned int read_timeouts; 136 | 137 | /* Number of write timeouts so far */ 138 | unsigned int write_timeouts; 139 | 140 | /* Number of alerts received so far */ 141 | unsigned int num_alerts; 142 | }; 143 | 144 | struct _pqueue; 145 | 146 | typedef struct record_pqueue_st { 147 | unsigned short epoch; 148 | struct _pqueue *q; 149 | } record_pqueue; 150 | 151 | typedef struct hm_fragment_st { 152 | struct hm_header_st msg_header; 153 | unsigned char *fragment; 154 | unsigned char *reassembly; 155 | } hm_fragment; 156 | 157 | struct dtls1_state_internal_st; 158 | 159 | typedef struct dtls1_state_st { 160 | /* Buffered (sent) handshake records */ 161 | struct _pqueue *sent_messages; 162 | 163 | /* Indicates when the last handshake msg or heartbeat sent will timeout */ 164 | struct timeval next_timeout; 165 | 166 | /* Timeout duration */ 167 | unsigned short timeout_duration; 168 | 169 | struct dtls1_state_internal_st *internal; 170 | } DTLS1_STATE; 171 | 172 | typedef struct dtls1_record_data_st { 173 | unsigned char *packet; 174 | unsigned int packet_length; 175 | SSL3_BUFFER rbuf; 176 | SSL3_RECORD rrec; 177 | } DTLS1_RECORD_DATA; 178 | 179 | #endif 180 | 181 | /* Timeout multipliers (timeout slice is defined in apps/timeouts.h */ 182 | #define DTLS1_TMO_READ_COUNT 2 183 | #define DTLS1_TMO_WRITE_COUNT 2 184 | 185 | #define DTLS1_TMO_ALERT_COUNT 12 186 | 187 | #ifdef __cplusplus 188 | } 189 | #endif 190 | #endif 191 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/ecdh.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: ecdh.h,v 1.5 2015/09/13 12:03:07 jsing Exp $ */ 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_size(const EC_KEY *ecdh); 95 | int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, 96 | EC_KEY *ecdh, 97 | void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)); 98 | 99 | int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new 100 | *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 101 | int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg); 102 | void *ECDH_get_ex_data(EC_KEY *d, int idx); 103 | 104 | 105 | /* BEGIN ERROR CODES */ 106 | /* The following lines are auto generated by the script mkerr.pl. Any changes 107 | * made after this point may be overwritten when the script is next run. 108 | */ 109 | void ERR_load_ECDH_strings(void); 110 | 111 | /* Error codes for the ECDH functions. */ 112 | 113 | /* Function codes. */ 114 | #define ECDH_F_ECDH_CHECK 102 115 | #define ECDH_F_ECDH_COMPUTE_KEY 100 116 | #define ECDH_F_ECDH_DATA_NEW_METHOD 101 117 | 118 | /* Reason codes. */ 119 | #define ECDH_R_KDF_FAILED 102 120 | #define ECDH_R_KEY_TRUNCATION 104 121 | #define ECDH_R_NON_FIPS_METHOD 103 122 | #define ECDH_R_NO_PRIVATE_VALUE 100 123 | #define ECDH_R_POINT_ARITHMETIC_FAILURE 101 124 | 125 | #ifdef __cplusplus 126 | } 127 | #endif 128 | #endif 129 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/hmac.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: hmac.h,v 1.12 2014/06/21 13:39:46 jsing Exp $ */ 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 | const EVP_MD *md; 77 | EVP_MD_CTX md_ctx; 78 | EVP_MD_CTX i_ctx; 79 | EVP_MD_CTX o_ctx; 80 | unsigned int key_length; 81 | unsigned char key[HMAC_MAX_MD_CBLOCK]; 82 | } HMAC_CTX; 83 | 84 | #define HMAC_size(e) (EVP_MD_size((e)->md)) 85 | 86 | 87 | void HMAC_CTX_init(HMAC_CTX *ctx); 88 | void HMAC_CTX_cleanup(HMAC_CTX *ctx); 89 | 90 | #define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */ 91 | 92 | int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, 93 | const EVP_MD *md); /* deprecated */ 94 | int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md, 95 | ENGINE *impl); 96 | int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); 97 | int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); 98 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, 99 | const unsigned char *d, size_t n, unsigned char *md, unsigned int *md_len); 100 | int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); 101 | 102 | void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/idea.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: idea.h,v 1.10 2014/06/12 15:49:29 deraadt Exp $ */ 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 | void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); 87 | void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); 88 | void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, 89 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,int enc); 90 | void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out, 91 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 92 | int *num,int enc); 93 | void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out, 94 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num); 95 | void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/md4.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: md4.h,v 1.16 2015/09/14 01:45:03 doug Exp $ */ 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 | #include 60 | 61 | #ifndef HEADER_MD4_H 62 | #define HEADER_MD4_H 63 | 64 | #include 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | 70 | #ifdef OPENSSL_NO_MD4 71 | #error MD4 is disabled. 72 | #endif 73 | 74 | /* 75 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 76 | * ! MD4_LONG has to be at least 32 bits wide. ! 77 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 78 | */ 79 | 80 | #define MD4_LONG unsigned int 81 | 82 | #define MD4_CBLOCK 64 83 | #define MD4_LBLOCK (MD4_CBLOCK/4) 84 | #define MD4_DIGEST_LENGTH 16 85 | 86 | typedef struct MD4state_st 87 | { 88 | MD4_LONG A,B,C,D; 89 | MD4_LONG Nl,Nh; 90 | MD4_LONG data[MD4_LBLOCK]; 91 | unsigned int num; 92 | } MD4_CTX; 93 | 94 | int MD4_Init(MD4_CTX *c); 95 | int MD4_Update(MD4_CTX *c, const void *data, size_t len); 96 | int MD4_Final(unsigned char *md, MD4_CTX *c); 97 | unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); 98 | void MD4_Transform(MD4_CTX *c, const unsigned char *b); 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/md5.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: md5.h,v 1.20 2014/10/20 13:06:54 bcook Exp $ */ 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 | #include 60 | 61 | #ifndef HEADER_MD5_H 62 | #define HEADER_MD5_H 63 | #if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__OpenBSD__) 64 | #define __bounded__(x, y, z) 65 | #endif 66 | 67 | #include 68 | 69 | #ifdef __cplusplus 70 | extern "C" { 71 | #endif 72 | 73 | #ifdef OPENSSL_NO_MD5 74 | #error MD5 is disabled. 75 | #endif 76 | 77 | /* 78 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 79 | * ! MD5_LONG has to be at least 32 bits wide. ! 80 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 81 | */ 82 | 83 | #define MD5_LONG unsigned int 84 | 85 | #define MD5_CBLOCK 64 86 | #define MD5_LBLOCK (MD5_CBLOCK/4) 87 | #define MD5_DIGEST_LENGTH 16 88 | 89 | typedef struct MD5state_st 90 | { 91 | MD5_LONG A,B,C,D; 92 | MD5_LONG Nl,Nh; 93 | MD5_LONG data[MD5_LBLOCK]; 94 | unsigned int num; 95 | } MD5_CTX; 96 | 97 | int MD5_Init(MD5_CTX *c); 98 | int MD5_Update(MD5_CTX *c, const void *data, size_t len) 99 | __attribute__ ((__bounded__(__buffer__,2,3))); 100 | int MD5_Final(unsigned char *md, MD5_CTX *c); 101 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md) 102 | __attribute__ ((__bounded__(__buffer__,1,2))); 103 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/modes.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: modes.h,v 1.2 2014/06/12 15:49:30 deraadt Exp $ */ 2 | /* ==================================================================== 3 | * Copyright (c) 2008 The OpenSSL Project. All rights reserved. 4 | * 5 | * Rights for redistribution and usage in source and binary 6 | * forms are granted according to the OpenSSL license. 7 | */ 8 | 9 | #include 10 | 11 | typedef void (*block128_f)(const unsigned char in[16], 12 | unsigned char out[16], 13 | const void *key); 14 | 15 | typedef void (*cbc128_f)(const unsigned char *in, unsigned char *out, 16 | size_t len, const void *key, 17 | unsigned char ivec[16], int enc); 18 | 19 | typedef void (*ctr128_f)(const unsigned char *in, unsigned char *out, 20 | size_t blocks, const void *key, 21 | const unsigned char ivec[16]); 22 | 23 | typedef void (*ccm128_f)(const unsigned char *in, unsigned char *out, 24 | size_t blocks, const void *key, 25 | const unsigned char ivec[16],unsigned char cmac[16]); 26 | 27 | void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out, 28 | size_t len, const void *key, 29 | unsigned char ivec[16], block128_f block); 30 | void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, 31 | size_t len, const void *key, 32 | unsigned char ivec[16], block128_f block); 33 | 34 | void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out, 35 | size_t len, const void *key, 36 | unsigned char ivec[16], unsigned char ecount_buf[16], 37 | unsigned int *num, block128_f block); 38 | 39 | void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out, 40 | size_t len, const void *key, 41 | unsigned char ivec[16], unsigned char ecount_buf[16], 42 | unsigned int *num, ctr128_f ctr); 43 | 44 | void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out, 45 | size_t len, const void *key, 46 | unsigned char ivec[16], int *num, 47 | block128_f block); 48 | 49 | void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out, 50 | size_t len, const void *key, 51 | unsigned char ivec[16], int *num, 52 | int enc, block128_f block); 53 | void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out, 54 | size_t length, const void *key, 55 | unsigned char ivec[16], int *num, 56 | int enc, block128_f block); 57 | void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out, 58 | size_t bits, const void *key, 59 | unsigned char ivec[16], int *num, 60 | int enc, block128_f block); 61 | 62 | size_t CRYPTO_cts128_encrypt_block(const unsigned char *in, unsigned char *out, 63 | size_t len, const void *key, 64 | unsigned char ivec[16], block128_f block); 65 | size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out, 66 | size_t len, const void *key, 67 | unsigned char ivec[16], cbc128_f cbc); 68 | size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, unsigned char *out, 69 | size_t len, const void *key, 70 | unsigned char ivec[16], block128_f block); 71 | size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out, 72 | size_t len, const void *key, 73 | unsigned char ivec[16], cbc128_f cbc); 74 | 75 | size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in, unsigned char *out, 76 | size_t len, const void *key, 77 | unsigned char ivec[16], block128_f block); 78 | size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out, 79 | size_t len, const void *key, 80 | unsigned char ivec[16], cbc128_f cbc); 81 | size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in, unsigned char *out, 82 | size_t len, const void *key, 83 | unsigned char ivec[16], block128_f block); 84 | size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out, 85 | size_t len, const void *key, 86 | unsigned char ivec[16], cbc128_f cbc); 87 | 88 | typedef struct gcm128_context GCM128_CONTEXT; 89 | 90 | GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block); 91 | void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx,void *key,block128_f block); 92 | void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv, 93 | size_t len); 94 | int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad, 95 | size_t len); 96 | int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, 97 | const unsigned char *in, unsigned char *out, 98 | size_t len); 99 | int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, 100 | const unsigned char *in, unsigned char *out, 101 | size_t len); 102 | int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, 103 | const unsigned char *in, unsigned char *out, 104 | size_t len, ctr128_f stream); 105 | int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, 106 | const unsigned char *in, unsigned char *out, 107 | size_t len, ctr128_f stream); 108 | int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag, 109 | size_t len); 110 | void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len); 111 | void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx); 112 | 113 | typedef struct ccm128_context CCM128_CONTEXT; 114 | 115 | void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx, 116 | unsigned int M, unsigned int L, void *key,block128_f block); 117 | int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, 118 | const unsigned char *nonce, size_t nlen, size_t mlen); 119 | void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, 120 | const unsigned char *aad, size_t alen); 121 | int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, 122 | const unsigned char *inp, unsigned char *out, size_t len); 123 | int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, 124 | const unsigned char *inp, unsigned char *out, size_t len); 125 | int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, 126 | const unsigned char *inp, unsigned char *out, size_t len, 127 | ccm128_f stream); 128 | int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, 129 | const unsigned char *inp, unsigned char *out, size_t len, 130 | ccm128_f stream); 131 | size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len); 132 | 133 | typedef struct xts128_context XTS128_CONTEXT; 134 | 135 | int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], 136 | const unsigned char *inp, unsigned char *out, size_t len, int enc); 137 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/opensslconf.h: -------------------------------------------------------------------------------- 1 | #include 2 | /* crypto/opensslconf.h.in */ 3 | 4 | #if defined(_MSC_VER) && !defined(__attribute__) 5 | #define __attribute__(a) 6 | #endif 7 | 8 | #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) 9 | #define OPENSSLDIR "/etc/ssl" 10 | #endif 11 | 12 | #undef OPENSSL_UNISTD 13 | #define OPENSSL_UNISTD 14 | 15 | #undef OPENSSL_EXPORT_VAR_AS_FUNCTION 16 | 17 | #if defined(HEADER_IDEA_H) && !defined(IDEA_INT) 18 | #define IDEA_INT unsigned int 19 | #endif 20 | 21 | #if defined(HEADER_MD2_H) && !defined(MD2_INT) 22 | #define MD2_INT unsigned int 23 | #endif 24 | 25 | #if defined(HEADER_RC2_H) && !defined(RC2_INT) 26 | /* I need to put in a mod for the alpha - eay */ 27 | #define RC2_INT unsigned int 28 | #endif 29 | 30 | #if defined(HEADER_RC4_H) 31 | #if !defined(RC4_INT) 32 | /* using int types make the structure larger but make the code faster 33 | * on most boxes I have tested - up to %20 faster. */ 34 | /* 35 | * I don't know what does "most" mean, but declaring "int" is a must on: 36 | * - Intel P6 because partial register stalls are very expensive; 37 | * - elder Alpha because it lacks byte load/store instructions; 38 | */ 39 | #define RC4_INT unsigned int 40 | #endif 41 | #if !defined(RC4_CHUNK) 42 | /* 43 | * This enables code handling data aligned at natural CPU word 44 | * boundary. See crypto/rc4/rc4_enc.c for further details. 45 | */ 46 | #define RC4_CHUNK unsigned long 47 | #endif 48 | #endif 49 | 50 | #if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) 51 | /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a 52 | * %20 speed up (longs are 8 bytes, int's are 4). */ 53 | #ifndef DES_LONG 54 | #define DES_LONG unsigned int 55 | #endif 56 | #endif 57 | 58 | #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) 59 | #define CONFIG_HEADER_BN_H 60 | #undef BN_LLONG 61 | 62 | /* Should we define BN_DIV2W here? */ 63 | 64 | /* Only one for the following should be defined */ 65 | #define SIXTY_FOUR_BIT_LONG 66 | #undef SIXTY_FOUR_BIT 67 | #undef THIRTY_TWO_BIT 68 | #endif 69 | 70 | #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) 71 | #define CONFIG_HEADER_RC4_LOCL_H 72 | /* if this is defined data[i] is used instead of *data, this is a %20 73 | * speedup on x86 */ 74 | #undef RC4_INDEX 75 | #endif 76 | 77 | #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 78 | #define CONFIG_HEADER_BF_LOCL_H 79 | #undef BF_PTR 80 | #endif /* HEADER_BF_LOCL_H */ 81 | 82 | #if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) 83 | #define CONFIG_HEADER_DES_LOCL_H 84 | #ifndef DES_DEFAULT_OPTIONS 85 | /* the following is tweaked from a config script, that is why it is a 86 | * protected undef/define */ 87 | #ifndef DES_PTR 88 | #undef DES_PTR 89 | #endif 90 | 91 | /* This helps C compiler generate the correct code for multiple functional 92 | * units. It reduces register dependancies at the expense of 2 more 93 | * registers */ 94 | #ifndef DES_RISC1 95 | #undef DES_RISC1 96 | #endif 97 | 98 | #ifndef DES_RISC2 99 | #undef DES_RISC2 100 | #endif 101 | 102 | #if defined(DES_RISC1) && defined(DES_RISC2) 103 | YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! 104 | #endif 105 | 106 | /* Unroll the inner loop, this sometimes helps, sometimes hinders. 107 | * Very mucy CPU dependant */ 108 | #ifndef DES_UNROLL 109 | #define DES_UNROLL 110 | #endif 111 | 112 | /* These default values were supplied by 113 | * Peter Gutman 114 | * They are only used if nothing else has been defined */ 115 | #if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) 116 | /* Special defines which change the way the code is built depending on the 117 | CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find 118 | even newer MIPS CPU's, but at the moment one size fits all for 119 | optimization options. Older Sparc's work better with only UNROLL, but 120 | there's no way to tell at compile time what it is you're running on */ 121 | 122 | #if defined( sun ) /* Newer Sparc's */ 123 | # define DES_PTR 124 | # define DES_RISC1 125 | # define DES_UNROLL 126 | #elif defined( __ultrix ) /* Older MIPS */ 127 | # define DES_PTR 128 | # define DES_RISC2 129 | # define DES_UNROLL 130 | #elif defined( __osf1__ ) /* Alpha */ 131 | # define DES_PTR 132 | # define DES_RISC2 133 | #elif defined ( _AIX ) /* RS6000 */ 134 | /* Unknown */ 135 | #elif defined( __hpux ) /* HP-PA */ 136 | /* Unknown */ 137 | #elif defined( __aux ) /* 68K */ 138 | /* Unknown */ 139 | #elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ 140 | # define DES_UNROLL 141 | #elif defined( __sgi ) /* Newer MIPS */ 142 | # define DES_PTR 143 | # define DES_RISC2 144 | # define DES_UNROLL 145 | #elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ 146 | # define DES_PTR 147 | # define DES_RISC1 148 | # define DES_UNROLL 149 | #endif /* Systems-specific speed defines */ 150 | #endif 151 | 152 | #endif /* DES_DEFAULT_OPTIONS */ 153 | #endif /* HEADER_DES_LOCL_H */ 154 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/opensslfeatures.h: -------------------------------------------------------------------------------- 1 | # define OPENSSL_NO_EC_NISTP_64_GCC_128 2 | # define OPENSSL_NO_CMS 3 | # define OPENSSL_NO_COMP 4 | # define OPENSSL_NO_EGD 5 | # define OPENSSL_NO_GMP 6 | # define OPENSSL_NO_JPAKE 7 | # define OPENSSL_NO_KRB5 8 | # define OPENSSL_NO_MD2 9 | # define OPENSSL_NO_MDC2 10 | # define OPENSSL_NO_PSK 11 | # define OPENSSL_NO_RC5 12 | # define OPENSSL_NO_RFC3779 13 | # define OPENSSL_NO_RSAX 14 | # define OPENSSL_NO_SCTP 15 | # define OPENSSL_NO_SEED 16 | # define OPENSSL_NO_SHA0 17 | # define OPENSSL_NO_SRP 18 | # define OPENSSL_NO_SSL2 19 | # define OPENSSL_NO_SSL3 20 | # define OPENSSL_NO_SSL3_METHOD 21 | # define OPENSSL_NO_STORE 22 | # define OPENSSL_NO_BUF_FREELISTS 23 | # define OPENSSL_NO_HEARTBEATS 24 | # define OPENSSL_NO_DYNAMIC_ENGINE 25 | 26 | # define OPENSSL_THREADS 27 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/opensslv.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: opensslv.h,v 1.39.4.3 2017/07/07 05:28:12 bcook Exp $ */ 2 | #ifndef HEADER_OPENSSLV_H 3 | #define HEADER_OPENSSLV_H 4 | 5 | /* These will change with each release of LibreSSL-portable */ 6 | #define LIBRESSL_VERSION_NUMBER 0x2050500fL 7 | #define LIBRESSL_VERSION_TEXT "LibreSSL 2.5.5" 8 | 9 | /* These will never change */ 10 | #define OPENSSL_VERSION_NUMBER 0x20000000L 11 | #define OPENSSL_VERSION_TEXT LIBRESSL_VERSION_TEXT 12 | #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT 13 | 14 | #define SHLIB_VERSION_HISTORY "" 15 | #define SHLIB_VERSION_NUMBER "1.0.0" 16 | 17 | #endif /* HEADER_OPENSSLV_H */ 18 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/ossl_typ.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: ossl_typ.h,v 1.13 2015/09/30 04:10:07 doug Exp $ */ 2 | /* ==================================================================== 3 | * Copyright (c) 1998-2001 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 | * This product includes cryptographic software written by Eric Young 51 | * (eay@cryptsoft.com). This product includes software written by Tim 52 | * Hudson (tjh@cryptsoft.com). 53 | * 54 | */ 55 | 56 | #ifndef HEADER_OPENSSL_TYPES_H 57 | #define HEADER_OPENSSL_TYPES_H 58 | 59 | #include 60 | 61 | typedef struct asn1_string_st ASN1_INTEGER; 62 | typedef struct asn1_string_st ASN1_ENUMERATED; 63 | typedef struct asn1_string_st ASN1_BIT_STRING; 64 | typedef struct asn1_string_st ASN1_OCTET_STRING; 65 | typedef struct asn1_string_st ASN1_PRINTABLESTRING; 66 | typedef struct asn1_string_st ASN1_T61STRING; 67 | typedef struct asn1_string_st ASN1_IA5STRING; 68 | typedef struct asn1_string_st ASN1_GENERALSTRING; 69 | typedef struct asn1_string_st ASN1_UNIVERSALSTRING; 70 | typedef struct asn1_string_st ASN1_BMPSTRING; 71 | typedef struct asn1_string_st ASN1_UTCTIME; 72 | typedef struct asn1_string_st ASN1_TIME; 73 | typedef struct asn1_string_st ASN1_GENERALIZEDTIME; 74 | typedef struct asn1_string_st ASN1_VISIBLESTRING; 75 | typedef struct asn1_string_st ASN1_UTF8STRING; 76 | typedef struct asn1_string_st ASN1_STRING; 77 | typedef int ASN1_BOOLEAN; 78 | typedef int ASN1_NULL; 79 | 80 | typedef struct ASN1_ITEM_st ASN1_ITEM; 81 | typedef struct asn1_pctx_st ASN1_PCTX; 82 | 83 | #if defined(_WIN32) && defined(__WINCRYPT_H__) 84 | #ifndef LIBRESSL_INTERNAL 85 | #ifdef _MSC_VER 86 | #pragma message("Warning, overriding WinCrypt defines") 87 | #else 88 | #warning overriding WinCrypt defines 89 | #endif 90 | #endif 91 | #undef X509_NAME 92 | #undef X509_CERT_PAIR 93 | #undef X509_EXTENSIONS 94 | #undef OCSP_REQUEST 95 | #undef OCSP_RESPONSE 96 | #undef PKCS7_ISSUER_AND_SERIAL 97 | #endif 98 | 99 | #ifdef BIGNUM 100 | #undef BIGNUM 101 | #endif 102 | typedef struct bignum_st BIGNUM; 103 | typedef struct bignum_ctx BN_CTX; 104 | typedef struct bn_blinding_st BN_BLINDING; 105 | typedef struct bn_mont_ctx_st BN_MONT_CTX; 106 | typedef struct bn_recp_ctx_st BN_RECP_CTX; 107 | typedef struct bn_gencb_st BN_GENCB; 108 | 109 | typedef struct buf_mem_st BUF_MEM; 110 | 111 | typedef struct evp_cipher_st EVP_CIPHER; 112 | typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; 113 | typedef struct env_md_st EVP_MD; 114 | typedef struct env_md_ctx_st EVP_MD_CTX; 115 | typedef struct evp_pkey_st EVP_PKEY; 116 | 117 | typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD; 118 | 119 | typedef struct evp_pkey_method_st EVP_PKEY_METHOD; 120 | typedef struct evp_pkey_ctx_st EVP_PKEY_CTX; 121 | 122 | typedef struct dh_st DH; 123 | typedef struct dh_method DH_METHOD; 124 | 125 | typedef struct dsa_st DSA; 126 | typedef struct dsa_method DSA_METHOD; 127 | 128 | typedef struct rsa_st RSA; 129 | typedef struct rsa_meth_st RSA_METHOD; 130 | 131 | typedef struct rand_meth_st RAND_METHOD; 132 | 133 | typedef struct ecdh_method ECDH_METHOD; 134 | typedef struct ecdsa_method ECDSA_METHOD; 135 | 136 | typedef struct x509_st X509; 137 | typedef struct X509_algor_st X509_ALGOR; 138 | typedef struct X509_crl_st X509_CRL; 139 | typedef struct x509_crl_method_st X509_CRL_METHOD; 140 | typedef struct x509_revoked_st X509_REVOKED; 141 | typedef struct X509_name_st X509_NAME; 142 | typedef struct X509_pubkey_st X509_PUBKEY; 143 | typedef struct x509_store_st X509_STORE; 144 | typedef struct x509_store_ctx_st X509_STORE_CTX; 145 | 146 | typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO; 147 | 148 | typedef struct v3_ext_ctx X509V3_CTX; 149 | typedef struct conf_st CONF; 150 | 151 | typedef struct store_st STORE; 152 | typedef struct store_method_st STORE_METHOD; 153 | 154 | typedef struct ui_st UI; 155 | typedef struct ui_method_st UI_METHOD; 156 | 157 | typedef struct st_ERR_FNS ERR_FNS; 158 | 159 | typedef struct engine_st ENGINE; 160 | typedef struct ssl_st SSL; 161 | typedef struct ssl_ctx_st SSL_CTX; 162 | 163 | typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; 164 | typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; 165 | typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; 166 | typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE; 167 | 168 | typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID; 169 | typedef struct DIST_POINT_st DIST_POINT; 170 | typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT; 171 | typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS; 172 | 173 | /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */ 174 | #define DECLARE_PKCS12_STACK_OF(type) /* Nothing */ 175 | #define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */ 176 | 177 | typedef struct crypto_ex_data_st CRYPTO_EX_DATA; 178 | /* Callback types for crypto.h */ 179 | typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, 180 | int idx, long argl, void *argp); 181 | typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, 182 | int idx, long argl, void *argp); 183 | typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, 184 | void *from_d, int idx, long argl, void *argp); 185 | 186 | typedef struct ocsp_req_ctx_st OCSP_REQ_CTX; 187 | typedef struct ocsp_response_st OCSP_RESPONSE; 188 | typedef struct ocsp_responder_id_st OCSP_RESPID; 189 | 190 | #endif /* def HEADER_OPENSSL_TYPES_H */ 191 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/pem2.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: pem2.h,v 1.5 2014/06/12 15:49:30 deraadt Exp $ */ 2 | /* ==================================================================== 3 | * Copyright (c) 1999 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 | * licensing@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 | * This product includes cryptographic software written by Eric Young 51 | * (eay@cryptsoft.com). This product includes software written by Tim 52 | * Hudson (tjh@cryptsoft.com). 53 | * 54 | */ 55 | 56 | /* 57 | * This header only exists to break a circular dependency between pem and err 58 | * Ben 30 Jan 1999. 59 | */ 60 | 61 | #ifdef __cplusplus 62 | extern "C" { 63 | #endif 64 | 65 | #ifndef HEADER_PEM_H 66 | void ERR_load_PEM_strings(void); 67 | #endif 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/poly1305.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: poly1305.h,v 1.3 2014/07/25 14:04:51 jsing Exp $ */ 2 | /* 3 | * Copyright (c) 2014 Joel Sing 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #ifndef HEADER_POLY1305_H 19 | #define HEADER_POLY1305_H 20 | 21 | #include 22 | 23 | #if defined(OPENSSL_NO_POLY1305) 24 | #error Poly1305 is disabled. 25 | #endif 26 | 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | typedef struct poly1305_context { 34 | size_t aligner; 35 | unsigned char opaque[136]; 36 | } poly1305_context; 37 | 38 | typedef struct poly1305_context poly1305_state; 39 | 40 | void CRYPTO_poly1305_init(poly1305_context *ctx, const unsigned char key[32]); 41 | void CRYPTO_poly1305_update(poly1305_context *ctx, const unsigned char *in, 42 | size_t len); 43 | void CRYPTO_poly1305_finish(poly1305_context *ctx, unsigned char mac[16]); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* HEADER_POLY1305_H */ 50 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/rand.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: rand.h,v 1.22 2014/10/22 14:02:52 jsing Exp $ */ 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 | #include 60 | 61 | #ifndef HEADER_RAND_H 62 | #define HEADER_RAND_H 63 | 64 | #include 65 | 66 | #include 67 | 68 | #ifdef __cplusplus 69 | extern "C" { 70 | #endif 71 | 72 | /* Already defined in ossl_typ.h */ 73 | /* typedef struct rand_meth_st RAND_METHOD; */ 74 | 75 | struct rand_meth_st { 76 | void (*seed)(const void *buf, int num); 77 | int (*bytes)(unsigned char *buf, int num); 78 | void (*cleanup)(void); 79 | void (*add)(const void *buf, int num, double entropy); 80 | int (*pseudorand)(unsigned char *buf, int num); 81 | int (*status)(void); 82 | }; 83 | 84 | int RAND_set_rand_method(const RAND_METHOD *meth); 85 | const RAND_METHOD *RAND_get_rand_method(void); 86 | #ifndef OPENSSL_NO_ENGINE 87 | int RAND_set_rand_engine(ENGINE *engine); 88 | #endif 89 | RAND_METHOD *RAND_SSLeay(void); 90 | 91 | #ifndef LIBRESSL_INTERNAL 92 | void RAND_cleanup(void ); 93 | int RAND_bytes(unsigned char *buf, int num); 94 | int RAND_pseudo_bytes(unsigned char *buf, int num); 95 | void RAND_seed(const void *buf, int num); 96 | void RAND_add(const void *buf, int num, double entropy); 97 | int RAND_load_file(const char *file, long max_bytes); 98 | int RAND_write_file(const char *file); 99 | const char *RAND_file_name(char *file, size_t num); 100 | int RAND_status(void); 101 | int RAND_poll(void); 102 | #endif 103 | 104 | /* BEGIN ERROR CODES */ 105 | /* The following lines are auto generated by the script mkerr.pl. Any changes 106 | * made after this point may be overwritten when the script is next run. 107 | */ 108 | void ERR_load_RAND_strings(void); 109 | 110 | /* Error codes for the RAND functions. (no longer used) */ 111 | 112 | /* Function codes. */ 113 | #define RAND_F_RAND_GET_RAND_METHOD 101 114 | #define RAND_F_RAND_INIT_FIPS 102 115 | #define RAND_F_SSLEAY_RAND_BYTES 100 116 | 117 | /* Reason codes. */ 118 | #define RAND_R_DUAL_EC_DRBG_DISABLED 104 119 | #define RAND_R_ERROR_INITIALISING_DRBG 102 120 | #define RAND_R_ERROR_INSTANTIATING_DRBG 103 121 | #define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101 122 | #define RAND_R_PRNG_NOT_SEEDED 100 123 | 124 | #ifdef __cplusplus 125 | } 126 | #endif 127 | #endif 128 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/rc2.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: rc2.h,v 1.11 2014/07/10 22:45:57 jsing Exp $ */ 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 | 64 | #ifdef OPENSSL_NO_RC2 65 | #error RC2 is disabled. 66 | #endif 67 | 68 | #define RC2_ENCRYPT 1 69 | #define RC2_DECRYPT 0 70 | 71 | #define RC2_BLOCK 8 72 | #define RC2_KEY_LENGTH 16 73 | 74 | #ifdef __cplusplus 75 | extern "C" { 76 | #endif 77 | 78 | typedef struct rc2_key_st 79 | { 80 | RC2_INT data[64]; 81 | } RC2_KEY; 82 | 83 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); 84 | void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, 85 | int enc); 86 | void RC2_encrypt(unsigned long *data,RC2_KEY *key); 87 | void RC2_decrypt(unsigned long *data,RC2_KEY *key); 88 | void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 89 | RC2_KEY *ks, unsigned char *iv, int enc); 90 | void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, 91 | long length, RC2_KEY *schedule, unsigned char *ivec, 92 | int *num, int enc); 93 | void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, 94 | long length, RC2_KEY *schedule, unsigned char *ivec, 95 | int *num); 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/rc4.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: rc4.h,v 1.13 2015/10/20 15:50:13 jsing Exp $ */ 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 | 64 | #ifdef OPENSSL_NO_RC4 65 | #error RC4 is disabled. 66 | #endif 67 | 68 | #include 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif 73 | 74 | typedef struct rc4_key_st { 75 | RC4_INT x, y; 76 | RC4_INT data[256]; 77 | } RC4_KEY; 78 | 79 | const char *RC4_options(void); 80 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 81 | void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 82 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, 83 | unsigned char *outdata); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/ripemd.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: ripemd.h,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ 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 | #include 60 | 61 | #ifndef HEADER_RIPEMD_H 62 | #define HEADER_RIPEMD_H 63 | 64 | #include 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | 70 | #ifdef OPENSSL_NO_RIPEMD 71 | #error RIPEMD is disabled. 72 | #endif 73 | 74 | #if defined(__LP32__) 75 | #define RIPEMD160_LONG unsigned long 76 | #elif defined(__ILP64__) 77 | #define RIPEMD160_LONG unsigned long 78 | #define RIPEMD160_LONG_LOG2 3 79 | #else 80 | #define RIPEMD160_LONG unsigned int 81 | #endif 82 | 83 | #define RIPEMD160_CBLOCK 64 84 | #define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) 85 | #define RIPEMD160_DIGEST_LENGTH 20 86 | 87 | typedef struct RIPEMD160state_st 88 | { 89 | RIPEMD160_LONG A,B,C,D,E; 90 | RIPEMD160_LONG Nl,Nh; 91 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; 92 | unsigned int num; 93 | } RIPEMD160_CTX; 94 | 95 | int RIPEMD160_Init(RIPEMD160_CTX *c); 96 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); 97 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); 98 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, 99 | unsigned char *md); 100 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/srtp.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: srtp.h,v 1.6 2015/09/01 15:18:23 jsing Exp $ */ 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 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. 60 | * 61 | * Redistribution and use in source and binary forms, with or without 62 | * modification, are permitted provided that the following conditions 63 | * are met: 64 | * 65 | * 1. Redistributions of source code must retain the above copyright 66 | * notice, this list of conditions and the following disclaimer. 67 | * 68 | * 2. Redistributions in binary form must reproduce the above copyright 69 | * notice, this list of conditions and the following disclaimer in 70 | * the documentation and/or other materials provided with the 71 | * distribution. 72 | * 73 | * 3. All advertising materials mentioning features or use of this 74 | * software must display the following acknowledgment: 75 | * "This product includes software developed by the OpenSSL Project 76 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 77 | * 78 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 79 | * endorse or promote products derived from this software without 80 | * prior written permission. For written permission, please contact 81 | * openssl-core@openssl.org. 82 | * 83 | * 5. Products derived from this software may not be called "OpenSSL" 84 | * nor may "OpenSSL" appear in their names without prior written 85 | * permission of the OpenSSL Project. 86 | * 87 | * 6. Redistributions of any form whatsoever must retain the following 88 | * acknowledgment: 89 | * "This product includes software developed by the OpenSSL Project 90 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 91 | * 92 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 93 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 94 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 95 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 96 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 97 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 98 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 99 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 100 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 101 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 102 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 103 | * OF THE POSSIBILITY OF SUCH DAMAGE. 104 | * ==================================================================== 105 | * 106 | * This product includes cryptographic software written by Eric Young 107 | * (eay@cryptsoft.com). This product includes software written by Tim 108 | * Hudson (tjh@cryptsoft.com). 109 | * 110 | */ 111 | /* 112 | * DTLS code by Eric Rescorla 113 | * 114 | * Copyright (C) 2006, Network Resonance, Inc. 115 | * Copyright (C) 2011, RTFM, Inc. 116 | */ 117 | 118 | #ifndef HEADER_D1_SRTP_H 119 | #define HEADER_D1_SRTP_H 120 | 121 | #ifdef __cplusplus 122 | extern "C" { 123 | #endif 124 | 125 | #define SRTP_AES128_CM_SHA1_80 0x0001 126 | #define SRTP_AES128_CM_SHA1_32 0x0002 127 | #define SRTP_AES128_F8_SHA1_80 0x0003 128 | #define SRTP_AES128_F8_SHA1_32 0x0004 129 | #define SRTP_NULL_SHA1_80 0x0005 130 | #define SRTP_NULL_SHA1_32 0x0006 131 | 132 | int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); 133 | int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles); 134 | 135 | STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); 136 | SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); 137 | 138 | #ifdef __cplusplus 139 | } 140 | #endif 141 | 142 | #endif 143 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/ssl2.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: ssl2.h,v 1.12 2014/12/14 15:30:50 jsing Exp $ */ 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_SSL2_H 60 | #define HEADER_SSL2_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | /* Protocol Version Codes */ 67 | #define SSL2_VERSION 0x0002 68 | #define SSL2_VERSION_MAJOR 0x00 69 | #define SSL2_VERSION_MINOR 0x02 70 | /* #define SSL2_CLIENT_VERSION 0x0002 */ 71 | /* #define SSL2_SERVER_VERSION 0x0002 */ 72 | 73 | /* Protocol Message Codes */ 74 | #define SSL2_MT_ERROR 0 75 | #define SSL2_MT_CLIENT_HELLO 1 76 | #define SSL2_MT_CLIENT_MASTER_KEY 2 77 | #define SSL2_MT_CLIENT_FINISHED 3 78 | #define SSL2_MT_SERVER_HELLO 4 79 | #define SSL2_MT_SERVER_VERIFY 5 80 | #define SSL2_MT_SERVER_FINISHED 6 81 | #define SSL2_MT_REQUEST_CERTIFICATE 7 82 | #define SSL2_MT_CLIENT_CERTIFICATE 8 83 | 84 | /* Error Message Codes */ 85 | #define SSL2_PE_UNDEFINED_ERROR 0x0000 86 | #define SSL2_PE_NO_CIPHER 0x0001 87 | #define SSL2_PE_NO_CERTIFICATE 0x0002 88 | #define SSL2_PE_BAD_CERTIFICATE 0x0004 89 | #define SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE 0x0006 90 | 91 | /* Cipher Kind Values */ 92 | #define SSL2_CK_NULL_WITH_MD5 0x02000000 /* v3 */ 93 | #define SSL2_CK_RC4_128_WITH_MD5 0x02010080 94 | #define SSL2_CK_RC4_128_EXPORT40_WITH_MD5 0x02020080 95 | #define SSL2_CK_RC2_128_CBC_WITH_MD5 0x02030080 96 | #define SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 0x02040080 97 | #define SSL2_CK_IDEA_128_CBC_WITH_MD5 0x02050080 98 | #define SSL2_CK_DES_64_CBC_WITH_MD5 0x02060040 99 | #define SSL2_CK_DES_64_CBC_WITH_SHA 0x02060140 /* v3 */ 100 | #define SSL2_CK_DES_192_EDE3_CBC_WITH_MD5 0x020700c0 101 | #define SSL2_CK_DES_192_EDE3_CBC_WITH_SHA 0x020701c0 /* v3 */ 102 | #define SSL2_CK_RC4_64_WITH_MD5 0x02080080 /* MS hack */ 103 | 104 | #define SSL2_CK_DES_64_CFB64_WITH_MD5_1 0x02ff0800 /* SSLeay */ 105 | #define SSL2_CK_NULL 0x02ff0810 /* SSLeay */ 106 | 107 | #define SSL2_TXT_DES_64_CFB64_WITH_MD5_1 "DES-CFB-M1" 108 | #define SSL2_TXT_NULL_WITH_MD5 "NULL-MD5" 109 | #define SSL2_TXT_RC4_128_WITH_MD5 "RC4-MD5" 110 | #define SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 "EXP-RC4-MD5" 111 | #define SSL2_TXT_RC2_128_CBC_WITH_MD5 "RC2-CBC-MD5" 112 | #define SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 "EXP-RC2-CBC-MD5" 113 | #define SSL2_TXT_IDEA_128_CBC_WITH_MD5 "IDEA-CBC-MD5" 114 | #define SSL2_TXT_DES_64_CBC_WITH_MD5 "DES-CBC-MD5" 115 | #define SSL2_TXT_DES_64_CBC_WITH_SHA "DES-CBC-SHA" 116 | #define SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 "DES-CBC3-MD5" 117 | #define SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA "DES-CBC3-SHA" 118 | #define SSL2_TXT_RC4_64_WITH_MD5 "RC4-64-MD5" 119 | 120 | #define SSL2_TXT_NULL "NULL" 121 | 122 | /* Flags for the SSL_CIPHER.algorithm2 field */ 123 | #define SSL2_CF_5_BYTE_ENC 0x01 124 | #define SSL2_CF_8_BYTE_ENC 0x02 125 | 126 | /* Certificate Type Codes */ 127 | #define SSL2_CT_X509_CERTIFICATE 0x01 128 | 129 | /* Authentication Type Code */ 130 | #define SSL2_AT_MD5_WITH_RSA_ENCRYPTION 0x01 131 | 132 | #define SSL2_MAX_SSL_SESSION_ID_LENGTH 32 133 | 134 | /* Upper/Lower Bounds */ 135 | #define SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS 256 136 | #define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 32767u /* 2^15-1 */ 137 | #define SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER 16383 /* 2^14-1 */ 138 | 139 | #define SSL2_CHALLENGE_LENGTH 16 140 | /*#define SSL2_CHALLENGE_LENGTH 32 */ 141 | #define SSL2_MIN_CHALLENGE_LENGTH 16 142 | #define SSL2_MAX_CHALLENGE_LENGTH 32 143 | #define SSL2_CONNECTION_ID_LENGTH 16 144 | #define SSL2_MAX_CONNECTION_ID_LENGTH 16 145 | #define SSL2_SSL_SESSION_ID_LENGTH 16 146 | #define SSL2_MAX_CERT_CHALLENGE_LENGTH 32 147 | #define SSL2_MIN_CERT_CHALLENGE_LENGTH 16 148 | #define SSL2_MAX_KEY_MATERIAL_LENGTH 24 149 | 150 | #ifdef __cplusplus 151 | } 152 | #endif 153 | #endif 154 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/ssl23.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: ssl23.h,v 1.4 2014/12/14 15:30:50 jsing Exp $ */ 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 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/stack.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: stack.h,v 1.9 2014/06/12 15:49:30 deraadt Exp $ */ 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 | int num; 68 | char **data; 69 | int sorted; 70 | 71 | int num_alloc; 72 | int (*comp)(const void *, const void *); 73 | } _STACK; /* Use STACK_OF(...) instead */ 74 | 75 | #define M_sk_num(sk) ((sk) ? (sk)->num:-1) 76 | #define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) 77 | 78 | int sk_num(const _STACK *); 79 | void *sk_value(const _STACK *, int); 80 | 81 | void *sk_set(_STACK *, int, void *); 82 | 83 | _STACK *sk_new(int (*cmp)(const void *, const void *)); 84 | _STACK *sk_new_null(void); 85 | void sk_free(_STACK *); 86 | void sk_pop_free(_STACK *st, void (*func)(void *)); 87 | int sk_insert(_STACK *sk, void *data, int where); 88 | void *sk_delete(_STACK *st, int loc); 89 | void *sk_delete_ptr(_STACK *st, void *p); 90 | int sk_find(_STACK *st, void *data); 91 | int sk_find_ex(_STACK *st, void *data); 92 | int sk_push(_STACK *st, void *data); 93 | int sk_unshift(_STACK *st, void *data); 94 | void *sk_shift(_STACK *st); 95 | void *sk_pop(_STACK *st); 96 | void sk_zero(_STACK *st); 97 | int (*sk_set_cmp_func(_STACK *sk, int (*c)(const void *, const void *)))( 98 | const void *, const void *); 99 | _STACK *sk_dup(_STACK *st); 100 | void sk_sort(_STACK *st); 101 | int sk_is_sorted(const _STACK *st); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/txt_db.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: txt_db.h,v 1.9 2014/07/10 22:45:58 jsing Exp $ */ 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 | 64 | #ifndef OPENSSL_NO_BIO 65 | #include 66 | #endif 67 | #include 68 | #include 69 | 70 | #define DB_ERROR_OK 0 71 | #define DB_ERROR_MALLOC 1 72 | #define DB_ERROR_INDEX_CLASH 2 73 | #define DB_ERROR_INDEX_OUT_OF_RANGE 3 74 | #define DB_ERROR_NO_INDEX 4 75 | #define DB_ERROR_INSERT_INDEX_CLASH 5 76 | 77 | #ifdef __cplusplus 78 | extern "C" { 79 | #endif 80 | 81 | typedef OPENSSL_STRING *OPENSSL_PSTRING; 82 | DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) 83 | 84 | typedef struct txt_db_st { 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 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/ui_compat.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: ui_compat.h,v 1.4 2014/06/12 15:49:31 deraadt Exp $ */ 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 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/include/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: whrlpool.h,v 1.5 2014/07/10 22:45:58 jsing Exp $ */ 2 | 3 | #include 4 | 5 | #ifndef HEADER_WHRLPOOL_H 6 | #define HEADER_WHRLPOOL_H 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #define WHIRLPOOL_DIGEST_LENGTH (512/8) 15 | #define WHIRLPOOL_BBLOCK 512 16 | #define WHIRLPOOL_COUNTER (256/8) 17 | 18 | typedef struct { 19 | union { 20 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 21 | /* double q is here to ensure 64-bit alignment */ 22 | double q[WHIRLPOOL_DIGEST_LENGTH/sizeof(double)]; 23 | } H; 24 | unsigned char data[WHIRLPOOL_BBLOCK/8]; 25 | unsigned int bitoff; 26 | size_t bitlen[WHIRLPOOL_COUNTER/sizeof(size_t)]; 27 | } WHIRLPOOL_CTX; 28 | 29 | #ifndef OPENSSL_NO_WHIRLPOOL 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 | -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x64/libcrypto-41.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x64/libcrypto-41.dll -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x64/libcrypto-41.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x64/libcrypto-41.exp -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x64/libcrypto-41.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x64/libcrypto-41.lib -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x64/libssl-43.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x64/libssl-43.dll -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x64/libssl-43.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x64/libssl-43.exp -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x64/libssl-43.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x64/libssl-43.lib -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x64/libtls-15.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x64/libtls-15.dll -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x64/libtls-15.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x64/libtls-15.exp -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x64/libtls-15.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x64/libtls-15.lib -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x64/ocspcheck.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x64/ocspcheck.exe -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x64/openssl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x64/openssl.exe -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x86/libcrypto-41.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x86/libcrypto-41.dll -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x86/libcrypto-41.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x86/libcrypto-41.exp -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x86/libcrypto-41.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x86/libcrypto-41.lib -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x86/libssl-43.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x86/libssl-43.dll -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x86/libssl-43.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x86/libssl-43.exp -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x86/libssl-43.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x86/libssl-43.lib -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x86/libtls-15.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x86/libtls-15.dll -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x86/libtls-15.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x86/libtls-15.exp -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x86/libtls-15.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x86/libtls-15.lib -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x86/ocspcheck.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x86/ocspcheck.exe -------------------------------------------------------------------------------- /libressl-2.5.5-windows/x86/openssl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/libressl-2.5.5-windows/x86/openssl.exe -------------------------------------------------------------------------------- /triage-collector.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.33027.164 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "triage-collector", "triage-collector\triage-collector.vcxproj", "{06718832-98E4-4A84-82C3-9F5678C326E5}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {5E42B778-F231-4797-B7FD-7D5BCA9738D0} = {5E42B778-F231-4797-B7FD-7D5BCA9738D0} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NTFSParserDLL", "NTFSParserDLL\NTFSParserDLL.vcxproj", "{5E42B778-F231-4797-B7FD-7D5BCA9738D0}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|x64 = Debug|x64 16 | Debug|x86 = Debug|x86 17 | Release|x64 = Release|x64 18 | Release|x86 = Release|x86 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {06718832-98E4-4A84-82C3-9F5678C326E5}.Debug|x64.ActiveCfg = Debug|x64 22 | {06718832-98E4-4A84-82C3-9F5678C326E5}.Debug|x64.Build.0 = Debug|x64 23 | {06718832-98E4-4A84-82C3-9F5678C326E5}.Debug|x86.ActiveCfg = Debug|Win32 24 | {06718832-98E4-4A84-82C3-9F5678C326E5}.Debug|x86.Build.0 = Debug|Win32 25 | {06718832-98E4-4A84-82C3-9F5678C326E5}.Debug|x86.Deploy.0 = Debug|Win32 26 | {06718832-98E4-4A84-82C3-9F5678C326E5}.Release|x64.ActiveCfg = Release|x64 27 | {06718832-98E4-4A84-82C3-9F5678C326E5}.Release|x64.Build.0 = Release|x64 28 | {06718832-98E4-4A84-82C3-9F5678C326E5}.Release|x86.ActiveCfg = Release|Win32 29 | {06718832-98E4-4A84-82C3-9F5678C326E5}.Release|x86.Build.0 = Release|Win32 30 | {5E42B778-F231-4797-B7FD-7D5BCA9738D0}.Debug|x64.ActiveCfg = Debug|x64 31 | {5E42B778-F231-4797-B7FD-7D5BCA9738D0}.Debug|x64.Build.0 = Debug|x64 32 | {5E42B778-F231-4797-B7FD-7D5BCA9738D0}.Debug|x86.ActiveCfg = Debug|Win32 33 | {5E42B778-F231-4797-B7FD-7D5BCA9738D0}.Debug|x86.Build.0 = Debug|Win32 34 | {5E42B778-F231-4797-B7FD-7D5BCA9738D0}.Release|x64.ActiveCfg = Release|x64 35 | {5E42B778-F231-4797-B7FD-7D5BCA9738D0}.Release|x64.Build.0 = Release|x64 36 | {5E42B778-F231-4797-B7FD-7D5BCA9738D0}.Release|x86.ActiveCfg = Release|Win32 37 | {5E42B778-F231-4797-B7FD-7D5BCA9738D0}.Release|x86.Build.0 = Release|Win32 38 | EndGlobalSection 39 | GlobalSection(SolutionProperties) = preSolution 40 | HideSolutionNode = FALSE 41 | EndGlobalSection 42 | GlobalSection(ExtensibilityGlobals) = postSolution 43 | SolutionGuid = {6E6D39AE-5F0A-4572-8E1B-8283249CB0E1} 44 | EndGlobalSection 45 | EndGlobal 46 | -------------------------------------------------------------------------------- /triage-collector/ConfigParser.cpp: -------------------------------------------------------------------------------- 1 | #include "ConfigParser.h" 2 | #include "util.h" 3 | #include "inipp.h" 4 | 5 | ConfigParser::ConfigParser(string path) 6 | { 7 | ifstream file(path); 8 | if (file.is_open()) { 9 | opened = true; 10 | inipp::Ini ini; 11 | ini.parse(file); 12 | ini.interpolate(); 13 | auto item = ini.sections.find("Base"); 14 | if (item != ini.sections.end()) { 15 | for (const auto& item : ini.sections["Base"]) 16 | { 17 | ConfigParser::TransformKeyValue(item.first, item.second); 18 | } 19 | } 20 | else 21 | { 22 | auto item = ini.sections.find(""); 23 | if (item != ini.sections.end()) { 24 | for (const auto& item : ini.sections[""]) 25 | { 26 | ConfigParser::TransformKeyValue(item.first, item.second); 27 | } 28 | } 29 | } 30 | item = ini.sections.find("Users"); 31 | if (item != ini.sections.end()) { 32 | users = item->second; 33 | } 34 | item = ini.sections.find("System"); 35 | if (item != ini.sections.end()) { 36 | system = item->second; 37 | } 38 | } 39 | else { 40 | opened = false; 41 | } 42 | } 43 | 44 | bool ConfigParser::TransformKeyValue(string key, string val) 45 | { 46 | if (CONFIGLIST.find(key) != CONFIGLIST.end()) { 47 | Value value; 48 | value.type = CONFIGLIST[key]; 49 | switch (CONFIGLIST[key]) { 50 | case TYPE_BOOL: 51 | value.ptr = new bool; 52 | val = trim(val); 53 | *((bool*)value.ptr) = [=]() { 54 | if (_stricmp("true", val.c_str()) == 0) { 55 | return true; 56 | } 57 | if (_stricmp("false", val.c_str()) == 0) { 58 | return false; 59 | } 60 | if (strcmp("1", val.c_str()) == 0) { 61 | return true; 62 | } 63 | if (strcmp("0", val.c_str()) == 0) { 64 | return false; 65 | } 66 | cerr << msg("パースエラー", 67 | "parse error.") << endl; 68 | cerr << key + " " + "(1:ON 2:OFF 0:EXIT)" << endl << "> "; 69 | int input; cin >> input; 70 | if (!input) __exit(EXIT_SUCCESS); 71 | 72 | return (input == 1) ? true : false; 73 | }(); 74 | 75 | break; 76 | case TYPE_INT: 77 | value.ptr = new int; 78 | val = trim(val); 79 | *((int*)value.ptr) = atoi(val.c_str()); 80 | break; 81 | case TYPE_STRING: 82 | value.ptr = new string; 83 | unsigned int idx = 0; 84 | for (idx = 0; idx < val.size() && isspace(val[idx]); idx++); 85 | *((string*)value.ptr) = val.substr(idx); 86 | break; 87 | } 88 | m[key] = value; 89 | } 90 | return true; 91 | } 92 | 93 | ConfigParser::~ConfigParser() 94 | { 95 | } 96 | 97 | bool ConfigParser::isOpened() { 98 | return opened; 99 | } 100 | 101 | 102 | bool ConfigParser::isSet(string key) { 103 | return m.find(key) != m.end(); 104 | } 105 | 106 | 107 | Value ConfigParser::getValue(string key) { 108 | if (m.find(key) != m.end()) { 109 | return m[key]; 110 | } 111 | else { 112 | cerr << key << msg("は定義されていません", " is undefined") << endl; 113 | cerr << key + " " + "(1:ON 2:OFF 0:EXIT)" << endl << "> "; 114 | int input; cin >> input; 115 | if (!input) __exit(EXIT_SUCCESS); 116 | Value val; 117 | val.type = TYPE_BOOL; 118 | val.ptr = new bool; 119 | CASTVAL(bool,val) = (input == 1) ? true : false; 120 | return val; 121 | } 122 | } 123 | 124 | string ConfigParser::trim(string &str) { 125 | size_t beg, end; 126 | for (beg = 0; beg < str.size() && isspace(str[beg]); beg++); 127 | for (end = beg; end < str.size() && !isspace(str[end]); end++); 128 | str = str.substr(beg, end - beg); 129 | return str; 130 | } -------------------------------------------------------------------------------- /triage-collector/ConfigParser.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | #define CASTVAL(type,val) *((type*)(val).ptr) 11 | #define CASTPTR(type,ptr) *((type*)ptr) 12 | 13 | enum TYPE_ID { 14 | TYPE_BOOL, 15 | TYPE_INT, 16 | TYPE_STRING 17 | }; 18 | 19 | struct Value { 20 | TYPE_ID type; 21 | void* ptr; 22 | }; 23 | 24 | struct c_ignorecase:std::binary_function { 25 | bool operator() (const string &s1, const string &s2) const { 26 | return _stricmp(s1.c_str(), s2.c_str()) < 0; 27 | } 28 | }; 29 | 30 | static map CONFIGLIST = { 31 | {"MemoryDump", TYPE_BOOL}, 32 | {"Swap", TYPE_BOOL}, 33 | {"MFT", TYPE_BOOL}, 34 | {"Logfile", TYPE_BOOL}, 35 | {"Secure", TYPE_BOOL}, 36 | {"UsnJrnl", TYPE_BOOL}, 37 | {"EventLog", TYPE_BOOL}, 38 | {"Prefetch", TYPE_BOOL}, 39 | {"Registry", TYPE_BOOL}, 40 | {"WMI", TYPE_BOOL}, 41 | {"SRUM", TYPE_BOOL }, 42 | {"Web", TYPE_BOOL }, 43 | {"Output", TYPE_STRING}, 44 | {"Target", TYPE_STRING}, 45 | {"MemoryDumpCmdline", TYPE_STRING}, 46 | {"host", TYPE_STRING}, 47 | {"port", TYPE_INT}, 48 | {"path", TYPE_STRING}, 49 | {"wevtutil", TYPE_BOOL}, 50 | {"Enter", TYPE_BOOL } 51 | }; 52 | 53 | class ConfigParser 54 | { 55 | private: 56 | bool opened; 57 | map m; 58 | 59 | public: 60 | map users; 61 | map system; 62 | ConfigParser(string); 63 | bool ConfigParser::TransformKeyValue(string, string); 64 | ~ConfigParser(); 65 | bool isOpened(); 66 | bool isSet(string); 67 | Value getValue(string); 68 | static string trim(string&); 69 | }; -------------------------------------------------------------------------------- /triage-collector/WriteWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "openssl\ssl.h" 9 | 10 | using namespace std; 11 | 12 | class WriteWrapper 13 | { 14 | private: 15 | char *filename; 16 | ULONGLONG filesize; 17 | 18 | ofstream osfile; 19 | 20 | static string address; 21 | static int port; 22 | static string proxy_address; 23 | static int proxy_port; 24 | static string path; 25 | static string uriroot; 26 | static bool useProxy; 27 | static string curdir; 28 | 29 | WSADATA wsadata; 30 | struct sockaddr_in server; 31 | bool isSSL; 32 | SSL *ssl; 33 | SOCKET sock; 34 | 35 | public: 36 | static const int STATUS_UNINTIALIZED = 0; 37 | static const int STATUS_LOCAL = 1; 38 | static const int STATUS_REMOTE = 2; 39 | 40 | public: 41 | static int status; // 0: uninitialized, 1: local, 2: remote 42 | bool isHeaderSent; 43 | 44 | public: 45 | WriteWrapper(char *, ULONGLONG, bool isDirectory=false); 46 | static bool isLocal(); 47 | bool getConnInfo(); 48 | int getProxyInfo(); 49 | string urlencode(string); 50 | void mkdir(string); 51 | static void chdir(string); 52 | int sendfile(const char *); 53 | int sendheader(ULONGLONG = 0); 54 | long long write(const char *, long long); 55 | long long read(char *, long long); 56 | string readall(); 57 | string readuntil(string); 58 | void close(); 59 | 60 | }; -------------------------------------------------------------------------------- /triage-collector/globals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ConfigParser.h" 4 | 5 | extern ConfigParser *config; -------------------------------------------------------------------------------- /triage-collector/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/triage-collector/resource.h -------------------------------------------------------------------------------- /triage-collector/triage-collector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "..\NTFSParserDLL\NTFS.h" 4 | #include "..\NTFSParserDLL\NTFS_DataType.h" 5 | -------------------------------------------------------------------------------- /triage-collector/triage-collector.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/triage-collector/triage-collector.ico -------------------------------------------------------------------------------- /triage-collector/triage-collector.ini: -------------------------------------------------------------------------------- 1 | [Base] 2 | MemoryDump = true 3 | MFT = true 4 | Logfile = true 5 | Secure = true 6 | UsnJrnl = true 7 | EventLog = true 8 | Prefetch = true 9 | Registry = true 10 | WMI = true 11 | SRUM = true 12 | Web = true 13 | Swap = true 14 | ;Target = G:\ 15 | wevtutil = true 16 | Enter = false 17 | MemoryDumpCmdline = winpmem_mini_x64_rc2.exe physmem.raw 18 | MemoryDumpCmdline64 = winpmem_mini_x64_rc2.exe physmem.raw 19 | MemoryDumpCmdline32 = winpmem_mini_x86.exe physmem.raw 20 | ;MemoryDumpCmdline = winpmem-2.1.post4.exe --output RAM.aff4 21 | ;MemoryDumpCmdline = DumpIt.exe /Q /N /T DMP /O RAM.dmp 22 | ;MemoryDumpCmdline = RamCapture64.exe RAM.raw 23 | ;MemoryDumpCmdline = MagnetRAMCapture.exe /accepteula /go .\RAM.raw 24 | ;Output = E:\ 25 | ;Output = \\hostname\sharename\ 26 | 27 | [Users] 28 | startup = \AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup 29 | recent = \AppData\Roaming\Microsoft\Windows\Recent 30 | WinTimeline = \AppData\Local\ConnectedDevicesPlatform 31 | RdpCache = \AppData\Local\Microsoft\Terminal Server Client\Cache 32 | PSHistory = \AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine 33 | IconCache = \AppData\Local\Microsoft\Windows\Explorer 34 | ;WER = \AppData\Local\Microsoft\Windows\WER 35 | ;outlook = \AppData\Local\Microsoft\Outlook 36 | ;thunderbird = \AppData\Roaming\Thunderbird\Profiles 37 | 38 | [System] 39 | tasks = \Windows\System32\Tasks 40 | tasksWow64 = \Windows\SysWOW64\Tasks 41 | startupall = \ProgramData\Microsoft\Windows\Start Menu\Programs\Startup 42 | ;WERALL = \ProgramData\Microsoft\Windows\WER 43 | sum = \Windows\System32\LogFiles\SUM 44 | Intune = \ProgramData\Microsoft\IntuneManagementExtension\Logs 45 | ntds = \Windows\NTDS 46 | sysvol = \Windows\SYSVOL\domain 47 | RecycleBin = \$Recycle.bin 48 | SearchIndex = \ProgramData\Microsoft\Search\Data\Applications\Windows 49 | PCA = \Windows\appcompat\pca 50 | BITS = \ProgramData\Microsoft\Network\Downloader 51 | 52 | -------------------------------------------------------------------------------- /triage-collector/triage-collector.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | 5 | #include "resource.h" 6 | 7 | #define APSTUDIO_READONLY_SYMBOLS 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // 10 | // Generated from the TEXTINCLUDE 2 resource. 11 | // 12 | #include "winres.h" 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | #undef APSTUDIO_READONLY_SYMBOLS 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // 日本語 (日本) resources 19 | 20 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) 21 | LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "resource.h\0" 32 | END 33 | 34 | 2 TEXTINCLUDE 35 | BEGIN 36 | "#include ""winres.h""\r\n" 37 | "\0" 38 | END 39 | 40 | 3 TEXTINCLUDE 41 | BEGIN 42 | "\r\n" 43 | "\0" 44 | END 45 | 46 | #endif // APSTUDIO_INVOKED 47 | 48 | 49 | ///////////////////////////////////////////////////////////////////////////// 50 | // 51 | // Icon 52 | // 53 | 54 | // Icon with lowest ID value placed first to ensure application icon 55 | // remains consistent on all systems. 56 | IDI_ICON1 ICON "triage-collector.ico" 57 | 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | // 61 | // Version 62 | // 63 | 64 | VS_VERSION_INFO VERSIONINFO 65 | FILEVERSION 2,0,0,0 66 | PRODUCTVERSION 2,0,0,0 67 | FILEFLAGSMASK 0x3fL 68 | #ifdef _DEBUG 69 | FILEFLAGS 0x1L 70 | #else 71 | FILEFLAGS 0x0L 72 | #endif 73 | FILEOS 0x40004L 74 | FILETYPE 0x1L 75 | FILESUBTYPE 0x0L 76 | BEGIN 77 | BLOCK "StringFileInfo" 78 | BEGIN 79 | BLOCK "041104b0" 80 | BEGIN 81 | VALUE "FileDescription", "Triage Collection Tool for Fast Forensic" 82 | VALUE "FileVersion", "2.0.0.0" 83 | VALUE "InternalName", "triage-collector.exe" 84 | VALUE "OriginalFilename", "triage-collector.exe" 85 | VALUE "ProductName", "triage-collector" 86 | VALUE "ProductVersion", "2.0.0.0" 87 | END 88 | END 89 | BLOCK "VarFileInfo" 90 | BEGIN 91 | VALUE "Translation", 0x411, 1200 92 | END 93 | END 94 | 95 | #endif // 日本語 (日本) resources 96 | ///////////////////////////////////////////////////////////////////////////// 97 | 98 | 99 | 100 | #ifndef APSTUDIO_INVOKED 101 | ///////////////////////////////////////////////////////////////////////////// 102 | // 103 | // Generated from the TEXTINCLUDE 3 resource. 104 | // 105 | 106 | 107 | ///////////////////////////////////////////////////////////////////////////// 108 | #endif // not APSTUDIO_INVOKED 109 | 110 | -------------------------------------------------------------------------------- /triage-collector/triage-collector.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | ヘッダー ファイル 20 | 21 | 22 | ヘッダー ファイル 23 | 24 | 25 | ヘッダー ファイル 26 | 27 | 28 | ヘッダー ファイル 29 | 30 | 31 | ヘッダー ファイル 32 | 33 | 34 | ヘッダー ファイル 35 | 36 | 37 | ヘッダー ファイル 38 | 39 | 40 | 41 | 42 | ソース ファイル 43 | 44 | 45 | ソース ファイル 46 | 47 | 48 | ソース ファイル 49 | 50 | 51 | ソース ファイル 52 | 53 | 54 | 55 | 56 | リソース ファイル 57 | 58 | 59 | 60 | 61 | リソース ファイル 62 | 63 | 64 | -------------------------------------------------------------------------------- /triage-collector/util.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "WriteWrapper.h" 5 | #include "globals.h" 6 | #include "util.h" 7 | 8 | void __exit(int code) { 9 | cerr << "Press Enter key to continue..." << endl; 10 | char c; 11 | cin.ignore(); 12 | cin.get(c); 13 | exit(code); 14 | } 15 | 16 | void _perror(char *msg) { 17 | char buf[1024]; 18 | DWORD ec = GetLastError(); // Error Code 19 | if (FormatMessage( 20 | FORMAT_MESSAGE_FROM_SYSTEM | 21 | FORMAT_MESSAGE_IGNORE_INSERTS, 22 | NULL, 23 | ec, 24 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 25 | buf, 26 | 1024, 27 | NULL) == 0) { 28 | cerr << "FormatMessage failed" << endl; 29 | } 30 | else { 31 | if (msg) 32 | cerr << msg << ": "; 33 | cerr << buf << endl; 34 | } 35 | } 36 | 37 | void mkdir(char *dirname, bool error) { 38 | WriteWrapper dir("", 0, true); 39 | 40 | if (dirname == NULL) { 41 | fprintf(stderr, "dirname must not be NULL\n"); 42 | return; 43 | } 44 | string dirname_s = string(dirname); 45 | 46 | size_t pos; 47 | if ((pos = dirname_s.find_first_of('\\')) == string::npos) { 48 | if (dir.isLocal()) { 49 | if (!CreateDirectory(dirname, NULL)) { 50 | if (error) 51 | _perror("CreateDirectory"); 52 | } 53 | } 54 | else { 55 | dir.mkdir(dirname); 56 | } 57 | dir.close(); 58 | } 59 | else { 60 | string topdir = dirname_s.substr(0, pos); 61 | string subdir = dirname_s.substr(pos + 1); 62 | mkdir((char*)topdir.c_str(), error); 63 | chdir((char*)topdir.c_str()); 64 | mkdir((char*)subdir.c_str(), error); 65 | chdir(".."); 66 | } 67 | } 68 | 69 | void chdir(char *dirname) { 70 | WriteWrapper dir("", 0, true); 71 | 72 | if (dir.isLocal()) { 73 | if (!SetCurrentDirectory(dirname)) { 74 | _perror("SetCurrentDirectory"); 75 | } 76 | } 77 | else { 78 | dir.chdir(dirname); 79 | } 80 | dir.close(); 81 | } 82 | 83 | string basename(string &path, char delim) { 84 | return path.substr(path.find_last_of(delim) + 1); 85 | } 86 | 87 | string dirname(string &path, char delim) { 88 | return path.substr(0, path.find_last_of(delim)); 89 | } 90 | 91 | string msg(string jp, string en, WORD lang) { 92 | if ((lang & 0xff) == LANG_JAPANESE) 93 | return jp; 94 | else 95 | return en; 96 | } 97 | 98 | string join(vector vs, string delim) { 99 | string ret = ""; 100 | for (size_t i = 0; i < vs.size() - 1; i++) { 101 | if (vs[i].empty()) continue; 102 | ret += vs[i] + delim; 103 | } 104 | ret += vs[vs.size() - 1]; 105 | return ret; 106 | } 107 | 108 | string hexdump(const unsigned char *s, size_t size) { 109 | if (s == NULL) 110 | return ""; 111 | ostringstream res; 112 | for (size_t i = 0; i < size; i++) { 113 | res << setw(2) << setfill('0') << hex << (unsigned int)s[i]; 114 | } 115 | return res.str(); 116 | } 117 | 118 | bool ends_with(const std::string& s, const std::string& suffix) { 119 | if (s.size() < suffix.size()) return false; 120 | return std::equal(std::rbegin(suffix), std::rend(suffix), std::rbegin(s)); 121 | } 122 | 123 | int findfiles(vector> *paths, string findpath, bool error, vector *fltout, const char* filter, unsigned int recurse, unsigned int curr, string currpath) { 124 | // return found file and isdir 125 | HANDLE hfind; 126 | WIN32_FIND_DATA w32fd; 127 | int ret = 0; 128 | 129 | if (!ends_with(findpath, "\\")) { findpath += "\\"; } 130 | string search_path = findpath + filter; 131 | hfind = FindFirstFile(search_path.c_str(), &w32fd); 132 | 133 | if (hfind == INVALID_HANDLE_VALUE) { 134 | if (error) { 135 | _perror((char*)search_path.c_str()); 136 | } 137 | return (int)INVALID_HANDLE_VALUE; 138 | } 139 | else { 140 | do { 141 | if (!strcmp(w32fd.cFileName, ".") 142 | || !strcmp(w32fd.cFileName, "..") 143 | || (fltout != NULL && fltout->size() > 0 && find(fltout->begin(), fltout->end(), string(w32fd.cFileName)) != fltout->end())) 144 | continue; 145 | string rcurrpath = string(w32fd.cFileName); 146 | if (currpath.size() > 0) { rcurrpath = currpath + "\\" + w32fd.cFileName; } 147 | paths->push_back(pair(rcurrpath, w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)); 148 | if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && recurse > 0 && curr < recurse) 149 | { 150 | string next_path = findpath + w32fd.cFileName; 151 | ret = findfiles(paths, next_path.c_str(), error, fltout, filter, recurse, curr + 1, rcurrpath); 152 | } 153 | } while (FindNextFile(hfind, &w32fd)); 154 | } 155 | if (!FindClose(hfind)) { 156 | _perror("FindClose"); 157 | } 158 | 159 | return ret; 160 | } 161 | 162 | vector> findstreams(const char* cfilepath, bool error) { 163 | 164 | vector> paths; 165 | WIN32_FIND_STREAM_DATA streamData; 166 | HANDLE hfind; 167 | 168 | 169 | size_t ret; 170 | wchar_t wfilepath[MAX_PATH + 1]; 171 | 172 | mbstowcs_s(&ret, wfilepath, size_t(MAX_PATH + 1), cfilepath, _TRUNCATE); 173 | hfind = FindFirstStreamW(wfilepath, FindStreamInfoStandard, &streamData, 0); 174 | 175 | if (hfind != INVALID_HANDLE_VALUE) { 176 | do { 177 | char ads[ MAX_PATH + 1 ]; 178 | //WideCharToMultiByte(CP_ACP, 0, streamData.cStreamName, -1, mtxt, MAX_PATH, NULL, NULL); 179 | wcstombs_s(&ret, ads, size_t(MAX_PATH + 1), streamData.cStreamName, _TRUNCATE); 180 | 181 | if ( strcmp( ads, "::$DATA" ) != 0) { 182 | // trim last ":$DATA" 183 | string ads_str = string(ads).substr(0, string(ads).length() - 6); 184 | paths.push_back(pair( ads_str, 0 ) ); 185 | } 186 | } while (FindNextStreamW(hfind, &streamData)); 187 | if (!FindClose(hfind)) { 188 | _perror("FindClose"); 189 | } 190 | 191 | } 192 | 193 | return paths; 194 | } 195 | -------------------------------------------------------------------------------- /triage-collector/util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace std; 8 | 9 | void __exit(int); 10 | void _perror(char *); 11 | void mkdir(char *, bool error=true); 12 | void chdir(char *); 13 | string basename(string &, char delim = '\\'); 14 | string dirname(string &, char delim = '\\'); 15 | string msg(string jp, string en, WORD lang = GetUserDefaultLangID()); 16 | string join(vector, string); 17 | string hexdump(const unsigned char*, size_t); 18 | int findfiles(vector>*, string, bool error = true, vector *fltout = {}, const char* filter = "*", unsigned int recurse = 0, unsigned int curr = 0, string currpath = string("")); 19 | vector> findstreams(const char* cfilepath, bool error = true); 20 | string base_name(string const&); 21 | bool ends_with(const std::string&, const std::string&); -------------------------------------------------------------------------------- /winpmem-2.1.post4.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/winpmem-2.1.post4.exe -------------------------------------------------------------------------------- /winpmem.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/winpmem.exe -------------------------------------------------------------------------------- /winpmem_mini_x64_rc2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/winpmem_mini_x64_rc2.exe -------------------------------------------------------------------------------- /winpmem_mini_x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herosi/triage-collector/0cfe0affa7c62c65d1a5ecfb3429a7a2e00fc7c5/winpmem_mini_x86.exe --------------------------------------------------------------------------------