aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Move Signature_Format enum to pubkey.hlloyd2008-04-292-32/+26
| | | | | | | | Including enums.h in needed places since asn1_int.h doesn't pull it in anymore. Remove Config::choose_sig_format, and move its logic into its only caller, the (global!) choose_sig_format in x509_ca.cpp
* propagate from branch 'net.randombit.botan.remove-libstate' (head ↵lloyd2008-04-2923-454/+185
|\ | | | | | | | | | | d4d75cf4f682ec63e316b853617e7cf9ba093272) to branch 'net.randombit.botan' (head 2fac918f1a1cb77d155cf434177e443d41e9e517)
| * propagate from branch 'net.randombit.botan' (head ↵lloyd2008-04-2123-454/+185
| |\ | | | | | | | | | | | | | | | 51f9ee5180a5cacdfff31504266e883b7bb0eb00) to branch 'net.randombit.botan.remove-libstate' (head 636b767b9686261418b1cb45a6271edeef87501b)
| | * propagate from branch 'net.randombit.botan' (head ↵lloyd2008-04-1723-454/+185
| | |\ | | | | | | | | | | | | | | | | | | | | 85596a0b1fbee6696261d36def7dad742375f7d9) to branch 'net.randombit.botan.remove-libstate' (head faf75eec422a3eb6108748315724fb6ac217dede)
| | | * propagate from branch 'net.randombit.botan' (head ↵lloyd2008-04-1223-454/+185
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | bcae6a19d8d96ebde33c832c76a130ea02bc923a) to branch 'net.randombit.botan.remove-libstate' (head f640991b6e433a264f5d22a08338cfc9c24c82da)
| | | | * propagate from branch 'net.randombit.botan' (head ↵lloyd2008-04-1023-454/+185
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6afe2db1f710f75bc27e189bb8bdb23613ce1ca3) to branch 'net.randombit.botan.remove-libstate' (head e40f0dbdfd847024c30fa0092c2acefc19a550b8)
| | | | | * Remove the Global_RNG namespace, along with rng.h and rng.cpp. This waslloyd2008-04-0712-88/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | essentially a facade for the RNG object living in the global library state. Rewrite all callers to directly invoke the global state object: this makes it more clear what functions are actually accessing mutable state outside of the normal reference graph (and thus, which functions will have to be altered in order to remove this dependency). Other facades remain in place for the configuration object and the memory allocator factory.
| | | | | * Remove X509_GlobalState in favor of static function Extensions::get_extensionlloyd2008-04-073-104/+23
| | | | | |
| | | | | * propagate from branch 'net.randombit.botan' (head ↵lloyd2008-04-071-15/+23
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | db3791f6bba4b57dd8aed17893565dc5bcd68f02) to branch 'net.randombit.botan.remove-libstate' (head 627d12447b2bb32aa08ff5daa499ac9580a77a05)
| | | | | * | Remove Charset_Transcoder; hardwire UTF-8/Latin-1 conversions into charset.cpplloyd2008-04-074-159/+101
| | | | | | |
| | | | | * | In Botan, the Timer base class provides access to a high-resolutionlloyd2008-04-075-47/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timer with an unspecified update rate and epoch. It is only used inside the entropy sources to provide some timing-dependent randomness. However, it is easier and basically 'as good' to treat the timers as entropy sources in their own right and feed their output directly into an entropy pool. This commit removes Library_State::system_clock and all calls to that function.
| | | | | * | Library_State::set_timer is never called from within Botan, low hanginglloyd2008-04-071-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fruit for removal.
| | | | | * | The intent of this branch is to remove the global library state objectlloyd2008-04-075-47/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Library_State, in libstate.{h,cpp}). It causes numerous 'interesting' problems with threads, etc, and the best solution here is to move to more or less an object-capability model, where the only objects that a piece of code can access are those which can be referenced through its arguments. First things first, remove the UI 'pulse' code. It is neither necessary nor sufficient for writing proper GUI/event driven code using Botan, has likely never been used in real code, and, given that, causes a distressing amount of overhead in terms of function calls made.
* | | | | | | The add_algorithm functions also need to be tagged with BOTAN_DLL inlloyd2008-04-251-5/+5
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | the source file (this seems to be the case for all global functions that we want to export from the library...)
* / / / / / Add BOTAN_DLL macro in all needed spots for working DLL export. Basedlloyd2008-04-211-5/+9
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on a patch from Joel Low for MSVC, modified and tested with GCC using -fvisibility=hidden and the visibility attribute. Getting this working completely requires making the shared object and static lib builds completely distinct (which is also a win since it allows avoiding -fPIC usage, etc in the static lib). Currently too many things are being exported, though it is an improvement as internal-only code like the bigint_* functions are hidden.
* / / / / Always set the position to the start of the block when generating a newlloyd2008-04-151-3/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | block of data in the X9.31 PRNG (previously, adding entropy would cause a new block to be computed but the read pointer would be the same as it had been in the old block). Nominally this is very slightly faster (we don't throw away bytes we just computed) but the change is more to make the code more obvious/explicit; I was surprised by its old behavior, which seems bad. In theory it could introduce additional weaknesses, if gaining advantage to this partial block that was being thrown away assisted in an attack (I do not know of any attacks against the X9.31 PRNG that work that way, however).
* | | | Remove setting of unused blinder_size config varlloyd2008-04-121-1/+0
| | | |
* | | | Modify areas that still assumed Pipe::message_id was exactly a u32bit.lloyd2008-04-123-20/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done by replacing Pipe::message_id with a completely opaque type and adding only the necessary operations. In this revision Pipe::message_id does remain a u32bit. However it may become an opaque type in the future. Move the Invalid_Message_Number exception to Pipe since that is the only piece of code which throws it.
* | | | Use existing reference to p in Elg_Core constructor for small code cleanuplloyd2008-04-121-2/+2
| | | |
* | | | In decimal string inputs: ignore spaces, and for other bad inputs throwlloyd2008-04-121-0/+7
| | | | | | | | | | | | | | | | an exception saying so.
* | | | Make the size of the random value used to blind the private keylloyd2008-04-121-15/+4
| | | | | | | | | | | | | | | | operations (to prevent timing attacks) a compile time constant.
* | | | Remove Config::option_as_u32bit - the only advantage it had over callinglloyd2008-04-125-40/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to_u32but on the return value from Config::option was that it passed it through parse_expr, which did some simple evaluation tricks so you could say 64*1024. That does not seem worth the cost in code, especially because most of the values so controlled are probably never changed. By making them compile time constants, additional optimizations are possible in the source as well as by the compiler. Remove the pkcs8_tries config option. Hardcode that value to 3 instead. I want to rewrite that code in the relatively near future and all that will (hopefully) go away.
* | | | Make the memory allocator's chunk size a compile time constant, via alloyd2008-04-122-22/+1
| | | | | | | | | | | | | | | | new build.h macro BOTAN_MEM_POOL_CHUNK_SIZE
* | | | Wrap lines to 80 columnslloyd2008-04-102-4/+12
| | | |
* | | | Rename fips140.h to selftest.h, since it doesn't really have much to dolloyd2008-04-102-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with FIPS-140 aside from being a startup self test. Remove the test of X9.19 MAC at startup because it's not that important, and loading it in the startup means a prototypical object will be created and exist in memory for the entire process runtime. This actually raises an interesting idea, that periodically the cache of objects could be cleared and, if one is needed again, it can be created again as if it was the first time.
* | | | Remove unused Config::option_as_listlloyd2008-04-101-8/+0
|/ / /
* | | Remove severa global configuration variables related to entropy gathering,lloyd2008-04-103-19/+6
| | | | | | | | | | | | instead passing those values as arguments.
* | | Remove the config option rng/ms_capi_prov_type - the CryptoAPI entropylloyd2008-04-101-1/+0
| | | | | | | | | | | | | | | source will default to using the PROV_RSA_FULL provider if an empty string is passed to the constructor.
* | | Remove the pem/ config arguments. Replace with arguments to the individuallloyd2008-04-102-21/+10
| | | | | | | | | | | | functions in pem.h. All have defaults with reasonable values.
* | | Add a second argument to X509_Cert_Options, which replaceslloyd2008-04-102-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | the configuration value default_expire Remove signing_offset as well - it is only used for setting the default time of a X509_Cert_Options: not worth the cost of a global variable.
* | | Remove the unused function Config::option_as_boollloyd2008-04-101-16/+0
| | |
* | | Change the interface of X509_CA::sign_request as follows:lloyd2008-04-101-17/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The allow_ca policy value is no longer checked. Callers should check if the request is for a CA cert and treat it accordingly; this makes it simpler to to case-by-case decisions (expecially among multiple threads) - Instead of a single time value, a u32bit representing the number of seconds from now the certificate should expire, the start and end times are passed explicitly as two X509_Time values.
* | | Change the copyrights in all files in the Botan tree to directly reflectlloyd2008-04-10208-208/+215
| |/ |/| | | | | | | | | the actual copyright holders. For rationale, see my post to botan-devel on April 9, subject 'Changing license to directly reflect contributors' (http://www.randombit.net/pipermail/botan-devel/2008-April/000527.html)
* | Remove Extensions::copy_this(). Define the Extensions copy constructor inlloyd2008-04-071-15/+23
|/ | | | terms of Extensions::operator=
* Move combine_timers from a free-standing function in util.h to a privatelloyd2008-04-071-2/+1
| | | | | static function of the Timer base class - since that is the only code which actually needs to access it.
* Remove the Named_Mutex_Holder and associated code. Convert all uses tolloyd2008-04-023-62/+44
| | | | | | | | | | | | | | instead allocate a reference to a mutex locally and use the more typical Mutex_Holder RAII object. Named_Mutex_Holder (and in particular the string->mutex mappings contained in the global state) have been found to be pretty expensive in at least some situations (see post by Jack Cummings to monotone-devel 2008-03-12), and doesn't really buy us that much in terms of ease of use. Also, it relies on the global state object, which has shown itself to be a rich source of race conditions and locking bugs. The intent is to incrementally remove all of the shared / global state and require applications to maintain that state where necessary.
* Use a special typedef, Pipe::message_id, rather than a bare u32bit,lloyd2008-03-142-11/+11
| | | | to represent the message number in a Pipe
* Add a new constructor for DataSource_Stream taking in a std::istream.lloyd2008-03-111-7/+21
| | | | | Previously the only method allowed was with a pathname, which is pretty inflexible since it prevents you from using devices like std::cin, etc
* In DataSink_Stream, allow explicitly setting a pathname (forlloyd2008-03-111-11/+13
| | | | | | identification purposes) when passing in a std::ostream, since there is no portable way to go from a std::ostream to the file or other device that it names
* Mostly revert 2f4fd18182d5a75c40cd831e7ee3c314be5c57d6, only keep thelloyd2008-03-10202-202/+202
| | | | | updated dates on files that have actually changed this year. This makes the diff across versions readable again.
* Unroll the loops in SHA_160::hash that unpack the input and perform thelloyd2008-03-091-4/+15
| | | | | expansion. While I would prefer to have the compiler to this, using GCC 4.1.2 it is 4% faster on a Core2 Q6600 with the loops partially unrolled.
* Rename offset_ variables to idx_lloyd2008-03-091-30/+30
|
* Alter bigint_madd2 and bigint_madd3 to take only 3 (4, resp) arguments,lloyd2008-03-093-6/+6
| | | | | | | with the last one being both one of the input values and the output carry register, since almost always they were in fact the same variable. Also update the x86 and x86-64 modules.
* Also inline xor_buf, both for immediate effeciency gains and for futurelloyd2008-03-091-34/+0
| | | | writing of it in assembly.
* Put reverse_bytes into bit_ops.h so they can be inlined. Rewrite the versionlloyd2008-03-081-29/+0
| | | | | | | for 64-bit to not use 64-bit constants - that way GCC won't complain everwhere. Plan is for a module to replace all of these with asm (bswap, xchg on x86), at least for x86-64
* Mass update of the copyright date. Honestly I don't know why I bother,lloyd2008-02-14208-208/+208
| | | | | | | but might as well keep it up to date. And it's easier to do it once with a 'perl -pi' command than to update each file over time. Apologies to anyone looking at diffs.
* Add a short comment describing Turing::fixedSlloyd2007-11-191-1/+1
|
* Change the default list of PRNG devices fromlloyd2007-11-171-1/+1
| | | | | | | | | /dev/urandom /dev/random to /dev/random /dev/srandom /dev/urandom because the es_dev module can handle reads from devices that may block without ever blocking for an unbounded amount of time.
* Drop es_file: replaced by es_devlloyd2007-11-172-37/+0
|
* Add a hook for the es_dev module in Builtin_Moduleslloyd2007-11-171-0/+8
|