MCPcopy Create free account
hub / github.com/ByConity/ByConity / processToken

Method processToken

src/Access/GSSAcceptor.cpp:340–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340String GSSAcceptorContext::processToken(const String & input_token, Poco::Logger * log)
341{
342 std::scoped_lock lock(gss_global_mutex);
343
344 String output_token;
345
346 try
347 {
348 if (is_ready || is_failed || context_handle == GSS_C_NO_CONTEXT)
349 reset();
350
351 gss_buffer_desc input_token_buf;
352 input_token_buf.length = input_token.size();
353 input_token_buf.value = const_cast<char *>(input_token.c_str());
354
355 gss_buffer_desc output_token_buf;
356 output_token_buf.length = 0;
357 output_token_buf.value = nullptr;
358
359 gss_name_t initiator_name = GSS_C_NO_NAME;
360 gss_OID mech_type = GSS_C_NO_OID;
361 OM_uint32 flags = 0;
362
363 SCOPE_EXIT({
364 if (initiator_name != GSS_C_NO_NAME)
365 {
366 OM_uint32 minor_status = 0;
367 [[maybe_unused]] OM_uint32 major_status = gss_release_name(
368 &minor_status,
369 &initiator_name
370 );
371 initiator_name = GSS_C_NO_NAME;
372 }
373
374 OM_uint32 minor_status = 0;
375 [[maybe_unused]] OM_uint32 major_status = gss_release_buffer(
376 &minor_status,
377 &output_token_buf
378 );
379 });
380
381 OM_uint32 minor_status = 0;
382 OM_uint32 major_status = gss_accept_sec_context(
383 &minor_status,
384 &context_handle,
385 acceptor_credentials_handle,
386 &input_token_buf,
387 GSS_C_NO_CHANNEL_BINDINGS,
388 &initiator_name,
389 &mech_type,
390 &output_token_buf,
391 &flags,
392 nullptr,
393 nullptr
394 );
395
396 if (major_status == GSS_S_COMPLETE)
397 {

Callers 1

authenticateUserMethod · 0.80

Calls 8

equalMechanismsFunction · 0.85
extractNameAndRealmFunction · 0.85
bufferToStringFunction · 0.85
extractStatusMessagesFunction · 0.85
tryLogCurrentExceptionFunction · 0.85
ExceptionClass · 0.50
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected