Browse Source

(kind of) finished mix registration test script

master
nkls 3 months ago
parent
commit
3fba3c2d95
8 changed files with 113 additions and 3 deletions
  1. +1
    -1
      Dockerfile
  2. BIN
      docs/nkls_slides.odp
  3. +23
    -1
      gnunet/register.sh
  4. +52
    -0
      gnunet/register.sh.save
  5. +21
    -0
      notes.txt
  6. +9
    -1
      run.sh
  7. +0
    -0
      tmp/n1/.config/gnunet.conf
  8. +7
    -0
      tmp/n1/key-gen-script

+ 1
- 1
Dockerfile View File

@ -9,7 +9,7 @@ RUN rm -rf /peppythonmixnet
FROM peppythonmixnet-test as postfix
ENV DEBIAN_FRONTEND noninteractive
RUN apt update -y; apt install -y postfix sudo syslog-ng
RUN apt update -y; apt install -y postfix gnupg sudo syslog-ng
RUN apt autoclean
FROM postfix as node


BIN
docs/nkls_slides.odp View File


+ 23
- 1
gnunet/register.sh View File

@ -1,5 +1,19 @@
#!/bin/bash
#generate rsa keypair for mix crypto things
hostname=$(hostname -A)
if [ ! $(gpg -k | grep root@$hostname) ]; then
echo "Key-Type: 1 \
Key-Length: 2048 \
Subkey-Type: 1 \
Subkey-Length: 2048 \
Name-Real: Root Superuser \
Name-Email: root@$hostname \
Expire-Date: 0" \
> key-gen-script
gpg --batch --gen-key key-gen-script
fi
#create GNS identity, if not existing
if [[ $(gnunet-identity -d | grep mixnet) ]]; then
echo "there is a mixnet identity, OK"
@ -21,11 +35,19 @@ fi
gnunet-namestore -a -e never -n email -p -t MX -V n1 "<root@n1.pep.example>" -z mixnet
#add TXT record with fingerprint
gnunet-namestore -a -e never -n mix -p -t TXT -V 44CF7B7252148BE970F53FF8BF378725BCA73C60 -z mixnet
#get Fingerprint of gpg key *facepalm*
FP=gpg --with-colons --fingerprint root@$hostname | grep fpr | head -1 | grep -Eo '[0-9A-F]{1,40}'
gnunet-namestore -a -e never -n mix -p -t TXT -V $FP -z mixnet
#add TXT recurd with public key
PUBKEY=gpg --export -a root@$HOSTNAME
gnunet-namestore -a -e never -n mix -p -t TXT -V $PUBKEY -z mixnet
#write peer id to file
gnunet-peerinfo -sq > peerid.txt
#publish peer id
gnunet-publish -k mixnet peerid.txt


+ 52
- 0
gnunet/register.sh.save View File

@ -0,0 +1,52 @@
#!/bin/bash
#generate rsa keypair for mix crypto things
HOSTNAME=$(hostname -A)
if [ ! $(gpg -k | grep root@$HOSTNAME) ]; then
echo "Key-Type: 1 \
Key-Length: 2048 \
Subkey-Type: 1 \
Subkey-Length: 2048 \
Name-Real: Root Superuser \
Name-Email: root@$HOSTNAME \
Expire-Date: 0" \
> key-gen-script
gpg --batch --gen-key key-gen-script
fi
#create GNS identity, if not existing
if [[ $(gnunet-identity -d | grep mixnet) ]]; then
echo "there is a mixnet identity, OK"
else
echo "there is no mixnet identity, adding one"
gnunet-identity -C mixnet
fi
#make mixnet identity the default identity for namestore
#subsystem, if not already done
if [[ $(gnunet-namestore -D | grep 'No default identity') ]]; then
echo "no default identity set. using mixnet identity.
gnunet-identity -s namestore -e mixnet
else
echo "default identity already set"
fi
#add MX record for mix EMail address
gnunet-namestore -a -e never -n email -p -t MX -V n1 "<root@$HOSTNAME>" -z mixnet
#get Fingerprint of gpg key *facepalm*
FP=gpg --with-colons --fingerprint root@$hostname | grep fpr | head -1 | grep -Eo '[0-9A-F]{1,40}'
#add TXT record with fingerprint in local GNS zone
gnunet-namestore -a -e never -n mix -p -t TXT -V $FP -z mixnet
#get Pubkey of gpg key
PUBKEY=
#write peer id to file
gnunet-peerinfo -sq > peerid.txt
#publish peer id
gnunet-publish -k mixnet peerid.txt
#cleaning up
rm peerid.txt

+ 21
- 0
notes.txt View File

@ -1,3 +1,24 @@
gen-key-script:
===============
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: Root Superuser
Name-Email: root@handbook.westarete.com
Expire-Date: 0
================
then:
gpg --batch --gen-key gen-key-script
https://meet.pep.security/b/nik-ueu-mhj-hvc
composition hellos:


+ 9
- 1
run.sh View File

@ -1,6 +1,14 @@
docker-compose up -d
sleep 3
docker exec alice.whatever.example client -n -d -p EB85BB5FA33A75E15E944E63F231550C4F47E38E -k /peppythonmixnet/tests/data/alice@openpgp.example.sec.asc /peppythonmixnet/tests/data/bob@openpgp.example.asc /peppythonmixnet/tests/data/root@n3.pep.example.asc /peppythonmixnet/tests/data/root@n2.pep.example.asc /peppythonmixnet/tests/data/root@n1.pep.example.asc -f /peppythonmixnet/tests/data/plain_from_alice_to_bob.eml
docker exec alice.whatever.example client -n -d -p EB85BB5FA33A75E15E944E63F231550C4F47E38E \
-k /peppythonmixnet/tests/data/alice@openpgp.example.sec.asc \
/peppythonmixnet/tests/data/bob@openpgp.example.asc \
/peppythonmixnet/tests/data/root@n3.pep.example.asc \
/peppythonmixnet/tests/data/root@n2.pep.example.asc \
/peppythonmixnet/tests/data/root@n1.pep.example.asc -f \
/peppythonmixnet/tests/data/plain_from_alice_to_bob.eml
sleep 3
docker exec alice.whatever.example cat /root/log/mixnet.log
docker exec alice.whatever.example cat /var/log/mail.log


+ 0
- 0
tmp/n1/.config/gnunet.conf View File


+ 7
- 0
tmp/n1/key-gen-script View File

@ -0,0 +1,7 @@
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: Root Superuser
Name-Email: root@handbook.westarete.com
Expire-Date: 0

Loading…
Cancel
Save