X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-sp-resolver.git;a=blobdiff_plain;f=src%2Fshibresolver%2Fresolver.cpp;fp=src%2Fshibresolver%2Fresolver.cpp;h=dd7bbbfe58cc3f2d7caf9ccd1a9013d04db24dd4;hp=5b2e70dbb6c6c5911af990d562e6099b0fda5399;hb=4b54ec4c31419818e4435184e55d0223ffa6a280;hpb=c27f8319944e4e3a4776a1c22591afb6af90ee6b diff --git a/src/shibresolver/resolver.cpp b/src/shibresolver/resolver.cpp index 5b2e70d..dd7bbbf 100644 --- a/src/shibresolver/resolver.cpp +++ b/src/shibresolver/resolver.cpp @@ -144,9 +144,16 @@ void ShibbolethResolver::setRequest(const SPRequest* request) if (request) { const GSSRequest* gss = dynamic_cast(request); if (gss) { - // TODO: fix API to prevent destruction of contexts +#ifdef SHIBRESOLVER_HAVE_GSSAPI_NAMINGEXTS + gss_name_t name = gss->getGSSName(); + if (name != GSS_C_NO_NAME) { + addToken(name); + return; + } +#endif gss_ctx_id_t ctx = gss->getGSSContext(); - addToken(&ctx); + if (ctx != GSS_C_NO_CONTEXT) + addToken(&ctx); } } #endif