12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- die "usage: verify-cn cnfile certificate_depth subject" if (@ARGV != 3);
- ($cnfile, $depth, $x509) = @ARGV;
- if ($depth == 0) {
-
-
-
-
-
- if ($x509 =~ / CN=([^,]+)/) {
- $cn = $1;
-
-
- open(FH, '<', $cnfile) or exit 1;
- while (defined($line = <FH>)) {
- if ($line !~ /^[[:space:]]*(#|$)/o) {
- chop($line);
- if ($line eq $cn) {
- exit 0;
- }
- }
- }
- close(FH);
- }
-
-
-
- exit 1;
- }
- exit 0;
|