Use rdrand as additional entropy source.
[openssl.git] / VMS / VMSify-conf.pl
1 #! /usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 my @directory_vars = ( "dir", "certs", "crl_dir", "new_certs_dir" );
7 my @file_vars = ( "database", "certificate", "serial", "crlnumber",
8                   "crl", "private_key", "RANDFILE" );
9 while(<STDIN>) {
10     chomp;
11     foreach my $d (@directory_vars) {
12         if (/^(\s*\#?\s*${d}\s*=\s*)\.\/([^\s\#]*)([\s\#].*)$/) {
13             $_ = "$1sys\\\$disk:\[.$2$3";
14         } elsif (/^(\s*\#?\s*${d}\s*=\s*)(\w[^\s\#]*)([\s\#].*)$/) {
15             $_ = "$1sys\\\$disk:\[.$2$3";
16         }
17         s/^(\s*\#?\s*${d}\s*=\s*\$\w+)\/([^\s\#]*)([\s\#].*)$/$1.$2\]$3/;
18         while(/^(\s*\#?\s*${d}\s*=\s*(\$\w+\.|sys\\\$disk:\[\.)[\w\.]+)\/([^\]]*)\](.*)$/) {
19             $_ = "$1.$3]$4";
20         }
21     }
22     foreach my $f (@file_vars) {
23         s/^(\s*\#?\s*${f}\s*=\s*)\.\/(.*)$/$1sys\\\$disk:\[\/$2/;
24         while(/^(\s*\#?\s*${f}\s*=\s*(\$\w+|sys\\\$disk:\[)[^\/]*)\/(\w+\/[^\s\#]*)([\s\#].*)$/) {
25             $_ = "$1.$3$4";
26         }
27         if (/^(\s*\#?\s*${f}\s*=\s*(\$\w+|sys\\\$disk:\[)[^\/]*)\/(\w+)([\s\#].*)$/) {
28             $_ = "$1]$3.$4";
29         } elsif  (/^(\s*\#?\s*${f}\s*=\s*(\$\w+|sys\\\$disk:\[)[^\/]*)\/([^\s\#]*)([\s\#].*)$/) {
30             $_ = "$1]$3$4";
31         }
32    }
33     print $_,"\n";
34 }