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))))
170 otOut <<
"OTCaller::~OTCaller: (This should only happen as the application "
206 otOut <<
"OTCaller::GetPassword: FYI, returning password after invoking a "
207 "(probably Java) password dialog.\n";
209 theOutput.setPassword_uint8(m_Password.getPassword_uint8(),
210 m_Password.getPasswordSize());
229 otOut <<
"OTCaller::delCallback: WARNING: setting existing callback "
230 "object pointer to nullptr. "
231 "(This message doesn't trigger if it was already nullptr.)\n";
238 otOut <<
"OTCaller::setCallback: Attempting to set the password OTCallback "
242 otOut <<
"OTCaller::setCallback: ERROR: nullptr password OTCallback "
243 "object passed in. (Returning.)\n";
252 otOut <<
"OTCaller::setCallback: FYI, the password OTCallback pointer was "
258 return (
nullptr ==
_callback) ?
false :
true;
267 <<
"OTCaller::callOne: FYI, Executing password callback (one)...\n";
271 otOut <<
"OTCaller::callOne: WARNING: Failed attempt to trigger "
272 "password callback (one), due to \"it hasn't been set "
283 <<
"OTCaller::callTwo: FYI, Executing password callback (two)...\n";
287 otOut <<
"OTCaller::callTwo: WARNING: Failed attempt to trigger "
288 "password callback (two), due to \"it hasn't been set "
EXPORT void delCallback()
EXPORT void ZeroOutPassword()
OTLOG_IMPORT OTLogStream otOut
virtual EXPORT void runOne(const char *szDisplay, OTPassword &theOutput) const
EXPORT void SetDisplay(const char *szDisplay, int32_t nLength)
EXPORT uint32_t getPasswordSize() const
EXPORT bool isCallbackSet() const
EXPORT void setCallback(OTCallback *cb)
EXPORT bool GetPassword(OTPassword &theOutput) const
EXPORT const uint8_t * getPassword_uint8() const
EXPORT const char * GetDisplay() const
EXPORT int32_t setPassword_uint8(const uint8_t *input, uint32_t size)
virtual EXPORT void runTwo(const char *szDisplay, OTPassword &theOutput) const