111ef9ea43433efa0e0cc539ca2fdec9e02ba8e9
[shibboleth/cpp-sp.git] / shibsp / handler / impl / AssertionConsumerService.cpp
1 /**
2  * Licensed to the University Corporation for Advanced Internet
3  * Development, Inc. (UCAID) under one or more contributor license
4  * agreements. See the NOTICE file distributed with this work for
5  * additional information regarding copyright ownership.
6  *
7  * UCAID licenses this file to you under the Apache License,
8  * Version 2.0 (the "License"); you may not use this file except
9  * in compliance with the License. You may obtain a copy of the
10  * License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17  * either express or implied. See the License for the specific
18  * language governing permissions and limitations under the License.
19  */
20
21 /**
22  * AssertionConsumerService.cpp
23  *
24  * Base class for handlers that create sessions by consuming SSO protocol responses.
25  */
26
27 #include "internal.h"
28 #include "exceptions.h"
29 #include "Application.h"
30 #include "ServiceProvider.h"
31 #include "SPRequest.h"
32 #include "handler/AssertionConsumerService.h"
33 #include "util/SPConstants.h"
34
35 # include <ctime>
36 #ifndef SHIBSP_LITE
37 # include "attribute/Attribute.h"
38 # include "attribute/filtering/AttributeFilter.h"
39 # include "attribute/filtering/BasicFilteringContext.h"
40 # include "attribute/resolver/AttributeExtractor.h"
41 # include "attribute/resolver/AttributeResolver.h"
42 # include "attribute/resolver/ResolutionContext.h"
43 # include "metadata/MetadataProviderCriteria.h"
44 # include "security/SecurityPolicy.h"
45 # include "security/SecurityPolicyProvider.h"
46 # include <boost/iterator/indirect_iterator.hpp>
47 # include <saml/exceptions.h>
48 # include <saml/SAMLConfig.h>
49 # include <saml/saml1/core/Assertions.h>
50 # include <saml/saml1/core/Protocols.h>
51 # include <saml/saml2/core/Protocols.h>
52 # include <saml/saml2/metadata/Metadata.h>
53 # include <saml/util/CommonDomainCookie.h>
54 using namespace samlconstants;
55 using opensaml::saml2md::MetadataProvider;
56 using opensaml::saml2md::RoleDescriptor;
57 using opensaml::saml2md::EntityDescriptor;
58 using opensaml::saml2md::IDPSSODescriptor;
59 using opensaml::saml2md::SPSSODescriptor;
60 #else
61 # include "lite/CommonDomainCookie.h"
62 #endif
63
64 using namespace shibspconstants;
65 using namespace shibsp;
66 using namespace opensaml;
67 using namespace xmltooling;
68 using namespace boost;
69 using namespace std;
70
71 AssertionConsumerService::AssertionConsumerService(
72     const DOMElement* e, const char* appId, Category& log, DOMNodeFilter* filter, const map<string,string>* remapper
73     ) : AbstractHandler(e, log, filter, remapper)
74 {
75     if (!e)
76         return;
77     string address(appId);
78     address += getString("Location").second;
79     setAddress(address.c_str());
80 #ifndef SHIBSP_LITE
81     if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
82         m_decoder.reset(
83             SAMLConfig::getConfig().MessageDecoderManager.newPlugin(
84                 getString("Binding").second, pair<const DOMElement*,const XMLCh*>(e,shibspconstants::SHIB2SPCONFIG_NS)
85                 )
86             );
87         m_decoder->setArtifactResolver(SPConfig::getConfig().getArtifactResolver());
88     }
89 #endif
90 }
91
92 AssertionConsumerService::~AssertionConsumerService()
93 {
94 }
95
96 pair<bool,long> AssertionConsumerService::run(SPRequest& request, bool isHandler) const
97 {
98     string relayState;
99     SPConfig& conf = SPConfig::getConfig();
100
101     if (conf.isEnabled(SPConfig::OutOfProcess)) {
102         // When out of process, we run natively and directly process the message.
103         return processMessage(request.getApplication(), request, request);
104     }
105     else {
106         // When not out of process, we remote all the message processing.
107         vector<string> headers(1, "Cookie");
108         headers.push_back("User-Agent");
109         headers.push_back("Accept-Language");
110         DDF out,in = wrap(request, &headers);
111         DDFJanitor jin(in), jout(out);
112         out=request.getServiceProvider().getListenerService()->send(in);
113         return unwrap(request, out);
114     }
115 }
116
117 void AssertionConsumerService::receive(DDF& in, ostream& out)
118 {
119     // Find application.
120     const char* aid=in["application_id"].string();
121     const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : nullptr;
122     if (!app) {
123         // Something's horribly wrong.
124         m_log.error("couldn't find application (%s) for new session", aid ? aid : "(missing)");
125         throw ConfigurationException("Unable to locate application for new session, deleted?");
126     }
127
128     // Unpack the request.
129     scoped_ptr<HTTPRequest> req(getRequest(in));
130
131     // Wrap a response shim.
132     DDF ret(nullptr);
133     DDFJanitor jout(ret);
134     scoped_ptr<HTTPResponse> resp(getResponse(ret));
135
136     // Since we're remoted, the result should either be a throw, a false/0 return,
137     // which we just return as an empty structure, or a response/redirect,
138     // which we capture in the facade and send back.
139     processMessage(*app, *req, *resp);
140     out << ret;
141 }
142
143 pair<bool,long> AssertionConsumerService::processMessage(
144     const Application& application, const HTTPRequest& httpRequest, HTTPResponse& httpResponse
145     ) const
146 {
147 #ifndef SHIBSP_LITE
148     // Locate policy key.
149     pair<bool,const char*> policyId = getString("policyId", m_configNS.get());  // namespace-qualified if inside handler element
150     if (!policyId.first)
151         policyId = application.getString("policyId");   // unqualified in Application(s) element
152
153     // Lock metadata for use by policy.
154     Locker metadataLocker(application.getMetadataProvider());
155
156     // Create the policy.
157     scoped_ptr<opensaml::SecurityPolicy> policy(
158         application.getServiceProvider().getSecurityPolicyProvider()->createSecurityPolicy(application, &IDPSSODescriptor::ELEMENT_QNAME, policyId.second)
159         );
160
161     string relayState;
162     scoped_ptr<XMLObject> msg;
163     try {
164         // Decode the message and process it in a protocol-specific way.
165         msg.reset(m_decoder->decode(relayState, httpRequest, *(policy.get())));
166         if (!msg)
167             throw BindingException("Failed to decode an SSO protocol response.");
168         DDF postData = recoverPostData(application, httpRequest, httpResponse, relayState.c_str());
169         DDFJanitor postjan(postData);
170         recoverRelayState(application, httpRequest, httpResponse, relayState);
171         limitRelayState(m_log, application, httpRequest, relayState.c_str());
172         implementProtocol(application, httpRequest, httpResponse, *policy, nullptr, *msg);
173
174         auto_ptr_char issuer(policy->getIssuer() ? policy->getIssuer()->getName() : nullptr);
175
176         // History cookie.
177         if (issuer.get() && *issuer.get())
178             maintainHistory(application, httpRequest, httpResponse, issuer.get());
179
180         // Now redirect to the state value. By now, it should be set to *something* usable.
181         // First check for POST data.
182         if (!postData.islist()) {
183             m_log.debug("ACS returning via redirect to: %s", relayState.c_str());
184             return make_pair(true, httpResponse.sendRedirect(relayState.c_str()));
185         }
186         else {
187             m_log.debug("ACS returning via POST to: %s", relayState.c_str());
188             return make_pair(true, sendPostResponse(application, httpResponse, relayState.c_str(), postData));
189         }
190     }
191     catch (XMLToolingException& ex) {
192         // Check for isPassive error condition.
193         const char* sc2 = ex.getProperty("statusCode2");
194         if (sc2 && !strcmp(sc2, "urn:oasis:names:tc:SAML:2.0:status:NoPassive")) {
195             pair<bool,bool> ignore = getBool("ignoreNoPassive", m_configNS.get());  // namespace-qualified if inside handler element
196             if (ignore.first && ignore.second && !relayState.empty()) {
197                 m_log.debug("ignoring SAML status of NoPassive and redirecting to resource...");
198                 return make_pair(true, httpResponse.sendRedirect(relayState.c_str()));
199             }
200         }
201         if (!relayState.empty())
202             ex.addProperty("RelayState", relayState.c_str());
203
204         // Log the error.
205         try {
206             scoped_ptr<TransactionLog::Event> event(SPConfig::getConfig().EventManager.newPlugin(LOGIN_EVENT, nullptr));
207             LoginEvent* error_event = dynamic_cast<LoginEvent*>(event.get());
208             if (error_event) {
209                 error_event->m_exception = &ex;
210                 error_event->m_request = &httpRequest;
211                 error_event->m_app = &application;
212                 if (policy->getIssuerMetadata())
213                     error_event->m_peer = dynamic_cast<const EntityDescriptor*>(policy->getIssuerMetadata()->getParent());
214                 auto_ptr_char prot(getProtocolFamily());
215                 error_event->m_protocol = prot.get();
216                 error_event->m_binding = getString("Binding").second;
217                 error_event->m_saml2Response = dynamic_cast<const saml2p::StatusResponseType*>(msg.get());
218                 if (!error_event->m_saml2Response)
219                     error_event->m_saml1Response = dynamic_cast<const saml1p::Response*>(msg.get());
220                 application.getServiceProvider().getTransactionLog()->write(*error_event);
221             }
222             else {
223                 m_log.warn("unable to audit event, log event object was of an incorrect type");
224             }
225         }
226         catch (std::exception& ex2) {
227             m_log.warn("exception auditing event: %s", ex2.what());
228         }
229
230         // If no sign of annotation, try to annotate it now.
231         if (!ex.getProperty("statusCode")) {
232             annotateException(&ex, policy->getIssuerMetadata(), nullptr, false);    // wait to throw it
233         }
234
235         throw;
236     }
237 #else
238     throw ConfigurationException("Cannot process message using lite version of shibsp library.");
239 #endif
240 }
241
242 void AssertionConsumerService::checkAddress(const Application& application, const HTTPRequest& httpRequest, const char* issuedTo) const
243 {
244     if (!issuedTo || !*issuedTo)
245         return;
246
247     const PropertySet* props = application.getPropertySet("Sessions");
248     pair<bool,bool> checkAddress = props ? props->getBool("checkAddress") : make_pair(false,true);
249     if (!checkAddress.first)
250         checkAddress.second = true;
251
252     if (checkAddress.second) {
253         m_log.debug("checking client address");
254         if (httpRequest.getRemoteAddr() != issuedTo) {
255             throw FatalProfileException(
256                "Your client's current address ($client_addr) differs from the one used when you authenticated "
257                 "to your identity provider. To correct this problem, you may need to bypass a proxy server. "
258                 "Please contact your local support staff or help desk for assistance.",
259                 namedparams(1, "client_addr", httpRequest.getRemoteAddr().c_str())
260                 );
261         }
262     }
263 }
264
265 #ifndef SHIBSP_LITE
266
267 const XMLCh* AssertionConsumerService::getProtocolFamily() const
268 {
269     return m_decoder ? m_decoder->getProtocolFamily() : nullptr;
270 }
271
272 const char* AssertionConsumerService::getType() const
273 {
274     return "AssertionConsumerService";
275 }
276
277 void AssertionConsumerService::generateMetadata(SPSSODescriptor& role, const char* handlerURL) const
278 {
279     // Initial guess at index to use.
280     pair<bool,unsigned int> ix = pair<bool,unsigned int>(false,0);
281     if (!strncmp(handlerURL, "https", 5))
282         ix = getUnsignedInt("sslIndex", shibspconstants::ASCII_SHIB2SPCONFIG_NS);
283     if (!ix.first)
284         ix = getUnsignedInt("index");
285     if (!ix.first)
286         ix.second = 1;
287
288     // Find maximum index in use and go one higher.
289     const vector<saml2md::AssertionConsumerService*>& services = const_cast<const SPSSODescriptor&>(role).getAssertionConsumerServices();
290     if (!services.empty() && ix.second <= services.back()->getIndex().second)
291         ix.second = services.back()->getIndex().second + 1;
292
293     const char* loc = getString("Location").second;
294     string hurl(handlerURL);
295     if (*loc != '/')
296         hurl += '/';
297     hurl += loc;
298     auto_ptr_XMLCh widen(hurl.c_str());
299
300     saml2md::AssertionConsumerService* ep = saml2md::AssertionConsumerServiceBuilder::buildAssertionConsumerService();
301     ep->setLocation(widen.get());
302     ep->setBinding(getXMLString("Binding").second);
303     ep->setIndex(ix.second);
304     role.getAssertionConsumerServices().push_back(ep);
305 }
306
307 opensaml::SecurityPolicy* AssertionConsumerService::createSecurityPolicy(
308     const Application& application, const xmltooling::QName* role, bool validate, const char* policyId
309     ) const
310 {
311     return new SecurityPolicy(application, role, validate, policyId);
312 }
313
314 class SHIBSP_DLLLOCAL DummyContext : public ResolutionContext
315 {
316 public:
317     DummyContext(const vector<Attribute*>& attributes) : m_attributes(attributes) {
318     }
319
320     virtual ~DummyContext() {
321         for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<Attribute>());
322     }
323
324     vector<Attribute*>& getResolvedAttributes() {
325         return m_attributes;
326     }
327     vector<Assertion*>& getResolvedAssertions() {
328         return m_tokens;
329     }
330
331 private:
332     vector<Attribute*> m_attributes;
333     static vector<Assertion*> m_tokens; // never any tokens, so just share an empty vector
334 };
335
336 vector<Assertion*> DummyContext::m_tokens;
337
338 ResolutionContext* AssertionConsumerService::resolveAttributes(
339     const Application& application,
340     const saml2md::RoleDescriptor* issuer,
341     const XMLCh* protocol,
342     const saml1::NameIdentifier* v1nameid,
343     const saml2::NameID* nameid,
344     const XMLCh* authncontext_class,
345     const XMLCh* authncontext_decl,
346     const vector<const Assertion*>* tokens
347     ) const
348 {
349     return resolveAttributes(
350         application,
351         nullptr,
352         issuer,
353         protocol,
354         v1nameid,
355         nullptr,
356         nameid,
357         nullptr,
358         authncontext_class,
359         authncontext_decl,
360         tokens
361         );
362 }
363
364 ResolutionContext* AssertionConsumerService::resolveAttributes(
365     const Application& application,
366     const GenericRequest* request,
367     const saml2md::RoleDescriptor* issuer,
368     const XMLCh* protocol,
369     const saml1::NameIdentifier* v1nameid,
370     const saml1::AuthenticationStatement* v1statement,
371     const saml2::NameID* nameid,
372     const saml2::AuthnStatement* statement,
373     const XMLCh* authncontext_class,
374     const XMLCh* authncontext_decl,
375     const vector<const Assertion*>* tokens
376     ) const
377 {
378     // First we do the extraction of any pushed information, including from metadata.
379     vector<Attribute*> resolvedAttributes;
380     AttributeExtractor* extractor = application.getAttributeExtractor();
381     if (extractor) {
382         Locker extlocker(extractor);
383         if (issuer) {
384             pair<bool,const char*> mprefix = application.getString("metadataAttributePrefix");
385             if (mprefix.first) {
386                 m_log.debug("extracting metadata-derived attributes...");
387                 try {
388                     // We pass nullptr for "issuer" because the IdP isn't the one asserting metadata-based attributes.
389                     extractor->extractAttributes(application, request, nullptr, *issuer, resolvedAttributes);
390                     for (indirect_iterator<vector<Attribute*>::iterator> a = make_indirect_iterator(resolvedAttributes.begin());
391                             a != make_indirect_iterator(resolvedAttributes.end()); ++a) {
392                         vector<string>& ids = a->getAliases();
393                         for (vector<string>::iterator id = ids.begin(); id != ids.end(); ++id)
394                             *id = mprefix.second + *id;
395                     }
396                 }
397                 catch (std::exception& ex) {
398                     m_log.error("caught exception extracting attributes: %s", ex.what());
399                 }
400             }
401         }
402
403         m_log.debug("extracting pushed attributes...");
404
405         if (v1nameid || nameid) {
406             try {
407                 if (v1nameid)
408                     extractor->extractAttributes(application, request, issuer, *v1nameid, resolvedAttributes);
409                 else
410                     extractor->extractAttributes(application, request, issuer, *nameid, resolvedAttributes);
411             }
412             catch (std::exception& ex) {
413                 m_log.error("caught exception extracting attributes: %s", ex.what());
414             }
415         }
416
417         if (v1statement || statement) {
418             try {
419                 if (v1statement)
420                     extractor->extractAttributes(application, request, issuer, *v1statement, resolvedAttributes);
421                 else
422                     extractor->extractAttributes(application, request, issuer, *statement, resolvedAttributes);
423             }
424             catch (std::exception& ex) {
425                 m_log.error("caught exception extracting attributes: %s", ex.what());
426             }
427         }
428
429         if (tokens) {
430             for (indirect_iterator<vector<const Assertion*>::const_iterator> t = make_indirect_iterator(tokens->begin());
431                     t != make_indirect_iterator(tokens->end()); ++t) {
432                 try {
433                     extractor->extractAttributes(application, request, issuer, *t, resolvedAttributes);
434                 }
435                 catch (std::exception& ex) {
436                     m_log.error("caught exception extracting attributes: %s", ex.what());
437                 }
438             }
439         }
440
441         AttributeFilter* filter = application.getAttributeFilter();
442         if (filter && !resolvedAttributes.empty()) {
443             BasicFilteringContext fc(application, resolvedAttributes, issuer, authncontext_class);
444             Locker filtlocker(filter);
445             try {
446                 filter->filterAttributes(fc, resolvedAttributes);
447             }
448             catch (std::exception& ex) {
449                 m_log.error("caught exception filtering attributes: %s", ex.what());
450                 m_log.error("dumping extracted attributes due to filtering exception");
451                 for_each(resolvedAttributes.begin(), resolvedAttributes.end(), xmltooling::cleanup<shibsp::Attribute>());
452                 resolvedAttributes.clear();
453             }
454         }
455     }
456     else {
457         m_log.warn("no AttributeExtractor plugin installed, check log during startup");
458     }
459
460     try {
461         AttributeResolver* resolver = application.getAttributeResolver();
462         if (resolver) {
463             m_log.debug("resolving attributes...");
464
465             Locker locker(resolver);
466             auto_ptr<ResolutionContext> ctx(
467                 resolver->createResolutionContext(
468                     application,
469                     issuer ? dynamic_cast<const saml2md::EntityDescriptor*>(issuer->getParent()) : nullptr,
470                     protocol,
471                     nameid,
472                     authncontext_class,
473                     authncontext_decl,
474                     tokens,
475                     &resolvedAttributes
476                     )
477                 );
478             resolver->resolveAttributes(*ctx);
479             // Copy over any pushed attributes.
480             while (!resolvedAttributes.empty()) {
481                 ctx->getResolvedAttributes().push_back(resolvedAttributes.back());
482                 resolvedAttributes.pop_back();
483             }
484             return ctx.release();
485         }
486     }
487     catch (std::exception& ex) {
488         m_log.error("attribute resolution failed: %s", ex.what());
489     }
490
491     if (!resolvedAttributes.empty()) {
492         try {
493             return new DummyContext(resolvedAttributes);
494         }
495         catch (bad_alloc&) {
496             for_each(resolvedAttributes.begin(), resolvedAttributes.end(), xmltooling::cleanup<shibsp::Attribute>());
497         }
498     }
499     return nullptr;
500 }
501
502 void AssertionConsumerService::extractMessageDetails(const Assertion& assertion, const XMLCh* protocol, opensaml::SecurityPolicy& policy) const
503 {
504     policy.setMessageID(assertion.getID());
505     policy.setIssueInstant(assertion.getIssueInstantEpoch());
506
507     if (XMLString::equals(assertion.getElementQName().getNamespaceURI(), samlconstants::SAML20_NS)) {
508         const saml2::Assertion* a2 = dynamic_cast<const saml2::Assertion*>(&assertion);
509         if (a2) {
510             m_log.debug("extracting issuer from SAML 2.0 assertion");
511             policy.setIssuer(a2->getIssuer());
512         }
513     }
514     else {
515         const saml1::Assertion* a1 = dynamic_cast<const saml1::Assertion*>(&assertion);
516         if (a1) {
517             m_log.debug("extracting issuer from SAML 1.x assertion");
518             policy.setIssuer(a1->getIssuer());
519         }
520     }
521
522     if (policy.getIssuer() && !policy.getIssuerMetadata() && policy.getMetadataProvider()) {
523         if (policy.getIssuer()->getFormat() && !XMLString::equals(policy.getIssuer()->getFormat(), saml2::NameIDType::ENTITY)) {
524             m_log.warn("non-system entity issuer, skipping metadata lookup");
525             return;
526         }
527         m_log.debug("searching metadata for assertion issuer...");
528         pair<const EntityDescriptor*,const RoleDescriptor*> entity;
529         MetadataProvider::Criteria& mc = policy.getMetadataProviderCriteria();
530         mc.entityID_unicode = policy.getIssuer()->getName();
531         mc.role = &IDPSSODescriptor::ELEMENT_QNAME;
532         mc.protocol = protocol;
533         entity = policy.getMetadataProvider()->getEntityDescriptor(mc);
534         if (!entity.first) {
535             auto_ptr_char iname(policy.getIssuer()->getName());
536             m_log.warn("no metadata found, can't establish identity of issuer (%s)", iname.get());
537         }
538         else if (!entity.second) {
539             m_log.warn("unable to find compatible IdP role in metadata");
540         }
541         else {
542             policy.setIssuerMetadata(entity.second);
543         }
544     }
545 }
546
547 LoginEvent* AssertionConsumerService::newLoginEvent(const Application& application, const xmltooling::HTTPRequest& request) const
548 {
549     if (!SPConfig::getConfig().isEnabled(SPConfig::Logging))
550         return nullptr;
551     try {
552         auto_ptr<TransactionLog::Event> event(SPConfig::getConfig().EventManager.newPlugin(LOGIN_EVENT, nullptr));
553         LoginEvent* login_event = dynamic_cast<LoginEvent*>(event.get());
554         if (login_event) {
555             login_event->m_request = &request;
556             login_event->m_app = &application;
557             login_event->m_binding = getString("Binding").second;
558             event.release();
559             return login_event;
560         }
561         else {
562             m_log.warn("unable to audit event, log event object was of an incorrect type");
563         }
564     }
565     catch (std::exception& ex) {
566         m_log.warn("exception auditing event: %s", ex.what());
567     }
568     return nullptr;
569 }
570
571 #endif
572
573 void AssertionConsumerService::maintainHistory(
574     const Application& application, const HTTPRequest& request, HTTPResponse& response, const char* entityID
575     ) const
576 {
577     static const char* defProps="; path=/";
578
579     const PropertySet* sessionProps=application.getPropertySet("Sessions");
580     pair<bool,bool> idpHistory=sessionProps->getBool("idpHistory");
581
582     if (idpHistory.first && idpHistory.second) {
583         pair<bool,const char*> cookieProps=sessionProps->getString("idpHistoryProps");
584         if (!cookieProps.first)
585             cookieProps=sessionProps->getString("cookieProps");
586         if (!cookieProps.first)
587             cookieProps.second=defProps;
588
589         // Set an IdP history cookie locally (essentially just a CDC).
590         CommonDomainCookie cdc(request.getCookie(CommonDomainCookie::CDCName));
591
592         // Either leave in memory or set an expiration.
593         pair<bool,unsigned int> days=sessionProps->getUnsignedInt("idpHistoryDays");
594         if (!days.first || days.second==0) {
595             string c = string(cdc.set(entityID)) + cookieProps.second;
596             response.setCookie(CommonDomainCookie::CDCName, c.c_str());
597         }
598         else {
599             time_t now=time(nullptr) + (days.second * 24 * 60 * 60);
600 #ifdef HAVE_GMTIME_R
601             struct tm res;
602             struct tm* ptime=gmtime_r(&now,&res);
603 #else
604             struct tm* ptime=gmtime(&now);
605 #endif
606             char timebuf[64];
607             strftime(timebuf,64,"%a, %d %b %Y %H:%M:%S GMT",ptime);
608             string c = string(cdc.set(entityID)) + cookieProps.second + "; expires=" + timebuf;
609             response.setCookie(CommonDomainCookie::CDCName, c.c_str());
610         }
611     }
612 }