xca/lib/Passwd.cpp
Christian Hohnstaedt 5f4d3e1084 Bug #3485139 Exception when creating certificates in passwordless db
Fix key decryption in case of an empty password.
Use "" instead of NULL for EVP_BytesToKey()
2012-03-31 14:28:37 +02:00

25 lines
350 B
C++

/* vi: set sw=4 ts=4:
*
* Copyright (C) 2011 Christian Hohnstaedt.
*
* All rights reserved.
*/
#include <QtCore/QByteArray>
#include "Passwd.h"
void Passwd::cleanse()
{
memset(data(), 0, size());
}
Passwd::~Passwd()
{
Passwd::cleanse();
}
unsigned char *Passwd::constUchar() const
{
return (unsigned char *)(size() ? constData() : "");
}