- GSSEAP_ONCE(&krbContextKeyOnce, createKrbContextKey);
-
- *context = GSSEAP_GETSPECIFIC(krbContextKey);
- if (*context == NULL) {
- *minor = initKrbContext(context);
- if (*minor == 0) {
- if (GSSEAP_SETSPECIFIC(krbContextKey, *context) != 0) {
- *minor = errno;
- krb5_free_context(*context);
- *context = NULL;
- }
+ tld = gssEapGetThreadLocalData();
+ if (tld != NULL) {
+ *context = tld->krbContext;
+ if (*context == NULL) {
+ *minor = initKrbContext(context);
+ if (*minor == 0)
+ tld->krbContext = *context;