trsa.com 2.8 KB
Newer Older
U
Ulf Möller 已提交
1 2
$! TRSA.COM  --  Tests rsa keys
$
3
$	__arch = "VAX"
4
$	if f$getsyi("cpu") .ge. 128 then -
5
	   __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
6 7 8 9 10
$	if __arch .eqs. "" then __arch = "UNK"
$!
$	if (p2 .eqs. "64") then __arch = __arch+ "_64"
$!
$	exe_dir = "sys$disk:[-.''__arch'.exe.apps]"
U
Ulf Möller 已提交
11
$
R
Richard Levitte 已提交
12 13 14 15 16 17
$	set noon
$	define/user sys$output nla0:
$	mcr 'exe_dir'openssl no-rsa
$	save_severity=$SEVERITY
$	set on
$	if save_severity
R
Richard Levitte 已提交
18
$	then
R
Richard Levitte 已提交
19 20
$	    write sys$output "skipping RSA conversion test"
$	    exit
R
Richard Levitte 已提交
21 22
$	endif
$
23
$	cmd = "mcr ''exe_dir'openssl rsa"
U
Ulf Möller 已提交
24
$
25
$	t = "testrsa.pem"
U
Ulf Möller 已提交
26 27 28
$	if p1 .nes. "" then t = p1
$
$	write sys$output "testing RSA conversions"
29 30 31
$	if f$search("fff.*") .nes "" then delete fff.*;*
$	if f$search("ff.*") .nes "" then delete ff.*;*
$	if f$search("f.*") .nes "" then delete f.*;*
32 33 34
$	convert/fdl=sys$input: 't' fff.p
RECORD
	FORMAT STREAM_LF
U
Ulf Möller 已提交
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
$
$	write sys$output "p -> d"
$	'cmd' -in fff.p -inform p -outform d -out f.d
$	if $severity .ne. 1 then exit 3
$!	write sys$output "p -> t"
$!	'cmd' -in fff.p -inform p -outform t -out f.t
$!	if $severity .ne. 1 then exit 3
$	write sys$output "p -> p"
$	'cmd' -in fff.p -inform p -outform p -out f.p
$	if $severity .ne. 1 then exit 3
$
$	write sys$output "d -> d"
$	'cmd' -in f.d -inform d -outform d -out ff.d1
$	if $severity .ne. 1 then exit 3
$!	write sys$output "t -> d"
$!	'cmd' -in f.t -inform t -outform d -out ff.d2
$!	if $severity .ne. 1 then exit 3
$	write sys$output "p -> d"
$	'cmd' -in f.p -inform p -outform d -out ff.d3
$	if $severity .ne. 1 then exit 3
$
$!	write sys$output "d -> t"
$!	'cmd' -in f.d -inform d -outform t -out ff.t1
$!	if $severity .ne. 1 then exit 3
$!	write sys$output "t -> t"
$!	'cmd' -in f.t -inform t -outform t -out ff.t2
$!	if $severity .ne. 1 then exit 3
$!	write sys$output "p -> t"
$!	'cmd' -in f.p -inform p -outform t -out ff.t3
$!	if $severity .ne. 1 then exit 3
$
$	write sys$output "d -> p"
$	'cmd' -in f.d -inform d -outform p -out ff.p1
$	if $severity .ne. 1 then exit 3
$!	write sys$output "t -> p"
$!	'cmd' -in f.t -inform t -outform p -out ff.p2
$!	if $severity .ne. 1 then exit 3
$	write sys$output "p -> p"
$	'cmd' -in f.p -inform p -outform p -out ff.p3
$	if $severity .ne. 1 then exit 3
$
76
$	backup/compare fff.p f.p
U
Ulf Möller 已提交
77
$	if $severity .ne. 1 then exit 3
78
$	backup/compare fff.p ff.p1
U
Ulf Möller 已提交
79
$	if $severity .ne. 1 then exit 3
80
$!	backup/compare fff.p ff.p2
U
Ulf Möller 已提交
81
$!	if $severity .ne. 1 then exit 3
82
$	backup/compare fff.p ff.p3
U
Ulf Möller 已提交
83 84
$	if $severity .ne. 1 then exit 3
$
85
$!	backup/compare f.t ff.t1
U
Ulf Möller 已提交
86
$!	if $severity .ne. 1 then exit 3
87
$!	backup/compare f.t ff.t2
U
Ulf Möller 已提交
88
$!	if $severity .ne. 1 then exit 3
89
$!	backup/compare f.t ff.t3
U
Ulf Möller 已提交
90 91
$!	if $severity .ne. 1 then exit 3
$
92
$	backup/compare f.p ff.p1
U
Ulf Möller 已提交
93
$	if $severity .ne. 1 then exit 3
94
$!	backup/compare f.p ff.p2
U
Ulf Möller 已提交
95
$!	if $severity .ne. 1 then exit 3
96
$	backup/compare f.p ff.p3
U
Ulf Möller 已提交
97 98 99
$	if $severity .ne. 1 then exit 3
$
$	delete f.*;*,ff.*;*,fff.*;*