X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=shibsp%2Fimpl%2FStorageServiceSessionCache.cpp;h=5aa9a7e78a29696a8760a528455cb39040148f42;hb=bd1247abd6efaa504e09d59103291d261f711f72;hp=8a7c0d117a6858d5e56553d71ff57716fc26f966;hpb=cfc4254ba5dd4fc8307baf3b562fe9011282551d;p=shibboleth%2Fcpp-sp.git diff --git a/shibsp/impl/StorageServiceSessionCache.cpp b/shibsp/impl/StorageServiceSessionCache.cpp index 8a7c0d1..5aa9a7e 100644 --- a/shibsp/impl/StorageServiceSessionCache.cpp +++ b/shibsp/impl/StorageServiceSessionCache.cpp @@ -769,13 +769,16 @@ Session* SSCache::find(const char* key, const Application& application, const ch "Your IP address ($1) does not match the address recorded at the time the session was established.", params(1,client_addr) ); - string eid(obj["entity_id"].string()); - obj.destroy(); - if (eid.empty()) + const char* eid = obj["entity_id"].string(); + if (!eid) { + obj.destroy(); throw ex; + } + string eid2(eid); + obj.destroy(); MetadataProvider* m=application.getMetadataProvider(); Locker locker(m); - annotateException(&ex,m->getEntityDescriptor(eid.c_str(),false)); // throws it + annotateException(&ex,m->getEntityDescriptor(MetadataProvider::Criteria(eid2.c_str(),NULL,NULL,false)).first); // throws it } } @@ -786,13 +789,16 @@ Session* SSCache::find(const char* key, const Application& application, const ch m_log.info("session timed out (ID: %s)", key); remove(key, application); RetryableProfileException ex("Your session has expired, and you must re-authenticate."); - string eid(obj["entity_id"].string()); - obj.destroy(); - if (eid.empty()) + const char* eid = obj["entity_id"].string(); + if (!eid) { + obj.destroy(); throw ex; + } + string eid2(eid); + obj.destroy(); MetadataProvider* m=application.getMetadataProvider(); Locker locker(m); - annotateException(&ex,m->getEntityDescriptor(eid.c_str(),false)); // throws it + annotateException(&ex,m->getEntityDescriptor(MetadataProvider::Criteria(eid2.c_str(),NULL,NULL,false)).first); // throws it } auto_ptr_XMLCh exp(obj["expires"].string()); @@ -803,13 +809,16 @@ Session* SSCache::find(const char* key, const Application& application, const ch m_log.info("session expired (ID: %s)", key); remove(key, application); RetryableProfileException ex("Your session has expired, and you must re-authenticate."); - string eid(obj["entity_id"].string()); - obj.destroy(); - if (eid.empty()) + const char* eid = obj["entity_id"].string(); + if (!eid) { + obj.destroy(); throw ex; + } + string eid2(eid); + obj.destroy(); MetadataProvider* m=application.getMetadataProvider(); Locker locker(m); - annotateException(&ex,m->getEntityDescriptor(eid.c_str(),false)); // throws it + annotateException(&ex,m->getEntityDescriptor(MetadataProvider::Criteria(eid2.c_str(),NULL,NULL,false)).first); // throws it } }