Skip to content

Commit

Permalink
cryptocrl: modified logic for retrieving entries in IsRevoked
Browse files Browse the repository at this point in the history
Also properly use the entry status.
  • Loading branch information
gganis committed Jul 6, 2017
1 parent db73662 commit 407cbf3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/XrdCrypto/XrdCryptosslX509Crl.cc
Expand Up @@ -400,11 +400,13 @@ int XrdCryptosslX509Crl::LoadCache()
bool rdlock = false;
XrdSutCacheEntry *cent = cache.Get((const char *)tagser, rdlock);
if (!cent) {
DEBUG("problems updating the cache");
DEBUG("problems getting entry in the cache");
return -1;
}
// Add revocation date
cent->mtime = XrdCryptosslASN1toUTC(X509_REVOKED_get0_revocationDate(rev));
// Set status
cent->mtime = kCE_ok;
// Release the string for the serial number
OPENSSL_free(tagser);
// Unlock the entry
Expand Down Expand Up @@ -562,9 +564,8 @@ bool XrdCryptosslX509Crl::IsRevoked(int serialnumber, int when)
sprintf(tagser,"%x",serialnumber);

// Look into the cache
bool rdlock = false;
XrdSutCacheEntry *cent = cache.Get((const char *)tagser, rdlock);
if (cent) {
XrdSutCacheEntry *cent = cache.Get((const char *)tagser);
if (cent && cent->status == kCE_ok) {
// Check the revocation time
if (now > cent->mtime) {
DEBUG("certificate "<<tagser<<" has been revoked");
Expand Down Expand Up @@ -600,9 +601,8 @@ bool XrdCryptosslX509Crl::IsRevoked(const char *sernum, int when)
}

// Look into the cache
bool rdlock = false;
XrdSutCacheEntry *cent = cache.Get((const char *)sernum, rdlock);
if (cent) {
XrdSutCacheEntry *cent = cache.Get((const char *)sernum);
if (cent && cent->status == kCE_ok) {
// Check the revocation time
if (now > cent->mtime) {
DEBUG("certificate "<<sernum<<" has been revoked");
Expand Down

0 comments on commit 407cbf3

Please sign in to comment.