[Cryptech-Commits] [sw/pkcs11] branch ksng updated: Python interface API will need to be cryptech.py11 for installation.

git at cryptech.is git at cryptech.is
Fri Apr 14 21:13:38 UTC 2017


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch ksng
in repository sw/pkcs11.

The following commit(s) were added to refs/heads/ksng by this push:
     new ce8ba92  Python interface API will need to be cryptech.py11 for installation.
ce8ba92 is described below

commit ce8ba928172071dc89cc1fc0520f840211bbfa0d
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Fri Apr 14 15:22:25 2017 -0400

    Python interface API will need to be cryptech.py11 for installation.
---
 Makefile                                 | 10 +++++-----
 README.md                                |  8 ++++----
 cryptech/__init__.py                     |  0
 {py11 => cryptech/py11}/__init__.py      |  2 +-
 {py11 => cryptech/py11}/attribute_map.py |  0
 {py11 => cryptech/py11}/attributes.py    |  0
 {py11 => cryptech/py11}/constants.py     |  0
 {py11 => cryptech/py11}/exceptions.py    |  0
 {py11 => cryptech/py11}/mutex.py         |  9 +++++----
 {py11 => cryptech/py11}/prototypes.py    |  0
 {py11 => cryptech/py11}/types.py         |  0
 scripts/py11-test.py                     |  4 ++--
 scripts/time-signature.py                |  6 +++---
 unit_tests.py                            |  6 +++---
 14 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/Makefile b/Makefile
index 4669c3b..954380e 100644
--- a/Makefile
+++ b/Makefile
@@ -138,10 +138,10 @@ ifndef OBJCOPY
   OBJCOPY := objcopy
 endif
 
-all: ${SONAME} p11util py11/attribute_map.py
+all: ${SONAME} p11util cryptech/py11/attribute_map.py
 
 clean:
