aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate
Commit message (Collapse)AuthorAgeFilesLines
* When creating a PBKDF2, first check if the argument name is a knownlloyd2010-08-211-2/+6
| | | | | | | | | | | | | MAC. If it is, use it as the PRF. Otherwise assume it is a hash function and use it with HMAC. Instead of instantiating the HMAC directly, go through the algorithm factory. Add a test using PBKDF2 with CMAC(Blowfish); Blowfish mainly because it supports arbitrarily large keys, and also the required 4 KiB of sbox tables actually would make it fairly useful in that it would make cracking using hardware or GPUs rather expensive. Have not confirmed this vector against any other implementation because I don't know of any other implementation of PBKDF2 that supports MACs other than HMAC.
* Fix return value for set_global_state_unless_setlloyd2010-08-081-0/+3
|
* Move the functions that directly manipulate the global state singletonlloyd2010-08-066-67/+165
| | | | | | | | | | | into global_state.{h,cpp}. Move all of the functions into a new namespace Global_State_Management, though exposing global_state() into the Botan namespace for compatability. Also add new functions global_state_exists and set_global_state_unless_set which may be helpful in certain tricky initialization scenarios (eg when an application using botan also uses a library which may or may not itself use botan).
* Rename Default_Engine to Core_Engine which describes its purposeslloyd2010-07-272-3/+3
| | | | (slightly) better.
* Modify CPUID so all the check functions are purely inline. Add a newlloyd2010-07-261-0/+3
| | | | | initialize() call which must be called prior to use of any other functions.
* Consolidate the two engines that provided assembler implementationslloyd2010-07-131-12/+4
| | | | | | (amd64_eng and ia32_eng) into a new asm_engine. This same engine could also be used in the event that asm code for other CPUs was added later on.
* Rename S2K to PBKDF, because that is by far the most common name - S2Klloyd2010-07-093-12/+22
| | | | | | | | | | | | | really is only used by OpenPGP, and largely it was named S2K here because the OpenPGP S2K was implemented years before the ones in PKCS #5. We have a typedef of PBKDF to S2K, and an inlined get_s2k that calls get_pbkdf for source compatability. There doesn't seem to be any reason to have a forward for the renamed s2k.h header - to actually use a PBKDF, you'd have to either include lookup.h and call get_s2k / get_pbkdf, or else include an algorithm-specific header and use it directly. In either case, including s2k.h is neither necessary nor sufficient.
* If we are going to lazily initialize, just create the type and calllloyd2010-06-251-2/+4
| | | | its constructor directly, instead of going through LibraryInitializer.
* Doxygenlloyd2010-06-211-5/+23
|
* Replace "@return a blah" and "@return the blah" with just "@return blah"lloyd2010-06-165-31/+31
|
* Yet more Doxygen commentslloyd2010-06-161-16/+18
|
* More Doxygen commentslloyd2010-06-162-0/+10
|
* Deprecated some of the old lookup functions in Doxygenlloyd2010-06-152-0/+38
|
* More Doxygen updates/fixeslloyd2010-06-151-2/+2
|
* Fix a few hundred Doxygen warningslloyd2010-06-154-40/+43
|
* Use "/*" instead of "/**" in starting comments at the begining of a file.lloyd2010-06-075-5/+5
| | | | | This caused Doxygen to think this was markup meant for it, which really caused some clutter in the namespace page.
* mutex.h is internal - had been picking up system installed versionlloyd2010-04-231-1/+1
|
* Allow adding engines dynamicallylloyd2010-03-241-10/+8
|
* Delete global RNG and the mutex in ~Library_Statelloyd2010-03-231-3/+5
|
* Don't require the AES module; if it's there its there, if it's notlloyd2010-03-192-4/+2
| | | | then you can't use the global PRNG but everything else still works.
* There are some nasty API problems that are caused by having to pass alloyd2010-03-194-8/+235
| | | | | | | | | | | | | | | | | | | | | | | | PRNG everywhere. The removal of the global PRNG was generated by a desire to remove the global library state entirely. However the real point of this was to remove the use of globally visible _mutable_ state; of the mutable state, the PRNG is probably the least important, and the most useful to share. And it seems unlikely that thread contention would be a major issue in the PRNG. Add back a global PRNG to Library_State. Use lazy initialization, so apps that don't ever use a PRNG don't need a seeding step. Then have AutoSeeded_RNG call that global PRNG. Offer once again RandomNumberGenerator& Library_State::global_rng(); which returns a reference to the global PRNG. This RNG object serializes access to itself with a mutex. Remove the hack known as Blinding::choose_nonce, replace with using the global PRNG to choose a blinding nonce
* At startup, test if lock_mem() at least seems to work. If it doesn't,lloyd2010-03-131-1/+2
| | | | | immediately fall back the the plain malloc-based allocator, which is typically quite a bit faster.
* Remove config options to toggle if X.509 extensions are critical orlloyd2010-03-103-48/+0
| | | | | | | | not. Instead provide via Extensions::add(). No way to modify behavior currently, it just follows the previous default police. Remove the config options from Library_State entirely. Die, mutable singletons, die.
* Remove the base/default_allocator option, instead save as a per-libstatelloyd2010-03-103-19/+25
| | | | variable directly.
* Rename PK_Encryptor_MR_with_EME and PK_Decryptor_MR_with_EME tolloyd2010-03-081-2/+2
| | | | | PK_Encryptor_EME and PK_Decryptor_EME; the message recovery is somewhat implicit in the recovery of the plaintext.
* Have the constructors in pubkey.h take all arguments look_pk does, andlloyd2010-03-081-9/+5
| | | | convert look_pk to simple forwarders.
* Remove the now no-op classes PK_Encrypting_Key,lloyd2010-03-081-20/+4
| | | | | PK_Decrypting_Key, PK_Signing_Key, PK_Verifying_with_MR_Key, and PK_Verifying_wo_MR_Key.
* Inline Engine_Core::mod_exp into singler caller, and deletelloyd2010-03-053-72/+0
|
* Remove IF_Corelloyd2010-03-052-31/+0
|
* Add ops for ElGamal encryption and decryption.lloyd2010-03-052-27/+0
| | | | | Note: blinding is not currently being used for RSA, RW, DH or ElGamal, which used to have them. This should be added back before release.
* Remove NR and DSA specific hookslloyd2010-03-052-54/+0
|
* Add verification ops for all signature key typeslloyd2010-03-051-2/+2
|
* Inline look_pk funcslloyd2010-03-053-102/+49
|
* This checkin represents a pretty major change in how PK operations arelloyd2010-03-042-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | performed. Up until now, each key object (eg DSA_PublicKey or ECDH_PrivateKey) had two jobs: contain the key material, and know how to perform any operations on that key. However because of a desire to support alternative implementations (GNU MP, hardware, whatever), there was a notion of operations, with the key objects containing an op that they got via engine rather than actually implementing the underlying algorithms directly. Now, represent the operation as an abstract interface (typically mapping a byte string to a byte string), and pass a plain Public_Key& or Private_Key& to the engine. The engine does any checks it wants (eg based on name, typeid, key sizes, etc), and either returns nothing (I'll pass) or a pointer to a new operation that represents signatures or encryption or what-have-you using that key. This means that plain key objects no longer contain operations. This is a major break with the traditional interface. On the other hand, using these 'bare' operations without padding, KDFs, etc is 99% of the time a bad idea anyway (and if you really need them, there are options so you get the bare op but via the pubkey.h interfaces). Currently this change is only implemented for DH and ECDH (ie, key agreement algorithms). Additionally the optional engines (gnump and openssl) have not been updated. I'll probably wait to touch those until after I can change them all in one go for all algos.
* Fix ElGamal pubkey encoding (OID was unknown)lloyd2010-03-041-1/+1
|
* Catch any exception for parsing name, assume it's a bad OIDlloyd2010-03-041-1/+1
|
* Modify the ECDSA signature OIDs. Previously the ones using the BSIlloyd2010-03-021-6/+8
| | | | | | | | | | | scheme, which is supposed to use the IEEE 1363-style concatenation format, was identified with the X9.62 OIDs, which are documented to use the DER sequence format. Switch the BSI ones to use the OIDs allocated for this purpose by BSI, and add the X9.62 ECDSA/SHA-1 OID since that was missing. Correct an ECDSA test that assumed the cert was identified with the BSI OID, even though in fact the cert in question uses an X9.62-style format.
* For PEM encoding ECC domain parameters I had been using the identifierlloyd2010-03-021-58/+58
| | | | | | | | "ECC DOMAIN PARAMETERS", because I couldn't find any other library that offered PEM encoding to be compatible with so I just picked something. Turns out OpenSSL does have PEM encoding of EC params (openssl ecparam), and uses "EC PARAMETERS". As good as anything else, and allows interop, so change to use that.
* Kill ECKAEG_Oplloyd2010-03-022-32/+0
|
* Remove ECDSA_Op and its attendant bitslloyd2010-03-022-32/+0
|
* Move all of the ECC domain parameter sets to policy.cpp, encoded as PEM,lloyd2010-03-021-0/+296
| | | | instead of weird custom format hard-coded in ec_dompar.cpp
* propagate from branch 'net.randombit.botan' (head ↵lloyd2010-02-247-208/+186
|\ | | | | | | | | | | 84baf58b29f3aaaee34e2b873d0040be5a6c4368) to branch 'net.randombit.botan.gost_3410' (head 63cbe3e357c071d7960bfedc31101eff35895285)
| * In SCAN_Name's constructor, first run the input through deref_alias beforelloyd2010-02-142-3/+5
| | | | | | | | | | breaking it apart. Otherwise it would miss on things like TLS.Digest.0 which expand to Parallel(MD5,SHA-1) which needs further parsing.
| * Add OID for Serpent/CBClloyd2010-01-191-0/+1
| |
| * Add doxygen commentslloyd2009-12-291-12/+39
| |
| * Make startup self-test failures more verboselloyd2009-12-261-2/+1
| |
| * Define lookup.{h,cpp} in terms of Algorithm_Factory. Inline a lot of simplelloyd2009-12-262-187/+123
| | | | | | | | functions into the header.
| * Add OIDs for SEED/CBC and HMAC with SHAlloyd2009-12-261-0/+8
| |
| * New SCAN decoding err string was misleading in one caselloyd2009-12-261-1/+4
| |
| * Improve exception output of SCAN_Name on bad inputlloyd2009-12-261-3/+5
| |