diff options
author | lloyd <[email protected]> | 2008-04-29 13:34:37 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-04-29 13:34:37 +0000 |
commit | af8b04c4583dfcad766eeed656650821a9de8675 (patch) | |
tree | 384910fc7829a607daaababe51f24f89d9eb8be5 /include | |
parent | acfdd1ccf164a413a3e6d8fe70d4f60dfe76fe7e (diff) | |
parent | b990aa276af6936a1c3d7c01d5b35d52ea7b3baa (diff) |
propagate from branch 'net.randombit.botan.remove-libstate' (head d4d75cf4f682ec63e316b853617e7cf9ba093272)
to branch 'net.randombit.botan' (head 2fac918f1a1cb77d155cf434177e443d41e9e517)
Diffstat (limited to 'include')
-rw-r--r-- | include/asn1_int.h | 38 | ||||
-rw-r--r-- | include/botan.h | 1 | ||||
-rw-r--r-- | include/buf_es.h | 1 | ||||
-rw-r--r-- | include/charset.h | 12 | ||||
-rw-r--r-- | include/def_char.h | 25 | ||||
-rw-r--r-- | include/enums.h | 52 | ||||
-rw-r--r-- | include/libstate.h | 25 | ||||
-rw-r--r-- | include/modules.h | 4 | ||||
-rw-r--r-- | include/rng.h | 32 | ||||
-rw-r--r-- | include/timers.h | 6 | ||||
-rw-r--r-- | include/util.h | 3 | ||||
-rw-r--r-- | include/x509_ext.h | 2 | ||||
-rw-r--r-- | include/x509stat.h | 35 |
13 files changed, 45 insertions, 191 deletions
diff --git a/include/asn1_int.h b/include/asn1_int.h index e6c3819c6..3e0562b9c 100644 --- a/include/asn1_int.h +++ b/include/asn1_int.h @@ -7,12 +7,48 @@ #define BOTAN_ASN1_H__ #include <botan/secmem.h> -#include <botan/enums.h> #include <botan/exceptn.h> namespace Botan { /************************************************* +* ASN.1 Type and Class Tags * +*************************************************/ +enum ASN1_Tag { + UNIVERSAL = 0x00, + APPLICATION = 0x40, + CONTEXT_SPECIFIC = 0x80, + PRIVATE = 0xC0, + + CONSTRUCTED = 0x20, + + EOC = 0x00, + BOOLEAN = 0x01, + INTEGER = 0x02, + BIT_STRING = 0x03, + OCTET_STRING = 0x04, + NULL_TAG = 0x05, + OBJECT_ID = 0x06, + ENUMERATED = 0x0A, + SEQUENCE = 0x10, + SET = 0x11, + + UTF8_STRING = 0x0C, + NUMERIC_STRING = 0x12, + PRINTABLE_STRING = 0x13, + T61_STRING = 0x14, + IA5_STRING = 0x16, + VISIBLE_STRING = 0x1A, + BMP_STRING = 0x1E, + + UTC_TIME = 0x17, + GENERALIZED_TIME = 0x18, + + NO_OBJECT = 0xFF00, + DIRECTORY_STRING = 0xFF01 +}; + +/************************************************* * Basic ASN.1 Object Interface * *************************************************/ class BOTAN_DLL ASN1_Object diff --git a/include/botan.h b/include/botan.h index 99c3864f3..a7b124da4 100644 --- a/include/botan.h +++ b/include/botan.h @@ -7,6 +7,5 @@ #include <botan/config.h> #include <botan/init.h> #include <botan/lookup.h> -#include <botan/rng.h> #include <botan/version.h> #include <botan/parsing.h> diff --git a/include/buf_es.h b/include/buf_es.h index 249adcb27..fafec7c80 100644 --- a/include/buf_es.h +++ b/include/buf_es.h @@ -24,7 +24,6 @@ class BOTAN_DLL Buffered_EntropySource : public EntropySource void add_bytes(const void*, u32bit); void add_bytes(u64bit); - void add_timestamp(); virtual void do_slow_poll() = 0; virtual void do_fast_poll(); diff --git a/include/charset.h b/include/charset.h index d585bf0ed..ac9f501a0 100644 --- a/include/charset.h +++ b/include/charset.h @@ -12,18 +12,6 @@ namespace Botan { -/************************************************* -* Character Set Transcoder Interface * -*************************************************/ -class BOTAN_DLL Charset_Transcoder - { - public: - virtual std::string transcode(const std::string&, - Character_Set, Character_Set) const = 0; - - virtual ~Charset_Transcoder() {} - }; - namespace Charset { /************************************************* diff --git a/include/def_char.h b/include/def_char.h deleted file mode 100644 index 71c2b975f..000000000 --- a/include/def_char.h +++ /dev/null @@ -1,25 +0,0 @@ -/************************************************* -* Default Character Set Handling Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#ifndef BOTAN_DEFAULT_CHARSET_H__ -#define BOTAN_DEFAULT_CHARSET_H__ - -#include <botan/charset.h> - -namespace Botan { - -/************************************************* -* Default Character Set Transcoder Object * -*************************************************/ -class BOTAN_DLL Default_Charset_Transcoder : public Charset_Transcoder - { - public: - std::string transcode(const std::string&, - Character_Set, Character_Set) const; - }; - -} - -#endif diff --git a/include/enums.h b/include/enums.h index 660c107ce..d12b5a1e3 100644 --- a/include/enums.h +++ b/include/enums.h @@ -9,43 +9,6 @@ namespace Botan { /************************************************* -* ASN.1 Type and Class Tags * -*************************************************/ -enum ASN1_Tag { - UNIVERSAL = 0x00, - APPLICATION = 0x40, - CONTEXT_SPECIFIC = 0x80, - PRIVATE = 0xC0, - - CONSTRUCTED = 0x20, - - EOC = 0x00, - BOOLEAN = 0x01, - INTEGER = 0x02, - BIT_STRING = 0x03, - OCTET_STRING = 0x04, - NULL_TAG = 0x05, - OBJECT_ID = 0x06, - ENUMERATED = 0x0A, - SEQUENCE = 0x10, - SET = 0x11, - - UTF8_STRING = 0x0C, - NUMERIC_STRING = 0x12, - PRINTABLE_STRING = 0x13, - T61_STRING = 0x14, - IA5_STRING = 0x16, - VISIBLE_STRING = 0x1A, - BMP_STRING = 0x1E, - - UTC_TIME = 0x17, - GENERALIZED_TIME = 0x18, - - NO_OBJECT = 0xFF00, - DIRECTORY_STRING = 0xFF01 -}; - -/************************************************* * X.509v3 Key Constraints * *************************************************/ enum Key_Constraints { @@ -99,21 +62,6 @@ enum Character_Set { LATIN1_CHARSET }; -/************************************************* -* Pulse Function * -*************************************************/ -enum Pulse_Type { - GENERAL_PULSE, - - PIPE_WRITE, - - PRIME_SEARCHING, - PRIME_SIEVING, - PRIME_PASSED_SIEVE, - PRIME_TESTING, - PRIME_FOUND -}; - static const u32bit NO_CERT_PATH_LIMIT = 0xFFFFFFF0; } diff --git a/include/libstate.h b/include/libstate.h index 5be88f460..6c59c6c03 100644 --- a/include/libstate.h +++ b/include/libstate.h @@ -42,19 +42,13 @@ class BOTAN_DLL Library_State }; friend class Engine_Iterator; - class BOTAN_DLL UI - { - public: - virtual void pulse(Pulse_Type) {} - virtual ~UI() {} - }; - Allocator* get_allocator(const std::string& = "") const; void add_allocator(Allocator*); void set_default_allocator(const std::string&) const; bool rng_is_seeded() const { return rng->is_seeded(); } void randomize(byte[], u32bit); + byte random(); void set_prng(RandomNumberGenerator*); void add_entropy_source(EntropySource*, bool = true); @@ -62,22 +56,9 @@ class BOTAN_DLL Library_State void add_entropy(EntropySource&, bool); u32bit seed_prng(bool, u32bit); - void set_timer(class Timer*); - u64bit system_clock() const; - class Config& config() const; class Mutex* get_mutex() const; - - void set_x509_state(class X509_GlobalState*); - class X509_GlobalState& x509_state(); - - void pulse(Pulse_Type) const; - void set_ui(UI*); - - void set_transcoder(class Charset_Transcoder*); - std::string transcode(const std::string, - Character_Set, Character_Set) const; private: Library_State(const Library_State&) {} Library_State& operator=(const Library_State&) { return (*this); } @@ -89,15 +70,11 @@ class BOTAN_DLL Library_State class Mutex* engine_lock; class Mutex* rng_lock; - class Timer* timer; mutable class Config* config_obj; - class X509_GlobalState* x509_state_obj; std::map<std::string, Allocator*> alloc_factory; mutable Allocator* cached_default_allocator; - UI* ui; - class Charset_Transcoder* transcoder; RandomNumberGenerator* rng; std::vector<Allocator*> allocators; std::vector<EntropySource*> entropy_sources; diff --git a/include/modules.h b/include/modules.h index 9c5a12e20..fb021405a 100644 --- a/include/modules.h +++ b/include/modules.h @@ -19,8 +19,6 @@ class BOTAN_DLL Modules { public: virtual class Mutex_Factory* mutex_factory() const = 0; - virtual class Timer* timer() const = 0; - virtual class Charset_Transcoder* transcoder() const = 0; virtual std::string default_allocator() const = 0; @@ -38,8 +36,6 @@ class BOTAN_DLL Builtin_Modules : public Modules { public: class Mutex_Factory* mutex_factory() const; - class Timer* timer() const; - class Charset_Transcoder* transcoder() const; std::string default_allocator() const; diff --git a/include/rng.h b/include/rng.h deleted file mode 100644 index 7dd4c1698..000000000 --- a/include/rng.h +++ /dev/null @@ -1,32 +0,0 @@ -/************************************************* -* Global RNG Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#ifndef BOTAN_GLOBAL_RNG_H__ -#define BOTAN_GLOBAL_RNG_H__ - -#include <botan/base.h> - -namespace Botan { - -/************************************************* -* RNG Access and Seeding Functions * -*************************************************/ -namespace Global_RNG { - -BOTAN_DLL void randomize(byte[], u32bit); -BOTAN_DLL byte random(); - -BOTAN_DLL void add_entropy(const byte[], u32bit); -BOTAN_DLL void add_entropy(EntropySource&, bool = true); - -BOTAN_DLL u32bit seed(bool = true, u32bit = 256); - -BOTAN_DLL void add_es(EntropySource*, bool = true); - -} - -} - -#endif diff --git a/include/timers.h b/include/timers.h index b2384e480..8bff4134d 100644 --- a/include/timers.h +++ b/include/timers.h @@ -6,17 +6,19 @@ #ifndef BOTAN_TIMERS_H__ #define BOTAN_TIMERS_H__ -#include <botan/types.h> +#include <botan/base.h> namespace Botan { /************************************************* * Timer Interface * *************************************************/ -class BOTAN_DLL Timer +class BOTAN_DLL Timer : public EntropySource { public: virtual u64bit clock() const; + u32bit slow_poll(byte[], u32bit); + virtual ~Timer() {} protected: static u64bit combine_timers(u32bit, u32bit, u32bit); diff --git a/include/util.h b/include/util.h index 5feab59c1..879acd1db 100644 --- a/include/util.h +++ b/include/util.h @@ -11,10 +11,9 @@ namespace Botan { /************************************************* -* Timer Access Functions * +* Time Access Functions * *************************************************/ BOTAN_DLL u64bit system_time(); -BOTAN_DLL u64bit system_clock(); /************************************************* * Memory Locking Functions * diff --git a/include/x509_ext.h b/include/x509_ext.h index 079d6ae32..5b302df0d 100644 --- a/include/x509_ext.h +++ b/include/x509_ext.h @@ -56,6 +56,8 @@ class BOTAN_DLL Extensions : public ASN1_Object Extensions(bool st = true) : should_throw(st) {} ~Extensions(); private: + static Certificate_Extension* get_extension(const OID&); + std::vector<Certificate_Extension*> extensions; bool should_throw; }; diff --git a/include/x509stat.h b/include/x509stat.h deleted file mode 100644 index 6ed7c2a08..000000000 --- a/include/x509stat.h +++ /dev/null @@ -1,35 +0,0 @@ -/************************************************* -* Globally Saved X.509 State Header * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#include <botan/asn1_oid.h> - -namespace Botan { - -/************************************************* -* Prototype for a Certificate Extension * -*************************************************/ -class BOTAN_DLL Extension_Prototype - { - public: - virtual class Certificate_Extension* make(const OID&) = 0; - virtual ~Extension_Prototype() {} - }; - -/************************************************* -* X.509 Global State * -*************************************************/ -class BOTAN_DLL X509_GlobalState - { - public: - void add(Extension_Prototype*); - class Certificate_Extension* get_extension(const OID&) const; - - X509_GlobalState(); - ~X509_GlobalState(); - private: - std::vector<Extension_Prototype*> prototypes; - }; - -} |