| 1 |
// $OpenLDAP$ |
| 2 |
/* |
| 3 |
* Copyright 2007-2024 The OpenLDAP Foundation, All Rights Reserved. |
| 4 |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
| 5 |
*/ |
| 6 |
|
| 7 |
#include <SaslInteraction.h> |
| 8 |
#include <iostream> |
| 9 |
#include "debug.h" |
| 10 |
|
| 11 |
SaslInteraction::SaslInteraction( sasl_interact_t *interact ) : |
| 12 |
m_interact(interact) {} |
| 13 |
|
| 14 |
SaslInteraction::~SaslInteraction() |
| 15 |
{ |
| 16 |
DEBUG(LDAP_DEBUG_TRACE, "SaslInteraction::~SaslInteraction()" << std::endl); |
| 17 |
} |
| 18 |
|
| 19 |
unsigned long SaslInteraction::getId() const |
| 20 |
{ |
| 21 |
return m_interact->id; |
| 22 |
} |
| 23 |
|
| 24 |
const std::string SaslInteraction::getPrompt() const |
| 25 |
{ |
| 26 |
return std::string(m_interact->prompt); |
| 27 |
} |
| 28 |
|
| 29 |
const std::string SaslInteraction::getChallenge() const |
| 30 |
{ |
| 31 |
return std::string(m_interact->challenge); |
| 32 |
} |
| 33 |
|
| 34 |
const std::string SaslInteraction::getDefaultResult() const |
| 35 |
{ |
| 36 |
return std::string(m_interact->defresult); |
| 37 |
} |
| 38 |
|
| 39 |
void SaslInteraction::setResult(const std::string &res) |
| 40 |
{ |
| 41 |
m_result = res; |
| 42 |
m_interact->result = m_result.data(); |
| 43 |
m_interact->len = m_result.size(); |
| 44 |
} |