1999-05-13 19:37:32 +08:00
|
|
|
$! TESTENC.COM -- Test encoding and decoding
|
|
|
|
$
|
|
|
|
$ __arch := VAX
|
2009-05-16 00:36:56 +08:00
|
|
|
$ if f$getsyi("cpu") .ge. 128 then -
|
2010-01-27 17:18:42 +08:00
|
|
|
__arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
|
2009-05-16 00:36:56 +08:00
|
|
|
$ if __arch .eqs. "" then __arch := UNK
|
1999-05-13 19:37:32 +08:00
|
|
|
$
|
2005-04-30 23:23:14 +08:00
|
|
|
$ testsrc := makefile.
|
1999-05-13 19:37:32 +08:00
|
|
|
$ test := p.txt
|
|
|
|
$ cmd := mcr 'exe_dir'openssl
|
|
|
|
$
|
2000-02-26 11:59:46 +08:00
|
|
|
$ if f$search(test) .nes. "" then delete 'test';*
|
2002-08-14 19:08:43 +08:00
|
|
|
$ convert/fdl=sys$input: 'testsrc' 'test'
|
|
|
|
RECORD
|
|
|
|
FORMAT STREAM_LF
|
1999-05-13 19:37:32 +08:00
|
|
|
$
|
2000-02-26 11:59:46 +08:00
|
|
|
$ if f$search(test+"-cipher") .nes. "" then delete 'test'-cipher;*
|
|
|
|
$ if f$search(test+"-clear") .nes. "" then delete 'test'-clear;*
|
|
|
|
$
|
1999-05-13 19:37:32 +08:00
|
|
|
$ write sys$output "cat"
|
|
|
|
$ 'cmd' enc -in 'test' -out 'test'-cipher
|
|
|
|
$ 'cmd' enc -in 'test'-cipher -out 'test'-clear
|
1999-11-12 09:46:50 +08:00
|
|
|
$ backup/compare 'test' 'test'-clear
|
1999-05-13 19:37:32 +08:00
|
|
|
$ if $severity .ne. 1 then exit 3
|
|
|
|
$ delete 'test'-cipher;*,'test'-clear;*
|
|
|
|
$
|
|
|
|
$ write sys$output "base64"
|
|
|
|
$ 'cmd' enc -a -e -in 'test' -out 'test'-cipher
|
|
|
|
$ 'cmd' enc -a -d -in 'test'-cipher -out 'test'-clear
|
1999-11-12 09:46:50 +08:00
|
|
|
$ backup/compare 'test' 'test'-clear
|
1999-05-13 19:37:32 +08:00
|
|
|
$ if $severity .ne. 1 then exit 3
|
|
|
|
$ delete 'test'-cipher;*,'test'-clear;*
|
|
|
|
$
|
2000-03-18 17:11:00 +08:00
|
|
|
$ define/user sys$output 'test'-cipher-commands
|
1999-05-13 19:37:32 +08:00
|
|
|
$ 'cmd' list-cipher-commands
|
2000-03-18 17:11:00 +08:00
|
|
|
$ open/read f 'test'-cipher-commands
|
1999-05-13 19:37:32 +08:00
|
|
|
$ loop_cipher_commands:
|
|
|
|
$ read/end=loop_cipher_commands_end f i
|
|
|
|
$ write sys$output i
|
2000-02-26 11:59:46 +08:00
|
|
|
$
|
|
|
|
$ if f$search(test+"-"+i+"-cipher") .nes. "" then -
|
|
|
|
delete 'test'-'i'-cipher;*
|
|
|
|
$ if f$search(test+"-"+i+"-clear") .nes. "" then -
|
|
|
|
delete 'test'-'i'-clear;*
|
|
|
|
$
|
1999-05-13 19:37:32 +08:00
|
|
|
$ 'cmd' 'i' -bufsize 113 -e -k test -in 'test' -out 'test'-'i'-cipher
|
|
|
|
$ 'cmd' 'i' -bufsize 157 -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear
|
1999-11-12 09:46:50 +08:00
|
|
|
$ backup/compare 'test' 'test'-'i'-clear
|
1999-05-13 19:37:32 +08:00
|
|
|
$ if $severity .ne. 1 then exit 3
|
|
|
|
$ delete 'test'-'i'-cipher;*,'test'-'i'-clear;*
|
|
|
|
$
|
|
|
|
$ write sys$output i," base64"
|
|
|
|
$ 'cmd' 'i' -bufsize 113 -a -e -k test -in 'test' -out 'test'-'i'-cipher
|
|
|
|
$ 'cmd' 'i' -bufsize 157 -a -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear
|
1999-11-12 09:46:50 +08:00
|
|
|
$ backup/compare 'test' 'test'-'i'-clear
|
1999-05-13 19:37:32 +08:00
|
|
|
$ if $severity .ne. 1 then exit 3
|
|
|
|
$ delete 'test'-'i'-cipher;*,'test'-'i'-clear;*
|
|
|
|
$
|
|
|
|
$ goto loop_cipher_commands
|
|
|
|
$ loop_cipher_commands_end:
|
|
|
|
$ close f
|
2000-03-17 05:20:35 +08:00
|
|
|
$ delete 'test'-cipher-commands;*
|
1999-05-13 19:37:32 +08:00
|
|
|
$ delete 'test';*
|