Exemplo n.º 1
0
void OTPassword::zeroMemory()
{
    size_ = 0;

    OTPassword::zeroMemory(static_cast<void*>(&(data_[0])), getBlockSize());

//
#ifndef _WIN32
    // UNLOCK the page, now that we're AFTER the point where
    // the memory was safely ZERO'd out.
    //
    if (isPageLocked_) {
        if (ot_unlockPage(static_cast<void*>(&(data_[0])), getBlockSize())) {
            isPageLocked_ = false;
        }
        else
            otErr << "OTPassword::zeroMemory: Error: Memory page was locked, "
                     "but then failed to unlock it.\n";
    }
#endif
}
Exemplo n.º 2
0
void OTPassword::zeroMemory()
{
	m_nPasswordSize = 0;
    // -------------------
    OTPassword::zeroMemory(m_szPassword, sizeof(m_szPassword));    
    // -------------------
    //
    // UNLOCK the page, now that we're AFTER the point where
    // the memory was safely ZERO'd out.
    //
    if (m_bIsPageLocked)
    {
        if (ot_unlockPage(static_cast<void *>(&(m_szPassword[0])), getBlockSize()))
        {
            m_bIsPageLocked = false;
        }
        else
            OTLog::Error("OTPassword::zeroMemory: Error: Memory page was locked, but then failed to unlock it.\n");
    }    
    // -------------------
}