summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-07-28 13:04:31 +0200
committerGitLab <gitlab@gitlab.com>2016-07-28 13:19:16 +0000
commiteda36b12d60a515f4f23321f44eb06b99d19e0ad (patch)
tree133af94f4d361ab72502c45e3fa63705833387b3 /tests
parent5e70830cd863b4090727dc51641ef617a1b92c5e (diff)
downloadgnutls-eda36b12d60a515f4f23321f44eb06b99d19e0ad.tar.gz
tests: key-tests: moved data files into data/ subdir
Diffstat (limited to 'tests')
-rw-r--r--tests/key-tests/Makefile.am8
-rw-r--r--tests/key-tests/data/ca-gnutls-keyid.pem (renamed from tests/key-tests/ca-gnutls-keyid.pem)0
-rw-r--r--tests/key-tests/data/ca-no-keyid.pem (renamed from tests/key-tests/ca-no-keyid.pem)0
-rw-r--r--tests/key-tests/data/ca-weird-keyid.pem (renamed from tests/key-tests/ca-weird-keyid.pem)0
-rw-r--r--tests/key-tests/data/key-ca-1234.p8 (renamed from tests/key-tests/key-ca-1234.p8)0
-rw-r--r--tests/key-tests/data/key-ca-empty.p8 (renamed from tests/key-tests/key-ca-empty.p8)0
-rw-r--r--tests/key-tests/data/key-ca-null.p8 (renamed from tests/key-tests/key-ca-null.p8)0
-rw-r--r--tests/key-tests/data/key-ca.pem (renamed from tests/key-tests/key-ca.pem)0
-rw-r--r--tests/key-tests/data/key-ecc.p8 (renamed from tests/key-tests/key-ecc.p8)0
-rw-r--r--tests/key-tests/data/key-ecc.pem (renamed from tests/key-tests/key-ecc.pem)0
-rw-r--r--tests/key-tests/data/key-user.pem (renamed from tests/key-tests/key-user.pem)0
-rw-r--r--tests/key-tests/data/openssl-key-ecc.p8 (renamed from tests/key-tests/openssl-key-ecc.p8)0
-rwxr-xr-xtests/key-tests/key-id14
-rwxr-xr-xtests/key-tests/pkcs840
14 files changed, 33 insertions, 29 deletions
diff --git a/tests/key-tests/Makefile.am b/tests/key-tests/Makefile.am
index d158a3c635..fdf3c7e16b 100644
--- a/tests/key-tests/Makefile.am
+++ b/tests/key-tests/Makefile.am
@@ -19,10 +19,10 @@
# along with this file; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-EXTRA_DIST = README key-ca.pem key-user.pem \
- ca-gnutls-keyid.pem ca-no-keyid.pem ca-weird-keyid.pem \
- key-ca-1234.p8 key-ca-empty.p8 key-ca-null.p8 \
- openssl-key-ecc.p8 key-ecc.p8 key-ecc.pem suppressions.valgrind
+EXTRA_DIST = README data/key-ca.pem data/key-user.pem \
+ data/ca-gnutls-keyid.pem data/ca-no-keyid.pem data/ca-weird-keyid.pem \
+ data/key-ca-1234.p8 data/key-ca-empty.p8 data/key-ca-null.p8 \
+ data/openssl-key-ecc.p8 data/key-ecc.p8 data/key-ecc.pem suppressions.valgrind
dist_check_SCRIPTS = key-id pkcs8
diff --git a/tests/key-tests/ca-gnutls-keyid.pem b/tests/key-tests/data/ca-gnutls-keyid.pem
index fdb7520a48..fdb7520a48 100644
--- a/tests/key-tests/ca-gnutls-keyid.pem
+++ b/tests/key-tests/data/ca-gnutls-keyid.pem
diff --git a/tests/key-tests/ca-no-keyid.pem b/tests/key-tests/data/ca-no-keyid.pem
index 50675e420b..50675e420b 100644
--- a/tests/key-tests/ca-no-keyid.pem
+++ b/tests/key-tests/data/ca-no-keyid.pem
diff --git a/tests/key-tests/ca-weird-keyid.pem b/tests/key-tests/data/ca-weird-keyid.pem
index 6ecfef4231..6ecfef4231 100644
--- a/tests/key-tests/ca-weird-keyid.pem
+++ b/tests/key-tests/data/ca-weird-keyid.pem
diff --git a/tests/key-tests/key-ca-1234.p8 b/tests/key-tests/data/key-ca-1234.p8
index dc6b1daf9a..dc6b1daf9a 100644
--- a/tests/key-tests/key-ca-1234.p8
+++ b/tests/key-tests/data/key-ca-1234.p8
diff --git a/tests/key-tests/key-ca-empty.p8 b/tests/key-tests/data/key-ca-empty.p8
index f86433fa65..f86433fa65 100644
--- a/tests/key-tests/key-ca-empty.p8
+++ b/tests/key-tests/data/key-ca-empty.p8
diff --git a/tests/key-tests/key-ca-null.p8 b/tests/key-tests/data/key-ca-null.p8
index e58483e952..e58483e952 100644
--- a/tests/key-tests/key-ca-null.p8
+++ b/tests/key-tests/data/key-ca-null.p8
diff --git a/tests/key-tests/key-ca.pem b/tests/key-tests/data/key-ca.pem
index 88e775c78c..88e775c78c 100644
--- a/tests/key-tests/key-ca.pem
+++ b/tests/key-tests/data/key-ca.pem
diff --git a/tests/key-tests/key-ecc.p8 b/tests/key-tests/data/key-ecc.p8
index 189ab0144f..189ab0144f 100644
--- a/tests/key-tests/key-ecc.p8
+++ b/tests/key-tests/data/key-ecc.p8
diff --git a/tests/key-tests/key-ecc.pem b/tests/key-tests/data/key-ecc.pem
index 57e40c7e5b..57e40c7e5b 100644
--- a/tests/key-tests/key-ecc.pem
+++ b/tests/key-tests/data/key-ecc.pem
diff --git a/tests/key-tests/key-user.pem b/tests/key-tests/data/key-user.pem
index e375860987..e375860987 100644
--- a/tests/key-tests/key-user.pem
+++ b/tests/key-tests/data/key-user.pem
diff --git a/tests/key-tests/openssl-key-ecc.p8 b/tests/key-tests/data/openssl-key-ecc.p8
index 4fc966f328..4fc966f328 100644
--- a/tests/key-tests/openssl-key-ecc.p8
+++ b/tests/key-tests/data/openssl-key-ecc.p8
diff --git a/tests/key-tests/key-id b/tests/key-tests/key-id
index b2158ba936..f5408b0982 100755
--- a/tests/key-tests/key-id
+++ b/tests/key-tests/key-id
@@ -24,14 +24,16 @@ set -e
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
+TMPFILE=key-id.$$.tmp
+TEMPLFILE=tmpl.$$.tmp
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=1"
fi
-PARAMS="--generate-certificate --load-privkey '${srcdir}/key-user.pem' --load-ca-privkey '${srcdir}/key-ca.pem' --template tmpl"
+PARAMS="--generate-certificate --load-privkey '${srcdir}/data/key-user.pem' --load-ca-privkey '${srcdir}/data/key-ca.pem' --template $TEMPLFILE"
-echo "serial = 0" > tmpl
+echo "serial = 0" > $TEMPLFILE
#eval "${CERTTOOL}" ${PARAMS} --load-ca-certificate $srcdir/ca-gnutls-keyid.pem \
# --outfile user-gnutls-keyid.pem 2> /dev/null
@@ -39,10 +41,10 @@ echo "serial = 0" > tmpl
#eval "${CERTTOOL}" ${PARAMS} --load-ca-certificate $srcdir/ca-no-keyid.pem \
# --outfile user-no-keyid.pem 2> /dev/null
-eval ${VALGRIND} "${CERTTOOL}" ${PARAMS} --load-ca-certificate "${srcdir}/ca-weird-keyid.pem" \
- --outfile user-weird-keyid.pem
+eval ${VALGRIND} "${CERTTOOL}" ${PARAMS} --load-ca-certificate "${srcdir}/data/ca-weird-keyid.pem" \
+ --outfile $TMPFILE
-if ${VALGRIND} "${CERTTOOL}" -i < user-weird-keyid.pem \
+if ${VALGRIND} "${CERTTOOL}" -i < $TMPFILE \
| grep '7a2c7a6097460603cbfb28e8e219df18deeb4e0d' > /dev/null; then
:
else
@@ -50,7 +52,7 @@ else
exit 1;
fi
-rm -f tmpl user-gnutls-keyid.pem user-no-keyid.pem user-weird-keyid.pem
+rm -f $TEMPLFILE $TMPFILE
# We're done.
exit 0
diff --git a/tests/key-tests/pkcs8 b/tests/key-tests/pkcs8
index 34b0f45095..0bf51a2340 100755
--- a/tests/key-tests/pkcs8
+++ b/tests/key-tests/pkcs8
@@ -22,15 +22,17 @@ srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
GREP="${GREP:-grep}"
+TMPFILE=tmp-key-ca.$$.p8
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=1"
fi
# check keys with password
-${VALGRIND} "${CERTTOOL}" --to-p8 --load-privkey "${srcdir}/key-ca.pem" --password "1234" \
- --outfile tmp-key-ca.p8 2>/dev/null
+${VALGRIND} "${CERTTOOL}" --to-p8 --load-privkey "${srcdir}/data/key-ca.pem" --password "1234" \
+ --outfile $TMPFILE 2>/dev/null
-${GREP} "BEGIN ENCRYPTED PRIVATE KEY" tmp-key-ca.p8 >/dev/null 2>&1
+${GREP} "BEGIN ENCRYPTED PRIVATE KEY" $TMPFILE >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -38,7 +40,7 @@ if test "${rc}" != "0"; then
exit ${rc}
fi
-${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/key-ca.pem" --password "1234" >/dev/null 2>&1
+${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/data/key-ca.pem" --password "1234" >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -46,7 +48,7 @@ if test "${rc}" != "0"; then
exit ${rc}
fi
-${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/key-ca-1234.p8" --password "1234" >/dev/null 2>&1
+${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/data/key-ca-1234.p8" --password "1234" >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -55,10 +57,10 @@ if test "${rc}" != "0"; then
fi
#keys encrypted with empty password
-${VALGRIND} "${CERTTOOL}" --to-p8 --load-privkey "${srcdir}/key-ca.pem" --password "" \
- --outfile tmp-key-ca.p8 2>/dev/null
+${VALGRIND} "${CERTTOOL}" --to-p8 --load-privkey "${srcdir}/data/key-ca.pem" --password "" \
+ --outfile $TMPFILE 2>/dev/null
-${GREP} "BEGIN PRIVATE KEY" tmp-key-ca.p8 >/dev/null 2>&1
+${GREP} "BEGIN PRIVATE KEY" $TMPFILE >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -66,7 +68,7 @@ if test "${rc}" != "0"; then
exit ${rc}
fi
-${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/key-ca.pem" --password "" >/dev/null 2>&1
+${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/data/key-ca.pem" --password "" >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -74,7 +76,7 @@ if test "${rc}" != "0"; then
exit ${rc}
fi
-${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/key-ca-empty.p8" --password "" >/dev/null 2>&1
+${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/data/key-ca-empty.p8" --password "" >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -83,10 +85,10 @@ if test "${rc}" != "0"; then
fi
#keys encrypted with null password
-${VALGRIND} "${CERTTOOL}" --to-p8 --load-privkey "${srcdir}/key-ca.pem" --null-password \
- --outfile tmp-key-ca.p8 2>/dev/null
+${VALGRIND} "${CERTTOOL}" --to-p8 --load-privkey "${srcdir}/data/key-ca.pem" --null-password \
+ --outfile $TMPFILE 2>/dev/null
-${GREP} "BEGIN ENCRYPTED PRIVATE KEY" tmp-key-ca.p8 >/dev/null 2>&1
+${GREP} "BEGIN ENCRYPTED PRIVATE KEY" $TMPFILE >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -94,7 +96,7 @@ if test "${rc}" != "0"; then
exit ${rc}
fi
-${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/key-ca.pem" --null-password >/dev/null 2>&1
+${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/data/key-ca.pem" --null-password >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -102,7 +104,7 @@ if test "${rc}" != "0"; then
exit ${rc}
fi
-${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/key-ca-null.p8" --null-password >/dev/null 2>&1
+${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/data/key-ca-null.p8" --null-password >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -112,7 +114,7 @@ fi
# Tests for PKCS #8 ECC keys
-${VALGRIND} "${CERTTOOL}" -k --infile "${srcdir}/key-ecc.pem" >/dev/null 2>&1
+${VALGRIND} "${CERTTOOL}" -k --infile "${srcdir}/data/key-ecc.pem" >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -120,7 +122,7 @@ if test "${rc}" != "0"; then
exit ${rc}
fi
-${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/key-ecc.p8" >/dev/null 2>&1
+${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/data/key-ecc.p8" >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -128,7 +130,7 @@ if test "${rc}" != "0"; then
exit ${rc}
fi
-${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/openssl-key-ecc.p8" >/dev/null 2>&1
+${VALGRIND} "${CERTTOOL}" -k --pkcs8 --infile "${srcdir}/data/openssl-key-ecc.p8" >/dev/null 2>&1
rc=$?
# We're done.
if test "${rc}" != "0"; then
@@ -136,6 +138,6 @@ if test "${rc}" != "0"; then
exit ${rc}
fi
-rm -f tmp-key-ca.p8
+rm -f $TMPFILE
exit 0