1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-08 23:37:47 +02:00

tests: Skip secret key import check in SELinux mode

* configure.ac (ENABLE_SELINUX_HACKS): New am_conditional.
* checks/Makefile.am (prepared.stamp): Replace by defs-config.inc.
(defs-config.inc): Create and set enable_selinux_hacks variable.
* checks/defs.inc: Include defs-config.inc.

* checks/armor.test: Do not run the last test in selinux mode.

GnuPG-bug-id: 1390
This commit is contained in:
Werner Koch 2012-11-08 17:16:40 +01:00
parent e3e5406049
commit 95347cf950
4 changed files with 29 additions and 12 deletions

View File

@ -39,22 +39,29 @@ DATA_FILES = data-500 data-9000 data-32000 data-80000 plain-large
EXTRA_DIST = defs.inc $(TESTS) $(TEST_FILES) \
mkdemodirs signdemokey
CLEANFILES = prepared.stamp x y yy z out err $(DATA_FILES) \
CLEANFILES = defs-config.inc x y yy z out err $(DATA_FILES) \
plain-1 plain-2 plain-3 trustdb.gpg *.lock .\#lk* \
*.test.log gpg_dearmor gpg.conf \
pubring.gpg secring.gpg pubring.pkr secring.skr
DISTCLEANFILES = pubring.gpg~ random_seed
all-local: prepared.stamp
all-local: defs-config.inc
distclean-local:
$(srcdir)/mkdemodirs --clean
prepared.stamp: ./pubring.gpg ./secring.gpg ./plain-1 ./plain-2 ./plain-3 \
defs-config.inc: ./pubring.gpg ./secring.gpg ./plain-1 ./plain-2 ./plain-3 \
./pubring.pkr ./secring.skr ./gpg_dearmor $(DATA_FILES)
$(GPG_IMPORT) $(srcdir)/pubdemo.asc
echo timestamp >./prepared.stamp
echo '# Do not edit - created by the Makefile. -*- sh -*-' \
> defs-config.inc
if ENABLE_SELINUX_HACKS
echo enable_selinux_hacks=yes >> defs-config.inc
else
echo enable_selinux_hacks=no >> defs-config.inc
endif
./gpg_dearmor:
echo '#!/bin/sh' >./gpg_dearmor

View File

@ -739,8 +739,13 @@ wg7Md81a5RI3F2FG8747t9gX
# armor filter gpg swalled the CRC line and passed the '-----END...'
# line on to the decryption layer.
# Can only perform this test if we have Twofish
# Can only perform this test if we have Twofish. We also can't use it
# if we have SELinux support, because that will fail on secret key
# import.
if test x$enable_selinux_hacks = xyes ; then
echo "SELinux support is enabled: skipping secret key import check"
else
if $GPG --with-colons --list-config ciphername | grep TWOFISH > /dev/null 2>/dev/null ; then
i=alpha_seckey
info "importing: $i"
@ -756,3 +761,4 @@ if $GPG --with-colons --list-config ciphername | grep TWOFISH > /dev/null 2>/dev
error "bug#1179 is back in town"
fi
fi
fi

View File

@ -1,9 +1,12 @@
# definitions for the check scripts
# definitions for the check scripts -*- sh -*-
#--------------------------------
#------ constants ---------------
#--------------------------------
# First the Makefile generated constants
. ./defs-config.inc || exit 3
# Note that usrpass1 is also used in Makefile.am
usrname1="one"
usrpass1="def"

View File

@ -920,6 +920,7 @@ fi
AM_CONDITIONAL(ENABLE_CARD_SUPPORT, test "$card_support" = yes)
AM_CONDITIONAL(ENABLE_AGENT_SUPPORT, test "$agent_support" = yes)
AM_CONDITIONAL(ENABLE_SELINUX_HACKS, test "$selinux_support" = yes)
dnl Checks for header files.
AC_HEADER_STDC