[pkg-opensc-commit] [libp11] 40/86: Initial EC testing framework

Eric Dorland eric at moszumanska.debian.org
Sun Jul 24 21:40:20 UTC 2016


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

eric pushed a commit to branch master
in repository libp11.

commit e9e74a5fe66753d18ee44e58d22b41d0a3a9101d
Author: Michał Trojnara <Michal.Trojnara at stunnel.org>
Date:   Tue Feb 9 09:39:03 2016 +0100

    Initial EC testing framework
---
 .travis.yml                                        |   1 +
 tests/Makefile.am                                  |  23 ++++++++++++---------
 tests/ec-cert.der                                  | Bin 0 -> 384 bytes
 tests/{common.sh => ec-common.sh}                  |  13 ++++++------
 tests/ec-prvkey.der                                | Bin 0 -> 121 bytes
 tests/ec-pubkey.der                                | Bin 0 -> 91 bytes
 tests/{testfork.softhsm => ec-testfork.softhsm}    |   2 +-
 tests/{cert.der => rsa-cert.der}                   | Bin
 tests/{common.sh => rsa-common.sh}                 |   6 +++---
 tests/{evp-sign.softhsm => rsa-evp-sign.softhsm}   |   2 +-
 tests/{key.der => rsa-prvkey.der}                  | Bin
 tests/{pubkey.der => rsa-pubkey.der}               | Bin
 tests/{testfork.softhsm => rsa-testfork.softhsm}   |   2 +-
 ...stlistkeys.softhsm => rsa-testlistkeys.softhsm} |   2 +-
 .../{testpkcs11.softhsm => rsa-testpkcs11.softhsm} |   2 +-
 15 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 2bf20fe..a6f0c4f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,6 +7,7 @@ compiler:
   - gcc
 
 before_script:
+  - openssl version -a
   - ./.travis.sh
   - touch config.rpath && autoreconf -fvi && ./configure --enable-strict --enable-pedantic
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 89acb8b..28e607a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,25 +1,28 @@
-EXTRA_DIST = cert.der key.der common.sh
+EXTRA_DIST = engines.cnf.in rsa-common.sh ec-common.sh
 
 AM_CFLAGS = $(OPENSSL_CFLAGS)
 AM_CPPFLAGS = \
-	-I$(top_srcdir)/ \
+	-I$(top_srcdir) \
 	-I$(top_srcdir)/src \
-	-I$(top_builddir)/
+	-I$(top_builddir)
 
 AM_LDFLAGS = -no-install
 LDADD = ../src/libp11.la $(OPENSSL_LIBS)
 
 check_PROGRAMS = fork-test evp-sign
-dist_check_SCRIPTS = testpkcs11.softhsm testfork.softhsm testlistkeys.softhsm \
-	evp-sign.softhsm
-dist_check_DATA = engines.cnf.in cert.der key.der pubkey.der
+dist_check_SCRIPTS = \
+	rsa-testpkcs11.softhsm rsa-testfork.softhsm rsa-testlistkeys.softhsm rsa-evp-sign.softhsm \
+	ec-testfork.softhsm
+dist_check_DATA = \
+	rsa-cert.der rsa-prvkey.der rsa-pubkey.der \
+	ec-cert.der ec-prvkey.der ec-pubkey.der
 
 TESTS = $(dist_check_SCRIPTS)
 
-TESTS_ENVIRONMENT =						\
-	LC_ALL="C"						\
-	EXEEXT=$(EXEEXT)					\
-	top_builddir="$(top_builddir)"				\
+TESTS_ENVIRONMENT =	\
+	LC_ALL="C" \
+	EXEEXT=$(EXEEXT) \
+	top_builddir="$(top_builddir)" \
 	srcdir="$(srcdir)"
 
 # vim: set noexpandtab:
diff --git a/tests/ec-cert.der b/tests/ec-cert.der
new file mode 100644
index 0000000..3b9490f
Binary files /dev/null and b/tests/ec-cert.der differ
diff --git a/tests/common.sh b/tests/ec-common.sh
similarity index 90%
copy from tests/common.sh
copy to tests/ec-common.sh
index 592558c..8ea2ba5 100755
--- a/tests/common.sh
+++ b/tests/ec-common.sh
@@ -94,17 +94,18 @@ PUK=1234
 init_card $PIN $PUK
 
 # generate key in token
-pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/key.der -y privkey >/dev/null
+pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/ec-prvkey.der -y privkey >/dev/null
 if test $? != 0;then
 	exit 1;
 fi
 
-pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/pubkey.der -y pubkey >/dev/null
-if test $? != 0;then
-	exit 1;
-fi
+# pkcs11-tool currently only supports RSA public keys
+#pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/ec-pubkey.der -y pubkey >/dev/null
+#if test $? != 0;then
+#	exit 1;
+#fi
 
-pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/cert.der -y cert >/dev/null
+pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/ec-cert.der -y cert >/dev/null
 if test $? != 0;then
 	exit 1;
 fi
