check.pl
来自「伯克利做的SFTP安全文件传输协议」· PL 代码 · 共 59 行
PL
59 行
#!/usr/bin/perl -w# verify a SafeTP builduse strict 'subs';sub run;if (@ARGV >= 1) { # any argument skips the standalone tests}else { # run the standalone test programs foreach $prog (qw(datablok tsint sdsa selgamal tdes tsha texcept crc blokutil nonport tpool sockutil)) { run("./$prog"); # bugfix: had been assuming that "." was in cwd }}# use a temporary directory for keys, since they will be# relatively weak$ENV{"SAFETP_CONFIG"} = "./weak.keys";# remove the existing keys (if any)system("rm -rf weak.keys");# create the keys (does not get entropy -- creates weak keys)run("echo test server | ./makekeys 512 512 0");# run the big testrun("./provider");# done!exit(0);sub run { my ($cmd) = @_; print("executing: $cmd\n"); my $log = "check.pl.out"; open(OUT,">>$log") or die; print OUT ("----------------- output of $cmd --------------\n"); close(OUT) or die; if (system("$cmd >> $log 2>&1") != 0) { print("$cmd failed.\n", "This probably needs to be fixed for\n", "SafeTP to run successfully. You may be able to\n", "learn more about why it failed by looking at\n", "its output, which is at the end of $log .\n"); exit(2); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?