cc_mslsa.c:
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 20 Oct 2005 20:24:21 +0000 (20:24 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 20 Oct 2005 20:24:21 +0000 (20:24 +0000)
  - provide defaults for client and server names in purge
    ticket routines
  - properly size the buffers used to store the names.

ticket: new
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17440 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/ChangeLog
src/lib/krb5/ccache/cc_mslsa.c

index dede9ceb32bc54e9f9d6249973c69aa28c5d9745..66627280bfc87ac878a65226101fc7dcdfd1e6d7 100644 (file)
@@ -1,3 +1,10 @@
+2005-10-20  Jeffrey Altman <jaltman@mit.edu>
+
+       * cc_mslsa.c: 
+          - provide defaults for client and server names in purge 
+            ticket routines
+          - properly size the buffers used to store the names.
+
 2005-06-15  Ken Raeburn  <raeburn@mit.edu>
 
        * cc_file.c (dereference): Fix test is list-walking loop.
index 02ecf9da162f6bf063183b5939ce3f3f2d9f4b96..e7e59766e4709ddca0bc3491026be10b7621a732 100644 (file)
@@ -840,7 +840,7 @@ PurgeTicket2000( HANDLE LogonHandle, ULONG  PackageId,
     NTSTATUS SubStatus = 0;
     KERB_PURGE_TKT_CACHE_REQUEST * pPurgeRequest;
     DWORD dwRequestLen = sizeof(KERB_PURGE_TKT_CACHE_REQUEST) + 1024;
-    char * sname, * srealm = NULL;
+    char * sname = NULL, * srealm = NULL;
 
     if (krb5_unparse_name(context, cred->server, &sname))
         return FALSE;
@@ -858,12 +858,12 @@ PurgeTicket2000( HANDLE LogonHandle, ULONG  PackageId,
     pPurgeRequest->LogonId.LowPart = 0;
     pPurgeRequest->LogonId.HighPart = 0;
     pPurgeRequest->ServerName.Buffer = (PWSTR)(((CHAR *)pPurgeRequest)+sizeof(KERB_PURGE_TKT_CACHE_REQUEST));
-    pPurgeRequest->ServerName.Length = strlen(sname);
+    pPurgeRequest->ServerName.Length = strlen(sname)*sizeof(WCHAR);
     pPurgeRequest->ServerName.MaximumLength = 256;
     ANSIToUnicode(sname, pPurgeRequest->ServerName.Buffer,
                   pPurgeRequest->ServerName.MaximumLength);
     pPurgeRequest->RealmName.Buffer = (PWSTR)(((CHAR *)pPurgeRequest)+sizeof(KERB_PURGE_TKT_CACHE_REQUEST)+512);
-    pPurgeRequest->RealmName.Length = strlen(srealm);
+    pPurgeRequest->RealmName.Length = strlen(srealm)*sizeof(WCHAR);
     pPurgeRequest->RealmName.MaximumLength = 256;
     ANSIToUnicode(srealm, pPurgeRequest->RealmName.Buffer,
                   pPurgeRequest->RealmName.MaximumLength);
@@ -894,8 +894,8 @@ PurgeTicketXP( HANDLE LogonHandle, ULONG  PackageId,
     NTSTATUS SubStatus = 0;
     KERB_PURGE_TKT_CACHE_EX_REQUEST * pPurgeRequest;
     DWORD dwRequestLen = sizeof(KERB_PURGE_TKT_CACHE_EX_REQUEST) + 2048;
-    char * cname, * crealm = NULL;
-    char * sname, * srealm = NULL;
+    char * cname = NULL, * crealm = NULL;
+    char * sname = NULL, * srealm = NULL;
 
     if (krb5_unparse_name(context, cred->client, &cname))
         return FALSE;
@@ -923,25 +923,25 @@ PurgeTicketXP( HANDLE LogonHandle, ULONG  PackageId,
     pPurgeRequest->LogonId.HighPart = 0;
     pPurgeRequest->Flags = 0;
     pPurgeRequest->TicketTemplate.ClientName.Buffer = (PWSTR)((CHAR *)pPurgeRequest + sizeof(KERB_PURGE_TKT_CACHE_EX_REQUEST));
-    pPurgeRequest->TicketTemplate.ClientName.Length = strlen(cname);
+    pPurgeRequest->TicketTemplate.ClientName.Length = strlen(cname)*sizeof(WCHAR);
     pPurgeRequest->TicketTemplate.ClientName.MaximumLength = 256;
     ANSIToUnicode(cname, pPurgeRequest->TicketTemplate.ClientName.Buffer,
                   pPurgeRequest->TicketTemplate.ClientName.MaximumLength);
 
     pPurgeRequest->TicketTemplate.ClientRealm.Buffer = (PWSTR)(((CHAR *)pPurgeRequest)+sizeof(KERB_PURGE_TKT_CACHE_EX_REQUEST) + 512);
-    pPurgeRequest->TicketTemplate.ClientRealm.Length = strlen(crealm);
+    pPurgeRequest->TicketTemplate.ClientRealm.Length = strlen(crealm)*sizeof(WCHAR);
     pPurgeRequest->TicketTemplate.ClientRealm.MaximumLength = 256;
     ANSIToUnicode(crealm, pPurgeRequest->TicketTemplate.ClientRealm.Buffer,
                   pPurgeRequest->TicketTemplate.ClientRealm.MaximumLength);
 
     pPurgeRequest->TicketTemplate.ServerName.Buffer = (PWSTR)(((CHAR *)pPurgeRequest)+sizeof(KERB_PURGE_TKT_CACHE_EX_REQUEST) + 1024);
-    pPurgeRequest->TicketTemplate.ServerName.Length = strlen(sname);
+    pPurgeRequest->TicketTemplate.ServerName.Length = strlen(sname)*sizeof(WCHAR);
     pPurgeRequest->TicketTemplate.ServerName.MaximumLength = 256;
     ANSIToUnicode(sname, pPurgeRequest->TicketTemplate.ServerName.Buffer,
                   pPurgeRequest->TicketTemplate.ServerName.MaximumLength);
 
     pPurgeRequest->TicketTemplate.ServerRealm.Buffer = (PWSTR)(((CHAR *)pPurgeRequest)+sizeof(KERB_PURGE_TKT_CACHE_EX_REQUEST) + 1536);
-    pPurgeRequest->TicketTemplate.ServerRealm.Length = strlen(srealm);
+    pPurgeRequest->TicketTemplate.ServerRealm.Length = strlen(srealm)*sizeof(WCHAR);
     pPurgeRequest->TicketTemplate.ServerRealm.MaximumLength = 256;
     ANSIToUnicode(srealm, pPurgeRequest->TicketTemplate.ServerRealm.Buffer,
                   pPurgeRequest->TicketTemplate.ServerRealm.MaximumLength);