~ubuntu-branches/ubuntu/raring/curl/raring-updates

« back to all changes in this revision

Viewing changes to tests/sshserver.pl

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2011-11-13 21:07:32 UTC
  • mto: (3.6.1 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 55.
  • Revision ID: package-import@ubuntu.com-20111113210732-bk5n25x2tu7aplur
Tags: upstream-7.22.0
ImportĀ upstreamĀ versionĀ 7.22.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#                            | (__| |_| |  _ <| |___
7
7
#                             \___|\___/|_| \_\_____|
8
8
#
9
 
# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
 
9
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
10
10
#
11
11
# This software is licensed as described in the file COPYING, which
12
12
# you should have received as part of this distribution. The terms
362
362
#***************************************************************************
363
363
# Generate host and client key files for curl's tests
364
364
#
365
 
if((! -e $hstprvkeyf) || (! -e $hstpubkeyf) ||
366
 
   (! -e $cliprvkeyf) || (! -e $clipubkeyf)) {
 
365
if((! -e $hstprvkeyf) || (! -s $hstprvkeyf) ||
 
366
   (! -e $hstpubkeyf) || (! -s $hstpubkeyf) ||
 
367
   (! -e $cliprvkeyf) || (! -s $cliprvkeyf) ||
 
368
   (! -e $clipubkeyf) || (! -s $clipubkeyf)) {
367
369
    # Make sure all files are gone so ssh-keygen doesn't complain
368
370
    unlink($hstprvkeyf, $hstpubkeyf, $cliprvkeyf, $clipubkeyf);
369
371
    logmsg 'generating host keys...' if($verbose);
706
708
#***************************************************************************
707
709
# Generate ssh client host key database file for curl's tests
708
710
#
709
 
if(! -e $knownhosts) {
 
711
if((! -e $knownhosts) || (! -s $knownhosts)) {
710
712
    logmsg 'generating ssh client known hosts file...' if($verbose);
 
713
    unlink($knownhosts);
711
714
    if(open(DSAKEYFILE, "<$hstpubkeyf")) {
712
715
        my @dsahostkey = do { local $/ = ' '; <DSAKEYFILE> };
713
716
        if(close(DSAKEYFILE)) {