diff --git a/tests/ec-prvkey.der b/tests/ec-prvkey.der
new file mode 100644
index 0000000..f3df806
Binary files /dev/null and b/tests/ec-prvkey.der differ
diff --git a/tests/ec-pubkey.der b/tests/ec-pubkey.der
new file mode 100644
index 0000000..7cca2a8
Binary files /dev/null and b/tests/ec-pubkey.der differ
diff --git a/tests/testfork.softhsm b/tests/ec-testfork.softhsm
similarity index 97%
copy from tests/testfork.softhsm
copy to tests/ec-testfork.softhsm
index c08ca56..961424a 100755
--- a/tests/testfork.softhsm
+++ b/tests/ec-testfork.softhsm
@@ -19,7 +19,7 @@
 
 outdir="output.$$"
 
-. ${srcdir}/common.sh
+. ${srcdir}/ec-common.sh
 
 ./fork-test $ADDITIONAL_PARAM $PIN
 if test $? != 0;then
diff --git a/tests/cert.der b/tests/rsa-cert.der
similarity index 100%
rename from tests/cert.der
rename to tests/rsa-cert.der
diff --git a/tests/common.sh b/tests/rsa-common.sh
similarity index 94%
rename from tests/common.sh
rename to tests/rsa-common.sh
index 592558c..34ee8ef 100755
--- a/tests/common.sh
+++ b/tests/rsa-common.sh
@@ -94,17 +94,17 @@ PUK=1234
 init_card $PIN $PUK
 
 # generate key in token
-pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/key.der -y privkey >/dev/null
+pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/rsa-prvkey.der -y privkey >/dev/null
 if test $? != 0;then
 	exit 1;
 fi
 
-pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/pubkey.der -y pubkey >/dev/null
+pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/rsa-pubkey.der -y pubkey >/dev/null
 if test $? != 0;then
 	exit 1;
 fi
 
-pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/cert.der -y cert >/dev/null
+pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${srcdir}/rsa-cert.der -y cert >/dev/null
 if test $? != 0;then
 	exit 1;
 fi
diff --git a/tests/evp-sign.softhsm b/tests/rsa-evp-sign.softhsm
similarity index 98%
rename from tests/evp-sign.softhsm
rename to tests/rsa-evp-sign.softhsm
index 210427c..6efacec 100755
--- a/tests/evp-sign.softhsm
+++ b/tests/rsa-evp-sign.softhsm
@@ -18,7 +18,7 @@
 
 outdir="output.$$"
 
-. ${srcdir}/common.sh
+. ${srcdir}/rsa-common.sh
 
 # This uses the engine for basic sign-verify operation.
 
diff --git a/tests/key.der b/tests/rsa-prvkey.der
similarity index 100%
rename from tests/key.der
rename to tests/rsa-prvkey.der
diff --git a/tests/pubkey.der b/tests/rsa-pubkey.der
similarity index 100%
rename from tests/pubkey.der
rename to tests/rsa-pubkey.der
diff --git a/tests/testfork.softhsm b/tests/rsa-testfork.softhsm
similarity index 97%
rename from tests/testfork.softhsm
rename to tests/rsa-testfork.softhsm
index c08ca56..0643e96 100755
--- a/tests/testfork.softhsm
+++ b/tests/rsa-testfork.softhsm
@@ -19,7 +19,7 @@
 
 outdir="output.$$"
 
-. ${srcdir}/common.sh
+. ${srcdir}/rsa-common.sh
 
 ./fork-test $ADDITIONAL_PARAM $PIN
 if test $? != 0;then
diff --git a/tests/testlistkeys.softhsm b/tests/rsa-testlistkeys.softhsm
similarity index 97%
rename from tests/testlistkeys.softhsm
rename to tests/rsa-testlistkeys.softhsm
index 47c6bf4..9494f9d 100755
--- a/tests/testlistkeys.softhsm
+++ b/tests/rsa-testlistkeys.softhsm
@@ -19,7 +19,7 @@
 
 outdir="output.$$"
 
-. ${srcdir}/common.sh
+. ${srcdir}/rsa-common.sh
 
 ../examples/listkeys $ADDITIONAL_PARAM $PIN
 if test $? != 0;then
diff --git a/tests/testpkcs11.softhsm b/tests/rsa-testpkcs11.softhsm
similarity index 97%
rename from tests/testpkcs11.softhsm
rename to tests/rsa-testpkcs11.softhsm
index fe55fb7..6b8d685 100755
--- a/tests/testpkcs11.softhsm
+++ b/tests/rsa-testpkcs11.softhsm
@@ -20,7 +20,7 @@
 
 outdir="output.$$"
 
-. ${srcdir}/common.sh
+. ${srcdir}/rsa-common.sh
 
 ../examples/auth $ADDITIONAL_PARAM $PIN
 if test $? != 0;then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/libp11.git



More information about the pkg-opensc-commit mailing list