aboutsummaryrefslogtreecommitdiffstats
path: root/src/python
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-03-28 11:32:37 -0400
committerJack Lloyd <[email protected]>2017-03-28 12:13:23 -0400
commit3a2bdcf10e98ecdfb9bb4943cb09d5baf7bf6ba1 (patch)
tree968c74c7d7018e4f3d5b1c796315940d0ed172d2 /src/python
parent5b0481cb93745c6b56d923698b164d2289559eb5 (diff)
Expose BigInt API subset to C API
Also adds RSA key constructors using BN
Diffstat (limited to 'src/python')
-rwxr-xr-xsrc/python/botan2.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/python/botan2.py b/src/python/botan2.py
index 399680b86..9d04b83db 100755
--- a/src/python/botan2.py
+++ b/src/python/botan2.py
@@ -3,7 +3,7 @@
"""Python wrapper of the botan crypto library
http://botan.randombit.net
-(C) 2015 Jack Lloyd
+(C) 2015,2017 Jack Lloyd
(C) 2015 Uri Blumenthal (extensions and patches)
Botan is released under the Simplified BSD License (see license.txt)
@@ -11,10 +11,8 @@ Botan is released under the Simplified BSD License (see license.txt)
This module uses the ctypes module and is usable by programs running
under at least CPython 2.7, CPython 3.4 and 3.5, or PyPy.
-It uses botan's ffi module, which exposes a C API. Right now the C API
-is versioned but as it is still in evolution, no provisions are made
-for handling more than a single API version in this module. So this
-module should be used only with the library version it accompanied.
+It uses botan's ffi module, which exposes a C API. It suppports all
+versions of Botan >= 2.0
"""
import sys
@@ -31,11 +29,8 @@ if sys.platform == 'darwin':
else:
botan = CDLL('libbotan-2.so')
-expected_api_rev = 20151015
-botan_api_rev = botan.botan_ffi_api_version()
-
-if botan_api_rev != expected_api_rev:
- raise Exception("Bad botan API rev got %d expected %d" % (botan_api_rev, expected_api_rev))
+if botan.botan_ffi_supports_api(20151015) == False:
+ raise Exception("The Botan library does not support the FFI API expected by this version of the Python module")
# Internal utilities
def _call_fn_returning_vec(guess, fn):