aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
* Rename 'darwin' target to 'macos'Jack Lloyd2019-03-277-14/+14
| | | | | Both because that's the more common term, and because iOS/watchOS also uses the Darwin kernel, but we have a distinct target for mobile.
* Work around problem with GCC 4.8Jack Lloyd2019-03-262-2/+4
|
* Fix some warnings from GCC 9Jack Lloyd2019-03-253-3/+3
| | | | New redundant-move and pessimizing-move warnings found some
* Avoid a warning when building in single file amalgamation modeJack Lloyd2019-03-131-1/+1
|
* Replace upper_bound with lower_bound in pgp_s2kEvgeny Pokhilko2019-03-111-1/+1
| | | | | | | | Fix: RFC4880_encode_count doesn't return consistent results when processing exact iterations. It returns RFC4880 code + 1. Update PGP_S2K_Iter test to verify PGP formula Add test to verify that encoded values match the PGP formula
* Fix Coverity warningsJack Lloyd2019-03-072-20/+38
| | | | | | | | Checking a ptr against null after dereferencing it. Allowing exception throw to escape a noexcept function. Both harmless.
* Add references for these addition chains [ci skip]Jack Lloyd2019-03-071-0/+4
|
* Merge GH #1849 Prefer to_string over as_stringJack Lloyd2019-03-0318-28/+41
|\
| * Fix MSVC and avoid deprecated function callJack Lloyd2019-03-011-1/+1
| |
| * s/as_string/to_string/Jack Lloyd2019-03-0118-28/+41
| | | | | | | | | | A few older APIs use as_string where everywhere else uses to_string. Add to_string's where missing, and deprecate X::as_string.
* | Handle invalid public key length in Ed25519Jack Lloyd2019-03-032-14/+20
|/ | | | Closes #1850
* Constify a few things in X509_Certificate::to_string()Jack Lloyd2019-03-011-5/+12
|
* Split CLI utils.cpp into more partsJack Lloyd2019-02-281-4/+7
| | | | | | Add base58 encoding/decoding CLI Use decrypt_or_random in pk_decrypt
* Prevent a warning with old GCCJack Lloyd2019-02-271-4/+5
| | | | GCC 4.8 seems to dislike returns_nonnull attribute, GCC 5 is ok.
* s/Blake2b/BLAKE2b/Jack Lloyd2019-02-222-18/+20
| | | | As that is the proper name of the hash. Add a typedef for compat.
* Unroll SHA-3Jack Lloyd2019-02-212-132/+158
| | | | Improves performance by about 10-12%
* Merge GH #1830 Add MacOS certificate storeJack Lloyd2019-02-193-0/+569
|\
| * add an adaptor for certificate keychain access on macOSRené Meusel2019-02-183-0/+569
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FIX: build on non-macOS platforms FIX: move constructor of scoped_CFType implement Certificate_Store_MacOS::all_subjects() Refactor: factor out X509 policy creation FIX: cosmetics FIX: code cosmetics * Refactor: use a unique_ptr rather than free() * Refactor: use a unique_ptr rather than free() * use std::shared_ptr<> for Pimpl * double-check opening of cert stores * add some documentation * copyright notice dates shush clang compiler warning -Wcast-qual See here for details: https://bugs.webkit.org/show_bug.cgi?id=177893 shush -Wmissing-braces on Travis CI (hopefully) FIX: crash when no certificate matches FIX: 'normalize' DNs according to Apple's needs FIX: take early review comments into account FIX: compiler warning regarding variable shadowing add timers to the cerstore tests FIX: catch invalid SHA-1 parameter FIX: handle ambiguous match in .find_cert_by_pubkey_sha1() according to the super-class's documentation FIX: API documentation FIX: cosmetics make Certificate_Store_MacOS::find_crl_for() return {} FIX: low-hanging review comments FIX: more review comments FIX: compiler warnings
* | Default McEliece and XMSS to SIV modeJack Lloyd2019-02-181-2/+10
| |
* | Add additional annotations for malloc functionsJack Lloyd2019-02-171-1/+1
| | | | | | | | May help codegen slightly.
* | Fixes for minimized buildsJack Lloyd2019-02-165-6/+20
| | | | | | | | Various configurations would fail build or test, fix that.
* | Renamed m_handle to m_prov as this is the variable name used elsewhere.Ricardo Martins2019-02-151-1/+1
| |
* | Support arbitrary key lengths in SHAKE-128 cipherJack Lloyd2019-02-132-22/+14
|/ | | | | We need this for Kyber, which uses 34 byte inputs to XOF when computing the public matrix.
* Build fixes for GNU/HurdJack Lloyd2019-02-041-0/+1
| | | | Thanks to @noloader for testing this and the relevant info.
* Merge GH #1819 Add Thread_Pool and use it for running testsJack Lloyd2019-01-315-14/+212
|\
| * Add a thread poolJack Lloyd2019-01-315-14/+212
| |
* | Have set_mem only work for bytesJack Lloyd2019-01-311-4/+3
| | | | | | | | It is (mildly) dangerous with larger types, and we don't need it.
* | Minor HMAC optimizationsJack Lloyd2019-01-312-15/+31
|/ | | | | Most importantly, avoid an allocation when the key is larger than a block size. Also avoid some virtual calls that can be cached.
* Merge GH #1821 Refactor CPUID to be thread safeJack Lloyd2019-01-317-54/+83
|\
| * Refactor CPUID to make it thread safeJack Lloyd2019-01-307-54/+83
| | | | | | | | | | | | | | | | | | | | Needed for #1819 and unfortunately Windows does not allow thread local data to be stored as a member of a DLL exported class. So hide it behind an accessor function instead. This slows down CPUID test somewhat and I would like to address that but it seems hard without breaking the CPUID API, which is for better or worse public.
* | Recognize BLAKE2b also [ci skip]Jack Lloyd2019-01-311-1/+1
|/ | | | See #1822
* Compile fixJack Lloyd2019-01-302-2/+2
|
* Use std::mutex instead of mutex_type hereJack Lloyd2019-01-304-8/+8
| | | | | std::condition_variable only works with std::mutex anyway, and this module is not enabled on systems without threads.
* Avoid a harmless data race in RSA decryptionJack Lloyd2019-01-281-0/+7
| | | | | | | | | Both threads called Modular_Reducer::reduce on m, which caused the significant words result to be written twice in an unsynchronized way. By calling it once beforehand it is computed and cached and so no additional writes occur. Found with helgrind.
* Fix warningJack Lloyd2019-01-241-3/+6
|
* Doc updatesJack Lloyd2019-01-241-1/+3
|
* Revamp BigInt encoding and decoding.Jack Lloyd2019-01-245-104/+131
| | | | Deprecate some crufty functions. Optimize binary encoding/decoding.
* Make the Memory_Pool MMU operations a compile time optionJack Lloyd2019-01-221-4/+16
| | | | | | Previously the calls were commented out as this has a substantial performance impact. Allow enabling them via a build.h toggle, and enable it by default when debug asserts are turned on.
* Remove some unnecessary assertsJack Lloyd2019-01-223-34/+0
| | | | Now this is checked at the higher level
* Merge GH #1816 Rename Integrity_Failure to Invalid_Authentication_TagJack Lloyd2019-01-2121-33/+50
|\
| * Rename Integrity_Failure to Invalid_Authentication_TagJack Lloyd2019-01-1821-33/+50
| | | | | | | | | | | | | | | | | | This makes the meaning and usage more clear. Add a specific error type so invalid tags can be distinguished without having to catch that specific type. See also #1813
* | Add BMI2 variants for SHA-512 and SHA-3Jack Lloyd2019-01-1810-10/+413
|/ | | | Both about 33% faster on Skylake
* Fix init ordering warningJack Lloyd2019-01-181-1/+1
|
* Remove use of std::filesystem / boost::filesystemJack Lloyd2019-01-172-69/+8
| | | | | | | | | Boost doesn't buy us anything here since we need to maintain Win32 and POSIX implementations for non-Boost builds, and Boost only supports those two APIs anyway. MSVC's implementation of std::filesystem does not help for similar reasons, as we have to maintain a Win32 version for MinGW.
* Define BOTAN_IF_CONSTEXPRJack Lloyd2019-01-174-8/+25
| | | | This lets us avoid some warnings under VC++ 2017
* Fix some warnings from PVS-StudioJack Lloyd2019-01-1711-14/+23
| | | | No real bugs, but pointed out some odd constructs and duplicated logic
* Merge GH #1808 Add sandbox feature to CLIJack Lloyd2019-01-141-0/+1
|\
| * Sandboxing feature from CLI pov.David Carlier2019-01-142-24/+0
| | | | | | | | | | No resources to free with actual OS features but might be of use for later.
| * Proposal of sandboxing feature.David Carlier2019-01-062-0/+25
| | | | | | | | For now only used by the TLS server.
* | Remove unused fieldsJack Lloyd2019-01-131-3/+0
| |