summaryrefslogtreecommitdiffstats
path: root/contrib/ldapc++/src/SaslInteraction.cpp
blob: 40d85b7e042f0756026499f2393e140ea6154ff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// $OpenLDAP$
/*
 * Copyright 2007-2018 The OpenLDAP Foundation, All Rights Reserved.
 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 */

#include <SaslInteraction.h>
#include <iostream>
#include "debug.h"

SaslInteraction::SaslInteraction( sasl_interact_t *interact ) :
        m_interact(interact) {}

SaslInteraction::~SaslInteraction()
{
    DEBUG(LDAP_DEBUG_TRACE, "SaslInteraction::~SaslInteraction()" << std::endl);
}

unsigned long SaslInteraction::getId() const
{
    return m_interact->id;
}

const std::string SaslInteraction::getPrompt() const
{
    return std::string(m_interact->prompt);
}

const std::string SaslInteraction::getChallenge() const
{
    return std::string(m_interact->challenge);
}

const std::string SaslInteraction::getDefaultResult() const
{
    return std::string(m_interact->defresult);
}

void SaslInteraction::setResult(const std::string &res)
{
    m_result = res;
    m_interact->result = m_result.data();
    m_interact->len = m_result.size();
}