~ubuntu-branches/ubuntu/dapper/openssh/dapper

« back to all changes in this revision

Viewing changes to regress/rekey.sh

  • Committer: Bazaar Package Importer
  • Author(s): Noah Meyerhans
  • Date: 2006-10-31 17:53:38 UTC
  • Revision ID: james.westby@ubuntu.com-20061031175338-kh299ada2qc2kzlb
Tags: upstream-3.8.1p1
ImportĀ upstreamĀ versionĀ 3.8.1p1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#       $OpenBSD: rekey.sh,v 1.1 2003/03/28 13:58:28 markus Exp $
 
2
#       Placed in the Public Domain.
 
3
 
 
4
tid="rekey during transfer data"
 
5
 
 
6
DATA=${OBJ}/data
 
7
COPY=${OBJ}/copy
 
8
LOG=${OBJ}/log
 
9
 
 
10
rm -f ${COPY} ${LOG} ${DATA}
 
11
dd if=/bin/ls${EXEEXT} of=${DATA} bs=1k seek=511 count=1 > /dev/null 2>&1
 
12
 
 
13
for s in 16 1k 128k 256k; do
 
14
        trace "rekeylimit ${s}"
 
15
        rm -f ${COPY}
 
16
        cat $DATA | \
 
17
                ${SSH} -oCompression=no -oRekeyLimit=$s \
 
18
                        -v -F $OBJ/ssh_proxy somehost "cat > ${COPY}" \
 
19
                2> ${LOG}
 
20
        if [ $? -ne 0 ]; then
 
21
                fail "ssh failed"
 
22
        fi
 
23
        cmp $DATA ${COPY}               || fail "corrupted copy"
 
24
        n=`grep 'NEWKEYS sent' ${LOG} | wc -l`
 
25
        n=`expr $n - 1`
 
26
        trace "$n rekeying(s)"
 
27
        if [ $n -lt 1 ]; then
 
28
                fail "no rekeying occured"
 
29
        fi
 
30
done
 
31
rm -f ${COPY} ${LOG} ${DATA}