Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
91ca943c
Commit
91ca943c
authored
Mar 06, 2009
by
Gary Wong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check all credential certificates against CRLs.
parent
e4516ce7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
protogeni/security/verifygenicred.in
protogeni/security/verifygenicred.in
+20
-1
No files found.
protogeni/security/verifygenicred.in
View file @
91ca943c
...
...
@@ -50,6 +50,7 @@ my $SSLDIR = "$TB/lib/ssl";
my
$EMULAB_CERT
=
"
$TB
/etc/emulab.pem
";
my
$EMULAB_KEY
=
"
$TB
/etc/emulab.key
";
my
$GENICERTS
=
"
$TB
/etc/genicacerts
";
my
$REVOKED
=
"
$TB
/etc/genicrl.serials
";
my
$OPENSSL
=
"
/usr/bin/openssl
";
my
$XMLLINT
=
"
/usr/local/bin/xmllint
";
my
$XMLSEC1
=
"
/usr/local/bin/xmlsec1
";
...
...
@@ -252,6 +253,17 @@ foreach my $credential ( keys( %credentials ) ) {
}
}
# Read in all entries from CRLs.
my
%revoked
=
();
if
(
-
r
$REVOKED
)
{
open
(
SERIALS
,
$REVOKED
)
or
fatal
(
"
Cannot read
$REVOKED
"
);
while
(
<
SERIALS
>
)
{
chomp
;
$revoked
{
$_
}
=
1
;
}
close
(
SERIALS
);
}
#
# The certficate used to sign the credential was either the Emulab certificate
# or that of the user delegating the credential. For now we just worry about
...
...
@@ -271,7 +283,7 @@ my $certarg = " " . join(" ", map("--trusted-pem $GENICERTS/$_", @pemfiles));
# covers the credential and all the parents up to the top.
#
foreach
my
$sigid
(
keys
(
%credentials
))
{
my
$cmd
=
"
$XMLSEC1
--verify
";
my
$cmd
=
"
$XMLSEC1
--verify
--store-signatures
";
$cmd
.=
"
--print-debug
"
if
(
$debug
);
$cmd
.=
"
--node-id Sig_
$sigid
$certarg
$xmlfile
";
...
...
@@ -293,9 +305,16 @@ foreach my $sigid (keys(%credentials)) {
}
print
STDERR
$line
if
(
defined
(
$line
)
&&
$debug
);
my
$issuer
=
undef
;
while
(
<
SEC
>
)
{
print
STDERR
$_
if
(
$debug
);
$issuer
=
$
1
if
m{^==== Issuer Name:.+/CN=([^/]+)/}
;
if
(
m{^==== Issuer Serial: (.+)}
)
{
$issuer
and
$revoked
{
"
$issuer
$1
"
}
and
fatal
(
"
Certificate
$issuer
$1 has been revoked
"
);
$issuer
=
undef
;
}
}
close
(
SEC
)
or
fatal
(
$!
?
"
Error closing
$XMLSEC1
pipe: $!
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment