Add name-based API to GSSRequest
authorscantor <scantor@3ebe4818-3638-0410-822d-ece5924dabe2>
Tue, 3 Apr 2012 21:38:27 +0000 (21:38 +0000)
committerscantor <scantor@3ebe4818-3638-0410-822d-ece5924dabe2>
Tue, 3 Apr 2012 21:38:27 +0000 (21:38 +0000)
git-svn-id: https://svn.shibboleth.net/extensions/cpp-sp-resolver/trunk@338 3ebe4818-3638-0410-822d-ece5924dabe2

1  2 
src/shibresolver/resolver.cpp

@@@ -144,9 -144,9 +144,16 @@@ void ShibbolethResolver::setRequest(con
      if (request) {
          const GSSRequest* gss = dynamic_cast<const GSSRequest*>(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