Fix configs and dockerfile to enable sphinx in tests

This commit is contained in:
heat-wave 2021-01-23 19:16:29 +00:00
parent f35ad11e3f
commit 815b8f4218
4 changed files with 19 additions and 15 deletions

View File

@ -5,8 +5,11 @@ cd libsphinx
git submodule update --init --recursive --remote git submodule update --init --recursive --remote
cd src cd src
sed -i 's|/usr/local|/usr|' makefile sed -i 's|/usr/local|/usr|' makefile
make make && make install && ldconfig
sudo make install cd ../..
ldconfig git clone https://github.com/stef/pwdsphinx
pip3 install pwdsphinx cd pwdsphinx
sudo mkdir -p /etc/sphinx python3 setup.py install
mkdir -p /etc/sphinx && cp ../test/sphinx.cfg /etc/sphinx/config && cd /etc/sphinx
openssl req -new -x509 -nodes -out server.crt -keyout server.key -subj '/CN=localhost'
sphinx init

View File

@ -1,13 +1,15 @@
FROM dyne/devuan:beowulf FROM dyne/devuan:beowulf
RUN apt-get update -y -q --allow-releaseinfo-change && apt-get install -y -q zsh cryptsetup gawk libgcrypt20-dev steghide qrencode python python2.7 python3-pip python3-dev libsodium-dev libssl-dev make gcc g++ sudo gettext file bsdmainutils RUN echo "deb http://deb.devuan.org/merged chimaera main" >> /etc/apt/sources.list
RUN apt-get update -y -q --allow-releaseinfo-change
RUN apt-get install -y -q -t beowulf zsh cryptsetup gawk libgcrypt20-dev steghide qrencode python python2.7 python3-pip python3-dev libssl-dev make gcc g++ sudo gettext file bsdmainutils
RUN apt-get install -y -q -t chimaera libsodium23 libsodium-dev
RUN pip3 install setuptools wheel RUN pip3 install setuptools wheel
COPY . /Tomb/ COPY . /Tomb/
# WORKDIR /Tomb/extras WORKDIR /Tomb/extras
# RUN ./install_sphinx.sh RUN ./install_sphinx.sh
# RUN cp test/sphinx.cfg /etc/sphinx/config
WORKDIR /Tomb WORKDIR /Tomb
RUN make --directory=extras/kdf-keys RUN make --directory=extras/kdf-keys

View File

@ -3,6 +3,7 @@ verbose = False
address = 127.0.0.1 address = 127.0.0.1
port = 2355 port = 2355
datadir = /tmp/.sphinx/ datadir = /tmp/.sphinx/
ssl_cert = /etc/sphinx/server.crt
[server] [server]
verbose = False verbose = False
@ -10,7 +11,5 @@ address = 127.0.0.1
port = 2355 port = 2355
datadir = /tmp/.sphinx/ datadir = /tmp/.sphinx/
keydir = /tmp/.sphinx/ keydir = /tmp/.sphinx/
ssl_cert = /etc/sphinx/server.crt
[websphinx] ssl_key = /etc/sphinx/server.key
pinentry=/usr/bin/pinentry
log=

4
tomb
View File

@ -505,14 +505,14 @@ sphinx_set_password() {
# check first if this host/user combination exists in store # check first if this host/user combination exists in store
# if yes, there is no need to make a call to create # if yes, there is no need to make a call to create
password=$(echo "$1" | sphinx get $(option_value --sphx-user) $(option_value --sphx-host) 2>$errorfile) password=$(echo "$1" | sphinx get $(option_value --sphx-user) $(option_value --sphx-host) 2>$errorfile)
if ! grep -q "ValueError: fail" $errorfile ; then if ! grep -q "error: sphinx protocol failure" $errorfile ; then
echo "$password" echo "$password"
rm $errorfile rm $errorfile
return 0 return 0
fi fi
# no such host/user combination in store, create one # no such host/user combination in store, create one
password=$(echo "$1" | sphinx create $(option_value --sphx-user) $(option_value --sphx-host) ulsd 0 2>$errorfile) password=$(echo "$1" | sphinx create $(option_value --sphx-user) $(option_value --sphx-host) ulsd 0 2>$errorfile)
if ! grep -q "ValueError: fail" $errorfile ; then if ! grep -q "error: sphinx protocol failure" $errorfile ; then
echo "$password" echo "$password"
rm $errorfile rm $errorfile
return 0 return 0