From 1c08f8e0258d1b0317fb837e78b4cef9359af9c9 Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 13 Aug 2009 18:32:49 +0000 Subject: Move version #s to 1.9.0-pre --- configure.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 75e57f95e..286e61979 100755 --- a/configure.py +++ b/configure.py @@ -36,10 +36,10 @@ class BuildConfigurationInformation(object): Version information """ version_major = 1 - version_minor = 8 - version_patch = 6 - version_so_patch = 2 - version_suffix = '' + version_minor = 9 + version_patch = 0 + version_so_patch = 0 + version_suffix = '-pre' version_string = '%d.%d.%d%s' % ( version_major, version_minor, version_patch, version_suffix) -- cgit v1.2.3 From 361b82c5a04f2980418e61c7630cf36478219f30 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 8 Sep 2009 15:33:54 +0000 Subject: Add a log line telling the user that we are assuming unaligned memory accesses, if we are. Add new options --with-unaligned-mem and --without-unaligned-mem to override the arch-specific guess. The only usage I specifically know for this is to allow unaligned accesses on m68k machines, when use on Coldfire is not expected. Other cases where most CPUs of a particular type support unaligned accesses but a specific target doesn't (or it is very slow) can also use this. --- configure.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 800af6cf1..97fd44816 100755 --- a/configure.py +++ b/configure.py @@ -115,6 +115,15 @@ def process_command_line(args): target_group.add_option('--with-endian', metavar='ORDER', default=None, help='override guess of CPU byte order') + target_group.add_option('--with-unaligned-mem', + dest='unaligned_mem', action='store_true', + default=None, + help='enable unaligned memory accesses') + + target_group.add_option('--without-unaligned-mem', + dest='unaligned_mem', action='store_false', + help=SUPPRESS_HELP) + build_group = OptionGroup(parser, 'Build options') build_group.add_option('--enable-shared', dest='build_shared_lib', @@ -404,7 +413,7 @@ class ArchInfo(object): self.submodel_aliases.items(), key = lambda k: len(k[0]), reverse = True) - def defines(self, target_submodel, with_endian): + def defines(self, target_submodel, with_endian, unaligned_ok): macros = ['TARGET_ARCH_IS_%s' % (self.basename.upper())] def form_cpu_macro(cpu_name): @@ -419,7 +428,12 @@ class ArchInfo(object): elif self.endian != None: macros.append('TARGET_CPU_IS_%s_ENDIAN' % (self.endian.upper())) - macros.append('TARGET_UNALIGNED_LOADSTORE_OK %d' % (self.unaligned_ok)) + if unaligned_ok is None: + unaligned_ok = self.unaligned_ok + + if unaligned_ok: + logging.info('Assuming unaligned memory access works on this CPU') + macros.append('TARGET_UNALIGNED_LOADSTORE_OK %d' % (unaligned_ok)) return macros @@ -725,7 +739,8 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo): cc.defines(options.with_tr1)), 'target_cpu_defines': make_cpp_macros( - arch.defines(options.cpu, options.with_endian)), + arch.defines(options.cpu, options.with_endian, + options.unaligned_mem)), 'include_files': makefile_list(build_config.headers), @@ -861,7 +876,7 @@ def choose_modules_to_use(options, modules): logging.info('Skipping mod because %s - %s' % ( reason, ' '.join(disabled_mods))) - logging.info('Loading modules %s', ' '.join(sorted(to_load))) + logging.debug('Loading modules %s', ' '.join(sorted(to_load))) return [modules[mod] for mod in to_load] -- cgit v1.2.3 From 72a7434e65061d61ec6d4bd2b78a0ca5406e41ad Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 10 Sep 2009 00:45:01 +0000 Subject: Update for 1.9.0 release 2009-09-09 --- configure.py | 2 +- doc/log.txt | 5 ++++- readme.txt | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 97fd44816..34242c4d7 100755 --- a/configure.py +++ b/configure.py @@ -39,7 +39,7 @@ class BuildConfigurationInformation(object): version_minor = 9 version_patch = 0 version_so_patch = 0 - version_suffix = '-pre' + version_suffix = '' version_string = '%d.%d.%d%s' % ( version_major, version_minor, version_patch, version_suffix) diff --git a/doc/log.txt b/doc/log.txt index e96056779..e6d3cdb05 100644 --- a/doc/log.txt +++ b/doc/log.txt @@ -1,9 +1,12 @@ -* 1.9.0-pre, 2009-??-?? +* 1.9.0, 2009-09-09 - Add support for parallel invocation of block ciphers where possible - Add SSE2 implementation of Serpent - Add Rivest's package transform (an all or nothing transform) - Minor speedups to the Turing key schedule + - Fix processing multiple messages in XTS mode + - Add --no-autoload option to configure.py, for minimized builds + - The previously used configure.pl script is no longer supported * 1.8.7, 2009-09-09 - Fix processing multiple messages in XTS mode diff --git a/readme.txt b/readme.txt index 1444c9573..5936600f4 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -Botan 1.9.0-pre 2009-09-09 +Botan 1.9.0 2009-09-09 Botan is a C++ class library for performing a wide variety of cryptographic operations. -- cgit v1.2.3 From 18d1a6d4d11d40afb2d5a9d96b0437933bcaa472 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sun, 13 Sep 2009 18:23:28 +0000 Subject: Update version #s to 1.9.1-pre --- configure.py | 6 +++--- doc/log.txt | 3 +++ readme.txt | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 34242c4d7..a769239e9 100755 --- a/configure.py +++ b/configure.py @@ -37,9 +37,9 @@ class BuildConfigurationInformation(object): """ version_major = 1 version_minor = 9 - version_patch = 0 - version_so_patch = 0 - version_suffix = '' + version_patch = 1 + version_so_patch = 1 + version_suffix = '-pre' version_string = '%d.%d.%d%s' % ( version_major, version_minor, version_patch, version_suffix) diff --git a/doc/log.txt b/doc/log.txt index e6d3cdb05..c53e1c823 100644 --- a/doc/log.txt +++ b/doc/log.txt @@ -1,4 +1,7 @@ +* 1.9.1-pre, 2009-??-?? + - Enable SSE2 optimizations under Visual C++ + * 1.9.0, 2009-09-09 - Add support for parallel invocation of block ciphers where possible - Add SSE2 implementation of Serpent diff --git a/readme.txt b/readme.txt index 5936600f4..307344cea 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -Botan 1.9.0 2009-09-09 +Botan 1.9.1-pre 2009-??-?? Botan is a C++ class library for performing a wide variety of cryptographic operations. -- cgit v1.2.3 From 18d48581310d60e3c9cd0fbdc0a574d8ebaaeed4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 29 Sep 2009 18:36:24 +0000 Subject: Add a new macro BOTAN_BUILD_COMPILER_IS_XXX to build.h --- configure.py | 19 ++++++++++++------- src/build-data/cc/bcc | 2 ++ src/build-data/cc/compaq | 2 ++ src/build-data/cc/ekopath | 2 ++ src/build-data/cc/gcc | 2 ++ src/build-data/cc/hpcc | 2 ++ src/build-data/cc/icc | 2 ++ src/build-data/cc/kai | 2 ++ src/build-data/cc/mipspro | 2 ++ src/build-data/cc/msvc | 2 ++ src/build-data/cc/open64 | 2 ++ src/build-data/cc/pgi | 2 ++ src/build-data/cc/sgipro64 | 2 ++ src/build-data/cc/sunwspro | 2 ++ src/build-data/cc/xlc | 2 ++ 15 files changed, 40 insertions(+), 7 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 9d6641c12..5c8835a95 100755 --- a/configure.py +++ b/configure.py @@ -443,6 +443,7 @@ class CompilerInfo(object): ['so_link_flags', 'mach_opt', 'mach_abi_linking'], { 'realname': '', 'binary_name': None, + 'macro_name': None, 'compile_option': '-c ', 'output_to_option': '-o ', 'add_include_dir_option': '-I', @@ -483,6 +484,7 @@ class CompilerInfo(object): del self.mach_opt + def mach_abi_link_flags(self, osname, arch, submodel): abi_link = set() @@ -515,15 +517,18 @@ class CompilerInfo(object): return self.so_link_flags['default'] def defines(self, with_tr1): - if with_tr1: - if with_tr1 == 'boost': - return ['USE_BOOST_TR1'] - elif with_tr1 == 'system': + + def tr1_macro(): + if with_tr1: + if with_tr1 == 'boost': + return ['USE_BOOST_TR1'] + elif with_tr1 == 'system': + return ['USE_STD_TR1'] + elif self.compiler_has_tr1: return ['USE_STD_TR1'] - elif self.compiler_has_tr1: - return ['USE_STD_TR1'] + return [] - return [] + return ['BUILD_COMPILER_IS_' + self.macro_name] + tr1_macro() class OsInfo(object): def __init__(self, infofile): diff --git a/src/build-data/cc/bcc b/src/build-data/cc/bcc index df09daff0..fe88c270e 100644 --- a/src/build-data/cc/bcc +++ b/src/build-data/cc/bcc @@ -1,5 +1,7 @@ realname "Borland C++" +macro_name "BORLAND" + binary_name "bcc32" compile_option "-c " diff --git a/src/build-data/cc/compaq b/src/build-data/cc/compaq index 66d3a5219..94075e888 100644 --- a/src/build-data/cc/compaq +++ b/src/build-data/cc/compaq @@ -1,5 +1,7 @@ realname "Compaq C++" +macro_name "COMPAQ" + binary_name "cxx" compile_option "-c " diff --git a/src/build-data/cc/ekopath b/src/build-data/cc/ekopath index ca2471059..38516e2f3 100644 --- a/src/build-data/cc/ekopath +++ b/src/build-data/cc/ekopath @@ -1,5 +1,7 @@ realname "PathScale EKOPath C++" +macro_name "PATHSCALE" + binary_name "pathCC" compile_option "-c " diff --git a/src/build-data/cc/gcc b/src/build-data/cc/gcc index 978ed6d58..606b622f6 100644 --- a/src/build-data/cc/gcc +++ b/src/build-data/cc/gcc @@ -1,5 +1,7 @@ realname "GNU C++" +macro_name "GCC" + binary_name "g++" compiler_has_tr1 yes diff --git a/src/build-data/cc/hpcc b/src/build-data/cc/hpcc index 284e92ca6..9c0d4a784 100644 --- a/src/build-data/cc/hpcc +++ b/src/build-data/cc/hpcc @@ -1,5 +1,7 @@ realname "HP-UX C++" +macro_name "HP_ACC" + binary_name "aCC" compile_option "-c " diff --git a/src/build-data/cc/icc b/src/build-data/cc/icc index 7d8e9682f..9595714f6 100644 --- a/src/build-data/cc/icc +++ b/src/build-data/cc/icc @@ -1,5 +1,7 @@ realname "Intel C++" +macro_name "INTEL" + binary_name "icpc" compiler_has_tr1 yes diff --git a/src/build-data/cc/kai b/src/build-data/cc/kai index 8585e54e0..52ddba4ab 100644 --- a/src/build-data/cc/kai +++ b/src/build-data/cc/kai @@ -1,5 +1,7 @@ realname "KAI C++" +macro_name "KAI" + binary_name "KCC" compile_option "-c " diff --git a/src/build-data/cc/mipspro b/src/build-data/cc/mipspro index b75fc4fb3..a4cfbd1ee 100644 --- a/src/build-data/cc/mipspro +++ b/src/build-data/cc/mipspro @@ -1,5 +1,7 @@ realname "SGI MIPSPro C++" +macro_name "MIPSPRO" + binary_name "CC" compile_option "-c " diff --git a/src/build-data/cc/msvc b/src/build-data/cc/msvc index 68e4517f8..c19d93e2b 100644 --- a/src/build-data/cc/msvc +++ b/src/build-data/cc/msvc @@ -1,5 +1,7 @@ realname "Visual C++" +macro_name "MSVC" + binary_name "cl.exe" compile_option "/nologo /c " diff --git a/src/build-data/cc/open64 b/src/build-data/cc/open64 index b7c1e9e99..0157440cf 100644 --- a/src/build-data/cc/open64 +++ b/src/build-data/cc/open64 @@ -1,5 +1,7 @@ realname "Open64" +macro_name "OPEN64" + binary_name "openCC" compile_option "-c " diff --git a/src/build-data/cc/pgi b/src/build-data/cc/pgi index 35f466477..c4fdb9e70 100644 --- a/src/build-data/cc/pgi +++ b/src/build-data/cc/pgi @@ -1,5 +1,7 @@ realname "Portland Group C++" +macro_name "PORTLAND_GROUP" + binary_name "pgCC" compile_option "-c " diff --git a/src/build-data/cc/sgipro64 b/src/build-data/cc/sgipro64 index 28132ffcc..be91ac69a 100644 --- a/src/build-data/cc/sgipro64 +++ b/src/build-data/cc/sgipro64 @@ -1,5 +1,7 @@ realname "SGI Pro64" +macro_name "SGI_PRO64" + binary_name "sgiCC" compile_option "-c " diff --git a/src/build-data/cc/sunwspro b/src/build-data/cc/sunwspro index e1bc0b26f..9756f8538 100644 --- a/src/build-data/cc/sunwspro +++ b/src/build-data/cc/sunwspro @@ -1,5 +1,7 @@ realname "Sun Workshop Pro C++" +macro_name "SUN_WORKSHOP" + binary_name "CC" compile_option "-c " diff --git a/src/build-data/cc/xlc b/src/build-data/cc/xlc index 64b888421..6d06b4c43 100644 --- a/src/build-data/cc/xlc +++ b/src/build-data/cc/xlc @@ -1,5 +1,7 @@ realname "IBM XL C/C++" +macro_name "IBM_XLC" + binary_name "xlC" compile_option "-c " -- cgit v1.2.3 From 1b976618fa6098b0e45de59135bdb91ced1c0bd4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 29 Sep 2009 18:49:04 +0000 Subject: New logic for reading info.txt files - if no block was given, then simply add all .cpp and .h files in the directory. --- configure.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 5c8835a95..8e98b7e6a 100755 --- a/configure.py +++ b/configure.py @@ -336,13 +336,20 @@ class ModuleInfo(object): lex_me_harder(infofile, self, ['add', 'requires', 'os', 'arch', 'cc', 'libs'], { 'realname': '', - 'load_on': 'request', + 'load_on': 'auto', 'define': None, 'modset': None, 'uses_tr1': 'false', 'note': '', 'mp_bits': 0 }) + if self.add == []: + for (dirpath, dirnames, filenames) in os.walk(self.lives_in): + if dirpath == self.lives_in: + self.add = [filename for filename in filenames + if filename.endswith('.cpp') or + filename.endswith('.h')] + # Coerce to more useful types self.libs = force_to_dict(self.libs) -- cgit v1.2.3 From 10195a560c12f89f23c7cc9a0a24e891a1ec91aa Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 29 Sep 2009 19:21:59 +0000 Subject: Add .S files automatically as well --- configure.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 8e98b7e6a..1c4edb851 100755 --- a/configure.py +++ b/configure.py @@ -348,7 +348,8 @@ class ModuleInfo(object): if dirpath == self.lives_in: self.add = [filename for filename in filenames if filename.endswith('.cpp') or - filename.endswith('.h')] + filename.endswith('.h') or + filename.endswith('.S')] # Coerce to more useful types self.libs = force_to_dict(self.libs) -- cgit v1.2.3 From b37dbf1f1c80168f79bcb59809be5002dc7515b4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 9 Oct 2009 16:11:45 +0000 Subject: Fix --enable-debug With GCC, only use -finline-functions if not a debug build --- configure.py | 14 +++++++++++--- src/build-data/cc/gcc | 5 +++-- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 1c4edb851..0f5e1502d 100755 --- a/configure.py +++ b/configure.py @@ -519,6 +519,14 @@ class CompilerInfo(object): return '' + def library_opt_flags(self, debug_build): + flags = self.lib_opt_flags + if debug_build and self.debug_flags != '': + flags += ' ' + self.debug_flags + if not debug_build and self.no_debug_flags != '': + flags += ' ' + self.no_debug_flags + return flags + def so_link_command_for(self, osname): if osname in self.so_link_flags: return self.so_link_flags[osname] @@ -731,7 +739,7 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo): options.arch, options.cpu), - 'lib_opt': cc.lib_opt_flags, + 'lib_opt': cc.library_opt_flags(options.debug_build), 'mach_opt': cc.mach_opts(options.arch, options.cpu), 'check_opt': cc.check_opt_flags, 'lang_flags': cc.lang_flags + options.extra_flags, @@ -1139,7 +1147,7 @@ if __name__ == '__main__': main() except Exception, e: print >>sys.stderr, e - #import traceback - #traceback.print_exc(file=sys.stderr) + import traceback + traceback.print_exc(file=sys.stderr) sys.exit(1) sys.exit(0) diff --git a/src/build-data/cc/gcc b/src/build-data/cc/gcc index 606b622f6..9adef8cfb 100644 --- a/src/build-data/cc/gcc +++ b/src/build-data/cc/gcc @@ -16,10 +16,11 @@ lang_flags "-D_REENTRANT -ansi -Wno-long-long" warning_flags "-W -Wall" #warning_flags "-Wextra -Wall -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wno-unused-parameter" -lib_opt_flags "-O2 -finline-functions" -check_opt_flags "-O2" +lib_opt_flags "-O2" +check_opt_flags "-O" shared_flags "-fPIC" debug_flags "-g" +no_debug_flags "-finline-functions" dll_import_flags "" dll_export_flags "" -- cgit v1.2.3 From 997e6c97b8ace857d00f9fd57f621ba9323c75df Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 9 Oct 2009 18:06:06 +0000 Subject: Add more or less functional integration with Boost.Python. Use --use-boost-python to enable creating a second makefile, Makefile.python, which has targets for building and installing the Python module. --- .mtn-ignore | 2 +- configure.py | 42 ++++++- src/build-data/makefile/python.in | 29 +++++ src/build-data/makefile/unix.in | 2 +- src/build-data/makefile/unix_shr.in | 2 +- src/wrap/python/__init__.py | 4 + src/wrap/python/core.cpp | 203 +++++++++++++++++++++++++++++++ src/wrap/python/filter.cpp | 178 +++++++++++++++++++++++++++ src/wrap/python/pk.cpp | 125 +++++++++++++++++++ src/wrap/python/python_botan.h | 51 ++++++++ src/wrap/python/x509.cpp | 140 +++++++++++++++++++++ wrappers/boost-python/Makefile | 20 ++- wrappers/boost-python/botan/__init__.py | 4 - wrappers/boost-python/src/core.cpp | 203 ------------------------------- wrappers/boost-python/src/filter.cpp | 176 --------------------------- wrappers/boost-python/src/pk.cpp | 125 ------------------- wrappers/boost-python/src/python_botan.h | 51 -------- wrappers/boost-python/src/x509.cpp | 140 --------------------- 18 files changed, 785 insertions(+), 712 deletions(-) create mode 100644 src/build-data/makefile/python.in create mode 100644 src/wrap/python/__init__.py create mode 100644 src/wrap/python/core.cpp create mode 100644 src/wrap/python/filter.cpp create mode 100644 src/wrap/python/pk.cpp create mode 100644 src/wrap/python/python_botan.h create mode 100644 src/wrap/python/x509.cpp delete mode 100644 wrappers/boost-python/botan/__init__.py delete mode 100644 wrappers/boost-python/src/core.cpp delete mode 100644 wrappers/boost-python/src/filter.cpp delete mode 100644 wrappers/boost-python/src/pk.cpp delete mode 100644 wrappers/boost-python/src/python_botan.h delete mode 100644 wrappers/boost-python/src/x509.cpp (limited to 'configure.py') diff --git a/.mtn-ignore b/.mtn-ignore index 63acd11e3..ec8588da0 100644 --- a/.mtn-ignore +++ b/.mtn-ignore @@ -1,4 +1,4 @@ -^Makefile$ +^Makefile.*$ ^botan-config$ ^botan.pc$ ^build$ diff --git a/configure.py b/configure.py index 0f5e1502d..857cab7e7 100755 --- a/configure.py +++ b/configure.py @@ -55,6 +55,12 @@ class BuildConfigurationInformation(object): self.checkobj_dir = os.path.join(self.build_dir, 'checks') self.libobj_dir = os.path.join(self.build_dir, 'lib') + self.python_dir = os.path.join(options.src_dir, 'wrap', 'python') + + self.use_boost_python = options.boost_python + + self.pyobject_dir = os.path.join(self.build_dir, 'python') + self.include_dir = os.path.join(self.build_dir, 'include') self.full_include_dir = os.path.join(self.include_dir, 'botan') @@ -71,6 +77,10 @@ class BuildConfigurationInformation(object): [os.path.join(checks_dir, file) for file in os.listdir(checks_dir) if file.endswith('.cpp')]) + self.python_sources = sorted( + [os.path.join(self.python_dir, file) for file in os.listdir(self.python_dir) + if file.endswith('.cpp')]) + def doc_files(self): docs = ['readme.txt'] @@ -87,6 +97,14 @@ class BuildConfigurationInformation(object): return 'botan-%d.%d.pc' % (self.version_major, self.version_minor) + def build_dirs(self): + dirs = [self.checkobj_dir, + self.libobj_dir, + self.full_include_dir] + if self.use_boost_python: + dirs.append(self.pyobject_dir) + return dirs + def username(self): return getpass.getuser() @@ -146,6 +164,10 @@ def process_command_line(args): build_group.add_option('--disable-debug', dest='debug_build', action='store_false', help=SUPPRESS_HELP) + build_group.add_option('--use-boost-python', dest='boost_python', + default=False, action='store_true', + help='enable Boost.Python wrapper') + build_group.add_option('--with-tr1-implementation', metavar='WHICH', dest='with_tr1', default=None, help='enable TR1 (options: none, system, boost)') @@ -781,6 +803,14 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo): build_commands(build_config.check_sources, build_config.checkobj_dir, 'CHECK')), + 'python_objs': makefile_list( + objectfile_list(build_config.python_sources, + build_config.pyobject_dir)), + + 'python_build_cmds': '\n'.join( + build_commands(build_config.python_sources, + build_config.pyobject_dir, 'PYTHON')), + 'ar_command': cc.ar_command or osinfo.ar_command, 'ranlib_command': osinfo.ranlib_command(), 'install_cmd_exec': osinfo.install_cmd_exec, @@ -802,6 +832,8 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo): 'mod_list': '\n'.join(['%s (%s)' % (m.basename, m.realname) for m in sorted(modules)]), + + 'python_version': '.'.join(map(str, sys.version_info[0:2])) } """ @@ -988,10 +1020,8 @@ def setup_build(build_config, options, template_vars): except OSError, e: logging.debug('Error while removing build dir: %s' % (e)) - for dirs in [build_config.checkobj_dir, - build_config.libobj_dir, - build_config.full_include_dir]: - os.makedirs(dirs) + for dir in build_config.build_dirs(): + os.makedirs(dir) makefile_template = os.path.join( options.makefile_dir, @@ -1010,6 +1040,10 @@ def setup_build(build_config, options, template_vars): templates_to_proc[os.path.join(options.build_data, template)] = \ os.path.join(build_config.build_dir, sink) + if options.boost_python: + templates_to_proc[ + os.path.join(options.makefile_dir, 'python.in')] = 'Makefile.python' + for (template, sink) in templates_to_proc.items(): try: f = open(sink, 'w') diff --git a/src/build-data/makefile/python.in b/src/build-data/makefile/python.in new file mode 100644 index 000000000..ee95f8d78 --- /dev/null +++ b/src/build-data/makefile/python.in @@ -0,0 +1,29 @@ +CXX = g++ + +PYTHON_ROOT = /usr/lib/python%{python_version}/config +PYTHON_INC = -I/usr/include/python%{python_version} +PYTHON_SITE_PACKAGE_DIR = /tmp/usr/lib/python%{python_version}/site-packages/ + +PYTHON_FLAGS = -Isrc/wrap/python -Os -fPIC -ftemplate-depth-255 -Wall -Wno-unused $(PYTHON_INC) + +PYTHON_OBJS = %{python_objs} + +BOTAN_PYTHON_MODDIR = build/botan-python + +all: $(BOTAN_PYTHON_MODDIR)/_botan.so + +%{python_build_cmds} + +$(BOTAN_PYTHON_MODDIR)/_botan.so: $(PYTHON_OBJS) + rm -rf $(BOTAN_PYTHON_MODDIR) + mkdir $(BOTAN_PYTHON_MODDIR) + cp src/wrap/python/*.py $(BOTAN_PYTHON_MODDIR) + $(CXX) -shared -o $@ $(PYTHON_OBJS) -L. -L$(PYTHON_ROOT) -lbotan -lboost_python -Wl,-rpath-link,. -Wl,-soname,$@ + +clean: + rm -f $(PYTHON_OBJS) $(BOTAN_PYTHON_MODDIR) + +install: + mkdir -p $(PYTHON_SITE_PACKAGE_DIR)/botan + cp $(BOTAN_PYTHON_MODDIR)/* $(PYTHON_SITE_PACKAGE_DIR)/botan + chmod -R u=rwX,go=rX $(PYTHON_SITE_PACKAGE_DIR)/botan diff --git a/src/build-data/makefile/unix.in b/src/build-data/makefile/unix.in index a48a5a17e..8e0e35b87 100644 --- a/src/build-data/makefile/unix.in +++ b/src/build-data/makefile/unix.in @@ -101,7 +101,7 @@ clean: distclean: clean $(RM_R) %{build_dir} $(RM_R) %{doc_src_dir}/doxygen %{doc_src_dir}/botan.doxy - $(RM) Makefile $(CONFIG_SCRIPT) $(PKGCONFIG) + $(RM) Makefile* $(CONFIG_SCRIPT) $(PKGCONFIG) install: $(LIBRARIES) $(ECHO) "Installing Botan into $(DESTDIR)... " diff --git a/src/build-data/makefile/unix_shr.in b/src/build-data/makefile/unix_shr.in index f718d1160..cfc8e3223 100644 --- a/src/build-data/makefile/unix_shr.in +++ b/src/build-data/makefile/unix_shr.in @@ -115,7 +115,7 @@ clean: distclean: clean $(RM_R) %{build_dir} $(RM_R) %{doc_src_dir}/doxygen %{doc_src_dir}/botan.doxy - $(RM) Makefile $(CONFIG_SCRIPT) $(PKGCONFIG) + $(RM) Makefile* $(CONFIG_SCRIPT) $(PKGCONFIG) install: $(LIBRARIES) $(ECHO) "Installing Botan into $(DESTDIR)... " diff --git a/src/wrap/python/__init__.py b/src/wrap/python/__init__.py new file mode 100644 index 000000000..2df9a456f --- /dev/null +++ b/src/wrap/python/__init__.py @@ -0,0 +1,4 @@ +from _botan import * + +# Initialize the library when the module is imported +init = LibraryInitializer() diff --git a/src/wrap/python/core.cpp b/src/wrap/python/core.cpp new file mode 100644 index 000000000..1992e3d61 --- /dev/null +++ b/src/wrap/python/core.cpp @@ -0,0 +1,203 @@ +/* +* Boost.Python module definition +* (C) 1999-2007 Jack Lloyd +*/ + +#include +#include +#include +using namespace Botan; + +#include "python_botan.h" + +class Python_RandomNumberGenerator + { + public: + Python_RandomNumberGenerator() + { rng = RandomNumberGenerator::make_rng(); } + ~Python_RandomNumberGenerator() { delete rng; } + + std::string name() const { return rng->name(); } + + void reseed() { rng->reseed(192); } + + int gen_random_byte() { return rng->next_byte(); } + + std::string gen_random(int n) + { + std::string s(n, 0); + rng->randomize(reinterpret_cast(&s[0]), n); + return s; + } + + void add_entropy(const std::string& in) + { rng->add_entropy(reinterpret_cast(in.c_str()), in.length()); } + + private: + RandomNumberGenerator* rng; + }; + +class Py_Cipher + { + public: + Py_Cipher(std::string algo_name, std::string direction, + std::string key); + + std::string cipher_noiv(const std::string& text); + + std::string cipher(const std::string& text, + const std::string& iv); + + std::string name() const { return algo_name; } + private: + std::string algo_name; + Keyed_Filter* filter; + Pipe pipe; + }; + +std::string Py_Cipher::cipher(const std::string& input, + const std::string& iv_str) + { + if(iv_str.size()) + { + const byte* iv_bytes = reinterpret_cast(iv_str.data()); + u32bit iv_len = iv_str.size(); + filter->set_iv(InitializationVector(iv_bytes, iv_len)); + } + + pipe.process_msg(input); + return pipe.read_all_as_string(Pipe::LAST_MESSAGE); + } + +// For IV-less algorithms +std::string Py_Cipher::cipher_noiv(const std::string& input) + { + pipe.process_msg(input); + return pipe.read_all_as_string(Pipe::LAST_MESSAGE); + } + +Py_Cipher::Py_Cipher(std::string algo_name, + std::string direction, + std::string key_str) + { + const byte* key_bytes = reinterpret_cast(key_str.data()); + u32bit key_len = key_str.size(); + + Cipher_Dir dir; + + if(direction == "encrypt") + dir = ENCRYPTION; + else if(direction == "decrypt") + dir = DECRYPTION; + else + throw std::invalid_argument("Bad cipher direction " + direction); + + filter = get_cipher(algo_name, dir); + filter->set_key(SymmetricKey(key_bytes, key_len)); + pipe.append(filter); + } + +class Py_HashFunction + { + public: + Py_HashFunction(const std::string& algo_name) + { + hash = get_hash(algo_name); + } + + ~Py_HashFunction() { delete hash; } + + void update(const std::string& input) + { + hash->update(input); + } + + std::string final() + { + std::string out(output_length(), 0); + hash->final(reinterpret_cast(&out[0])); + return out; + } + + std::string name() const + { + return hash->name(); + } + + u32bit output_length() const + { + return hash->OUTPUT_LENGTH; + } + + private: + HashFunction* hash; + }; + +class Py_MAC + { + public: + + Py_MAC(const std::string& name, const std::string& key_str) + { + mac = get_mac(name); + + mac->set_key(reinterpret_cast(key_str.data()), + key_str.size()); + } + + ~Py_MAC() { delete mac; } + + u32bit output_length() const { return mac->OUTPUT_LENGTH; } + + std::string name() const { return mac->name(); } + + void update(const std::string& in) { mac->update(in); } + + std::string final() + { + std::string out(output_length(), 0); + mac->final(reinterpret_cast(&out[0])); + return out; + } + private: + MessageAuthenticationCode* mac; + }; + +BOOST_PYTHON_MODULE(_botan) + { + python::class_("LibraryInitializer") + .def(python::init< python::optional >()); + + python::class_("RandomNumberGenerator") + .def(python::init<>()) + .def("__str__", &Python_RandomNumberGenerator::name) + .def("name", &Python_RandomNumberGenerator::name) + .def("reseed", &Python_RandomNumberGenerator::reseed) + .def("add_entropy", &Python_RandomNumberGenerator::add_entropy) + .def("gen_random_byte", &Python_RandomNumberGenerator::gen_random_byte) + .def("gen_random", &Python_RandomNumberGenerator::gen_random); + + python::class_ + ("Cipher", python::init()) + .def("name", &Py_Cipher::name) + .def("cipher", &Py_Cipher::cipher) + .def("cipher", &Py_Cipher::cipher_noiv); + + python::class_ + ("HashFunction", python::init()) + .def("update", &Py_HashFunction::update) + .def("final", &Py_HashFunction::final) + .def("name", &Py_HashFunction::name) + .def("output_length", &Py_HashFunction::output_length); + + python::class_ + ("MAC", python::init()) + .def("update", &Py_MAC::update) + .def("final", &Py_MAC::final) + .def("name", &Py_MAC::name) + .def("output_length", &Py_MAC::output_length); + + export_filters(); + export_pk(); + export_x509(); + } diff --git a/src/wrap/python/filter.cpp b/src/wrap/python/filter.cpp new file mode 100644 index 000000000..a678af9e5 --- /dev/null +++ b/src/wrap/python/filter.cpp @@ -0,0 +1,178 @@ +/************************************************* +* Boost.Python module definition * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#include +using namespace boost::python; + +#include +#include +using namespace Botan; + +class Py_Filter : public Filter + { + public: + virtual void write_str(const std::string&) = 0; + + void write(const byte data[], u32bit length) + { + write_str(std::string((const char*)data, length)); + } + + void send_str(const std::string& str) + { + printf("Py_Filter::send_str\n"); + send((const byte*)str.data(), str.length()); + } + }; + +class FilterWrapper : public Py_Filter, public wrapper + { + public: + void start_msg() + { + printf("wrapper start_msg\n"); + if(override start_msg = this->get_override("start_msg")) + start_msg(); + } + + void end_msg() + { + printf("wrapper end_msg\n"); + if(override end_msg = this->get_override("end_msg")) + end_msg(); + } + + void default_start_msg() {} + void default_end_msg() {} + + virtual void write_str(const std::string& str) + { + printf("wrapper write\n"); + this->get_override("write")(str); + } + }; + +Filter* return_or_raise(Filter* filter, const std::string& name) + { + if(filter) + return filter; + throw Invalid_Argument("Filter " + name + " could not be found"); + } + +Filter* make_filter1(const std::string& name) + { + Filter* filter = 0; + + if(have_hash(name)) filter = new Hash_Filter(name); + else if(name == "Hex_Encoder") filter = new Hex_Encoder; + else if(name == "Hex_Decoder") filter = new Hex_Decoder; + else if(name == "Base64_Encoder") filter = new Base64_Encoder; + else if(name == "Base64_Decoder") filter = new Base64_Decoder; + + return return_or_raise(filter, name); + } + +Filter* make_filter2(const std::string& name, + const SymmetricKey& key) + { + Filter* filter = 0; + + if(have_mac(name)) + filter = new MAC_Filter(name, key); + else if(have_stream_cipher(name)) + filter = new StreamCipher_Filter(name, key); + + return return_or_raise(filter, name); + } + +// FIXME: add new wrapper for Keyed_Filter here +Filter* make_filter3(const std::string& name, + const SymmetricKey& key, + Cipher_Dir direction) + { + return return_or_raise( + get_cipher(name, key, direction), + name); + } + +Filter* make_filter4(const std::string& name, + const SymmetricKey& key, + const InitializationVector& iv, + Cipher_Dir direction) + { + return return_or_raise( + get_cipher(name, key, iv, direction), + name); + } + +void append_filter(Pipe& pipe, std::auto_ptr filter) + { + pipe.append(filter.get()); + filter.release(); + } + +void prepend_filter(Pipe& pipe, std::auto_ptr filter) + { + pipe.prepend(filter.get()); + filter.release(); + } + +void do_send(std::auto_ptr filter, const std::string& data) + { + printf("Sending %s to %p\n", data.c_str(), filter.get()); + filter->send_str(data); + } + +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(rallas_ovls, read_all_as_string, 0, 1) + +void export_filters() + { + class_, boost::noncopyable> + ("__Internal_FilterObj", no_init); + + def("make_filter", make_filter1, + return_value_policy()); + def("make_filter", make_filter2, + return_value_policy()); + def("make_filter", make_filter3, + return_value_policy()); + def("make_filter", make_filter4, + return_value_policy()); + + // This might not work - Pipe will delete the filter, but Python + // might have allocated the space with malloc() or who-knows-what -> bad + class_, + bases, boost::noncopyable> + ("FilterObj") + .def("write", pure_virtual(&Py_Filter::write_str)) + .def("send", &do_send) + .def("start_msg", &Filter::start_msg, &FilterWrapper::default_start_msg) + .def("end_msg", &Filter::end_msg, &FilterWrapper::default_end_msg); + + implicitly_convertible, + std::auto_ptr >(); + + void (Pipe::*pipe_write_str)(const std::string&) = &Pipe::write; + void (Pipe::*pipe_process_str)(const std::string&) = &Pipe::process_msg; + + class_("PipeObj") + .def(init<>()) + /* + .def_readonly("LAST_MESSAGE", &Pipe::LAST_MESSAGE) + .def_readonly("DEFAULT_MESSAGE", &Pipe::DEFAULT_MESSAGE) + */ + .add_property("default_msg", &Pipe::default_msg, &Pipe::set_default_msg) + .add_property("msg_count", &Pipe::message_count) + .def("append", append_filter) + .def("prepend", prepend_filter) + .def("reset", &Pipe::reset) + .def("pop", &Pipe::pop) + .def("end_of_data", &Pipe::end_of_data) + .def("start_msg", &Pipe::start_msg) + .def("end_msg", &Pipe::end_msg) + .def("write", pipe_write_str) + .def("process_msg", pipe_process_str) + .def("read_all", &Pipe::read_all_as_string, rallas_ovls()); + } diff --git a/src/wrap/python/pk.cpp b/src/wrap/python/pk.cpp new file mode 100644 index 000000000..72d3294b8 --- /dev/null +++ b/src/wrap/python/pk.cpp @@ -0,0 +1,125 @@ +/************************************************* +* Boost.Python module definition * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#include +#include +#include +#include +using namespace Botan; + +#include +namespace python = boost::python; + +std::string encode_pub(const Public_Key* key, + const std::string& type) + { + if(type == "DER") + { + Pipe pipe; + pipe.start_msg(); + X509::encode(*key, pipe, RAW_BER); + pipe.end_msg(); + return pipe.read_all_as_string(); + } + else if(type == "PEM") + return X509::PEM_encode(*key); + else + throw Encoding_Error("Unknown key encoding method " + type); + } + +std::string encode_priv(const Private_Key* key, + const std::string& type) + { + if(type == "DER") + { + Pipe pipe; + PKCS8::encode(*key, pipe, RAW_BER); + return pipe.read_all_as_string(); + } + else if(type == "PEM") + return PKCS8::PEM_encode(*key); + else + throw Encoding_Error("Unknown key encoding method " + type); + } + +/* +Private_Key* load_priv(const std::string& file, const std::string& pass) + { + return PKCS8::load_key(file, pass); + } + +Public_Key* load_public(const std::string& file) + { + return X509::load_key(file); + } +*/ + +/* +std::string encrypt_string(const PK_Encryptor* enc, const std::string& in) + { + SecureVector cipher = enc->encrypt((const byte*)in.data(), in.length()); + return std::string((const char*)cipher.begin(), cipher.size()); + } + +std::string decrypt_string(const PK_Decryptor* dec, const std::string& in) + { + SecureVector plain = dec->decrypt((const byte*)in.data(), in.length()); + return std::string((const char*)plain.begin(), plain.size()); + } +*/ + +void export_pk() + { + /* + python::def("private_key", load_priv, + python::return_value_policy()); + python::def("public_key", load_public, + python::return_value_policy()); + */ + + python::class_ + ("Public_Key", python::no_init) + .add_property("name", &Public_Key::algo_name) + .add_property("max_input_bits", &Public_Key::max_input_bits) + .def("public_key", encode_pub); + + python::class_, boost::noncopyable> + ("PK_Encrypting_Key", python::no_init); + + python::class_, boost::noncopyable> + ("Private_Key", python::no_init) + .def("private_key", encode_priv); + + python::class_, boost::noncopyable> + ("PK_Decrypting_Key", python::no_init); + + python::class_ > + ("RSA_PublicKey", python::no_init); + + python::class_ > + ("DSA_PublicKey", python::no_init); + + /* + python::class_ > + ("RSA_PrivateKey", python::init()); + */ + + /* + python::class_ + ("PK_Encryptor", python::no_init) + .def("__init__", + python::make_constructor(get_pk_encryptor, + python::with_custodian_and_ward_postcall<0, 1>())) + .def("max_input", &PK_Encryptor::maximum_input_size) + .def("encrypt", encrypt_string); + */ + + /* + python::class_ + ("PK_Decryptor", python::no_init) + .def("__init__", python::make_constructor(get_pk_decryptor)) + .def("decrypt", decrypt_string); + */ + } diff --git a/src/wrap/python/python_botan.h b/src/wrap/python/python_botan.h new file mode 100644 index 000000000..18c51dbb1 --- /dev/null +++ b/src/wrap/python/python_botan.h @@ -0,0 +1,51 @@ + +#ifndef BOTAN_BOOST_PYTHON_COMMON_H__ +#define BOTAN_BOOST_PYTHON_COMMON_H__ + +#include +#include +#include +using namespace Botan; + +#include +namespace python = boost::python; + +extern void export_filters(); +extern void export_pk(); +extern void export_x509(); + +class Bad_Size : public Exception + { + public: + Bad_Size(u32bit got, u32bit expected) : + Exception("Bad size detected in Python/C++ conversion layer: got " + + to_string(got) + " bytes, expected " + to_string(expected)) + {} + }; + +inline std::string make_string(const byte input[], u32bit length) + { + return std::string((const char*)input, length); + } + +inline std::string make_string(const MemoryRegion& in) + { + return make_string(in.begin(), in.size()); + } + +inline void string2binary(const std::string& from, byte to[], u32bit expected) + { + if(from.size() != expected) + throw Bad_Size(from.size(), expected); + std::memcpy(to, from.data(), expected); + } + +template +inline python::object get_owner(T* me) + { + return python::object( + python::handle<>( + python::borrowed(python::detail::wrapper_base_::get_owner(*me)))); + } + +#endif diff --git a/src/wrap/python/x509.cpp b/src/wrap/python/x509.cpp new file mode 100644 index 000000000..90c2bba1c --- /dev/null +++ b/src/wrap/python/x509.cpp @@ -0,0 +1,140 @@ +/************************************************* +* Boost.Python module definition * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#include +#include +#include +#include +#include +#include +using namespace Botan; + +#include +namespace python = boost::python; + +template +class vector_to_list + { + public: + static PyObject* convert(const std::vector& in) + { + python::list out; + typename std::vector::const_iterator i = in.begin(); + while(i != in.end()) + { + out.append(*i); + ++i; + } + return python::incref(out.ptr()); + } + + vector_to_list() + { + python::to_python_converter, vector_to_list >(); + } + }; + +template +class memvec_to_hexstr + { + public: + static PyObject* convert(const T& in) + { + Pipe pipe(new Hex_Encoder); + pipe.process_msg(in); + std::string result = pipe.read_all_as_string(); + return python::incref(python::str(result).ptr()); + } + + memvec_to_hexstr() + { + python::to_python_converter >(); + } + }; + +class X509_Store_Search_Wrap : public X509_Store::Search_Func, + public python::wrapper + { + public: + bool match(const X509_Certificate& cert) const + { + return this->get_override("match")(cert); + } + }; + +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(add_cert_ols, add_cert, 1, 2) +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(validate_cert_ols, validate_cert, 1, 2) + +void export_x509() + { + vector_to_list(); + vector_to_list(); + memvec_to_hexstr >(); + + python::class_ + ("X509_Certificate", python::init()) + .def(python::self == python::self) + .def(python::self != python::self) + .add_property("version", &X509_Certificate::x509_version) + .add_property("is_CA", &X509_Certificate::is_CA_cert) + .add_property("self_signed", &X509_Certificate::is_self_signed) + .add_property("pathlimit", &X509_Certificate::path_limit) + .add_property("as_pem", &X509_Object::PEM_encode) + .def("start_time", &X509_Certificate::start_time) + .def("end_time", &X509_Certificate::end_time) + .def("subject_info", &X509_Certificate::subject_info) + .def("issuer_info", &X509_Certificate::issuer_info) + .def("ex_constraints", &X509_Certificate::ex_constraints) + .def("policies", &X509_Certificate::policies) + .def("subject_key_id", &X509_Certificate::subject_key_id) + .def("authority_key_id", &X509_Certificate::authority_key_id); + + python::class_ + ("X509_CRL", python::init()) + .add_property("as_pem", &X509_Object::PEM_encode); + + python::enum_("verify_result") + .value("verified", VERIFIED) + .value("unknown_x509_error", UNKNOWN_X509_ERROR) + .value("cannot_establish_trust", CANNOT_ESTABLISH_TRUST) + .value("cert_chain_too_long", CERT_CHAIN_TOO_LONG) + .value("signature_error", SIGNATURE_ERROR) + .value("policy_error", POLICY_ERROR) + .value("invalid_usage", INVALID_USAGE) + .value("cert_format_error", CERT_FORMAT_ERROR) + .value("cert_issuer_not_found", CERT_ISSUER_NOT_FOUND) + .value("cert_not_yet_valid", CERT_NOT_YET_VALID) + .value("cert_has_expired", CERT_HAS_EXPIRED) + .value("cert_is_revoked", CERT_IS_REVOKED) + .value("crl_format_error", CRL_FORMAT_ERROR) + .value("crl_issuer_not_found", CRL_ISSUER_NOT_FOUND) + .value("crl_not_yet_valid", CRL_NOT_YET_VALID) + .value("crl_has_expired", CRL_HAS_EXPIRED) + .value("ca_cert_cannot_sign", CA_CERT_CANNOT_SIGN) + .value("ca_cert_not_for_cert_issuer", CA_CERT_NOT_FOR_CERT_ISSUER) + .value("ca_cert_not_for_crl_issuer", CA_CERT_NOT_FOR_CRL_ISSUER); + + python::enum_("cert_usage") + .value("any", X509_Store::ANY) + .value("tls_server", X509_Store::TLS_SERVER) + .value("tls_client", X509_Store::TLS_CLIENT) + .value("code_signing", X509_Store::CODE_SIGNING) + .value("email_protection", X509_Store::EMAIL_PROTECTION) + .value("time_stamping", X509_Store::TIME_STAMPING) + .value("crl_signing", X509_Store::CRL_SIGNING); + + { + python::scope in_class = + python::class_("X509_Store") + .def("add_cert", &X509_Store::add_cert, add_cert_ols()) + .def("validate", &X509_Store::validate_cert, validate_cert_ols()) + .def("get_certs", &X509_Store::get_certs) + .def("add_crl", &X509_Store::add_crl); + + python::class_ + ("Search_Func") + .def("match", python::pure_virtual(&X509_Store::Search_Func::match)); + } + } diff --git a/wrappers/boost-python/Makefile b/wrappers/boost-python/Makefile index e3a1acf37..2d2c38e58 100644 --- a/wrappers/boost-python/Makefile +++ b/wrappers/boost-python/Makefile @@ -2,8 +2,8 @@ CXX = g++ LANG_FLAGS = -fPIC -Wall -Wno-unused -ftemplate-depth-255 OPT_FLAGS = -g -Os -PYTHON_ROOT = /usr/lib/python2.5/config -PYTHON_INC = -I/usr/include/python2.5 +PYTHON_ROOT = /usr/lib/python2.6/config +PYTHON_INC = -I/usr/include/python2.6 PYTHON_DEF = -DBOOST_PYTHON_DYNAMIC_LIB -DBOOST_PYTHON_SOURCE WRAPPER_CFLAGS = $(shell botan-config --cflags) @@ -11,13 +11,21 @@ SHARED_CFLAGS = $(LANG_FLAGS) $(OPT_FLAGS) $(PYTHON_INC) BOOST_CFLAGS = $(PYTHON_DEF) $(SHARED_CFLAGS) -WRAP_SRC = $(wildcard src/*.cpp) -WRAP_OBJS = $(patsubst src/%.cpp,build/%.o,$(WRAP_SRC)) +WRAP_OBJS = build/python/core.o build/python/filter.o build/python/pk.o build/python/x509.o all: botan/_botan.so -build/%.o: src/%.cpp - $(CXX) -Isrc/ $(SHARED_CFLAGS) $(WRAPPER_CFLAGS) -c $< -o $@ +build/python/core.o: src/wrap/python/core.cpp + $(CXX) -Isrc/wrap/python $(SHARED_CFLAGS) $(WRAPPER_CFLAGS) -c $< -o $@ + +build/python/filter.o: src/wrap/python/filter.cpp + $(CXX) -Isrc/wrap/python $(SHARED_CFLAGS) $(WRAPPER_CFLAGS) -c $< -o $@ + +build/python/pk.o: src/wrap/python/pk.cpp + $(CXX) -Isrc/wrap/python $(SHARED_CFLAGS) $(WRAPPER_CFLAGS) -c $< -o $@ + +build/python/x509.o: src/wrap/python/x509.cpp + $(CXX) -Isrc/wrap/python $(SHARED_CFLAGS) $(WRAPPER_CFLAGS) -c $< -o $@ botan/_botan.so: $(WRAP_OBJS) $(CXX) -shared -o $@ $(shell botan-config --libs) -L$(PYTHON_ROOT) $(WRAP_OBJS) -lboost_python -Wl,-rpath-link,. -Wl,-soname,$@ diff --git a/wrappers/boost-python/botan/__init__.py b/wrappers/boost-python/botan/__init__.py deleted file mode 100644 index 2df9a456f..000000000 --- a/wrappers/boost-python/botan/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from _botan import * - -# Initialize the library when the module is imported -init = LibraryInitializer() diff --git a/wrappers/boost-python/src/core.cpp b/wrappers/boost-python/src/core.cpp deleted file mode 100644 index 1992e3d61..000000000 --- a/wrappers/boost-python/src/core.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* -* Boost.Python module definition -* (C) 1999-2007 Jack Lloyd -*/ - -#include -#include -#include -using namespace Botan; - -#include "python_botan.h" - -class Python_RandomNumberGenerator - { - public: - Python_RandomNumberGenerator() - { rng = RandomNumberGenerator::make_rng(); } - ~Python_RandomNumberGenerator() { delete rng; } - - std::string name() const { return rng->name(); } - - void reseed() { rng->reseed(192); } - - int gen_random_byte() { return rng->next_byte(); } - - std::string gen_random(int n) - { - std::string s(n, 0); - rng->randomize(reinterpret_cast(&s[0]), n); - return s; - } - - void add_entropy(const std::string& in) - { rng->add_entropy(reinterpret_cast(in.c_str()), in.length()); } - - private: - RandomNumberGenerator* rng; - }; - -class Py_Cipher - { - public: - Py_Cipher(std::string algo_name, std::string direction, - std::string key); - - std::string cipher_noiv(const std::string& text); - - std::string cipher(const std::string& text, - const std::string& iv); - - std::string name() const { return algo_name; } - private: - std::string algo_name; - Keyed_Filter* filter; - Pipe pipe; - }; - -std::string Py_Cipher::cipher(const std::string& input, - const std::string& iv_str) - { - if(iv_str.size()) - { - const byte* iv_bytes = reinterpret_cast(iv_str.data()); - u32bit iv_len = iv_str.size(); - filter->set_iv(InitializationVector(iv_bytes, iv_len)); - } - - pipe.process_msg(input); - return pipe.read_all_as_string(Pipe::LAST_MESSAGE); - } - -// For IV-less algorithms -std::string Py_Cipher::cipher_noiv(const std::string& input) - { - pipe.process_msg(input); - return pipe.read_all_as_string(Pipe::LAST_MESSAGE); - } - -Py_Cipher::Py_Cipher(std::string algo_name, - std::string direction, - std::string key_str) - { - const byte* key_bytes = reinterpret_cast(key_str.data()); - u32bit key_len = key_str.size(); - - Cipher_Dir dir; - - if(direction == "encrypt") - dir = ENCRYPTION; - else if(direction == "decrypt") - dir = DECRYPTION; - else - throw std::invalid_argument("Bad cipher direction " + direction); - - filter = get_cipher(algo_name, dir); - filter->set_key(SymmetricKey(key_bytes, key_len)); - pipe.append(filter); - } - -class Py_HashFunction - { - public: - Py_HashFunction(const std::string& algo_name) - { - hash = get_hash(algo_name); - } - - ~Py_HashFunction() { delete hash; } - - void update(const std::string& input) - { - hash->update(input); - } - - std::string final() - { - std::string out(output_length(), 0); - hash->final(reinterpret_cast(&out[0])); - return out; - } - - std::string name() const - { - return hash->name(); - } - - u32bit output_length() const - { - return hash->OUTPUT_LENGTH; - } - - private: - HashFunction* hash; - }; - -class Py_MAC - { - public: - - Py_MAC(const std::string& name, const std::string& key_str) - { - mac = get_mac(name); - - mac->set_key(reinterpret_cast(key_str.data()), - key_str.size()); - } - - ~Py_MAC() { delete mac; } - - u32bit output_length() const { return mac->OUTPUT_LENGTH; } - - std::string name() const { return mac->name(); } - - void update(const std::string& in) { mac->update(in); } - - std::string final() - { - std::string out(output_length(), 0); - mac->final(reinterpret_cast(&out[0])); - return out; - } - private: - MessageAuthenticationCode* mac; - }; - -BOOST_PYTHON_MODULE(_botan) - { - python::class_("LibraryInitializer") - .def(python::init< python::optional >()); - - python::class_("RandomNumberGenerator") - .def(python::init<>()) - .def("__str__", &Python_RandomNumberGenerator::name) - .def("name", &Python_RandomNumberGenerator::name) - .def("reseed", &Python_RandomNumberGenerator::reseed) - .def("add_entropy", &Python_RandomNumberGenerator::add_entropy) - .def("gen_random_byte", &Python_RandomNumberGenerator::gen_random_byte) - .def("gen_random", &Python_RandomNumberGenerator::gen_random); - - python::class_ - ("Cipher", python::init()) - .def("name", &Py_Cipher::name) - .def("cipher", &Py_Cipher::cipher) - .def("cipher", &Py_Cipher::cipher_noiv); - - python::class_ - ("HashFunction", python::init()) - .def("update", &Py_HashFunction::update) - .def("final", &Py_HashFunction::final) - .def("name", &Py_HashFunction::name) - .def("output_length", &Py_HashFunction::output_length); - - python::class_ - ("MAC", python::init()) - .def("update", &Py_MAC::update) - .def("final", &Py_MAC::final) - .def("name", &Py_MAC::name) - .def("output_length", &Py_MAC::output_length); - - export_filters(); - export_pk(); - export_x509(); - } diff --git a/wrappers/boost-python/src/filter.cpp b/wrappers/boost-python/src/filter.cpp deleted file mode 100644 index 830e090de..000000000 --- a/wrappers/boost-python/src/filter.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/************************************************* -* Boost.Python module definition * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#include -using namespace boost::python; - -#include -#include -using namespace Botan; - -class Py_Filter : public Filter - { - public: - virtual void write_str(const std::string&) = 0; - - void write(const byte data[], u32bit length) - { - write_str(std::string((const char*)data, length)); - } - - void send_str(const std::string& str) - { - printf("Py_Filter::send_str\n"); - send((const byte*)str.data(), str.length()); - } - }; - -class FilterWrapper : public Py_Filter, public wrapper - { - public: - void start_msg() - { - printf("wrapper start_msg\n"); - if(override start_msg = this->get_override("start_msg")) - start_msg(); - } - - void end_msg() - { - printf("wrapper end_msg\n"); - if(override end_msg = this->get_override("end_msg")) - end_msg(); - } - - void default_start_msg() {} - void default_end_msg() {} - - virtual void write_str(const std::string& str) - { - printf("wrapper write\n"); - this->get_override("write")(str); - } - }; - -Filter* return_or_raise(Filter* filter, const std::string& name) - { - if(filter) - return filter; - throw Invalid_Argument("Filter " + name + " could not be found"); - } - -Filter* make_filter1(const std::string& name) - { - Filter* filter = 0; - - if(have_hash(name)) filter = new Hash_Filter(name); - else if(name == "Hex_Encoder") filter = new Hex_Encoder; - else if(name == "Hex_Decoder") filter = new Hex_Decoder; - else if(name == "Base64_Encoder") filter = new Base64_Encoder; - else if(name == "Base64_Decoder") filter = new Base64_Decoder; - - return return_or_raise(filter, name); - } - -Filter* make_filter2(const std::string& name, - const SymmetricKey& key) - { - Filter* filter = 0; - - if(have_mac(name)) - filter = new MAC_Filter(name, key); - else if(have_stream_cipher(name)) - filter = new StreamCipher_Filter(name, key); - - return return_or_raise(filter, name); - } - -// FIXME: add new wrapper for Keyed_Filter here -Filter* make_filter3(const std::string& name, - const SymmetricKey& key, - Cipher_Dir direction) - { - return return_or_raise( - get_cipher(name, key, direction), - name); - } - -Filter* make_filter4(const std::string& name, - const SymmetricKey& key, - const InitializationVector& iv, - Cipher_Dir direction) - { - return return_or_raise( - get_cipher(name, key, iv, direction), - name); - } - -void append_filter(Pipe& pipe, std::auto_ptr filter) - { - pipe.append(filter.get()); - filter.release(); - } - -void prepend_filter(Pipe& pipe, std::auto_ptr filter) - { - pipe.prepend(filter.get()); - filter.release(); - } - -void do_send(std::auto_ptr filter, const std::string& data) - { - printf("Sending %s to %p\n", data.c_str(), filter.get()); - filter->send_str(data); - } - -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(rallas_ovls, read_all_as_string, 0, 1) - -void export_filters() - { - class_, boost::noncopyable> - ("__Internal_FilterObj", no_init); - - def("make_filter", make_filter1, - return_value_policy()); - def("make_filter", make_filter2, - return_value_policy()); - def("make_filter", make_filter3, - return_value_policy()); - def("make_filter", make_filter4, - return_value_policy()); - - // This might not work - Pipe will delete the filter, but Python - // might have allocated the space with malloc() or who-knows-what -> bad - class_, - bases, boost::noncopyable> - ("FilterObj") - .def("write", pure_virtual(&Py_Filter::write_str)) - .def("send", &do_send) - .def("start_msg", &Filter::start_msg, &FilterWrapper::default_start_msg) - .def("end_msg", &Filter::end_msg, &FilterWrapper::default_end_msg); - - implicitly_convertible, - std::auto_ptr >(); - - void (Pipe::*pipe_write_str)(const std::string&) = &Pipe::write; - void (Pipe::*pipe_process_str)(const std::string&) = &Pipe::process_msg; - - class_("PipeObj") - .def(init<>()) - .def_readonly("LAST_MESSAGE", &Pipe::LAST_MESSAGE) - .def_readonly("DEFAULT_MESSAGE", &Pipe::DEFAULT_MESSAGE) - .add_property("default_msg", &Pipe::default_msg, &Pipe::set_default_msg) - .add_property("msg_count", &Pipe::message_count) - .def("append", append_filter) - .def("prepend", prepend_filter) - .def("reset", &Pipe::reset) - .def("pop", &Pipe::pop) - .def("end_of_data", &Pipe::end_of_data) - .def("start_msg", &Pipe::start_msg) - .def("end_msg", &Pipe::end_msg) - .def("write", pipe_write_str) - .def("process_msg", pipe_process_str) - .def("read_all", &Pipe::read_all_as_string, rallas_ovls()); - } diff --git a/wrappers/boost-python/src/pk.cpp b/wrappers/boost-python/src/pk.cpp deleted file mode 100644 index 72d3294b8..000000000 --- a/wrappers/boost-python/src/pk.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/************************************************* -* Boost.Python module definition * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#include -#include -#include -#include -using namespace Botan; - -#include -namespace python = boost::python; - -std::string encode_pub(const Public_Key* key, - const std::string& type) - { - if(type == "DER") - { - Pipe pipe; - pipe.start_msg(); - X509::encode(*key, pipe, RAW_BER); - pipe.end_msg(); - return pipe.read_all_as_string(); - } - else if(type == "PEM") - return X509::PEM_encode(*key); - else - throw Encoding_Error("Unknown key encoding method " + type); - } - -std::string encode_priv(const Private_Key* key, - const std::string& type) - { - if(type == "DER") - { - Pipe pipe; - PKCS8::encode(*key, pipe, RAW_BER); - return pipe.read_all_as_string(); - } - else if(type == "PEM") - return PKCS8::PEM_encode(*key); - else - throw Encoding_Error("Unknown key encoding method " + type); - } - -/* -Private_Key* load_priv(const std::string& file, const std::string& pass) - { - return PKCS8::load_key(file, pass); - } - -Public_Key* load_public(const std::string& file) - { - return X509::load_key(file); - } -*/ - -/* -std::string encrypt_string(const PK_Encryptor* enc, const std::string& in) - { - SecureVector cipher = enc->encrypt((const byte*)in.data(), in.length()); - return std::string((const char*)cipher.begin(), cipher.size()); - } - -std::string decrypt_string(const PK_Decryptor* dec, const std::string& in) - { - SecureVector plain = dec->decrypt((const byte*)in.data(), in.length()); - return std::string((const char*)plain.begin(), plain.size()); - } -*/ - -void export_pk() - { - /* - python::def("private_key", load_priv, - python::return_value_policy()); - python::def("public_key", load_public, - python::return_value_policy()); - */ - - python::class_ - ("Public_Key", python::no_init) - .add_property("name", &Public_Key::algo_name) - .add_property("max_input_bits", &Public_Key::max_input_bits) - .def("public_key", encode_pub); - - python::class_, boost::noncopyable> - ("PK_Encrypting_Key", python::no_init); - - python::class_, boost::noncopyable> - ("Private_Key", python::no_init) - .def("private_key", encode_priv); - - python::class_, boost::noncopyable> - ("PK_Decrypting_Key", python::no_init); - - python::class_ > - ("RSA_PublicKey", python::no_init); - - python::class_ > - ("DSA_PublicKey", python::no_init); - - /* - python::class_ > - ("RSA_PrivateKey", python::init()); - */ - - /* - python::class_ - ("PK_Encryptor", python::no_init) - .def("__init__", - python::make_constructor(get_pk_encryptor, - python::with_custodian_and_ward_postcall<0, 1>())) - .def("max_input", &PK_Encryptor::maximum_input_size) - .def("encrypt", encrypt_string); - */ - - /* - python::class_ - ("PK_Decryptor", python::no_init) - .def("__init__", python::make_constructor(get_pk_decryptor)) - .def("decrypt", decrypt_string); - */ - } diff --git a/wrappers/boost-python/src/python_botan.h b/wrappers/boost-python/src/python_botan.h deleted file mode 100644 index 18c51dbb1..000000000 --- a/wrappers/boost-python/src/python_botan.h +++ /dev/null @@ -1,51 +0,0 @@ - -#ifndef BOTAN_BOOST_PYTHON_COMMON_H__ -#define BOTAN_BOOST_PYTHON_COMMON_H__ - -#include -#include -#include -using namespace Botan; - -#include -namespace python = boost::python; - -extern void export_filters(); -extern void export_pk(); -extern void export_x509(); - -class Bad_Size : public Exception - { - public: - Bad_Size(u32bit got, u32bit expected) : - Exception("Bad size detected in Python/C++ conversion layer: got " + - to_string(got) + " bytes, expected " + to_string(expected)) - {} - }; - -inline std::string make_string(const byte input[], u32bit length) - { - return std::string((const char*)input, length); - } - -inline std::string make_string(const MemoryRegion& in) - { - return make_string(in.begin(), in.size()); - } - -inline void string2binary(const std::string& from, byte to[], u32bit expected) - { - if(from.size() != expected) - throw Bad_Size(from.size(), expected); - std::memcpy(to, from.data(), expected); - } - -template -inline python::object get_owner(T* me) - { - return python::object( - python::handle<>( - python::borrowed(python::detail::wrapper_base_::get_owner(*me)))); - } - -#endif diff --git a/wrappers/boost-python/src/x509.cpp b/wrappers/boost-python/src/x509.cpp deleted file mode 100644 index 90c2bba1c..000000000 --- a/wrappers/boost-python/src/x509.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/************************************************* -* Boost.Python module definition * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#include -#include -#include -#include -#include -#include -using namespace Botan; - -#include -namespace python = boost::python; - -template -class vector_to_list - { - public: - static PyObject* convert(const std::vector& in) - { - python::list out; - typename std::vector::const_iterator i = in.begin(); - while(i != in.end()) - { - out.append(*i); - ++i; - } - return python::incref(out.ptr()); - } - - vector_to_list() - { - python::to_python_converter, vector_to_list >(); - } - }; - -template -class memvec_to_hexstr - { - public: - static PyObject* convert(const T& in) - { - Pipe pipe(new Hex_Encoder); - pipe.process_msg(in); - std::string result = pipe.read_all_as_string(); - return python::incref(python::str(result).ptr()); - } - - memvec_to_hexstr() - { - python::to_python_converter >(); - } - }; - -class X509_Store_Search_Wrap : public X509_Store::Search_Func, - public python::wrapper - { - public: - bool match(const X509_Certificate& cert) const - { - return this->get_override("match")(cert); - } - }; - -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(add_cert_ols, add_cert, 1, 2) -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(validate_cert_ols, validate_cert, 1, 2) - -void export_x509() - { - vector_to_list(); - vector_to_list(); - memvec_to_hexstr >(); - - python::class_ - ("X509_Certificate", python::init()) - .def(python::self == python::self) - .def(python::self != python::self) - .add_property("version", &X509_Certificate::x509_version) - .add_property("is_CA", &X509_Certificate::is_CA_cert) - .add_property("self_signed", &X509_Certificate::is_self_signed) - .add_property("pathlimit", &X509_Certificate::path_limit) - .add_property("as_pem", &X509_Object::PEM_encode) - .def("start_time", &X509_Certificate::start_time) - .def("end_time", &X509_Certificate::end_time) - .def("subject_info", &X509_Certificate::subject_info) - .def("issuer_info", &X509_Certificate::issuer_info) - .def("ex_constraints", &X509_Certificate::ex_constraints) - .def("policies", &X509_Certificate::policies) - .def("subject_key_id", &X509_Certificate::subject_key_id) - .def("authority_key_id", &X509_Certificate::authority_key_id); - - python::class_ - ("X509_CRL", python::init()) - .add_property("as_pem", &X509_Object::PEM_encode); - - python::enum_("verify_result") - .value("verified", VERIFIED) - .value("unknown_x509_error", UNKNOWN_X509_ERROR) - .value("cannot_establish_trust", CANNOT_ESTABLISH_TRUST) - .value("cert_chain_too_long", CERT_CHAIN_TOO_LONG) - .value("signature_error", SIGNATURE_ERROR) - .value("policy_error", POLICY_ERROR) - .value("invalid_usage", INVALID_USAGE) - .value("cert_format_error", CERT_FORMAT_ERROR) - .value("cert_issuer_not_found", CERT_ISSUER_NOT_FOUND) - .value("cert_not_yet_valid", CERT_NOT_YET_VALID) - .value("cert_has_expired", CERT_HAS_EXPIRED) - .value("cert_is_revoked", CERT_IS_REVOKED) - .value("crl_format_error", CRL_FORMAT_ERROR) - .value("crl_issuer_not_found", CRL_ISSUER_NOT_FOUND) - .value("crl_not_yet_valid", CRL_NOT_YET_VALID) - .value("crl_has_expired", CRL_HAS_EXPIRED) - .value("ca_cert_cannot_sign", CA_CERT_CANNOT_SIGN) - .value("ca_cert_not_for_cert_issuer", CA_CERT_NOT_FOR_CERT_ISSUER) - .value("ca_cert_not_for_crl_issuer", CA_CERT_NOT_FOR_CRL_ISSUER); - - python::enum_("cert_usage") - .value("any", X509_Store::ANY) - .value("tls_server", X509_Store::TLS_SERVER) - .value("tls_client", X509_Store::TLS_CLIENT) - .value("code_signing", X509_Store::CODE_SIGNING) - .value("email_protection", X509_Store::EMAIL_PROTECTION) - .value("time_stamping", X509_Store::TIME_STAMPING) - .value("crl_signing", X509_Store::CRL_SIGNING); - - { - python::scope in_class = - python::class_("X509_Store") - .def("add_cert", &X509_Store::add_cert, add_cert_ols()) - .def("validate", &X509_Store::validate_cert, validate_cert_ols()) - .def("get_certs", &X509_Store::get_certs) - .def("add_crl", &X509_Store::add_crl); - - python::class_ - ("Search_Func") - .def("match", python::pure_virtual(&X509_Store::Search_Func::match)); - } - } -- cgit v1.2.3 From a7b4116a35fcf749fb92c32027bb69e1e371d659 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 9 Oct 2009 19:05:22 +0000 Subject: Bump version to 1.9.1-rc1 --- configure.py | 2 +- doc/log.txt | 2 +- readme.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 857cab7e7..1590e8559 100755 --- a/configure.py +++ b/configure.py @@ -39,7 +39,7 @@ class BuildConfigurationInformation(object): version_minor = 9 version_patch = 1 version_so_patch = 1 - version_suffix = '-dev' + version_suffix = '-rc1' version_string = '%d.%d.%d%s' % ( version_major, version_minor, version_patch, version_suffix) diff --git a/doc/log.txt b/doc/log.txt index 3dac507ca..9ebf3a2ad 100644 --- a/doc/log.txt +++ b/doc/log.txt @@ -1,5 +1,5 @@ -* 1.9.1-pre, 2009-??-?? +* 1.9.1-rc1, 2009-10-09 - Better support for Python and Perl wrappers - Add an implementation of Blue Midnight Wish (Round 2 tweak version) - Add threshold secret sharing (draft-mcgrew-tss-02) diff --git a/readme.txt b/readme.txt index 307344cea..b592da41d 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -Botan 1.9.1-pre 2009-??-?? +Botan 1.9.1-rc1 2009-10-09 Botan is a C++ class library for performing a wide variety of cryptographic operations. -- cgit v1.2.3 From afc93aafb9ead8264db251479ac0c4f698a8daf7 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 19 Oct 2009 20:13:06 +0000 Subject: Be more forgiving of names passed with --cpu --- configure.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 1d7e1451d..b4e7f8895 100755 --- a/configure.py +++ b/configure.py @@ -600,7 +600,15 @@ class OsInfo(object): ['TARGET_OS_HAS_' + feat.upper() for feat in self.target_features] +def fixup_proc_name(proc): + proc = proc.lower().replace(' ', '') + for junk in ['(tm)', '(r)']: + proc = proc.replace(junk, '') + return proc + def canon_processor(archinfo, proc): + proc = fixup_proc_name(proc) + for ainfo in archinfo.values(): if ainfo.basename == proc or proc in ainfo.aliases: return (ainfo.basename, ainfo.basename) @@ -617,12 +625,7 @@ def guess_processor(archinfo): if base_proc == '': raise Exception('Could not determine target CPU; set with --cpu') - full_proc = platform.processor().lower().replace(' ', '') - for junk in ['(tm)', '(r)']: - full_proc = full_proc.replace(junk, '') - - if full_proc == '': - full_proc = base_proc + full_proc = fixup_proc_name(platform.processor()) or base_proc for ainfo in archinfo.values(): if ainfo.basename == base_proc or base_proc in ainfo.aliases: -- cgit v1.2.3 From 211ebf5f32111246dd42c39e5bb367b5c29e1746 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 21 Oct 2009 05:52:44 +0000 Subject: Disable traceback --- configure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index b4e7f8895..bdf5ee4b3 100755 --- a/configure.py +++ b/configure.py @@ -1189,7 +1189,7 @@ if __name__ == '__main__': main() except Exception, e: print >>sys.stderr, e - import traceback - traceback.print_exc(file=sys.stderr) + #import traceback + #traceback.print_exc(file=sys.stderr) sys.exit(1) sys.exit(0) -- cgit v1.2.3 From 8addfadd8cb724158fefd4f9e36a177b2290d11f Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 21 Oct 2009 06:17:03 +0000 Subject: Reset version as 1.9.1-dev instead of -rc1 --- configure.py | 2 +- doc/log.txt | 2 +- readme.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index bdf5ee4b3..c6ab1f99c 100755 --- a/configure.py +++ b/configure.py @@ -39,7 +39,7 @@ class BuildConfigurationInformation(object): version_minor = 9 version_patch = 1 version_so_patch = 1 - version_suffix = '-rc1' + version_suffix = '-dev' version_string = '%d.%d.%d%s' % ( version_major, version_minor, version_patch, version_suffix) diff --git a/doc/log.txt b/doc/log.txt index 50e769a9f..1ce3a8caa 100644 --- a/doc/log.txt +++ b/doc/log.txt @@ -1,5 +1,5 @@ -* 1.9.1-rc1, 2009-10-09 +* 1.9.1-dev, 2009-??-?? - Better support for Python and Perl wrappers - Add an implementation of Blue Midnight Wish (Round 2 tweak version) - Add threshold secret sharing (draft-mcgrew-tss-02) diff --git a/readme.txt b/readme.txt index b592da41d..4ee618af0 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -Botan 1.9.1-rc1 2009-10-09 +Botan 1.9.1-dev 2009-??-?? Botan is a C++ class library for performing a wide variety of cryptographic operations. -- cgit v1.2.3 From 1bbab4ef0544388a46f02ab2985ada55a82c0e9d Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 23 Oct 2009 13:55:08 +0000 Subject: Update docs for 1.9.1 release 2009-10-23 --- configure.py | 2 +- doc/log.txt | 3 ++- readme.txt | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index c6ab1f99c..45979aa4c 100755 --- a/configure.py +++ b/configure.py @@ -39,7 +39,7 @@ class BuildConfigurationInformation(object): version_minor = 9 version_patch = 1 version_so_patch = 1 - version_suffix = '-dev' + version_suffix = '' version_string = '%d.%d.%d%s' % ( version_major, version_minor, version_patch, version_suffix) diff --git a/doc/log.txt b/doc/log.txt index 20886a708..c1913764f 100644 --- a/doc/log.txt +++ b/doc/log.txt @@ -1,11 +1,12 @@ -* 1.9.1-dev, 2009-??-?? +* 1.9.1, 2009-10-23 - Better support for Python and Perl wrappers - Add an implementation of Blue Midnight Wish (Round 2 tweak version) - Modify Skein-512 to match the tweaked 1.2 specification - Add threshold secret sharing (draft-mcgrew-tss-02) - Add runtime cpu feature detection for x86/x86-64 - Add code for general runtime self testing for hashes, MACs, and ciphers + - Optimize XTEA; twice as fast as before on Core2 and Opteron - New parsing code for SCAN algorithm names - Enable SSE2 optimizations under Visual C++ - Remove all use of C++ exception specifications diff --git a/readme.txt b/readme.txt index 4ee618af0..bc7c7fc71 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -Botan 1.9.1-dev 2009-??-?? +Botan 1.9.1 2009-10-23 Botan is a C++ class library for performing a wide variety of cryptographic operations. -- cgit v1.2.3 From 3b2eef9bd141e70b7dfe90fe8cc57d6561733fbc Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 26 Oct 2009 02:44:24 +0000 Subject: Tick version to 1.9.2-dev --- configure.py | 6 +++--- doc/log.txt | 2 ++ readme.txt | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 45979aa4c..88eb45963 100755 --- a/configure.py +++ b/configure.py @@ -37,9 +37,9 @@ class BuildConfigurationInformation(object): """ version_major = 1 version_minor = 9 - version_patch = 1 - version_so_patch = 1 - version_suffix = '' + version_patch = 2 + version_so_patch = 2 + version_suffix = '-dev' version_string = '%d.%d.%d%s' % ( version_major, version_minor, version_patch, version_suffix) diff --git a/doc/log.txt b/doc/log.txt index c1913764f..41405c6ad 100644 --- a/doc/log.txt +++ b/doc/log.txt @@ -1,4 +1,6 @@ +* 1.9.2-dev, ????-??-?? + * 1.9.1, 2009-10-23 - Better support for Python and Perl wrappers - Add an implementation of Blue Midnight Wish (Round 2 tweak version) diff --git a/readme.txt b/readme.txt index bc7c7fc71..644c6a4a8 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -Botan 1.9.1 2009-10-23 +Botan 1.9.2-dev, ????-??-?? Botan is a C++ class library for performing a wide variety of cryptographic operations. -- cgit v1.2.3