diff options
-rwxr-xr-x | configure.py | 17 | ||||
-rw-r--r-- | doc/api.tex | 13 | ||||
-rwxr-xr-x | doc/scripts/configure.pl | 2 | ||||
-rw-r--r-- | doc/tutorial.tex | 4 | ||||
-rw-r--r-- | src/build-data/arch/alpha.txt (renamed from src/build-data/arch/alpha) | 0 | ||||
-rw-r--r-- | src/build-data/arch/amd64.txt (renamed from src/build-data/arch/amd64) | 0 | ||||
-rw-r--r-- | src/build-data/arch/arm.txt (renamed from src/build-data/arch/arm) | 0 | ||||
-rw-r--r-- | src/build-data/arch/hitachi-sh.txt (renamed from src/build-data/arch/hitachi-sh) | 0 | ||||
-rw-r--r-- | src/build-data/arch/hppa.txt (renamed from src/build-data/arch/hppa) | 0 | ||||
-rw-r--r-- | src/build-data/arch/ia32.txt (renamed from src/build-data/arch/ia32) | 0 | ||||
-rw-r--r-- | src/build-data/arch/ia64.txt (renamed from src/build-data/arch/ia64) | 0 | ||||
-rw-r--r-- | src/build-data/arch/m68k.txt (renamed from src/build-data/arch/m68k) | 0 | ||||
-rw-r--r-- | src/build-data/arch/mips32.txt (renamed from src/build-data/arch/mips32) | 0 | ||||
-rw-r--r-- | src/build-data/arch/mips64.txt (renamed from src/build-data/arch/mips64) | 0 | ||||
-rw-r--r-- | src/build-data/arch/ppc.txt (renamed from src/build-data/arch/ppc) | 0 | ||||
-rw-r--r-- | src/build-data/arch/ppc64.txt (renamed from src/build-data/arch/ppc64) | 0 | ||||
-rw-r--r-- | src/build-data/arch/s390.txt (renamed from src/build-data/arch/s390) | 0 | ||||
-rw-r--r-- | src/build-data/arch/s390x.txt (renamed from src/build-data/arch/s390x) | 0 | ||||
-rw-r--r-- | src/build-data/arch/sparc32.txt (renamed from src/build-data/arch/sparc32) | 0 | ||||
-rw-r--r-- | src/build-data/arch/sparc64.txt (renamed from src/build-data/arch/sparc64) | 0 | ||||
-rw-r--r-- | src/build-data/cc/bcc.txt (renamed from src/build-data/cc/bcc) | 0 | ||||
-rw-r--r-- | src/build-data/cc/compaq.txt (renamed from src/build-data/cc/compaq) | 0 | ||||
-rw-r--r-- | src/build-data/cc/ekopath.txt (renamed from src/build-data/cc/ekopath) | 0 | ||||
-rw-r--r-- | src/build-data/cc/gcc.txt (renamed from src/build-data/cc/gcc) | 0 | ||||
-rw-r--r-- | src/build-data/cc/hpcc.txt (renamed from src/build-data/cc/hpcc) | 0 | ||||
-rw-r--r-- | src/build-data/cc/icc.txt (renamed from src/build-data/cc/icc) | 0 | ||||
-rw-r--r-- | src/build-data/cc/kai.txt (renamed from src/build-data/cc/kai) | 0 | ||||
-rw-r--r-- | src/build-data/cc/mipspro.txt (renamed from src/build-data/cc/mipspro) | 0 | ||||
-rw-r--r-- | src/build-data/cc/msvc.txt (renamed from src/build-data/cc/msvc) | 0 | ||||
-rw-r--r-- | src/build-data/cc/open64.txt (renamed from src/build-data/cc/open64) | 0 | ||||
-rw-r--r-- | src/build-data/cc/pgi.txt (renamed from src/build-data/cc/pgi) | 0 | ||||
-rw-r--r-- | src/build-data/cc/sgipro64.txt (renamed from src/build-data/cc/sgipro64) | 0 | ||||
-rw-r--r-- | src/build-data/cc/sunwspro.txt (renamed from src/build-data/cc/sunwspro) | 0 | ||||
-rw-r--r-- | src/build-data/cc/xlc.txt (renamed from src/build-data/cc/xlc) | 0 | ||||
-rw-r--r-- | src/build-data/os/aix.txt (renamed from src/build-data/os/aix) | 0 | ||||
-rw-r--r-- | src/build-data/os/beos.txt (renamed from src/build-data/os/beos) | 0 | ||||
-rw-r--r-- | src/build-data/os/cygwin.txt (renamed from src/build-data/os/cygwin) | 0 | ||||
-rw-r--r-- | src/build-data/os/darwin.txt (renamed from src/build-data/os/darwin) | 0 | ||||
-rw-r--r-- | src/build-data/os/defaults.txt (renamed from src/build-data/os/defaults) | 0 | ||||
-rw-r--r-- | src/build-data/os/dragonfly.txt (renamed from src/build-data/os/dragonfly) | 0 | ||||
-rw-r--r-- | src/build-data/os/freebsd.txt (renamed from src/build-data/os/freebsd) | 0 | ||||
-rw-r--r-- | src/build-data/os/hpux.txt (renamed from src/build-data/os/hpux) | 0 | ||||
-rw-r--r-- | src/build-data/os/irix.txt (renamed from src/build-data/os/irix) | 0 | ||||
-rw-r--r-- | src/build-data/os/linux.txt (renamed from src/build-data/os/linux) | 0 | ||||
-rw-r--r-- | src/build-data/os/mingw.txt (renamed from src/build-data/os/mingw) | 0 | ||||
-rw-r--r-- | src/build-data/os/netbsd.txt (renamed from src/build-data/os/netbsd) | 0 | ||||
-rw-r--r-- | src/build-data/os/openbsd.txt (renamed from src/build-data/os/openbsd) | 0 | ||||
-rw-r--r-- | src/build-data/os/qnx.txt (renamed from src/build-data/os/qnx) | 0 | ||||
-rw-r--r-- | src/build-data/os/solaris.txt (renamed from src/build-data/os/solaris) | 0 | ||||
-rw-r--r-- | src/build-data/os/tru64.txt (renamed from src/build-data/os/tru64) | 0 | ||||
-rw-r--r-- | src/build-data/os/windows.txt (renamed from src/build-data/os/windows) | 0 | ||||
-rw-r--r-- | src/pubkey/pubkey.h | 2 | ||||
-rw-r--r-- | src/rng/auto_rng/auto_rng.cpp | 9 | ||||
-rw-r--r-- | src/rng/auto_rng/info.txt | 1 |
54 files changed, 34 insertions, 14 deletions
diff --git a/configure.py b/configure.py index 1590e8559..1d7e1451d 100755 --- a/configure.py +++ b/configure.py @@ -301,7 +301,7 @@ def lex_me_harder(infofile, to_obj, allowed_groups, name_val_pairs): else: to_obj.parent_module = None else: - to_obj.basename = basename + to_obj.basename = basename.replace('.txt', '') lexer = shlex.shlex(open(infofile), infofile, posix=True) lexer.wordchars += '|:.<>/,-!' # handle various funky chars in info.txt @@ -951,18 +951,23 @@ def load_info_files(options): for (dirpath, dirnames, filenames) in \ os.walk(os.path.join(options.build_data, subdir)): for filename in filenames: - yield os.path.join(dirpath, filename) + if filename.endswith('.txt'): + yield os.path.join(dirpath, filename) - archinfo = dict([(os.path.basename(info), ArchInfo(info)) + def form_name(filepath): + return os.path.basename(filepath).replace('.txt', '') + + archinfo = dict([(form_name(info), ArchInfo(info)) for info in list_files_in_build_data('arch')]) - osinfo = dict([(os.path.basename(info), OsInfo(info)) + osinfo = dict([(form_name(info), OsInfo(info)) for info in list_files_in_build_data('os')]) - ccinfo = dict([(os.path.basename(info), CompilerInfo(info)) + ccinfo = dict([(form_name(info), CompilerInfo(info)) for info in list_files_in_build_data('cc')]) - del osinfo['defaults'] # FIXME (remove the file) + if 'defaults' in osinfo: + del osinfo['defaults'] # FIXME (remove the file) return (modules, archinfo, ccinfo, osinfo) diff --git a/doc/api.tex b/doc/api.tex index d86fa79e2..556e76aa0 100644 --- a/doc/api.tex +++ b/doc/api.tex @@ -1360,12 +1360,18 @@ private key: \begin{verbatim} namespace PKCS8 { - PKCS8_PrivateKey* load_key(DataSource& in, const User_Interface& ui); - PKCS8_PrivateKey* load_key(DataSource& in, std::string passphrase = ""); + PKCS8_PrivateKey* load_key(DataSource& in, + RandomNumberGenerator& rng, + const User_Interface& ui); + PKCS8_PrivateKey* load_key(DataSource& in, + RandomNumberGenerator& rng, + std::string passphrase = ""); PKCS8_PrivateKey* load_key(const std::string& filename, + RandomNumberGenerator& rng, const User_Interface& ui); PKCS8_PrivateKey* load_key(const std::string& filename, + RandomNumberGenerator& rng, const std::string& passphrase = ""); } \end{verbatim} @@ -1384,6 +1390,9 @@ using. You can think of it as a user interface interface. The default \type{User\_Interface} is actually very dumb, and effectively acts just like the versions taking the \type{std::string}. +All versions need access to a \type{RandomNumberGenerator} in order to +perform probabilistic tests on the loaded key material. + After loading a key, you can use \function{dynamic\_cast} to find out what operations it supports, and use it appropriately. Remember to \function{delete} it once you are done with it. diff --git a/doc/scripts/configure.pl b/doc/scripts/configure.pl index bd7e41a3e..9415d5a42 100755 --- a/doc/scripts/configure.pl +++ b/doc/scripts/configure.pl @@ -1582,6 +1582,8 @@ sub read_info_files { foreach my $file (dir_list($dir)) { my $fullpath = File::Spec->catfile($dir, $file); + $file =~ s/.txt//; + trace("reading $fullpath"); %{$allinfo{$file}} = &$func($file, $fullpath); } diff --git a/doc/tutorial.tex b/doc/tutorial.tex index 244461994..9229cb853 100644 --- a/doc/tutorial.tex +++ b/doc/tutorial.tex @@ -626,9 +626,11 @@ This is very similar to reading raw public keys, with the difference that the key may be encrypted with a user passphrase: \begin{verbatim} + // rng is a RandomNumberGenerator, like AutoSeeded_RNG + DataSource_Stream somefile("somefile"); std::string a_passphrase = /* get from the user */ - PKCS8_PrivateKey* key = PKCS8::load_key(somefile, a_passphrase); + PKCS8_PrivateKey* key = PKCS8::load_key(somefile, rng, a_passphrase); \end{verbatim} You can, by the way, convert a \type{PKCS8\_PrivateKey} to a diff --git a/src/build-data/arch/alpha b/src/build-data/arch/alpha.txt index 60b264396..60b264396 100644 --- a/src/build-data/arch/alpha +++ b/src/build-data/arch/alpha.txt diff --git a/src/build-data/arch/amd64 b/src/build-data/arch/amd64.txt index 216588e7b..216588e7b 100644 --- a/src/build-data/arch/amd64 +++ b/src/build-data/arch/amd64.txt diff --git a/src/build-data/arch/arm b/src/build-data/arch/arm.txt index c6be4ad46..c6be4ad46 100644 --- a/src/build-data/arch/arm +++ b/src/build-data/arch/arm.txt diff --git a/src/build-data/arch/hitachi-sh b/src/build-data/arch/hitachi-sh.txt index 8e9f7eee3..8e9f7eee3 100644 --- a/src/build-data/arch/hitachi-sh +++ b/src/build-data/arch/hitachi-sh.txt diff --git a/src/build-data/arch/hppa b/src/build-data/arch/hppa.txt index 4cdd40889..4cdd40889 100644 --- a/src/build-data/arch/hppa +++ b/src/build-data/arch/hppa.txt diff --git a/src/build-data/arch/ia32 b/src/build-data/arch/ia32.txt index aafcf9a77..aafcf9a77 100644 --- a/src/build-data/arch/ia32 +++ b/src/build-data/arch/ia32.txt diff --git a/src/build-data/arch/ia64 b/src/build-data/arch/ia64.txt index 7ca84c007..7ca84c007 100644 --- a/src/build-data/arch/ia64 +++ b/src/build-data/arch/ia64.txt diff --git a/src/build-data/arch/m68k b/src/build-data/arch/m68k.txt index 759a3dac1..759a3dac1 100644 --- a/src/build-data/arch/m68k +++ b/src/build-data/arch/m68k.txt diff --git a/src/build-data/arch/mips32 b/src/build-data/arch/mips32.txt index 9846c8fb2..9846c8fb2 100644 --- a/src/build-data/arch/mips32 +++ b/src/build-data/arch/mips32.txt diff --git a/src/build-data/arch/mips64 b/src/build-data/arch/mips64.txt index dbb49d028..dbb49d028 100644 --- a/src/build-data/arch/mips64 +++ b/src/build-data/arch/mips64.txt diff --git a/src/build-data/arch/ppc b/src/build-data/arch/ppc.txt index e2dfa6ea2..e2dfa6ea2 100644 --- a/src/build-data/arch/ppc +++ b/src/build-data/arch/ppc.txt diff --git a/src/build-data/arch/ppc64 b/src/build-data/arch/ppc64.txt index 6d5eb7ad2..6d5eb7ad2 100644 --- a/src/build-data/arch/ppc64 +++ b/src/build-data/arch/ppc64.txt diff --git a/src/build-data/arch/s390 b/src/build-data/arch/s390.txt index 312b262c4..312b262c4 100644 --- a/src/build-data/arch/s390 +++ b/src/build-data/arch/s390.txt diff --git a/src/build-data/arch/s390x b/src/build-data/arch/s390x.txt index 9fe6bd615..9fe6bd615 100644 --- a/src/build-data/arch/s390x +++ b/src/build-data/arch/s390x.txt diff --git a/src/build-data/arch/sparc32 b/src/build-data/arch/sparc32.txt index 6b752df87..6b752df87 100644 --- a/src/build-data/arch/sparc32 +++ b/src/build-data/arch/sparc32.txt diff --git a/src/build-data/arch/sparc64 b/src/build-data/arch/sparc64.txt index c0575efc4..c0575efc4 100644 --- a/src/build-data/arch/sparc64 +++ b/src/build-data/arch/sparc64.txt diff --git a/src/build-data/cc/bcc b/src/build-data/cc/bcc.txt index fe88c270e..fe88c270e 100644 --- a/src/build-data/cc/bcc +++ b/src/build-data/cc/bcc.txt diff --git a/src/build-data/cc/compaq b/src/build-data/cc/compaq.txt index 94075e888..94075e888 100644 --- a/src/build-data/cc/compaq +++ b/src/build-data/cc/compaq.txt diff --git a/src/build-data/cc/ekopath b/src/build-data/cc/ekopath.txt index 38516e2f3..38516e2f3 100644 --- a/src/build-data/cc/ekopath +++ b/src/build-data/cc/ekopath.txt diff --git a/src/build-data/cc/gcc b/src/build-data/cc/gcc.txt index 9adef8cfb..9adef8cfb 100644 --- a/src/build-data/cc/gcc +++ b/src/build-data/cc/gcc.txt diff --git a/src/build-data/cc/hpcc b/src/build-data/cc/hpcc.txt index 9c0d4a784..9c0d4a784 100644 --- a/src/build-data/cc/hpcc +++ b/src/build-data/cc/hpcc.txt diff --git a/src/build-data/cc/icc b/src/build-data/cc/icc.txt index 9595714f6..9595714f6 100644 --- a/src/build-data/cc/icc +++ b/src/build-data/cc/icc.txt diff --git a/src/build-data/cc/kai b/src/build-data/cc/kai.txt index 52ddba4ab..52ddba4ab 100644 --- a/src/build-data/cc/kai +++ b/src/build-data/cc/kai.txt diff --git a/src/build-data/cc/mipspro b/src/build-data/cc/mipspro.txt index a4cfbd1ee..a4cfbd1ee 100644 --- a/src/build-data/cc/mipspro +++ b/src/build-data/cc/mipspro.txt diff --git a/src/build-data/cc/msvc b/src/build-data/cc/msvc.txt index c19d93e2b..c19d93e2b 100644 --- a/src/build-data/cc/msvc +++ b/src/build-data/cc/msvc.txt diff --git a/src/build-data/cc/open64 b/src/build-data/cc/open64.txt index 0157440cf..0157440cf 100644 --- a/src/build-data/cc/open64 +++ b/src/build-data/cc/open64.txt diff --git a/src/build-data/cc/pgi b/src/build-data/cc/pgi.txt index c4fdb9e70..c4fdb9e70 100644 --- a/src/build-data/cc/pgi +++ b/src/build-data/cc/pgi.txt diff --git a/src/build-data/cc/sgipro64 b/src/build-data/cc/sgipro64.txt index be91ac69a..be91ac69a 100644 --- a/src/build-data/cc/sgipro64 +++ b/src/build-data/cc/sgipro64.txt diff --git a/src/build-data/cc/sunwspro b/src/build-data/cc/sunwspro.txt index 9756f8538..9756f8538 100644 --- a/src/build-data/cc/sunwspro +++ b/src/build-data/cc/sunwspro.txt diff --git a/src/build-data/cc/xlc b/src/build-data/cc/xlc.txt index 6d06b4c43..6d06b4c43 100644 --- a/src/build-data/cc/xlc +++ b/src/build-data/cc/xlc.txt diff --git a/src/build-data/os/aix b/src/build-data/os/aix.txt index cec818580..cec818580 100644 --- a/src/build-data/os/aix +++ b/src/build-data/os/aix.txt diff --git a/src/build-data/os/beos b/src/build-data/os/beos.txt index 2b12792bb..2b12792bb 100644 --- a/src/build-data/os/beos +++ b/src/build-data/os/beos.txt diff --git a/src/build-data/os/cygwin b/src/build-data/os/cygwin.txt index c2aadea98..c2aadea98 100644 --- a/src/build-data/os/cygwin +++ b/src/build-data/os/cygwin.txt diff --git a/src/build-data/os/darwin b/src/build-data/os/darwin.txt index 298621216..298621216 100644 --- a/src/build-data/os/darwin +++ b/src/build-data/os/darwin.txt diff --git a/src/build-data/os/defaults b/src/build-data/os/defaults.txt index 5648643a9..5648643a9 100644 --- a/src/build-data/os/defaults +++ b/src/build-data/os/defaults.txt diff --git a/src/build-data/os/dragonfly b/src/build-data/os/dragonfly.txt index 7e3663435..7e3663435 100644 --- a/src/build-data/os/dragonfly +++ b/src/build-data/os/dragonfly.txt diff --git a/src/build-data/os/freebsd b/src/build-data/os/freebsd.txt index ea96b0c88..ea96b0c88 100644 --- a/src/build-data/os/freebsd +++ b/src/build-data/os/freebsd.txt diff --git a/src/build-data/os/hpux b/src/build-data/os/hpux.txt index 6e17d3b73..6e17d3b73 100644 --- a/src/build-data/os/hpux +++ b/src/build-data/os/hpux.txt diff --git a/src/build-data/os/irix b/src/build-data/os/irix.txt index fd8b43287..fd8b43287 100644 --- a/src/build-data/os/irix +++ b/src/build-data/os/irix.txt diff --git a/src/build-data/os/linux b/src/build-data/os/linux.txt index 53528511a..53528511a 100644 --- a/src/build-data/os/linux +++ b/src/build-data/os/linux.txt diff --git a/src/build-data/os/mingw b/src/build-data/os/mingw.txt index eb25017fc..eb25017fc 100644 --- a/src/build-data/os/mingw +++ b/src/build-data/os/mingw.txt diff --git a/src/build-data/os/netbsd b/src/build-data/os/netbsd.txt index 435d8f5e8..435d8f5e8 100644 --- a/src/build-data/os/netbsd +++ b/src/build-data/os/netbsd.txt diff --git a/src/build-data/os/openbsd b/src/build-data/os/openbsd.txt index cb44bd115..cb44bd115 100644 --- a/src/build-data/os/openbsd +++ b/src/build-data/os/openbsd.txt diff --git a/src/build-data/os/qnx b/src/build-data/os/qnx.txt index 28bc8dea9..28bc8dea9 100644 --- a/src/build-data/os/qnx +++ b/src/build-data/os/qnx.txt diff --git a/src/build-data/os/solaris b/src/build-data/os/solaris.txt index 8610b4898..8610b4898 100644 --- a/src/build-data/os/solaris +++ b/src/build-data/os/solaris.txt diff --git a/src/build-data/os/tru64 b/src/build-data/os/tru64.txt index e320c1df4..e320c1df4 100644 --- a/src/build-data/os/tru64 +++ b/src/build-data/os/tru64.txt diff --git a/src/build-data/os/windows b/src/build-data/os/windows.txt index a04d609b8..a04d609b8 100644 --- a/src/build-data/os/windows +++ b/src/build-data/os/windows.txt diff --git a/src/pubkey/pubkey.h b/src/pubkey/pubkey.h index 815550edd..c73a54d35 100644 --- a/src/pubkey/pubkey.h +++ b/src/pubkey/pubkey.h @@ -181,7 +181,7 @@ class BOTAN_DLL PK_Verifier * @return true if the signature is valid */ bool verify_message(const byte msg[], u32bit msg_length, - const byte sig[], u32bit sig_length); + const byte sig[], u32bit sig_length); /** * Verify a signature. * @param msg the message that the signature belongs to diff --git a/src/rng/auto_rng/auto_rng.cpp b/src/rng/auto_rng/auto_rng.cpp index 07b2ddec2..f02a9249f 100644 --- a/src/rng/auto_rng/auto_rng.cpp +++ b/src/rng/auto_rng/auto_rng.cpp @@ -11,7 +11,6 @@ #include <botan/hmac.h> #include <botan/sha2_32.h> #include <botan/sha2_64.h> -#include <botan/aes.h> #if defined(BOTAN_HAS_RANDPOOL) #include <botan/randpool.h> @@ -25,6 +24,10 @@ #include <botan/x931_rng.h> #endif +#if defined(BOTAN_HAS_AES) + #include <botan/aes.h> +#endif + #if defined(BOTAN_HAS_TIMER_HARDWARE) #include <botan/tm_hard.h> #endif @@ -135,7 +138,7 @@ AutoSeeded_RNG::AutoSeeded_RNG(u32bit poll_bits) #if defined(BOTAN_HAS_HMAC_RNG) rng = new HMAC_RNG(new HMAC(new SHA_512), new HMAC(new SHA_256)); -#elif defined(BOTAN_HAS_RANDPOOL) +#elif defined(BOTAN_HAS_RANDPOOL) && defined(BOTAN_HAS_AES) rng = new Randpool(new AES_256, new HMAC(new SHA_256)); #endif @@ -143,7 +146,7 @@ AutoSeeded_RNG::AutoSeeded_RNG(u32bit poll_bits) throw Internal_Error("No usable RNG found enabled in build"); /* If X9.31 is available, use it to wrap the other RNG as a failsafe */ -#if defined(BOTAN_HAS_X931_RNG) +#if defined(BOTAN_HAS_X931_RNG) && defined(BOTAN_HAS_AES) rng = new ANSI_X931_RNG(new AES_256, rng); #endif diff --git a/src/rng/auto_rng/info.txt b/src/rng/auto_rng/info.txt index 2f41bc068..7d5d5ddcc 100644 --- a/src/rng/auto_rng/info.txt +++ b/src/rng/auto_rng/info.txt @@ -10,7 +10,6 @@ auto_rng.cpp </add> <requires> -aes hmac sha2 timer |