Skip to content

Commit

Permalink
secgsi: improving checking of CA expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
gganis committed Jun 19, 2018
1 parent 07d48ba commit 505ebad
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/XrdSecgsi/XrdSecProtocolgsi.cc
Expand Up @@ -4108,6 +4108,15 @@ bool XrdSecProtocolgsi::VerifyCA(int opt, X509Chain *cca, XrdCryptoFactory *CF)

// Point to the certificate
XrdCryptoX509 *xc = cca->Begin();
if (!xc) {
PRINT("Cannot attach to first certificate in chain");
return 0;
}
// Make sure it is valid
if (!(xc->IsValid())) {
PRINT("CA certificate is expired ("<<xc->SubjectHash()<<", not_before: "<<xc->NotBefore()<<" secs UTC )");
return 0;
}
// Is it self-signed ?
bool self = (!strcmp(xc->IssuerHash(), xc->SubjectHash())) ? 1 : 0;
if (!self) {
Expand Down

0 comments on commit 505ebad

Please sign in to comment.