From 467f50650ab18728412014371179afee6bab8286 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Tue, 15 Mar 2011 18:56:27 +1100 Subject: [PATCH] add a testing path for setting initiator credentials requires GSSEAP_DEBUG to be defined, set environment variable GSSEAP_CREDS to password --- util_cred.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util_cred.c b/util_cred.c index 6330118..64b9284 100644 --- a/util_cred.c +++ b/util_cred.c @@ -120,6 +120,9 @@ gssEapAcquireCred(OM_uint32 *minor, { OM_uint32 major, tmpMinor; gss_cred_id_t cred; +#ifdef GSSEAP_DEBUG + gss_buffer_desc envPassword; +#endif /* XXX TODO validate with changed set_cred_option API */ *pCred = GSS_C_NO_CREDENTIAL; @@ -189,6 +192,15 @@ gssEapAcquireCred(OM_uint32 *minor, cred->flags |= CRED_FLAG_DEFAULT_IDENTITY; } +#ifdef GSSEAP_DEBUG + if (password == GSS_C_NO_BUFFER && + (envPassword.value = getenv("GSSEAP_CREDS")) != NULL) { + envPassword.length = strlen((char *)envPassword.value); + major = duplicateBuffer(minor, &envPassword, &cred->password); + if (GSS_ERROR(major)) + goto cleanup; + } else +#endif /* GSSEAP_DEBUG */ if (password != GSS_C_NO_BUFFER) { major = duplicateBuffer(minor, password, &cred->password); if (GSS_ERROR(major)) -- 2.1.4