[freeside-commits] freeside/FS/FS svc_cert.pm,1.1.2.5,1.1.2.6
Ivan,,,
ivan at wavetail.420.am
Sun Nov 7 23:36:02 PST 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv1465/FS/FS
Modified Files:
Tag: FREESIDE_2_1_BRANCH
svc_cert.pm
Log Message:
certificates ala communigate, RT#7515
Index: svc_cert.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_cert.pm,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -w -d -r1.1.2.5 -r1.1.2.6
--- svc_cert.pm 8 Nov 2010 00:01:59 -0000 1.1.2.5
+++ svc_cert.pm 8 Nov 2010 07:36:00 -0000 1.1.2.6
@@ -303,9 +303,30 @@
$self->csr($csr);
}
-#sub check_csr {
-# my $self = shift;
-#}
+sub check_csr {
+ my $self = shift;
+
+ my $in = $self->csr;
+
+ run( [qw( openssl req -subject -noout ), ],
+ '<'=>\$in,
+ '>pipe'=>\*OUT, '2>'=>'/dev/null'
+ )
+ ;#or die "error running openssl: $!";
+
+ #subject=/CN=cn.example.com/ST=AK/O=Tofuy/OU=Soybean dept./C=US/L=Tofutown
+ my $line = <OUT>;
+ $line =~ /^subject=\/(.*)$/ or return ();
+ my $subj = $1;
+
+ map { if ( /^\s*(\w+)=\s*(.*)\s*$/ ) {
+ ($1=>$2);
+ } else {
+ ();
+ }
+ }
+ split('/', $subj);
+}
sub generate_selfsigned {
my $self = shift;
@@ -360,7 +381,7 @@
$hash{$f} = { map { if ( /^\s*(\w+)=\s*(.*)\s*$/ ) {
($1=>$2);
} else {
- (''=>'');
+ ();
}
}
split('/', $hash{$f})
More information about the freeside-commits
mailing list