summaryrefslogtreecommitdiffstats
path: root/Source/cmCryptoHash.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmCryptoHash: Add support for SHA-3 algorithmsBrad King2016-11-101-6/+22
|
* cmCryptoHash: Re-implement in terms of librhashBrad King2016-11-101-44/+53
| | | | | | Offer direct construction with an enumeration of supported algorithms. Also expose the Initialize/Append/Finalize steps publicly and add a FinalizeHex method.
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-0/+2
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-9/+15
|
* cmCryptoHash: New ByteHash methods that return a byte vectorSebastian Holtermann2016-08-101-26/+40
|
* cmCryptoHash: Return byte vector from internal Finalize methodSebastian Holtermann2016-08-101-10/+10
| | | | | | Some callers may want the raw byte vector instead of the hex character string. Convert the internal implementation to use this so that we can later add public APIs to get it.
* cmCryptoHash: New byte hash to string functionSebastian Holtermann2016-08-101-0/+31
|
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-8/+8
| | | | | | | | | | | | Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to our own implementation adopted from the KWSys auto_ptr implementation. Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers that do not warn about it. Automate the client site conversions: git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \ 's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
* use CM_NULLPTRDaniel Pfeifer2016-06-281-1/+1
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-45/+45
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Remove use of include <cmsys/ios/*> and cmsys_ios::*Brad King2015-08-201-1/+1
| | | | We no longer need this compatibility layer for the compilers we support.
* Fix build on AIX failing because of access to string elementsRolf Eike Beer2014-04-041-1/+1
| | | | | | | | | | The compilation failed with this error message: .../Source/cmCryptoHash.cxx: In method `string cmCryptoHash::HashString (const string &)': .../Source/cmCryptoHash.cxx:41: non-lvalue in unary `&' This was introduced in 77f60392d93f41a8828d3db1d7b76d45f1535d07 (stringapi: Accept strings when MD5 hashing data).
* stringapi: Accept strings when MD5 hashing dataBen Boeckel2014-03-081-5/+5
|
* Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-1/+2
| | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* cmCryptoHash: Increase alignment of HashFile bufferBrad King2013-06-131-3/+3
| | | | | | | The SHA512_Update implementation accesses input data via 64-bit integers. This requires alignment of the input buffer on some architectures. Align our stack-allocated buffer for file content to satisfy this requirement.
* cmCryptoHash: Provide factory "New" methodBrad King2011-11-161-0/+19
| | | | | Construct a cmCryptoHash subclass instance based on the name of the desired hash algorithm.
* Add file(SHA*) commands to compute cryptographic hashesBrad King2011-11-161-0/+21
| | | | Add a file() command API for SHA1, SHA224, SHA256, SHA384, and SHA512.
* Factor Compute(File|String)MD5 into cmCryptoHash helperBrad King2011-11-161-0/+90
Define an abstract API around the backend hash algorithm. Expose ifstream errors to HashFile callers. Always try opening the file. Succeed only if the end of file is reached without error.