## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
-##
+##
## TrIPE is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
-##
+##
## You should have received a copy of the GNU General Public License
## along with TrIPE; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
-##
+##
## TrIPE is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
-##
+##
## You should have received a copy of the GNU General Public License
## along with TrIPE; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
checkbg(&p);
die(EXIT_FAILURE, "%s", p);
} else
- die(EXIT_FAILURE, "unexpected output `%s %s'", q, p);
+ die(EXIT_FAILURE, "unexpected output `%s %s'", q, p);
}
static void sline(char *p, size_t len, void *b)
-D, --daemon Become a background task after connecting.\n\
-d, --directory=DIR Select current directory [default " CONFIGDIR "].\n\
-a, --admin-socket=FILE Select socket to connect to\n\
- [default " SOCKETDIR "/tripesock].\n\
+ [default " SOCKETDIR "/tripesock].\n\
-P, --pidfile=FILE Write process-id to FILE.\n\
\n\
-s, --spawn Start server rather than connecting.\n\
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
-##
+##
## TrIPE is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
-##
+##
## You should have received a copy of the GNU General Public License
## along with TrIPE; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* (c) 2003 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
-dnl
+dnl
dnl TrIPE is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
-dnl
+dnl
dnl You should have received a copy of the GNU General Public License
dnl along with TrIPE; if not, write to the Free Software Foundation,
dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
DIRS="" AC_SUBST([DIRS])
python=no
-mdw_PROG_PYTHON([2.3],
+mdw_PROG_PYTHON([2.3],
[python=yes
pyscripts='${PYTHONSCRIPTS}'
DIRS="$DIRS keys"
python -c >&5 2>&5 '
import pygtk
pygtk.require("2.0")
-import gtk
+import gtk
' && mdw_cv_pygtk=yes
])
if test $mdw_cv_pygtk = yes; then
AC_ARG_WITH([linux-includes],
[ --with-linux-includes=DIR
- search for Linux kernel includes in DIR],
+ search for Linux kernel includes in DIR],
[CFLAGS="$CFLAGS -I$withval"],
[:])
AC_ARG_WITH([configdir],
-[ --with-configdir=DIR look for keys and other configuration in DIR
- [default=/var/lib/tripe]],
+[ --with-configdir=DIR look for keys and other configuration in DIR
+ [default=/var/lib/tripe]],
[configdir=$withval],
[configdir=/var/lib/tripe])
AC_ARG_WITH([socketdir],
-[ --with-socketdir=DIR put admin socket in DIR [default=.]],
+[ --with-socketdir=DIR put admin socket in DIR [default=.]],
[socketdir=$withval],
[socketdir=.])
AC_ARG_WITH([pidfile],
-[ --with-pidfile=FILE make tripectl write its pid to FILE
- [default=./tripectl.pid]],
+[ --with-pidfile=FILE make tripectl write its pid to FILE
+ [default=./tripectl.pid]],
[pidfile=$withval],
[pidfile=tripectl.pid])
AC_ARG_WITH([initconfig],
[ --with-initconfig=FILE read definitions from FILE in init script
- [default=/etc/tripe.conf]],
+ [default=/etc/tripe.conf]],
[initconfig=$withval],
[initconfig=/etc/tripe.conf])
AC_ARG_WITH([logfile],
-[ --with-logfile=DIR make tripectl write its log to FILE
- [default=./tripe.log]],
+[ --with-logfile=DIR make tripectl write its log to FILE
+ [default=./tripe.log]],
[logfile=$withval],
[logfile=tripe.log])
WIRESHARK_CFLAGS=""
WIRESHARK_PLUGIN_DIR="unknown"
AC_ARG_WITH([wireshark],
-[ --with-wireshark build and install Wireshark plugin],
+[ --with-wireshark build and install Wireshark plugin],
[case "$withval" in
no) wireshark=false requirewireshark=false;;
yes) wireshark=true; requirewireshark=true;;
tun=auto
AC_ARG_WITH([tunnel],
-[ --with-tunnel=KIND kinds of tunnel device to use
- (linux, unet, bsd, slip)],
+[ --with-tunnel=KIND kinds of tunnel device to use
+ (linux, unet, bsd, slip)],
[tun=$withval])
if test "$tun" = auto; then
bsd) AC_DEFINE([TUN_BSD], [1],
[Install the BSD tunnel driver.]) ;;
unet) AC_DEFINE([TUN_UNET], [1],
- [Install the obsolete Linux Usernet driver.]) ;;
+ [Install the obsolete Linux Usernet driver.]) ;;
slip) ;;
*) AC_MSG_ERROR([Unknown tunnel type]) ;;
esac
tunnels="$tunnels&tun_$i, "
done
AC_SUBST(tun)
-AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0],
+AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0],
[List of tunnel drivers to install.])
mdw_MLIB(2.0.0)
mdw_CATACOMB(2.1.0, [CFLAGS="$CFLAGS $CATACOMB_CFLAGS"])
if test "$wireshark" = true -a "$WIRESHARK_PLUGIN_DIR" = unknown; then
- AC_CACHE_CHECK([where to put Wireshark plugins],
+ AC_CACHE_CHECK([where to put Wireshark plugins],
[mdw_cv_wireshark_plugin_dir], [
changequote(,)
mdw_cv_wireshark_plugin_dir="failed"
wsver=`$wsbin -v | sed 's/^[^ ]* \([0-9A-Za-z.]*\).*$/\1/;q'`
dir=$wsprefix/lib/wireshark/plugins/$wsver
if test -d "$dir"; then
- mdw_cv_wireshark_plugin_dir=$dir
+ mdw_cv_wireshark_plugin_dir=$dir
fi
fi
changequote([, ])
bad=true
mdw_CFLAGS=$CFLAGS
wsprefix=`echo $WIRESHARK_PLUGIN_DIR | sed 's:/lib/.*$::'`
- AC_CACHE_CHECK([how to find the Wireshark headers],
+ AC_CACHE_CHECK([how to find the Wireshark headers],
[mdw_cv_wireshark_includes], [
mdw_cv_wireshark_includes=failed
for i in \
])
case $mdw_cv_wireshark_includes in
failed) wireshark=false;;
- esac
+ esac
fi
if test "$wireshark" = true; then
fi
AH_TEMPLATE([CONFIGDIR],
- [Tripe should look here for keys and other configuration.])
+ [Tripe should look here for keys and other configuration.])
AH_TEMPLATE([SOCKETDIR],
- [Tripe should make its administration socket here.])
+ [Tripe should make its administration socket here.])
mdw_DEFINE_PATHS([
mdw_DEFINE_PATH([CONFIGDIR], [$configdir])
mdw_DEFINE_PATH([SOCKETDIR], [$socketdir])
* Support SLIP encapsulation.
- -- Mark Wooding <mdw@distorted.org.uk> Sun, 4 Sep 2005 00:52:56 +0100
+ -- Mark Wooding <mdw@distorted.org.uk> Sun, 4 Sep 2005 00:52:56 +0100
tripe (1.0.0pre6) experimental; urgency=low
TrIPE is a simple VPN protocol. It uses cryptography to ensure secrecy
and authenticity of packets it sends and receives.
.
- This package contains the main daemon, support programs, and documentation.
+ This package contains the main daemon, support programs, and documentation.
It ideally wants a 2.4 series kernel with the TUN/TAP driver enabled, but
it will work with any kernel which speaks SLIP.
d=`pwd`; cd ..; dpkg-source -i -b $$d/deb-build/=deb=/*
rm -rf deb-build/=deb=
-.PHONY: binary binary-arch binary-indep clean install source
+.PHONY: binary binary-arch binary-indep clean install source
SETTING UP TRIPE FOR DEBIAN GNU/LINUX
- Firstly, you need to set up public key parameters. To generate
+ Firstly, you need to set up public key parameters. To generate
a new set, run
# cd /etc/tripe
set -e
if [ "$1" = "purge" ] ; then
- update-rc.d tripe remove >/dev/null
+ update-rc.d tripe remove >/dev/null
fi
#DEBHELPER#
set -e
if [ -x "/etc/init.d/tripe" ]; then
- invoke-rc.d tripe stop
+ invoke-rc.d tripe stop
fi
#DEBHELPER#
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
-##
+##
## TrIPE is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
-##
+##
## You should have received a copy of the GNU General Public License
## along with TrIPE; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.BR : \c
.IR port ]
.br
-
+
.IB addr : port
.IB addr : port
.SH "DESCRIPTION"
.\" -*-nroff-*-
.so tmac.rfc
.
-.TL "Straylight/Edgeware" "Mark Wooding"
-.TL "Request for Comments: XXXX" "Straylight/Edgeware"
-.TL "" "11 April 2003"
+.TL "Straylight/Edgeware" "Mark Wooding"
+.TL "Request for Comments: XXXX" "Straylight/Edgeware"
+.TL "" "11 April 2003"
.
.TT XXXX Wooding "April 2003" \
"TrIPE: The Trivial IP Encryption Protocol"
.P
When a pair of peer hosts are made aware of each other, they begin a key
negotiation, using an authenticated Diffie-Hellman key exchange
-protocol. This enables them to agree a
+protocol. This enables them to agree a
.I keyset :
a collection of short-term symmetric keys and other parameters (such as
sequence numbering spaces). Keysets expire after a fixed amount of
.B "\\$1" \c
.if !'\\$2'.' \ \\$2\c
.if !'\\$3'' \{\
-:
+:
.I "\\$3" \c
.\}
..
.LS 2n
..
.P
-We need to deal with a number of data items during the protocol.
+We need to deal with a number of data items during the protocol.
.if t \{\
Object names are given in
.I italics .
is primed, toggle the primed-ness of the components.
.P
Data objects are given types which determine their representation in
-protocol messages. Type names are given in
+protocol messages. Type names are given in
.B UPPERCASE .
.P
.T1 "Atomic data items"
be the number of octets required to represent
.I n
in base-256 format with no leading zeroes, except that if
-.I n
+.I n
= 0
-then
+then
.I z
= 1; in other cases,
-.I z
+.I z
is the unique integer such that
.ie t 256\*(^(\fIz\fP\-1\*(^) \(<= \fIn\fP < 256\*(^(\fIz\fP\*(^).
.el 256^{z-1} <= n < 256^z.
commands and reply to them.
.PP
Responses to background commands are indicated by a line beginning with
-one of the tokens
+one of the tokens
.BR BGOK ,
.BR BGFAIL ,
or
.BR BGINFO ,
-followed by the command tag. These correspond to the
+followed by the command tag. These correspond to the
.BR OK ,
.BR FAIL ,
and
.B INFO
line, in a fixed-column format. Column zero contains the key letter for
selecting that message type; column one contains either a space or a
-.RB ` + '
+.RB ` + '
sign, if the message type is disabled or enabled respectively; and a
textual description of the message type begins at column 3 and continues
to the end of the line.
line for each command it supports. Each line lists the command name,
followed by the names of the arguments. This may be helpful as a memory
aid for interactive use, or for program clients probing for features.
-.SP
+.SP
.BI "IFNAME " peer
Emits an
.B INFO
.BR ADD .
.SP
.BI "NOTIFY " tokens\fR...
-Issues a
+Issues a
.B USER
notification to all interested administration clients.
.SP
.RS
.TP
.BI "ping-ok " millis
-A response was received
+A response was received
.I millis
after the ping was sent.
.TP
.BR "service-exists" .
.SP
.BI "SVCENSURE " service " \fR[" version \fR]
-Ensure that
+Ensure that
.I service
is provided, and (if specified) to at least the given
.IR version .
.BR BGFAIL )
response to the service job with the given
.IR jobid ,
-passing the
+passing the
.I tokens
as the reason for failure. The job is closed.
.SP
.SP
.BR "TRACE " [\fIoptions\fP]
Selects trace outputs: see
-.B "Trace lists"
+.B "Trace lists"
above. Message types provided are:
.RS
.PP
Enables or disables asynchronous broadcasts
.IR "for the current connection only" .
See
-.B "Trace lists"
+.B "Trace lists"
above. The default watch state for the connection the server opens
automatically on stdin/stdout is to show warnings and trace messages;
other connections show no asynchronous broadcast messages. (This is
.RE
.SP
.BI "WARN " tokens\fR...
-Issues a
+Issues a
.B USER
warning to all interested administration clients.
.SH "ERROR MESSAGES"
The
.I word
is not a valid time interval specification. Acceptable time
-specifications are nonnegative integers followed optionally by
+specifications are nonnegative integers followed optionally by
.BR d ,
.BR h ,
.BR m ,
The given port number is out of range.
.SP
.BI "not-service-provider " service
-(For
+(For
.BR SVCRELEASE .)
The invoking client is not the current provider of the named
.IR service ,
.BR ADD .)
The port name
.I port
-couldn't be found in
+couldn't be found in
.BR /etc/services .
.TP
.BI "unknown-service " service
warnings before this.
.SP
.BI "KEYMGMT bad-public-keyring " message
-The public keyring couldn't be read. Usually, there will have been
+The public keyring couldn't be read. Usually, there will have been
.B key-file-error
warnings before this.
.SP
.BI "KX " peer " unexpected " msgtoken
The message received wasn't appropriate for this stage of the key
exchange process. This may mean that one of our previous packets got
-lost. For
+lost. For
.BR pre-challenge ,
it may simply mean that the peer has recently restarted.
.SP
.SS "PEER warnings"
These are largely concerned with management of peers and the low-level
details of the network protocol. The second word is usually the name of
-a peer, or
+a peer, or
.RB ` \- '
if none is relevant.
.SP
.SP
.BI "TUN \- bsd no-tunnel-devices"
The driver couldn't find an available tunnel device. Maybe if you
-create some more
+create some more
.BI /dev/tun nn
files, it will work.
.SP
.PP
The master authority has a configuration file
.BR tripe-keys.master ,
-usually created by copying the template provided and editing it.
+usually created by copying the template provided and editing it.
.PP
The published repository consists of a tarball of the
.B repos
A peer starts by downloading a copy of
.B tripe-keys.conf
and then making sure it's authentic. (This is one of the tricky bits.
-The other is getting public keys back to the master authority.) This is
+The other is getting public keys back to the master authority.) This is
enough for the peer to fetch a copy of the repository, verify the
signature, and assemble a public keyring for the other peers in the
network.
.IR command .
.TP
.B "setup"
-Constructs a new repository and makes a signing key (as for
+Constructs a new repository and makes a signing key (as for
.BR newmaster )
and key-exchange parameters. Fails if
.B repos
.B repos
directory with the version in the new archive, and if necessary it
replaces the current configuration file with the new one in the
-archive. It then does a
+archive. It then does a
.B rebuild
to construct a new
.B keyring.pub
.BI ${ name } \fR,
which are replaced by the value assigned to
.IR name .
-Many
+Many
.IR name s
have significance to the
.B tripe-keys
.TP
.I kx
Key-exchange algorithm to use. Either
-.B dh
+.B dh
(integer Diffie-Hellman)
or
.B ec
.BR ec .
.TP
.I sig-genalg
-Key-generation algorithm for signing key. Default depends on
+Key-generation algorithm for signing key. Default depends on
.I sig
as follows.
.TS
.I local-port
and
.I remote-port
-must be numbers;
+must be numbers;
.I remote-addr
may be a hostname or an IP address in dotted-quad format. Exactly two
.B peer
Begin the next branch of the first fork filter node named
.I tag
in each filter chain. See below for more about filter chains.
-.TP
+.TP
.BI flood\fR[\fP: type : millis : size\fR]
Flood both peers with random packets. If
.I type
.RB [ \-n
.IR tunnel ]
.br
-
+
.RB [ \-U
.IR user ]
.RB [ \-G
.RB [ \-T
.IR trace-opts ]
.br
-
+
.RB [ \-k
.IR priv-keyring ]
.RB [ \-K
is omitted, the same file descriptor is used for input and output.
.PP
The dynamic allocation script must be named by an absolute or relative
-pathname, beginning with
+pathname, beginning with
.RB ` / '
or
.RB ` . '.
.I after
any passed automatically by
.B tripectl
-(e.g.,
+(e.g.,
.BR \-a ).
.TP
.B "\-l, \-\-syslog"
.SS "Starting the tripe server"
If any of the options
.BR \-s ,
-.B \-p
+.B \-p
or
.B \-S
are given,
.B tripemon
program is a fairly simple graphical monitor program for TrIPE. It's
not ever-so user-friendly in some ways, but it works fairly well. A
-perusal of
+perusal of
.BR tripe-admin (5)
would help you understand it better. That said, describing the program
in detail is probably less interesting than letting you explore it for
with the property that, for any $K \in \keys \mathcal{E}$, any plaintext
message $x$, and any ciphertext $y$ returned as a result of $E_K(x)$, we
have $D_K(y) = x$.
-\end{definition}
+\end{definition}
\begin{definition}[Chosen plaintext security for symmetric encryption]
\label{def:sym-cpa}
\begin{eqnalign}[rl]
\Adv{ddh}{G}(A) =
& \Pr[\alpha \getsr \Nupto{q}; \beta \getsr \Nupto{q} :
- A(g^\alpha, g^\beta, g^{\alpha\beta}) = 1] - {} \\
+ A(g^\alpha, g^\beta, g^{\alpha\beta}) = 1] - {} \\
& \Pr[\alpha \getsr \Nupto{q}; \beta \getsr \Nupto{q};
- \gamma \getsr \Nupto{q} :
- A(g^\alpha, g^\beta, g^\gamma) = 1].
+ \gamma \getsr \Nupto{q} :
+ A(g^\alpha, g^\beta, g^\gamma) = 1].
\end{eqnalign}
\end{equation}
The \emph{insecurity function of the decision Diffie-Hellman problem in
Function $\id{decrypt}(k, \id{ty}, c)$: \+ \\
$(i, y, \tau) \gets c$; \\
\IF $V_{k.\Xid{K}{mac-in}}((\id{ty}, i, y), \tau) = 0$ \THEN \\ \ind
- \RETURN $\bot$; \- \\
+ \RETURN $\bot$; \- \\
\IF $i < k.\id{seq-in}$ \THEN \RETURN $\bot$; \\
$m \gets D_{k.\Xid{K}{enc-in}}(y)$; \\
$k.\id{seq-in} \gets i + 1$; \\
\begin{table}
\begin{tabularx}{\textwidth}{Mr X}
- G & A cyclic group known by all participants \\
- q = |G| & The prime order of $G$ \\
- g & A generator of $G$ \\
- E_K(\cdot) & Encryption under key $K$, here used to denote
- application of the $\id{encrypt}(K, \cdot)$
- operation \\
+ G & A cyclic group known by all participants \\
+ q = |G| & The prime order of $G$ \\
+ g & A generator of $G$ \\
+ E_K(\cdot) & Encryption under key $K$, here used to denote
+ application of the $\id{encrypt}(K, \cdot)$
+ operation \\
\alpha \inr \Nupto{q} & Alice's private key \\
- a = g^{\alpha} & Alice's public key \\
+ a = g^{\alpha} & Alice's public key \\
\rho_A \inr \Nupto{q} & Alice's secret Diffie-Hellman value \\
- r_A = g^{\rho_A} & Alice's public \emph{challenge} \\
+ r_A = g^{\rho_A} & Alice's public \emph{challenge} \\
c_A = H(\cookie{cookie}, r_A)
- & Alice's \emph{cookie} \\
+ & Alice's \emph{cookie} \\
v_A = \rho_A \xor H(\cookie{expected-reply}, r_A, r_B, b^{\rho_A})
- & Alice's challenge \emph{check value} \\
+ & Alice's challenge \emph{check value} \\
r_B^\alpha = a^{\rho_B}
- & Alice's reply \\
+ & Alice's reply \\
K = r_B^{\rho_A} = r_B^{\rho_A} = g^{\rho_A\rho_B}
- & Alice and Bob's shared secret key \\
+ & Alice and Bob's shared secret key \\
w_A = H(\cookie{switch-request}, c_A, c_B)
- & Alice's \emph{switch request} value \\
+ & Alice's \emph{switch request} value \\
u_A = H(\cookie{switch-confirm}, c_A, c_B)
- & Alice's \emph{switch confirm} value \\
+ & Alice's \emph{switch confirm} value \\
\end{tabularx}
\caption{Names used during key-exchange}
\caption{Message contents, as sent by Alice}
\label{tab:kx-messages}
\end{table}
-
+
\begin{messages}
\item[kx-pre-challenge] Contains a plain statement of Alice's challenge.
This is Alice's first message of a session.
$\id{send}(\cookie{kx-pre-challenge}, r_A)$; \- \\[\medskipamount]
Procedure $\id{kx-receive}(\id{type}, \id{data})$: \\ \ind
\IF $\id{type} = \cookie{kx-pre-challenge}$ \THEN \\ \ind
- \id{msg-pre-challenge}(\id{data}); \- \\
+ \id{msg-pre-challenge}(\id{data}); \- \\
\ELSE \IF $\id{type} = \cookie{kx-cookie}$ \THEN \\ \ind
- \id{msg-cookie}(\id{data}); \- \\
+ \id{msg-cookie}(\id{data}); \- \\
\ELSE \IF $\id{type} = \cookie{kx-challenge}$ \THEN \\ \ind
- \id{msg-challenge}(\id{data}); \- \\
+ \id{msg-challenge}(\id{data}); \- \\
\ELSE \IF $\id{type} = \cookie{kx-reply}$ \THEN \\ \ind
- \id{msg-reply}(\id{data}); \- \\
+ \id{msg-reply}(\id{data}); \- \\
\ELSE \IF $\id{type} = \cookie{kx-switch}$ \THEN \\ \ind
- \id{msg-switch}(\id{data}); \- \\
+ \id{msg-switch}(\id{data}); \- \\
\ELSE \IF $\id{type} = \cookie{kx-switch-ok}$ \THEN \\ \ind
- \id{msg-switch-ok}(\id{data}); \-\- \\[\medskipamount]
+ \id{msg-switch-ok}(\id{data}); \-\- \\[\medskipamount]
Procedure $\id{msg-pre-challenge}(\id{data})$: \+ \\
\IF $\id{state} \ne \cookie{challenge}$ \THEN \RETURN; \\
$r \gets \id{data}$; \\
\IF $\Xid{n}{chal} \ge \Xid{n}{chal-thresh}$ \THEN \\ \ind
- $\id{send}(\cookie{kx-cookie}, r_A, \id{cookie}(r_A)))$; \- \\
+ $\id{send}(\cookie{kx-cookie}, r_A, \id{cookie}(r_A)))$; \- \\
\ELSE \+ \\
- $\id{new-chal}(r)$; \\
- $\id{send}(\cookie{kx-challenge}, r_A,
- \id{cookie}(r), \id{checkval}(r))$; \-\-\\[\medskipamount]
+ $\id{new-chal}(r)$; \\
+ $\id{send}(\cookie{kx-challenge}, r_A,
+ \id{cookie}(r), \id{checkval}(r))$; \-\-\\[\medskipamount]
Procedure $\id{msg-cookie}(\id{data})$: \+ \\
\IF $\id{state} \ne \cookie{challenge}$ \THEN \RETURN; \\
$(r, c_A) \gets \id{data}$; \\
\IF $c_A \ne \id{cookie}(r_A)$ \THEN \RETURN; \\
$\id{new-chal}(r)$; \\
$\id{send}(\cookie{kx-challenge}, r_A,
- \id{cookie}(r), \id{checkval}(r))$; \- \\[\medskipamount]
+ \id{cookie}(r), \id{checkval}(r))$; \- \\[\medskipamount]
Procedure $\id{msg-challenge}(\id{data})$: \+ \\
\IF $\id{state} \ne \cookie{challenge}$ \THEN \RETURN; \\
$(r, c_A, v) \gets \id{data}$; \\
$k \gets \id{chal-tab}[i].k$; \\
$y \gets \id{encrypt}(k, \cookie{kx-reply}, r^\alpha)$; \\
$\id{send}(\cookie{kx-reply}, c_A, \id{cookie}(r),
- \id{checkval}(r), y)$
+ \id{checkval}(r), y)$
\next
Procedure $\id{msg-reply}(\id{data})$: \+ \\
$(c, c_A, v, y) \gets \id{data}$; \\
$i \gets \id{find-chal}(c)$; \\
\IF $i = \bot$ \THEN \RETURN; \\
\IF $\id{check-reply}(i, \id{chal-tab}[i].r, v) = \bot$ \THEN \\ \ind
- \RETURN; \- \\
+ \RETURN; \- \\
$k \gets \id{chal-tab}[i].k$; \\
$x \gets \id{decrypt}(k, \cookie{kx-reply}, y)$; \\
\IF $x = \bot$ \THEN \RETURN; \\
\IF $x = \bot$ \THEN \RETURN; \\
$(x, w) \gets x$; \\
\IF $\id{state} = \cookie{challenge}$ \THEN \\ \ind
- \IF $x \ne b^{\rho_A}$ \THEN \RETURN; \\
- $\id{chal-commit} \gets \id{chal-tab}[i]$; \- \\
+ \IF $x \ne b^{\rho_A}$ \THEN \RETURN; \\
+ $\id{chal-commit} \gets \id{chal-tab}[i]$; \- \\
\ELSE \IF $c \ne \id{chal-commit}.c$ \THEN \RETURN; \\
\IF $w \ne H(\cookie{switch-request}, c, c_A)$ \THEN \RETURN; \\
$w \gets H(\cookie{switch-confirm}, c_A, c)$; \\
$r$; $c$; $\id{replied}$; $k$; \- \\[\medskipamount]
Function $\id{find-chal}(c)$: \+ \\
\FOR $i = 0$ \TO $\Xid{n}{chal}$ \DO \\ \ind
- \IF $\id{chal-tab}[i].c = c$ \THEN \RETURN $i$; \- \\
+ \IF $\id{chal-tab}[i].c = c$ \THEN \RETURN $i$; \- \\
\RETURN $\bot$; \- \\[\medskipamount]
Function $\id{cookie}(r)$: \+ \\
\RETURN $H(\cookie{cookie}, r)$; \- \\[\medskipamount]
Function $\id{check-reply}(i, r, v)$: \+ \\
\IF $i \ne \bot \land \id{chal-tab}[i].\id{replied} = 1$ \THEN \\ \ind
- \RETURN $i$; \- \\
+ \RETURN $i$; \- \\
$\rho \gets v \xor H(\cookie{expected-reply}, r, r_A, r^\alpha)$; \\
\IF $g^\rho \ne r$ \THEN \RETURN $\bot$; \\
\IF $i = \bot$ \THEN $i \gets \id{new-chal}(r)$; \\
\next
Function $\id{checkval}(r)$: \\ \ind
\RETURN $\rho_A \xor H(\cookie{expected-reply},
- r_A,r, b^{\rho_A})$; \- \\[\medskipamount]
+ r_A,r, b^{\rho_A})$; \- \\[\medskipamount]
Function $\id{new-chal}(r)$: \+ \\
$c \gets \id{cookie}(r)$; \\
$i \gets \id{find-chal}(c)$; \\
\IF $i \ne \bot$ \THEN \RETURN $i$; \\
\IF $\Xid{n}{chal} < \Xid{n}{chal-max}$ \THEN \\ \ind
- $i \gets \Xid{n}{chal}$; \\
- $\id{chal-tab}[i] \gets \NEW \id{chal-slot}$; \\
- $\Xid{n}{chal} \gets \Xid{n}{chal} + 1$; \- \\
+ $i \gets \Xid{n}{chal}$; \\
+ $\id{chal-tab}[i] \gets \NEW \id{chal-slot}$; \\
+ $\Xid{n}{chal} \gets \Xid{n}{chal} + 1$; \- \\
\ELSE \\ \ind
- $i \getsr [\Xid{n}{chal-max}]$; \- \\
+ $i \getsr [\Xid{n}{chal-max}]$; \- \\
$\id{chal-tab}[i].r \gets r$; \\
$\id{chal-tab}[i].c \gets c$; \\
$\id{chal-tab}[i].\id{replied} \gets 0$; \\
\caption{Encryption using CBC mode}
\label{fig:cbc}
\end{figure}
-
+
\begin{definition}[CBC mode]
\label{def:cbc}
Let $P\colon \keys P \times \Bin^\ell to \Bin^\ell$ be a pseudorandom
$I \getsr \Bin^\ell$; \\
$y \gets I$; \\
\FOR $i = 0$ \TO $|x|/\ell$ \DO \\ \ind
- $x_i \gets x[\ell i \bitsto \ell (i + 1)]$; \\
- $y_i \gets P_K(x_i \xor I)$; \\
- $I \gets y_i$; \\
- $y \gets y \cat y_i$; \- \\
+ $x_i \gets x[\ell i \bitsto \ell (i + 1)]$; \\
+ $y_i \gets P_K(x_i \xor I)$; \\
+ $I \gets y_i$; \\
+ $y \gets y \cat y_i$; \- \\
\RETURN $y$;
\next
Algorithm $\Xid{D}{CBC}^P_K(y)$: \+ \\
$I \gets y[0 \bitsto \ell]$; \\
$x \gets \emptystring$; \\
\FOR $1 = 0$ \TO $|y|/\ell$ \DO \\ \ind
- $y_i \gets y[\ell i \bitsto \ell (i + 1)]$; \\
- $x_i \gets P^{-1}_K(y_i) \xor I$; \\
- $I \gets y_i$; \\
- $x \gets x \cat x_i$; \- \\
+ $y_i \gets y[\ell i \bitsto \ell (i + 1)]$; \\
+ $x_i \gets P^{-1}_K(y_i) \xor I$; \\
+ $I \gets y_i$; \\
+ $x \gets x \cat x_i$; \- \\
\RETURN $x$;
\end{program}
\end{definition}
"e" [dd] ="x"
"i" [uu] ="y"
[]!{"x"; "e" **{}, "x"+/4pt/ ="p",
- "x"; "y" **{}, "x"+/4pt/ ="q",
- "y"; "x" **{}, "y"+/4pt/ ="r",
- "y"; "i" **{}, "y"+/4pt/ ="s",
- "e";
- "p" **\dir{-};
- "q" **\crv{"x"};
- "r" **\dir{-};
- "s" **\crv{"y"};
- "i" **\dir{-}?>*\dir{>}}
+ "x"; "y" **{}, "x"+/4pt/ ="q",
+ "y"; "x" **{}, "y"+/4pt/ ="r",
+ "y"; "i" **{}, "y"+/4pt/ ="s",
+ "e";
+ "p" **\dir{-};
+ "q" **\crv{"x"};
+ "r" **\dir{-};
+ "s" **\crv{"y"};
+ "i" **\dir{-}?>*\dir{>}}
"xor" :[dd] *+[F]{E}="e"
"e" [l] {K} :"e"
"e" [dddddlll] *+=(1, 0)+[F]{\mathstrut y_{n-2}}="i"
"e" [dd] ="x"
"i" [uu] ="y"
[]!{"x"; "e" **{}, "x"+/4pt/ ="p",
- "x"; "y" **{}, "x"+/4pt/ ="q",
- "y"; "x" **{}, "y"+/4pt/ ="r",
- "y"; "i" **{}, "y"+/4pt/ ="s",
- "x"; "y" **{} ?="c" ?(0.5)/-4pt/ ="cx" ?(0.5)/4pt/ ="cy",
- "e";
- "p" **\dir{-};
- "q" **\crv{"x"};
- "cx" **\dir{-};
- "c" *[@]\cir<4pt>{d^u};
- "cy";
- "r" **\dir{-};
- "s" **\crv{"y"};
- "i" **\dir{-}?>*\dir{>}}
+ "x"; "y" **{}, "x"+/4pt/ ="q",
+ "y"; "x" **{}, "y"+/4pt/ ="r",
+ "y"; "i" **{}, "y"+/4pt/ ="s",
+ "x"; "y" **{} ?="c" ?(0.5)/-4pt/ ="cx" ?(0.5)/4pt/ ="cy",
+ "e";
+ "p" **\dir{-};
+ "q" **\crv{"x"};
+ "cx" **\dir{-};
+ "c" *[@]\cir<4pt>{d^u};
+ "cy";
+ "r" **\dir{-};
+ "s" **\crv{"y"};
+ "i" **\dir{-}?>*\dir{>}}
\end{graph} \]
\caption{Encryption using CBC mode with ciphertext stealing}
\label{fig:cbc-steal}
-\end{figure}
+\end{figure}
\begin{definition}[CBC stealing]
\label{def:cbc-steal}
$t = |x| \bmod \ell$; \\
\IF $t \ne 0$ \THEN $x \gets x \cat 0^{\ell-t}$; \\
\FOR $i = 0$ \TO $|x|/\ell$ \DO \\ \ind
- $x_i \gets x[\ell i \bitsto \ell (i + 1)]$; \\
- $y_i \gets P_K(x_i \xor I)$; \\
- $I \gets y_i$; \\
- $y \gets y \cat y_i$; \- \\
+ $x_i \gets x[\ell i \bitsto \ell (i + 1)]$; \\
+ $y_i \gets P_K(x_i \xor I)$; \\
+ $I \gets y_i$; \\
+ $y \gets y \cat y_i$; \- \\
\IF $t \ne 0$ \THEN \\ \ind
- $b \gets |y| - 2\ell$; \\
- $y \gets $\=$y[0 \bitsto b] \cat
- y[b + \ell \bitsto |y|] \cat {}$ \\
- \>$y[b \bitsto b + t]$; \- \\
+ $b \gets |y| - 2\ell$; \\
+ $y \gets $\=$y[0 \bitsto b] \cat
+ y[b + \ell \bitsto |y|] \cat {}$ \\
+ \>$y[b \bitsto b + t]$; \- \\
\RETURN $y$;
\next
Algorithm $\Xid{D}{CBC-steal}^P_K(y)$: \+ \\
$I \gets y[0 \bitsto \ell]$; \\
$t = |y| \bmod \ell$; \\
\IF $t \ne 0$ \THEN \\ \ind
- $b \gets |y| - t - \ell$; \\
- $z \gets P^{-1}_K(y[b \bitsto b + \ell])$; \\
- $y \gets $\=$y[0 \bitsto b] \cat
- y[b + \ell \bitsto |y|] \cat {}$ \\
- \>$z[t \bitsto \ell]$; \- \\
+ $b \gets |y| - t - \ell$; \\
+ $z \gets P^{-1}_K(y[b \bitsto b + \ell])$; \\
+ $y \gets $\=$y[0 \bitsto b] \cat
+ y[b + \ell \bitsto |y|] \cat {}$ \\
+ \>$z[t \bitsto \ell]$; \- \\
$x \gets \emptystring$; \\
\FOR $1 = 0$ \TO $|y|/\ell$ \DO \\ \ind
- $y_i \gets y[\ell i \bitsto \ell (i + 1)]$; \\
- $x_i \gets P^{-1}_K(y_i) \xor I$; \\
- $I \gets y_i$; \\
- $x \gets x \cat x_i$; \- \\
+ $y_i \gets y[\ell i \bitsto \ell (i + 1)]$; \\
+ $x_i \gets P^{-1}_K(y_i) \xor I$; \\
+ $I \gets y_i$; \\
+ $x \gets x \cat x_i$; \- \\
\IF $t \ne 0$ \THEN \\ \ind
- $x \gets x \cat z[0 \bitsto t] \xor y[b \bitsto b + t]$; \- \\
+ $x \gets x \cat z[0 \bitsto t] \xor y[b \bitsto b + t]$; \- \\
\RETURN $x$;
\end{program}
\end{definition}
Function $\id{steal}(l, y)$: \+ \\
$t \gets l \bmod \ell$; \\
\IF $t \ne 0$ \THEN \\ \ind
- $b \gets |y| - 2\ell$; \\
- $y \gets $\=$y[0 \bitsto b] \cat
- y[b + \ell \bitsto |y|] \cat y[b \bitsto b + t]$; \- \\
+ $b \gets |y| - 2\ell$; \\
+ $y \gets $\=$y[0 \bitsto b] \cat
+ y[b + \ell \bitsto |y|] \cat y[b \bitsto b + t]$; \- \\
\RETURN $y$;
\end{program}
Comparing this to definition~\ref{def:cbc-steal} shows that $A'$ simlates
\Pr[C_n]
& = \sum_{x \in \Bin^\ell} \Pr[C_n \mid x^* = x] \Pr[x^* = x] \\
& = \sum_{x \in \Bin^\ell}
- \Pr[x^* = x] \sum_{0\le i<n} \Pr[y^* = z_i \xor x] \\
+ \Pr[x^* = x] \sum_{0\le i<n} \Pr[y^* = z_i \xor x] \\
& \le \sum_{0\le i<n} \frac{1}{2^\ell - n}
- \sum_{x \in \Bin^\ell} \Pr[x^* = x] \\
+ \sum_{x \in \Bin^\ell} \Pr[x^* = x] \\
& = \frac{n}{2^\ell - n}
\end{eqnarray}
\bibliography{mdw-crypto,cryptography,cryptography2000,rfc}
\end{document}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "wrestlers"
%%% End:
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
-##
+##
## TrIPE is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
-##
+##
## You should have received a copy of the GNU General Public License
## along with TrIPE; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
fi
;;
esac
-
+
# --- Do what was wanted ---
case "$1" in
[ -x $i ] || continue
name=`basename $i`
case $name in *~|\#*) continue;; esac
- if $i; then
+ if $i; then
echo -n " $name"
else
- echo -n " ($name failed)"
+ echo -n " ($name failed)"
fi
done
echo " done"
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
-##
+##
## TrIPE is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
-##
+##
## You should have received a copy of the GNU General Public License
## along with TrIPE; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Options supported:
--h, --help Show this help message.
--v, --version Show the version number.
--u, --usage Show pointlessly short usage string.
+-h, --help Show this help message.
+-v, --version Show the version number.
+-u, --usage Show pointlessly short usage string.
Subcommands available:
"""
OS.rename(new, base)
finally:
OS.chdir(cwd)
- rmtree('tmp')
+ rmtree('tmp')
def cmd_update(args):
cwd = OS.getcwd()
### Main driver
class UsageError (Exception): pass
-
+
commands = {'help': (cmd_help, 0, 1, ''),
'newmaster': (cmd_newmaster, 0, 0, ''),
'setup': (cmd_setup, 0, 0, ''),
### Master key integrity
# Since the master public key is contained within the repository, we must
-# check its integrity: therefore we record its sequence number and
-# fingerprint here. These are filled in automatically by
+# check its integrity: therefore we record its sequence number and
+# fingerprint here. These are filled in automatically by
# `tripe-keys upload'. Leave them as they are.
master-sequence = @MASTER-SEQUENCE@
hk-master = @HK-MASTER@
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
-##
+##
## TrIPE is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
-##
+##
## You should have received a copy of the GNU General Public License
## along with TrIPE; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
me.unping()
def destroy(me):
if me.pinger is not None:
- GO.source_remove(me.pinger)
+ GO.source_remove(me.pinger)
def report(me, msg):
moanbox(msg)
return True
Options supported:
--h, --help Show this help message.
--v, --version Show the version number.
--u, --usage Show pointlessly short usage string.
+-h, --help Show this help message.
+-v, --version Show the version number.
+-u, --usage Show pointlessly short usage string.
--d, --directory=DIR Use TrIPE directory DIR.
--a, --admin-socket=FILE Select socket to connect to."""
+-d, --directory=DIR Use TrIPE directory DIR.
+-a, --admin-socket=FILE Select socket to connect to."""
exit(0)
elif o in ('-v', '--version'):
version(stdout)
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
-##
+##
## TrIPE is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
-##
+##
## You should have received a copy of the GNU General Public License
## along with TrIPE; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* (c) 2003 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
udp_me.sin_family = udp_peer.sin_family = AF_INET;
parseaddr(argv[optind], &udp_me.sin_addr, &pt);
- udp_me.sin_port = pt;
+ udp_me.sin_port = pt;
parseaddr(argv[optind + 1], &udp_peer.sin_addr, &pt);
udp_peer.sin_port = pt;
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
-##
+##
## TrIPE is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
-##
+##
## You should have received a copy of the GNU General Public License
## along with TrIPE; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
PASS(f->p->f, buf, sz);
setflood(f);
}
-
+
static void setflood(flood *f)
{
struct timeval tv;
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
-##
+##
## TrIPE is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
-##
+##
## You should have received a copy of the GNU General Public License
## along with TrIPE; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{
admin *a, *aa;
dstr d = DSTR_INIT;
-
+
if (!(flags & F_INIT))
return;
dstr_puts(&d, status);
case 'h': t *= 60;
case 'm': t *= 60;
case 's': if (q[1] != 0)
- default: t = -1;
+ default: t = -1;
case 0: break;
}
- return (t);
+ return (t);
}
/* --- @a_findpeer@ --- *
sel_rmtimer(&r->t);
xfree(r->addr);
a_bgrelease(&r->bg);
-}
+}
/* --- @a_restimer@ --- *
*
a->seq, BGTAG(r), r->addr); )
/* --- If the name is numeric, do it the easy way --- */
-
+
if (inet_aton(av[i], &r->sa.sin.sin_addr)) {
T( trace(T_ADMIN, "admin: resop %s done the easy way", BGTAG(r)); )
func(r, ARES_OK);
a_bgrelease(&pg->bg);
}
return;
-
+
bad_syntax:
a_fail(a, "bad-syntax", "%s", cmd, "[OPTIONS] PEER", cmd, A_END);
fail:
}
a_fail(a, "bad-%s-option", what, "%c", *p, A_END);
return (0);
- tropt_ok:;
+ tropt_ok:;
break;
}
p++;
a_notify("NEWIFNAME", "?PEER", p, "%s", p_ifname(p), "%s", av[1], A_END);
p_setifname(p, av[1]);
a_ok(a);
- }
+ }
}
static void acmd_getchal(admin *a, unsigned ac, char *av[])
"ip-bytes-in=%lu", st->sz_ipin,
A_END);
a_info(a,
- "ip-packets-out=%lu", st->n_ipout,
+ "ip-packets-out=%lu", st->n_ipout,
"ip-bytes-out=%lu", st->sz_ipout,
A_END);
a_info(a, "rejected-packets=%lu", st->n_reject, A_END);
{ "tunnels", 0, 0, 0, acmd_tunnels },
{ "version", 0, 0, 0, acmd_version },
{ "warn", "MESSAGE ...", 1, 0xffff, acmd_warn },
- { "watch", "[OPTIONS]", 0, 1, acmd_watch },
+ { "watch", "[OPTIONS]", 0, 1, acmd_watch },
{ 0, 0, 0, 0, 0 }
};
for (c = acmdtab; c->name; c++) {
if (c->help)
a_info(a, "%s", c->name, "*%s", c->help, A_END);
- else
+ else
a_info(a, "%s", c->name, A_END);
}
a_ok(a);
if (c->argmin > ac || ac > c->argmax) {
if (!c->help)
a_fail(a, "bad-syntax", "%s", c->name, "", A_END);
- else
+ else
a_fail(a, "bad-syntax", "%s", c->name, "%s", c->help, A_END);
} else
c->func(a, ac, av + 1);
* (c) 2005 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* %$r_A = g^{\rho_A}$% Alice's challenge
* %$c_A = H(\cookie{cookie}, r_A)$% Alice's cookie
* %$v_A = \rho_A \xor H(\cookie{expected-reply}, a, r_A, r_B, b^{\rho_A})$%
- * Alice's challenge check value
+ * Alice's challenge check value
* %$r_B^\alpha = a^{\rho_B}$% Alice's reply
* %$K = r_B^{\rho_A} = r_B^{\rho_A} = g^{\rho_A\rho_B}$%
- * Alice and Bob's shared secret key
+ * Alice and Bob's shared secret key
* %$w_A = H(\cookie{switch-request}, c_A, c_B)$%
- * Alice's switch request value
+ * Alice's switch request value
* %$u_A = H(\cookie{switch-confirm}, c_A, c_B)$%
- * Alice's switch confirm value
+ * Alice's switch confirm value
*
* The messages are then:
*
*
* %$\cookie{kx-switch-ok}, E_K(u_A))$%
* Switch received. Committed; send data; move to @KXS_SWITCH@.
- */
+ */
/*----- Tunable parameters ------------------------------------------------*/
goto badcheck;
/* --- Fill in a new challenge block --- */
-
+
kxc = kxc_new(kx);
G_COPY(gg, kxc->c, c);
G_COPY(gg, kxc->r, r);
G_DESTROY(gg, cc);
G_DESTROY(gg, r);
mp_drop(cv);
- return (0);
+ return (0);
}
/* --- @dochallenge@ --- *
kx->r[0] = kxc;
kx->nr = 1;
kxc_stoptimer(kxc);
- ksl_link(kx->ks, kxc->ks);
+ ksl_link(kx->ks, kxc->ks);
}
/* --- @doreply@ --- *
if (BLEFT(b)) {
a_warn("KX", "?PEER", kx->p, "invalid", "reply", A_END);
goto bad;
- }
+ }
if (kx->s == KXS_CHAL) {
commit(kx, kxc);
kx->s = KXS_COMMIT;
return (0);
bad:
- return (-1);
+ return (-1);
}
/*----- Main code ---------------------------------------------------------*/
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* --- @keymoan@ --- *
*
* Arguments: @const char *file@ = name of the file
- * @int line@ = line number in file
- * @const char *msg@ = error message
- * @void *p@ = argument pointer
+ * @int line@ = line number in file
+ * @const char *msg@ = error message
+ * @void *p@ = argument pointer
*
- * Returns: ---
+ * Returns: ---
*
- * Use: Reports an error message about loading a key file.
+ * Use: Reports an error message about loading a key file.
*/
static void keymoan(const char *file, int line, const char *msg, void *p)
/* --- Good, we're happy --- *
*
- * Dodginess! We change the group over here, but don't free any old group
+ * Dodginess! We change the group over here, but don't free any old group
* elements. This assumes that the new group is basically the same as the
* old one, and will happily adopt the existing elements. If it isn't,
* then we lose badly. Check this, then.
/* --- Ensure that the group is correct --- *
*
- * Dodginess! We assume that if this works, our global group is willing to
+ * Dodginess! We assume that if this works, our global group is willing to
* adopt this public element. Probably reasonable.
*/
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* --- Encrypted data format --- *
*
* Let %$p_i$% be the %$i$%-th plaintext message, with type %$t$%. We first
- * compute
+ * compute
*
* %$c_i = \mathcal{E}\textrm{-CBC}_{K_{\text{E}}}(p_i)$%
*
rc = -1;
}
ks->sz_exp = nsz;
- return (rc);
+ return (rc);
}
/* --- @dodecrypt@ --- *
*
* Arguments: @const void *k@ = pointer to key material
* @size_t x, y, z@ = offsets into key material (see below)
- * @peer *p@ = pointer to peer information
+ * @peer *p@ = pointer to peer information
*
* Returns: A pointer to the new keyset.
*
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
uint32 id;
const octet *magic;
ping *pg;
-
+
IF_TRACING(T_PEER, {
trace(T_PEER, "peer: received %s reply from %s",
p_pingtype(msg), p->spec.name);
case MISC_PING:
buf_put(p_txstart(p, MSG_MISC | MISC_PONG), BCUR(&b), BLEFT(&b));
p_txend(p);
- break;
+ break;
case MISC_PONG:
p_ponged(p, MISC_PONG, &b);
break;
if (strcmp(name, p->spec.name) == 0)
return (p);
}
- return (0);
+ return (0);
}
/* --- @p_destroy@ --- *
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
unsigned long sz_exp; /* Data limit for the keyset */
T( unsigned seq; ) /* Sequence number for tracing */
unsigned f; /* Various useful flags */
- gcipher *cin, *cout; /* Keyset ciphers for encryption */
+ gcipher *cin, *cout; /* Keyset ciphers for encryption */
size_t tagsz; /* Length to truncate MAC tags */
- gmac *min, *mout; /* Keyset MACs for integrity */
+ gmac *min, *mout; /* Keyset MACs for integrity */
uint32 oseq; /* Outbound sequence number */
seqwin iseq; /* Inbound sequence number */
} keyset;
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
sel_file f; /* Selector for tunnel device */
struct peer *p; /* Pointer to my peer */
unsigned n; /* Number of my tunnel device */
-};
+};
/* --- @t_read@ --- *
*
* (c) 2003 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
const tunnel_ops *ops; /* Pointer to operations */
sel_file f; /* Selector for TUN/TAP device */
struct peer *p; /* Pointer to my peer */
-};
+};
/* --- @t_read@ --- *
*
* (c) 2005 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# define ST_EOF 4u /* File descriptor reported EOF */
size_t n; /* Number of bytes used in buffer */
octet buf[PKBUFSZ]; /* Buffer for incoming data */
-};
+};
/*----- Static variables --------------------------------------------------*/
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
-##
+##
## TrIPE is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
-##
+##
## You should have received a copy of the GNU General Public License
## along with TrIPE; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* (c) 2003 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Trivial IP Encryption (TrIPE).
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* TrIPE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with TrIPE; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static gint gethash(proto_tree *tt, int hf, tvbuff_t *b, gint off)
{
proto_tree_add_item(tt, hf, b, off, hashsz, FALSE);
- return (off + hashsz);
+ return (off + hashsz);
}
static gint getmp(proto_tree *tt, const hfmp *hf, tvbuff_t *b, gint off)
proto_tree_add_item(tt, hf->hfy_len, b, off + 2 + len, 2, FALSE);
proto_tree_add_item(tt, hf->hfy_val, b, off + 4 + len, len2, FALSE);
r = off + len + len2 + 4;
- }
+ }
return (r);
}
proto_tree_add_item(ti, hf_tripe_ct_ct, b, off, -1, FALSE);
goto done;
done:;
- }
+ }
}
void proto_register_tripe(void)