[27938] in Kerberos

home help back first fref pref prev next nref lref last post

Question about purge a particular ticket from the cache

daemon@ATHENA.MIT.EDU (Chuang Liu)
Thu Jun 14 21:41:25 2007

Date: Thu, 14 Jun 2007 18:40:51 -0700 (PDT)
From: Chuang Liu <liu_nsk@yahoo.com.cn>
To: kerberos@mit.edu
MIME-Version: 1.0
Message-ID: <402559.28298.qm@web15115.mail.cnb.yahoo.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: kerberos-bounces@mit.edu

I tried to purge a particular ticket from the cache
using "KERB_PURGE_TKT_CACHE_REQUEST", and got a " The
parameter is incorrect" error. Could anybody help me
please?

I first tried to get all existing tickets. 

  KERB_QUERY_TKT_CACHE_REQUEST req = {
    KerbQueryTicketCacheMessage
  };

  // send the request to Kerb and get a response
  void* pRep;
  DWORD cbRep;
  NTSTATUS pkgStatus;
  NTSTATUS s = LsaCallAuthenticationPackage(
                m_hLSA, m_nKerbIndex,
                &req, sizeof req,
                &pRep, &cbRep, &pkgStatus);
  if (s) {
    OutputInfo(L"LsaCallAuthenticationPackage", s);
    return;
  }
  if (pkgStatus) {
    OutputInfo(L"KerbQueryTicketCacheMessage",
               pkgStatus);
    return;
  }

   // we now have a collection of information about
   // all tickets in the current logon session
   m_pTktCache = (KERB_QUERY_TKT_CACHE_RESPONSE*)pRep;

then I checked each ticket, if it follows a particular
patter, I will purge it. 

   for (DWORD i = 0; i < m_pTktCache->CountOfTickets;
++i) {

      KERB_TICKET_CACHE_INFO& ti =
m_pTktCache->Tickets[i];

     if(/* some pattern*/) {
       KERB_PURGE_TKT_CACHE_REQUEST req;
       req.MessageType = KerbPurgeTicketCacheMessage;
       req.ServerName = ti.ServerName;
       req.RealmName = ti.RealmName; 

       NTSTATUS pkgStatus;
       NTSTATUS s = LsaCallAuthenticationPackage(
                    m_hLSA, m_nKerbIndex,
                    &req, sizeof req,
                    0, 0, &pkgStatus);
      
       if (pkgStatus) {
           OutputInfo(L"KerbPurgeTicketCache",
pkgStatus);
          return;
      }
     
  }


The purge of the particular key failed with error
message "The parameter is incorrect". Did I miss
anything in the code? Thanks. 

Chuang


       
____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  
________________________________________________
Kerberos mailing list           Kerberos@mit.edu
https://mailman.mit.edu/mailman/listinfo/kerberos

home help back first fref pref prev next nref lref last post