summaryrefslogtreecommitdiffstats
path: root/src/windows/leashdll/lshfunc.c
diff options
context:
space:
mode:
authorKevin Wasserman <kevin.wasserman@painless-security.com>2012-07-23 04:30:27 -0400
committerBen Kaduk <kaduk@mit.edu>2012-08-24 12:22:58 -0400
commit9bc411e72fce5bed3ed00ae5b09f8c239309bae0 (patch)
tree0b457e8c5e0d1201f2bc4a58e2540ca3eba44ca4 /src/windows/leashdll/lshfunc.c
parentdbfd93ea15b12472e4612af928f8baabb2cda611 (diff)
downloadkrb5-9bc411e72fce5bed3ed00ae5b09f8c239309bae0.tar.gz
krb5-9bc411e72fce5bed3ed00ae5b09f8c239309bae0.tar.xz
krb5-9bc411e72fce5bed3ed00ae5b09f8c239309bae0.zip
kfw support for multiple identities
We need a sense of what the default identity is, then, with a way to set it and list it. The memory management model changes some, as well. Use a bold font to indicate the current default identity in the GUI; while here use an italic font for expired credentials. In the process, rip out some krb4 remenants, and remove ancient code conditional on the lack of KRB5_TC_NOTICKET. Define USE_MESSAGE_BOX when building leash and use MessageBox(). [kaduk@mit.edu: adjust for style, flesh out commit message.] ticket: 7253 (new) queue: kfw target_version: 1.10.4 tags: pullup
Diffstat (limited to 'src/windows/leashdll/lshfunc.c')
-rw-r--r--src/windows/leashdll/lshfunc.c45
1 files changed, 13 insertions, 32 deletions
diff --git a/src/windows/leashdll/lshfunc.c b/src/windows/leashdll/lshfunc.c
index 1a0bf14305..614bb799eb 100644
--- a/src/windows/leashdll/lshfunc.c
+++ b/src/windows/leashdll/lshfunc.c
@@ -867,26 +867,9 @@ not_an_API_LeashFreeTicketList(TicketList** ticketList)
killList = tempList;
tempList = (TicketList*)tempList->next;
- free(killList->theTicket);
- if (killList->tktEncType)
- free(killList->tktEncType);
- if (killList->keyEncType)
- free(killList->keyEncType);
- if (killList->addrCount) {
- int n;
- for ( n=0; n<killList->addrCount; n++) {
- if (killList->addrList[n])
- free(killList->addrList[n]);
- }
- }
- if (killList->addrList)
- free(killList->addrList);
- if (killList->name)
- free(killList->name);
- if (killList->inst)
- free(killList->inst);
- if (killList->realm)
- free(killList->realm);
+ free(killList->service);
+ if (killList->encTypes)
+ free(killList->encTypes);
free(killList);
}
@@ -2873,8 +2856,7 @@ acquire_tkt_no_princ(krb5_context context, char * ccname, int cclen)
GetEnvironmentVariable("KRB5CCNAME", ccachename, sizeof(ccachename));
}
- not_an_API_LeashKRB5GetTickets(&ticketinfo,&list,&ctx);
- not_an_API_LeashFreeTicketList(&list);
+ not_an_API_LeashKRB5GetTickets(&ticketinfo,&ctx);
if ( ticketinfo.btickets != GOOD_TICKETS &&
dwMsLsaImport && Leash_importable() ) {
@@ -2939,8 +2921,8 @@ acquire_tkt_no_princ(krb5_context context, char * ccname, int cclen)
if ( import ) {
Leash_import();
- not_an_API_LeashKRB5GetTickets(&ticketinfo,&list,&ctx);
- not_an_API_LeashFreeTicketList(&list);
+ not_an_API_LeashKRB5FreeTickets(&ticketinfo);
+ not_an_API_LeashKRB5GetTickets(&ticketinfo,&ctx);
}
}
@@ -2958,7 +2940,7 @@ acquire_tkt_no_princ(krb5_context context, char * ccname, int cclen)
strncpy(ccname, ccachename, cclen);
ccname[cclen-1] = '\0';
}
-
+ not_an_API_LeashKRB5FreeTickets(&ticketinfo);
if ( !context )
pkrb5_free_context(ctx);
}
@@ -2968,7 +2950,6 @@ static void
acquire_tkt_for_princ(krb5_context context, krb5_principal desiredPrincipal,
char * ccname, int cclen)
{
- TicketList *list = NULL;
TICKETINFO ticketinfo;
krb5_context ctx;
DWORD dwMsLsaImport = Leash_get_default_mslsa_import();
@@ -2992,8 +2973,7 @@ acquire_tkt_for_princ(krb5_context context, krb5_principal desiredPrincipal,
GetEnvironmentVariable("KRB5CCNAME", ccachename, sizeof(ccachename));
}
- not_an_API_LeashKRB5GetTickets(&ticketinfo,&list,&ctx);
- not_an_API_LeashFreeTicketList(&list);
+ not_an_API_LeashKRB5GetTickets(&ticketinfo,&ctx);
pkrb5_unparse_name(ctx, desiredPrincipal, &name);
@@ -3032,14 +3012,14 @@ acquire_tkt_for_princ(krb5_context context, krb5_principal desiredPrincipal,
SetEnvironmentVariable("KRB5CCNAME", ccachename);
- not_an_API_LeashKRB5GetTickets(&ticketinfo,&list,&ctx);
- not_an_API_LeashFreeTicketList(&list);
+ not_an_API_LeashKRB5FreeTickets(&ticketinfo);
+ not_an_API_LeashKRB5GetTickets(&ticketinfo,&ctx);
if (ticketinfo.btickets != GOOD_TICKETS) {
Leash_import();
- not_an_API_LeashKRB5GetTickets(&ticketinfo,&list,&ctx);
- not_an_API_LeashFreeTicketList(&list);
+ not_an_API_LeashKRB5FreeTickets(&ticketinfo);
+ not_an_API_LeashKRB5GetTickets(&ticketinfo,&ctx);
}
}
}
@@ -3059,6 +3039,7 @@ acquire_tkt_for_princ(krb5_context context, krb5_principal desiredPrincipal,
ccname[cclen-1] = '\0';
}
}
+ not_an_API_LeashKRB5FreeTickets(&ticketinfo);
if (name)
pkrb5_free_unparsed_name(ctx, name);