Skip to content

Commit

Permalink
Merge pull request #461 from ellert/crl-fix
Browse files Browse the repository at this point in the history
Fix hash-algorithm detection bug
  • Loading branch information
gganis committed Feb 10, 2017
2 parents c07a51d + be89136 commit c4577aa
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/XrdSecgsi/XrdSecProtocolgsi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3946,12 +3946,15 @@ XrdCryptoX509Crl *XrdSecProtocolgsi::LoadCRL(XrdCryptoX509 *xca, const char *sub
return crl;
}

String caroot(subjhash);
if (caroot.endswith(".0"))
caroot.erase(caroot.length() - 2, 2);

// Get the CA hash
String cahash(subjhash);
int hashalg = 0;
if (strcmp(subjhash, xca->SubjectHash())) hashalg = 1;
// Drop the extension (".0")
String caroot(cahash, 0, cahash.find(".0")-1);
if (strcmp(caroot.c_str(), xca->SubjectHash())) hashalg = 1;

String cahash = caroot + ".0";

// The dir
String crlext = XrdSecProtocolgsi::DefCRLext;
Expand Down

0 comments on commit c4577aa

Please sign in to comment.