#!/usr/bin/perl -w

# Verify X509 Common Name

# Return 0 if cn matches the common name component of X509_NAME_oneline,
# 1 otherwise.

($depth, $cn) = @ARGV;

# debugging purposes
# print "<$cn> <$depth>\n";

## VERIFIKATION

## CA
if ($depth   == 1
&& $cn eq '/C=DE/ST=Bayern/L=Erlangen/O=Friedrich-Alexander.Universitaet/OU=Informatik.CIP-Pool.CA/CN=CA.Informatik/Email=ca@cip.informatik.uni-erlangen.de') {
	exit 0;
}
## SERVER STRING
 elsif  ($depth == 0
&& $cn eq '/C=DE/ST=Bayern/L=Erlangen/O=Friedrich-Alexander.Universitaet/OU=Informatik.CIP-Pool/CN=faui06.informatik.uni-erlangen.de/Email=problems@cip.informatik.uni-erlangen.de') {
	exit 0;
}

exit 1;
