List Info

Thread: OpenSSL: openssl/test/ cms-test.pl




OpenSSL: openssl/test/ cms-test.pl
country flaguser name
Germany
2008-03-18 13:51:44
  OpenSSL CVS Repository
  http://cvs.openssl.org/
 
____________________________________________________________
________________

  Server: cvs.openssl.org                  Name:   Dr.
Stephen Henson
  Root:   /v/openssl/cvs                   Email:  steveopenssl.org
  Module: openssl                          Date:  
18-Mar-2008 19:51:44
  Branch: HEAD                             Handle:
2008031818514400

  Modified files:
    openssl/test            cms-test.pl

  Log:
    Delete tmp files, silence openssl commands, compare
extracted content.

  Summary:
    Revision    Changes     Path
    1.4         +53 -2      openssl/test/cms-test.pl
 
____________________________________________________________
________________

  patch -p0 <<' .'
  Index: openssl/test/cms-test.pl
 
============================================================
================
  $ cvs diff -u -r1.3 -r1.4 cms-test.pl
  --- openssl/test/cms-test.pl	18 Mar 2008 18:29:54
-0000	1.3
  +++ openssl/test/cms-test.pl	18 Mar 2008 18:51:44
-0000	1.4
   -319,26 +319,77 
       print "ALL TESTS SUCCESSFUL.n";
   }
   
  +unlink "test.cms";
  +unlink "test2.cms";
  +unlink "smtst.txt";
  +
   sub run_smime_tests {
       my ( $rv, $aref, $scmd, $vcmd ) = _;
   
       foreach $smtst ($aref) {
           my ( $tnam, $rscmd, $rvcmd ) = $smtst;
  -        system( $scmd . $rscmd );
  +        system("$scmd$rscmd 2>cms.err
1>cms.out");
           if ($?) {
               print "$tnam: generation errorn";
               $$rv++;
               exit 1 if $halt_err;
               next;
           }
  -        system( $vcmd . $rvcmd );
  +        system("$vcmd$rvcmd 2>cms.err
1>cms.out");
           if ($?) {
               print "$tnam: verify errorn";
               $$rv++;
               exit 1 if $halt_err;
               next;
           }
  +	if (!cmp_files("smtst.txt",
"smcont.txt")) {
  +            print "$tnam: content verify
errorn";
  +            $$rv++;
  +            exit 1 if $halt_err;
  +            next;
  +	}
           print "$tnam: OKn";
       }
   }
   
  +sub cmp_files {
  +    my ( $f1, $f2 ) = _;
  +    my ( $fp1, $fp2 );
  +
  +    my ( $rd1, $rd2 );
  +
  +    if ( !open( $fp1, "<$f1" ) ) {
  +        print STDERR "Can't Open file $f1n";
  +        return 0;
  +    }
  +
  +    if ( !open( $fp2, "<$f2" ) ) {
  +        print STDERR "Can't Open file $f2n";
  +        return 0;
  +    }
  +
  +    binmode $fp1;
  +    binmode $fp2;
  +
  +    my $ret = 0;
  +
  +    for ( ; ; ) {
  +        $n1 = sysread $fp1, $rd1, 4096;
  +        $n2 = sysread $fp2, $rd2, 4096;
  +        last if ( $n1 != $n2 );
  +        last if ( $rd1 ne $rd2 );
  +
  +        if ( $n1 == 0 ) {
  +            $ret = 1;
  +            last;
  +        }
  +
  +    }
  +
  +    close $fp1;
  +    close $fp2;
  +
  +    return $ret;
  +
  +}
  +
   .
____________________________________________________________
__________
OpenSSL Project                                 http://www.openssl.org
CVS Repository Commit List                    
openssl-cvsopenssl.org
Automated List Manager                          
majordomoopenssl.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )