144 #include <sys/types.h>
145 #include <sys/mman.h>
150 #define PAGESIZE sysconf(_SC_PAGESIZE)
155 #define mlock(a, b) \
156 mlock(((void*)(((size_t)(a)) & (~((PAGESIZE)-1)))), \
157 (((((size_t)(a)) + (b)-1) | ((PAGESIZE)-1)) + 1) - \
158 (((size_t)(a)) & (~((PAGESIZE)-1))))
159 #define munlock(a, b) \
160 munlock(((void*)(((size_t)(a)) & (~((PAGESIZE)-1)))), \
161 (((((size_t)(a)) + (b)-1) | ((PAGESIZE)-1)) + 1) - \
162 (((size_t)(a)) & (~((PAGESIZE)-1))))
206 return m_bUsingOldSystem;
211 m_bUsingOldSystem = bUsing;
216 return (
nullptr == m_pMasterPW);
221 return (
nullptr != m_pMasterPW);
226 return m_strDisplay.c_str();
230 std::shared_ptr<OTCachedKey> pCachedKey)
231 : m_pMasterPW(pMasterPW)
232 , m_strDisplay(nullptr == szDisplay ?
"(Sorry, no user data provided.)"
234 , m_bUsingOldSystem(false)
235 , m_pCachedKey(pCachedKey)
239 OT_ASSERT(((
nullptr == pMasterPW) && (!pCachedKey)) ||
240 ((
nullptr != pMasterPW) && (pCachedKey)));
245 std::shared_ptr<OTCachedKey> pCachedKey)
246 : m_pMasterPW(pMasterPW)
247 , m_strDisplay(str_Display)
248 , m_bUsingOldSystem(false)
249 , m_pCachedKey(pCachedKey)
253 OT_ASSERT(((
nullptr == pMasterPW) && (!pCachedKey)) ||
254 ((
nullptr != pMasterPW) && (pCachedKey)));
259 std::shared_ptr<OTCachedKey> pCachedKey)
260 : m_pMasterPW(pMasterPW)
261 , m_strDisplay(strDisplay.Get())
262 , m_bUsingOldSystem(false)
263 , m_pCachedKey(pCachedKey)
267 OT_ASSERT(((
nullptr == pMasterPW) && (!pCachedKey)) ||
268 ((
nullptr != pMasterPW) && (pCachedKey)));
273 m_pMasterPW =
nullptr;
EXPORT const char * GetDisplayString() const
EXPORT bool isUsingOldSystem() const
EXPORT void setUsingOldSystem(bool bUsing=true)
EXPORT OTPasswordData(const char *szDisplay, OTPassword *pMasterPW=nullptr, std::shared_ptr< OTCachedKey > pCachedKey=std::shared_ptr< OTCachedKey >())
EXPORT bool isForCachedKey() const
EXPORT bool isForNormalNym() const