-	rm -rf *.o ${SONAME}* p11util attributes.h py11/*.pyc
+	rm -rf *.o ${SONAME}* p11util attributes.h cryptech/*.pyc cryptech/py11/*.pyc
 	${MAKE} -C libtfm  $@
 	${MAKE} -C libhal  $@
 
@@ -159,8 +159,8 @@ ${LIBHAL_BLD}/libhal.a: .FORCE ${LIBTFM_BLD}/libtfm.a
 attributes.h: attributes.yaml scripts/build-attributes Makefile
 	python scripts/build-attributes attributes.yaml attributes.h
 
-py11/attribute_map.py: attributes.yaml scripts/build-py11-attributes Makefile
-	python scripts/build-py11-attributes attributes.yaml py11/attribute_map.py
+cryptech/py11/attribute_map.py: attributes.yaml scripts/build-py11-attributes Makefile
+	python scripts/build-py11-attributes attributes.yaml $@
 
 pkcs11.o: pkcs11.c attributes.h ${LIBS}
 	${CC} ${CFLAGS} -c $<
@@ -190,7 +190,7 @@ tags: TAGS
 TAGS: *.[ch]
 	etags $^
 
-# Basic testing, via the Python unittest library and our py11 interface code
+# Basic testing, via the Python unittest library and our cryptech.py11 interface code
 
 test: all
 	python unit_tests.py
diff --git a/README.md b/README.md
index 7cee87d..0671398 100644
--- a/README.md
+++ b/README.md
@@ -11,10 +11,10 @@ only himself, but all of his friends, relations, and casual
 acquaintances.
 
 Along with the PKCS #11 library itself, the package includes a
-companion Python interface ("py11"), which uses the ctypes module from
-the Python standard library to talk to the PKCS #11 implementation.
-The Python implementation is intended primarily to simplify testing
-the C code.
+companion Python interface ("cryptech.py11"), which uses the ctypes
+module from the Python standard library to talk to the PKCS #11
+implementation.  The Python implementation is intended primarily to
+simplify testing the C code, but can be used for other purposes.
 
 
 ## Novel design features ##
diff --git a/cryptech/__init__.py b/cryptech/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/py11/__init__.py b/cryptech/py11/__init__.py
similarity index 99%
rename from py11/__init__.py
rename to cryptech/py11/__init__.py
index da79e34..46b62d6 100644
--- a/py11/__init__.py
+++ b/cryptech/py11/__init__.py
@@ -19,7 +19,7 @@ class PKCS11 (object):
   PKCS #11 API object, encapsulating the PKCS #11 library itself.
   Sample usage:
 
-    from py11 import *
+    from cryptech.py11 import *
 
     p11 = PKCS11()
     p11.C_Initialize()
diff --git a/py11/attribute_map.py b/cryptech/py11/attribute_map.py
similarity index 100%
rename from py11/attribute_map.py
rename to cryptech/py11/attribute_map.py
diff --git a/py11/attributes.py b/cryptech/py11/attributes.py
similarity index 100%
rename from py11/attributes.py
rename to cryptech/py11/attributes.py
diff --git a/py11/constants.py b/cryptech/py11/constants.py
similarity index 100%
rename from py11/constants.py
rename to cryptech/py11/constants.py
diff --git a/py11/exceptions.py b/cryptech/py11/exceptions.py
similarity index 100%
rename from py11/exceptions.py
rename to cryptech/py11/exceptions.py
diff --git a/py11/mutex.py b/cryptech/py11/mutex.py
similarity index 91%
rename from py11/mutex.py
rename to cryptech/py11/mutex.py
index f71e006..da2123c 100644
--- a/py11/mutex.py
+++ b/cryptech/py11/mutex.py
@@ -1,6 +1,6 @@
 """
-Optional Python mutex implementation for py11 library, using the
-threading.Lock primitive to provide the mutex itself.
+Optional Python mutex implementation for cryptech.py11 library,
+using the threading.Lock primitive to provide the mutex itself.
 
 Most of the code in this module has to do with mapping between the
 Python and PKCS #11 APIs.
@@ -13,12 +13,13 @@ test the API.
 
 Sample usage:
 
-  from p11 import *
-  from py11.mutex import MutexDB
+  from cryptech.py11       import *
+  from cryptech.py11.mutex import MutexDB
 
   p11 = PKCS11()
   mdb = MutexDB()
   p11.C_Initialize(0, mdb.create, mdb.destroy, mdb.lock, mdb.unlock)
+
 """
 
 from struct      import pack, unpack
diff --git a/py11/prototypes.py b/cryptech/py11/prototypes.py
similarity index 100%
rename from py11/prototypes.py
rename to cryptech/py11/prototypes.py
diff --git a/py11/types.py b/cryptech/py11/types.py
similarity index 100%
rename from py11/types.py
rename to cryptech/py11/types.py
diff --git a/scripts/py11-test.py b/scripts/py11-test.py
index 04372ec..87af29d 100644
--- a/scripts/py11-test.py
+++ b/scripts/py11-test.py
@@ -1,7 +1,7 @@
 # Initial test script using py11.  About 2/3 testing PKCS #11, 1/3
 # doodles figuring out what else py11 should be automating for us.
 
-from py11 import *
+from cryptech.py11 import *
 from struct import pack, unpack
 
 def show_token(i, t, strip = True):
@@ -77,7 +77,7 @@ elif False:
 
 else:
   print "Using our own pseudo-MUTEXes"
-  from py11.mutex import MutexDB
+  from cryptech.py11.mutex import MutexDB
   mdb = MutexDB()
   p11.C_Initialize(0, mdb.create, mdb.destroy, mdb.lock, mdb.unlock)
 
diff --git a/scripts/time-signature.py b/scripts/time-signature.py
index eef646d..99ec718 100755
--- a/scripts/time-signature.py
+++ b/scripts/time-signature.py
@@ -15,12 +15,12 @@ from Crypto.Hash.SHA384 import SHA384Hash as SHA384
 from Crypto.Hash.SHA512 import SHA512Hash as SHA512
 
 try:
-    from py11 import *
+    from cryptech.py11 import *
 except ImportError:
-    # Kludge to let us run script from repo without installing py11
+    # Kludge to let us run script from repo without installing cryptech.py11
     from os.path import dirname, abspath
     sys.path.append(dirname(dirname(abspath(sys.argv[0]))))
-    from py11 import *
+    from cryptech.py11 import *
 
 
 if platform.system() == "Darwin":
diff --git a/unit_tests.py b/unit_tests.py
index 2fc9d3f..1a7470d 100644
--- a/unit_tests.py
+++ b/unit_tests.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 """
-PKCS #11 unit tests, using Py11 and the Python unit_test framework.
+PKCS #11 unit tests, using cryptech.py11 and the Python unit_test framework.
 """
 
 import unittest
@@ -9,8 +9,8 @@ import datetime
 import platform
 import sys
 
-from py11 import *
-from py11.mutex import MutexDB
+from cryptech.py11 import *
+from cryptech.py11.mutex import MutexDB
 
 try:
     from Crypto.Util.number     import inverse

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list