2f01744f82
This uses the portable Ed25519 library made by Orson Peters, which in turn uses the reference implementation made by Daniel J. Bernstein. This implementation also allows Ed25519 keys to be used for key exchange, so there is no need to add a separate implementation of Curve25519.
28 lines
717 B
Bash
Executable file
28 lines
717 B
Bash
Executable file
#!/bin/sh
|
|
|
|
. ./testlib.sh
|
|
|
|
# Generate keys
|
|
|
|
mkdir -p $d1
|
|
|
|
$sptps_keypair $d1/server.priv $d1/server.pub
|
|
$sptps_keypair $d1/client.priv $d1/client.pub
|
|
|
|
# Test transfer of a simple file.
|
|
|
|
(sleep 1; $sptps_test -q $d1/client.priv $d1/server.pub localhost 32750 <../README) &
|
|
$sptps_test $d1/server.priv $d1/client.pub 32750 >$d1/out1
|
|
cmp $d1/out1 ../README
|
|
|
|
$sptps_test -q $d1/server.priv $d1/client.pub 32750 <../NEWS &
|
|
sleep 1
|
|
$sptps_test $d1/client.priv $d1/server.pub localhost 32750 > $d1/out2
|
|
cmp $d1/out2 ../NEWS
|
|
|
|
# Datagram mode
|
|
|
|
$sptps_test -dq $d1/server.priv $d1/client.pub 32750 <../COPYING &
|
|
sleep 1
|
|
sleep 1 | $sptps_test -dq $d1/client.priv $d1/server.pub localhost 32750 >$d1/out3
|
|
cmp $d1/out3 ../COPYING
|