aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
* Reduce likelyhood of stray pointer writes via ffi layer.Jack Lloyd2015-09-101-0/+8
| | | | | In error cases the output value was not intialized, so callers which ignored the error return might blindly use an uninitialized pointer.
* Add missing compression overridesSimon Warta2015-09-013-2/+3
|
* Move Credentials_Manager to TLSJack Lloyd2015-08-294-6/+1
|
* Remove alloc module; move secmem.h to base and locking_allocator to utilsJack Lloyd2015-08-2915-21/+1
|
* Fix OpenSSL RSA to better handle no padding mode.Jack Lloyd2015-08-293-10/+45
| | | | | | In raw mode pad out plaintext inputs with zeros as needed as otherwise OpenSSL rejects the input as too small. And when decrypting, strip leading zeros to match the behavior of the base implementation.
* Reverse the algorithm priority orderingJack Lloyd2015-08-2914-25/+50
| | | | | | Previously 0 was the highest priority and 255 was the lowest. But this is really quite confusing, instead treat 0 as lowest and 255 as highest so normal integer intuitions apply.
* Fix minimized builds and amalgamation buildsJack Lloyd2015-08-294-21/+35
| | | | | | | | No need to include the pk_utils.h header until we know ECDSA is enabled in the build. Move OpenSSL_Error to an internal header, was previously defined twice when all sources were combined.
* Merge pull request #236 from bogiord/add-alloc-constructorJack Lloyd2015-08-291-4/+7
|\ | | | | | | | | Make secure_allocator conforming with C++11 allocator concept. Add a template constructor and make the equality operators standard-compliant. Missing this broke iterator debugging with MSVC 2015.
| * Make the equality operators standard-compliant.bogdan2015-08-291-4/+4
| | | | | | The equality operators need to support different specializations as well; this is also part of the standard allocator requirements.
| * Add template constructor to secure_allocatorbogdan2015-08-051-0/+3
| | | | | | This is required by the Standard for an allocator. As far as I can tell, not having it breaks compilation in MSVC 2015, at least when iterator debugging is enabled. More details here: http://stackoverflow.com/q/31802806/4326278.
* | Avoid a crash in the TLS server if the client sends ALPN but no nextJack Lloyd2015-08-281-1/+1
| | | | | | | | protocol handler was specified to the Server constructor. GH #252
* | Add ECDSA provider using OpenSSLJack Lloyd2015-08-281-0/+217
| | | | | | | | | | Unfortunately the signer cannot be tested in current framework because OpenSSL does not use RFC 6979 deterministic signatures.
* | Remove unused variableJack Lloyd2015-08-281-3/+0
| |
* | Move GF(p) side channel countermeasure toggles to build.hJack Lloyd2015-08-282-28/+43
| | | | | | | | Some tweaks for point multiplication using fixed windows.
* | Use 16 byte alignment for all allocations in the mlock allocatorJack Lloyd2015-08-281-7/+1
| |
* | Add override specifiers to zlib.hJack Lloyd2015-08-281-6/+6
| |
* | Gzip_Decompression should be a subclass of Stream_DecompressionJack Lloyd2015-08-281-1/+1
| | | | | | | | GH #264
* | Compression: Fix zlib failure on compression of empty inputDaniel Seither2015-08-281-0/+8
| | | | | | | | | | zlib treats a nullptr output buffer as an error. This commit fixes the failing compression tests.
* | Compression: Prevent undefined behavior when feeding empty inputDaniel Seither2015-08-281-7/+7
| | | | | | | | | | | | &emptyVector[n] triggers undefined behavior because it is an out-of- bounds access, even if n == 0. emptyVector.data() does not (but may return nullptr).
* | Guard rlimit reset with a defined check for RLIMIT_MEMLOCK as it isJack Lloyd2015-08-241-0/+5
| | | | | | | | | | | | | | | | missing on Solaris at least. On such systems it's probably safe to assume that no amount of memory can be mlock'ed from userspace, so just return zero to disable the allocator entirely. GH #262
* | Remove high bit set char from comment as it broke amalgamation generationJack Lloyd2015-08-221-4/+8
| | | | | | | | | | | | under Python3. Ironically there doesn't seem to be any way to portably handle non-ASCII in a way that is compatible with Python 2.7 and 3 at the same time.
* | Missing addJack Lloyd2015-08-211-0/+1
| |
* | In RSA, check that the input is less than the modulus n before blindingJack Lloyd2015-08-211-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | rather than after. After blinding the value is always reduced mod n so the condition is never met. This may be the cause of RSA test failures described in GH #174 The scenario was that during randomized corruption tests we occasionally provide an input which was greater than the modulus. When that happened the value was effectively reduced mod n, so the self-check would later fail, because the decrypted result (reduced mod n) would be compared with the original (larger than n) input.
* | Add power analysis countermeasures for ECC point multiplications.Jack Lloyd2015-08-215-169/+312
| | | | | | | | | | | | | | | | The plain PointGFp operator* now uses Montgomery ladder exclusively. Adds a blinded point multiply algorithm which uses exponent and point randomization, as well as a Montgomery ladder technique that takes a random walk of the possible addition chains for k.
* | Add m_ prefix to member variable Power_Mod::m_coreSimon Warta2015-08-212-23/+23
| |
* | Refactor ./botan speedSimon Warta2015-08-212-9/+19
| | | | | | | | | | | | | | * Add random_prime benchmark * Add is_prime benchmark * Respect runtime in benchmark_transform(). This sets default runtime from 2s to 0.5s per configuration
* | Remove 'extern "C"' from src/lib/math/mpSimon Warta2015-08-1415-58/+2
| | | | | | | | | | | | | | | | | | | | C functions must not throw but Botan::bigint_divop throws (MSVC: warning C4297: 'Botan::bigint_divop' : function assumed not to throw an exception but does) * Move bigint_mul -> Botan::bigint_sqr * Move bigint_sqr -> Botan::bigint_sqr * Variable in unnamed namespace supersedes "static" keyword
* | Add stricter time parsing; Add more testsSimon Warta2015-08-112-8/+34
| |
* | Sometimes we don't know the input format. But it is one of twoSimon Warta2015-08-115-9/+28
| |
* | Explicitly fwd declase classes BER_Decoder, DER_EncoderSimon Warta2015-08-113-12/+10
| |
* | Remove string constructor of X509_Time()Simon Warta2015-08-116-205/+153
| | | | | | | | | | | | | | | | | | | | | | * Break down string representations to to_string() and readable_string() * Add m_ prefix to member variable names * Fix order of methods * Move comments Doxygen friendly to header * Make set_to() private (future subjejt of refectoring); People should use constructor Closes #185
* | Strict uint32 parsingSimon Warta2015-08-111-0/+10
| |
* | Avoid integer overlow in string->uint32 converterSimon Warta2015-08-101-3/+16
| | | | | | | | | | | | | | On systems where unsigned long is uint64 (typically 64 bit systems), a string containing a number greater than 2^32-1 was sucessfully converted to a uint64 and than reduced to uint32, causing an overflow. E.g. to_u32bit("4294967296") was 0 and to_u32bit("4294967297") was 1.
* | Merge branch 'master' of https://github.com/randombit/botanJack Lloyd2015-08-082-28/+29
|\ \
| * | Add m_ prefix to member variables in SecureQueueSimon Warta2015-08-082-27/+28
| | |
| * | Merge pull request #235 from tiwoc/overridesSimon Warta2015-08-081-1/+1
| |\ \ | | |/ | |/| Add two missing overrides and fix bug in fuzzer relating to these
| | * Add missing override for SecureQueue::check_available()Daniel Seither2015-08-031-1/+1
| | |
* | | Expose the NIST prime values and reduction operations as plain functions.Jack Lloyd2015-08-086-269/+229
|/ / | | | | | | | | | | Previously they were hidden away as private functions on the CurveGFp types. This allows directly testing the reduction functions against other computational methods.
* | For CBC, ECB, and XTS the output length of a zero length input is wellJack Lloyd2015-08-043-7/+9
| | | | | | | | | | | | defined, so don't fail. Fix XTS, as XTS always uses ciphertext stealing the value of output_length had been incorrect in rounding up to the block size.
* | Remove unused pkcs8 includesSimon Warta2015-08-038-8/+0
| | | | | | | | Only botan-cli, botan-tests and the FFI module depend on PKCS8
* | Merge pull request #232 from tiwoc/clang-cpuidSimon Warta2015-08-031-1/+1
|\ \ | |/ |/| Enable use of cpuid.h with clang
| * Enable use of cpuid.h with clangDaniel Seither2015-07-301-1/+1
| |
* | Fix two crashes in the BER decoder found with afl.Jack Lloyd2015-08-027-6/+60
| | | | | | | | | | One a read at 0 of an empty vector, the other causing allocation of an arbitrary amount of memory.
* | utils: Add missing overridesDaniel Seither2015-07-301-1/+1
| |
* | tls: Add missing overridesDaniel Seither2015-07-301-30/+30
| |
* | stream: Add missing overridesDaniel Seither2015-07-305-38/+38
| |
* | rng: Add missing overridesDaniel Seither2015-07-305-30/+30
| |
* | pubkey: Add missing overridesDaniel Seither2015-07-3025-86/+89
| |
* | pk_pad: Add missing overridesDaniel Seither2015-07-309-34/+34
| |
* | pbkdf: Add missing overridesDaniel Seither2015-07-301-2/+2
| |