git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@1 b624d157-de02-0410-bad0-e51aec6abb33master
@ -0,0 +1,9 @@ |
||||
# Diese Datei wurde mit dem qmake-Manager von KDevelop erstellt. |
||||
# ------------------------------------------- |
||||
# Unterverzeichnis relativ zum Projektverzeichnis: . |
||||
# Das Target ist Projekt im Unterverzeichnis |
||||
|
||||
CONFIG += release \ |
||||
warn_on |
||||
TEMPLATE = subdirs |
||||
SUBDIRS += src |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 634 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,57 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include "Database.h" |
||||
|
||||
|
||||
CEntry::CEntry(){ |
||||
ImageID=0; |
||||
GroupID=0; |
||||
Creation.SetToNow(); |
||||
LastMod.SetToNow(); |
||||
LastAccess.SetToNow(); |
||||
Expire.Set(28,12,2999,0,0,0); |
||||
BinaryDataLength=0; |
||||
pBinaryData=NULL; |
||||
} |
||||
|
||||
bool CGroup::UI_ExpandByDefault=true; |
||||
|
||||
CGroup::CGroup(){ |
||||
Creation.SetToNow(); |
||||
LastAccess.SetToNow(); |
||||
LastMod.SetToNow(); |
||||
Expire.Set(1,1,2999,0,0,0); |
||||
Level=0; |
||||
ImageID=0; |
||||
Name="<Group>"; |
||||
UI_ItemIsExpanded=UI_ExpandByDefault; |
||||
} |
||||
|
||||
CGroup::~CGroup(){ |
||||
} |
||||
|
||||
CEntry::~CEntry(){ |
||||
if(pBinaryData) { |
||||
delete [] pBinaryData; |
||||
} |
||||
pBinaryData=NULL; |
||||
|
||||
} |
@ -0,0 +1,99 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#ifndef _DATABASE_H_ |
||||
#define _DATABASE_H_ |
||||
|
||||
#include <vector.h> |
||||
#include "lib/PwmTime.h" |
||||
#include "lib/SecString.h" |
||||
|
||||
class CEntry{ |
||||
public: |
||||
CEntry(); |
||||
~CEntry(); |
||||
UINT8 ID[16]; |
||||
UINT32 sID; |
||||
UINT32 GroupID; |
||||
UINT32 ImageID; |
||||
QString Title; |
||||
QString URL; |
||||
QString UserName; |
||||
SecString Password; |
||||
QString Additional; |
||||
QString BinaryDesc; |
||||
CPwmTime Creation; |
||||
CPwmTime LastMod; |
||||
CPwmTime LastAccess; |
||||
CPwmTime Expire; |
||||
UINT8 *pBinaryData; |
||||
UINT32 BinaryDataLength; |
||||
UINT32 PasswordLength; |
||||
bool ReadEntryField(UINT16 FieldType, UINT32 FieldSize, UINT8 *pData); |
||||
}; |
||||
|
||||
|
||||
class CGroup{ |
||||
public: |
||||
CGroup(); |
||||
~CGroup(); |
||||
UINT32 ID; |
||||
UINT32 ImageID; |
||||
UINT32 NumEntries; |
||||
QString Name; |
||||
CPwmTime Creation; |
||||
CPwmTime LastMod; |
||||
CPwmTime LastAccess; |
||||
CPwmTime Expire; |
||||
UINT16 Level; |
||||
UINT32 Flags; |
||||
bool ReadGroupField(UINT16 FieldType, UINT32 FieldSize, UINT8 *pData); |
||||
|
||||
bool UI_ItemIsExpanded; |
||||
static bool UI_ExpandByDefault; |
||||
|
||||
}; |
||||
|
||||
|
||||
typedef vector<CEntry>::iterator EntryItr; |
||||
typedef vector<CGroup>::iterator GroupItr; |
||||
|
||||
|
||||
class AbstractDatabase{ |
||||
public: |
||||
vector<CGroup>Groups; |
||||
vector<CEntry>Entries; |
||||
}; |
||||
|
||||
|
||||
|
||||
class Database:public AbstractDatabase{ |
||||
public: |
||||
int CryptoAlgorithmus; |
||||
int KeyEncRounds; |
||||
QString filename; |
||||
bool modflag; |
||||
int SearchGroupID; |
||||
|
||||
protected: |
||||
UINT8 MasterKey[32]; |
||||
UINT8 TransformedMasterKey[32]; |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,155 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "ListViews.h" |
||||
#include "PwManager.h" |
||||
#include <qstring.h> |
||||
#include <qlistview.h> |
||||
|
||||
|
||||
|
||||
GroupItem::GroupItem(CGroup* group, QListView * parent ) : QListViewItem(parent) |
||||
{ |
||||
pGroup=group; |
||||
setDropEnabled(true); |
||||
} |
||||
|
||||
GroupItem::GroupItem(CGroup* group, QListViewItem * parent ): QListViewItem(parent) |
||||
{ |
||||
pGroup=group; |
||||
setDropEnabled(true); |
||||
} |
||||
|
||||
GroupItem::GroupItem(CGroup* group, QListView * parent, QListViewItem * after ): QListViewItem(parent,after) |
||||
{ |
||||
pGroup=group; |
||||
setDropEnabled(true); |
||||
} |
||||
|
||||
GroupItem::GroupItem(CGroup* group, QListViewItem * parent, QListViewItem * after ): QListViewItem(parent,after) |
||||
{ |
||||
pGroup=group; |
||||
setDropEnabled(true); |
||||
} |
||||
|
||||
GroupItem::GroupItem(CGroup* group, QListView* parent, QString l1,QString l2,QString l3,QString l4, |
||||
QString l5,QString l6,QString l7,QString l8) |
||||
:QListViewItem(parent,l1,l2,l3,l4,l5,l6,l7,l8) |
||||
{ |
||||
pGroup=group; |
||||
setDropEnabled(true); |
||||
} |
||||
|
||||
GroupItem::GroupItem(CGroup* group, QListViewItem* parent, QString l1,QString l2,QString l3,QString l4, |
||||
QString l5,QString l6,QString l7,QString l8) |
||||
:QListViewItem(parent,l1,l2,l3,l4,l5,l6,l7,l8) |
||||
{ |
||||
pGroup=group; |
||||
setDropEnabled(true); |
||||
} |
||||
|
||||
GroupItem::GroupItem(CGroup* group, QListView* parent,QListViewItem* after, QString l1,QString l2,QString l3,QString l4, |
||||
QString l5,QString l6,QString l7,QString l8) |
||||
:QListViewItem(parent,after,l1,l2,l3,l4,l5,l6,l7,l8) |
||||
{ |
||||
pGroup=group; |
||||
setDropEnabled(true); |
||||
} |
||||
|
||||
GroupItem::GroupItem(CGroup* group, QListViewItem* parent,QListViewItem* after, QString l1,QString l2,QString l3,QString l4, |
||||
QString l5,QString l6,QString l7,QString l8) |
||||
:QListViewItem(parent,after,l1,l2,l3,l4,l5,l6,l7,l8) |
||||
{ |
||||
pGroup=group; |
||||
setDropEnabled(true); |
||||
} |
||||
|
||||
GroupItem::~GroupItem(){} |
||||
|
||||
|
||||
bool GroupItem::acceptDrop(const QMimeSource* mime){ |
||||
qDebug("DropEvent\n"); |
||||
return true; |
||||
} |
||||
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
EntryItem::EntryItem(CEntry* entry, QListView * parent ) : QListViewItem(parent) |
||||
{ |
||||
pEntry=entry; |
||||
setDragEnabled(true); |
||||
} |
||||
|
||||
EntryItem::EntryItem(CEntry* entry, QListViewItem * parent ): QListViewItem(parent) |
||||
{ |
||||
pEntry=entry; |
||||
setDragEnabled(true); |
||||
} |
||||
|
||||
EntryItem::EntryItem(CEntry* entry, QListView * parent, QListViewItem * after ): QListViewItem(parent,after) |
||||
{ |
||||
pEntry=entry; |
||||
setDragEnabled(true); |
||||
} |
||||
|
||||
EntryItem::EntryItem(CEntry* entry, QListViewItem * parent, QListViewItem * after ): QListViewItem(parent,after) |
||||
{ |
||||
pEntry=entry; |
||||
setDragEnabled(true); |
||||
} |
||||
|
||||
EntryItem::EntryItem(CEntry* entry, QListView* parent, QString l1,QString l2,QString l3,QString l4, |
||||
QString l5,QString l6,QString l7,QString l8) |
||||
:QListViewItem(parent,l1,l2,l3,l4,l5,l6,l7,l8) |
||||
{ |
||||
pEntry=entry; |
||||
setDragEnabled(true); |
||||
} |
||||
|
||||
EntryItem::EntryItem(CEntry* entry, QListViewItem* parent, QString l1,QString l2,QString l3,QString l4, |
||||
QString l5,QString l6,QString l7,QString l8) |
||||
:QListViewItem(parent,l1,l2,l3,l4,l5,l6,l7,l8) |
||||
{ |
||||
pEntry=entry; |
||||
setDragEnabled(true); |
||||
} |
||||
|
||||
EntryItem::EntryItem(CEntry* entry, QListView* parent,QListViewItem* after, QString l1,QString l2,QString l3,QString l4, |
||||
QString l5,QString l6,QString l7,QString l8) |
||||
:QListViewItem(parent,after,l1,l2,l3,l4,l5,l6,l7,l8) |
||||
{ |
||||
pEntry=entry; |
||||
setDragEnabled(true); |
||||
} |
||||
|
||||
EntryItem::EntryItem(CEntry* entry, QListViewItem* parent,QListViewItem* after, QString l1,QString l2,QString l3,QString l4, |
||||
QString l5,QString l6,QString l7,QString l8) |
||||
:QListViewItem(parent,after,l1,l2,l3,l4,l5,l6,l7,l8) |
||||
{ |
||||
pEntry=entry; |
||||
setDragEnabled(true); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
CGroupView::CGroupView(QWidget * parent, const char * name, WFlags f):QListView(parent,name,f){ |
||||
|
||||
}; |
@ -0,0 +1,108 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#ifndef _LISTVIEWS_H_ |
||||
#define _LISTVIEWS_H_ |
||||
|
||||
#include <qlistview.h> |
||||
#include <qmime.h> |
||||
#include "PwManager.h" |
||||
|
||||
class GroupItem: public QListViewItem{ |
||||
public: |
||||
CGroup* pGroup; |
||||
virtual bool acceptDrop(const QMimeSource * mime); |
||||
///////////////////////////////////////////////////////////////////////
|
||||
GroupItem(CGroup*, QListView * parent ); |
||||
GroupItem(CGroup*, QListViewItem * parent ); |
||||
GroupItem(CGroup*, QListView * parent, QListViewItem * after ); |
||||
GroupItem(CGroup*, QListViewItem * parent, QListViewItem * after ); |
||||
|
||||
GroupItem(CGroup*, QListView * parent, |
||||
QString, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null ); |
||||
|
||||
GroupItem(CGroup*, QListViewItem * parent, |
||||
QString, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null ); |
||||
|
||||
GroupItem(CGroup*, QListView * parent, QListViewItem * after, |
||||
QString, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null ); |
||||
|
||||
GroupItem(CGroup*, QListViewItem * parent, QListViewItem * after, |
||||
QString, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null ); |
||||
~GroupItem(); |
||||
/////////////////////////////////////////////////////////////////////////
|
||||
}; |
||||
|
||||
|
||||
class EntryItem: public QListViewItem{ |
||||
public: |
||||
CEntry* pEntry; |
||||
///////////////////////////////////////////////////////////////////////
|
||||
EntryItem(CEntry*, QListView * parent ); |
||||
EntryItem(CEntry*, QListViewItem * parent ); |
||||
EntryItem(CEntry*, QListView * parent, QListViewItem * after ); |
||||
EntryItem(CEntry*, QListViewItem * parent, QListViewItem * after ); |
||||
|
||||
EntryItem(CEntry*, QListView * parent, |
||||
QString, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null ); |
||||
|
||||
EntryItem(CEntry*, QListViewItem * parent, |
||||
QString, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null ); |
||||
|
||||
EntryItem(CEntry*, QListView * parent, QListViewItem * after, |
||||
QString, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null ); |
||||
|
||||
EntryItem(CEntry*, QListViewItem * parent, QListViewItem * after, |
||||
QString, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null, |
||||
QString = QString::null, QString = QString::null ); |
||||
/////////////////////////////////////////////////////////////////////////
|
||||
}; |
||||
|
||||
|
||||
class CGroupView: public QListView{ |
||||
public: |
||||
CGroupView(QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); |
||||
|
||||
|
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,915 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include <iostream.h> |
||||
#include <time.h> |
||||
#include <qfile.h> |
||||
#include <qstringlist.h> |
||||
#include <qobject.h> |
||||
#include <qdatetime.h> |
||||
#include "crypto/sha256.h" |
||||
#include "crypto/rijndael.h" |
||||
#include "crypto/twoclass.h" |
||||
#include "lib/random.h" |
||||
|
||||
#include "PwManager.h" |
||||
|
||||
bool PwDatabase::loadDatabase(QString _filename, QString& err){ |
||||
unsigned long total_size,crypto_size; |
||||
UINT32 Signature1,Signature2,Version,NumGroups,NumEntries,Flags; |
||||
UINT8 TrafoRandomSeed[32]; |
||||
UINT8 FinalRandomSeed[16]; |
||||
UINT8 ContentsHash[32]; |
||||
UINT8 EncryptionIV[16]; |
||||
|
||||
filename=_filename; |
||||
QFile file(filename); |
||||
file.open(IO_ReadOnly); |
||||
total_size=file.size(); |
||||
char* buffer = new char[total_size]; |
||||
file.readBlock(buffer,total_size); |
||||
file.close(); |
||||
|
||||
if(total_size < DB_HEADER_SIZE){ |
||||
err=trUtf8("Unerwartete Dateigröße (Dateigröße < DB_HEADER_SIZE)"); |
||||
return false; } |
||||
|
||||
memcpy(&Signature1,buffer,4); |
||||
memcpy(&Signature2,buffer+4,4); |
||||
memcpy(&Flags,buffer+8,4); |
||||
memcpy(&Version,buffer+12,4); |
||||
memcpy(FinalRandomSeed,buffer+16,16); |
||||
memcpy(EncryptionIV,buffer+32,16); |
||||
memcpy(&NumGroups,buffer+48,4); |
||||
memcpy(&NumEntries,buffer+52,4); |
||||
memcpy(ContentsHash,buffer+56,32); |
||||
memcpy(TrafoRandomSeed,buffer+88,32); |
||||
memcpy(&KeyEncRounds,buffer+120,4); |
||||
|
||||
if((Signature1!=PWM_DBSIG_1) || (Signature2!=PWM_DBSIG_2)){ |
||||
err=trUtf8("Falsche Signatur"); |
||||
return false;} |
||||
|
||||
|
||||
if((Version & 0xFFFFFF00) != (PWM_DBVER_DW & 0xFFFFFF00)){ |
||||
err=trUtf8("Nicht unterstüzte Dateiversion"); |
||||
return false;} |
||||
|
||||
if(Flags & PWM_FLAG_RIJNDAEL) CryptoAlgorithmus = ALGO_AES; |
||||
else if(Flags & PWM_FLAG_TWOFISH) CryptoAlgorithmus = ALGO_TWOFISH; |
||||
else { |
||||
err=trUtf8("Unbekannter Verschlüsselungsalgorithmus"); |
||||
return false; |
||||
} |
||||
|
||||
transformKey(MasterKey,TransformedMasterKey,TrafoRandomSeed,KeyEncRounds); |
||||
UINT8 FinalKey[32]; |
||||
sha256_context sha32; |
||||
sha256_starts(&sha32); |
||||
sha256_update(&sha32,FinalRandomSeed, 16); |
||||
sha256_update(&sha32,TransformedMasterKey, 32); |
||||
sha256_finish(&sha32,FinalKey); |
||||
|
||||
if(CryptoAlgorithmus == ALGO_AES) |
||||
{ |
||||
Rijndael aes; |
||||
// Initialize Rijndael algorithm
|
||||
if(aes.init(Rijndael::CBC, Rijndael::Decrypt, FinalKey, |
||||
Rijndael::Key32Bytes, EncryptionIV) != RIJNDAEL_SUCCESS) |
||||
{return false;} |
||||
// Decrypt! The first bytes aren't encrypted (that's the header)
|
||||
crypto_size = (unsigned long)aes.padDecrypt((UINT8 *)buffer + DB_HEADER_SIZE, |
||||
total_size - DB_HEADER_SIZE, (UINT8 *)buffer + DB_HEADER_SIZE); |
||||
} |
||||
else if(CryptoAlgorithmus == ALGO_TWOFISH) |
||||
{ |
||||
CTwofish twofish; |
||||
if(twofish.init(FinalKey, 32, EncryptionIV) != true){return false;} |
||||
crypto_size = (unsigned long)twofish.padDecrypt((UINT8 *)buffer + DB_HEADER_SIZE, |
||||
total_size - DB_HEADER_SIZE, (UINT8 *)buffer + DB_HEADER_SIZE); |
||||
} |
||||
|
||||
if((crypto_size > 2147483446) || (crypto_size == 0)){return false;} |
||||
|
||||
sha256_starts(&sha32); |
||||
sha256_update(&sha32,(unsigned char *)buffer + DB_HEADER_SIZE,crypto_size); |
||||
sha256_finish(&sha32,(unsigned char *)FinalKey); |
||||
|
||||
if(memcmp(ContentsHash, FinalKey, 32) != 0) |
||||
{ |
||||
err=trUtf8("Hash-Test fehlgeschlage: der Schlüssl ist falsch oder die Datei ist beschädigt."); |
||||
return false;} |
||||
|
||||
|
||||
Groups.resize(NumGroups); |
||||
Entries.resize(NumEntries); |
||||
|
||||
unsigned long tmp_id=0; |
||||
unsigned long pos = DB_HEADER_SIZE; |
||||
UINT16 FieldType; |
||||
UINT32 FieldSize; |
||||
char* pField; |
||||
bool bRet; |
||||
|
||||
|
||||
for(unsigned long CurGroup = 0; CurGroup < NumGroups; ) |
||||
{ |
||||
pField = buffer+pos; |
||||
|
||||
memcpy(&FieldType, pField, 2); |
||||
pField += 2; pos += 2; |
||||
if(pos >= total_size) { |
||||
return false; } |
||||
|
||||
memcpy(&FieldSize, pField, 4); |
||||
pField += 4; pos += 4; |
||||
if(pos >= (total_size + FieldSize)) { |
||||
return false;} |
||||
|
||||
bRet = Groups[CurGroup].ReadGroupField(FieldType, FieldSize, (UINT8 *)pField); |
||||
if((FieldType == 0xFFFF) && (bRet == true)){ |
||||
CurGroup++;} // Now and ONLY now the counter gets increased
|
||||
|
||||
pField += FieldSize; |
||||
pos += FieldSize; |
||||
if(pos >= total_size) { return false;} |
||||
} |
||||
|
||||
|
||||
for(unsigned long CurEntry = 0; CurEntry < NumEntries;) |
||||
{ |
||||
pField = buffer+pos; |
||||
|
||||
memcpy(&FieldType, pField, 2); |
||||
pField += 2; pos += 2; |
||||
if(pos >= total_size){ |
||||
return false;} |
||||
|
||||
memcpy(&FieldSize, pField, 4); |
||||
pField += 4; pos += 4; |
||||
if(pos >= (total_size + FieldSize)) { |
||||
return false; } |
||||
|
||||
bRet = Entries[CurEntry].ReadEntryField(FieldType,FieldSize,(UINT8*)pField); |
||||
if((FieldType == 0xFFFF) && (bRet == true)){ |
||||
Entries[CurEntry].sID=tmp_id++; |
||||
CurEntry++;} // Now and ONLY now the counter gets increased
|
||||
|
||||
pField += FieldSize; |
||||
pos += FieldSize; |
||||
if(pos >= total_size) { |
||||
return false; } |
||||
} |
||||
|
||||
unsigned long CurGID, g, e, z, num; |
||||
delete [] buffer; |
||||
|
||||
for(vector<CEntry>::iterator i=Entries.begin();i!=Entries.end();i++){ |
||||
if(IsMetaStream(*i)==true){ |
||||
///@TODO Parse Metastreams
|
||||
deleteEntry(i); |
||||
i--; |
||||
} |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
|
||||
void PwDatabase::transformKey(UINT8* src,UINT8* dst,UINT8* KeySeed,int rounds){ |
||||
UINT8* tmp=new UINT8[32]; |
||||
Rijndael rijndael; |
||||
sha256_context sha2; |
||||
if(rijndael.init(Rijndael::ECB, Rijndael::Encrypt, (const UINT8 *)KeySeed, |
||||
Rijndael::Key32Bytes, 0) != RIJNDAEL_SUCCESS){ |
||||
cout << QString("unexpected error in %1, line %2").arg(__FILE__).arg(__LINE__) << endl; |
||||
exit(1);} |
||||
|
||||
memcpy(tmp,src,32); |
||||
for(int i=0;i<rounds;i++){ |
||||
rijndael.blockEncrypt((const UINT8 *)tmp, 256, (UINT8 *)tmp); |
||||
} |
||||
|
||||
sha256_starts(&sha2); |
||||
sha256_update(&sha2,tmp,32); |
||||
sha256_finish(&sha2,tmp); |
||||
|
||||
memcpy(dst,tmp,32); |
||||
delete [] tmp; |
||||
} |
||||
|
||||
bool PwDatabase::CalcMasterKeyByPassword(QString& Password){ |
||||
|
||||
unsigned long KeyLen, FileSize, Read; |
||||
sha256_context sha32; |
||||
char *paKey = NULL; |
||||
|
||||
if(Password == QString::null) return false; |
||||
|
||||
paKey = new char[Password.length() + 1]; |
||||
if(paKey == NULL) return false; |
||||
strcpy(paKey, Password); |
||||
|
||||
|
||||
|
||||
if(paKey == NULL) return false; |
||||
|
||||
KeyLen = strlen(paKey); |
||||
|
||||
if(KeyLen == 0) { |
||||
SecString::overwrite(paKey,Password.length() + 1); |
||||
delete [] paKey; |
||||
return false; } |
||||
|
||||
sha256_starts(&sha32); |
||||
sha256_update(&sha32,(unsigned char*) paKey, KeyLen); |
||||
sha256_finish(&sha32,MasterKey); |
||||
SecString::overwrite(paKey,Password.length() + 1); |
||||
delete [] paKey; |
||||
return true; |
||||
} |
||||
|
||||
|
||||
bool PwDatabase::CalcMasterKeyByFile(QString filename){ |
||||
|
||||
QFile file(filename); |
||||
if(file.open(IO_ReadOnly) == false) return false; |
||||
unsigned long FileSize=file.size(); |
||||
|
||||
if(FileSize == 32){ |
||||
if(file.readBlock((char*)MasterKey,32) != 32){ |
||||
file.close(); |
||||
return false;} |
||||
} |
||||
else |
||||
{ |
||||
sha256_context sha32; |
||||
sha256_starts(&sha32); |
||||
unsigned char* buffer = new unsigned char[2048]; |
||||
while(1) |
||||
{ |
||||
unsigned long read=file.readBlock((char*)buffer,2048); |
||||
if(read == 0) break; |
||||
sha256_update(&sha32,buffer,read); |
||||
if(read != 2048) break; |
||||
} |
||||
sha256_finish(&sha32,MasterKey); |
||||
delete [] buffer; |
||||
} |
||||
|
||||
file.close(); |
||||
return true; |
||||
} |
||||
|
||||
|
||||
CEntry* PwDatabase::addEntry(){ |
||||
CEntry NewEntry; |
||||
if(Entries.size()==0){ |
||||
NewEntry.sID=0; |
||||
getRandomBytes(&NewEntry.ID,16,1,false); |
||||
} |
||||
else { |
||||
NewEntry.sID=(*(Entries.end()-1)).sID+1; |
||||
while(1){ |
||||
bool used=false; |
||||
getRandomBytes(&NewEntry.ID,16,1,false); |
||||
for(int j=0;j<Entries.size();j++){ |
||||
int k; |
||||
for(k=0;k<16;k++){if(Entries[j].ID[k]!=NewEntry.ID[k])k=0;break;} |
||||
if(k==15)used=true;} |
||||
if(used==false)break; |
||||
}} |
||||
Entries.push_back(NewEntry); |
||||
return &Entries.back(); |
||||
} |
||||
|
||||
|
||||
bool PwDatabase::CalcMasterKeyByFileAndPw(QString filename, QString& Password){ |
||||
UINT8* FileKey; |
||||
UINT8* PasswordKey; |
||||
PasswordKey=new UINT8[32]; |
||||
FileKey=new UINT8[32]; |
||||
sha256_context sha32; |
||||
/////////////////////////
|
||||
QFile file(filename); |
||||
if(file.open(IO_ReadOnly) == false) return false; |
||||
unsigned long FileSize=file.size(); |
||||
if(FileSize == 32){ |
||||
if(file.readBlock((char*)FileKey,32) != 32){ |
||||
file.close(); |
||||
return false;} |
||||
} |
||||
else{ |
||||
sha256_starts(&sha32); |
||||
unsigned char* buffer = new unsigned char[2048]; |
||||
while(1) |
||||
{ |
||||
unsigned long read=file.readBlock((char*)buffer,2048); |
||||
if(read == 0) break; |
||||
sha256_update(&sha32,buffer,read); |
||||
if(read != 2048) break; |
||||
} |
||||
sha256_finish(&sha32,FileKey); |
||||
delete [] buffer; |
||||
} |
||||
file.close(); |
||||
|
||||
//////////////////////
|
||||
|
||||
unsigned long KeyLen; |
||||
char *paKey = NULL; |
||||
if(Password == QString::null) return false; |
||||
paKey = new char[Password.length() + 1]; |
||||
if(paKey == NULL) return false; |
||||
strcpy(paKey, Password); |
||||
if(paKey == NULL) return false; |
||||
KeyLen = strlen(paKey); |
||||
if(KeyLen == 0) { |
||||
delete [] paKey; |
||||
return false; } |
||||
sha256_starts(&sha32); |
||||
sha256_update(&sha32,(unsigned char*) paKey, KeyLen); |
||||
sha256_finish(&sha32,PasswordKey); |
||||
delete [] paKey; |
||||
////////////////////
|
||||
sha256_starts(&sha32); |
||||
sha256_update(&sha32,(unsigned char*)PasswordKey,32); |
||||
sha256_update(&sha32,(unsigned char*)FileKey,32); |
||||
sha256_finish(&sha32,MasterKey); |
||||
delete[] PasswordKey; |
||||
delete[] FileKey; |
||||
} |
||||
|
||||
|
||||
vector<CEntry>::iterator PwDatabase::deleteEntry(vector<CEntry>::iterator iterator){ |
||||
return Entries.erase(iterator); |
||||
} |
||||
|
||||
vector<CEntry>::iterator PwDatabase::deleteEntry(CEntry* entry){ |
||||
return deleteEntry(getEntryIterator(entry)); |
||||
} |
||||
|
||||
bool PwDatabase::IsMetaStream(CEntry& p){ |
||||
|
||||
if(p.pBinaryData == NULL) return false; |
||||
if(p.Additional == NULL) return false; |
||||
if(p.BinaryDesc == NULL) return false; |
||||
if(p.BinaryDesc != "bin-stream") return false; |
||||
if(p.Title == NULL) return false; |
||||
if(p.Title != "Meta-Info") return false; |
||||
if(p.UserName == NULL) return false; |
||||
if(p.UserName != "SYSTEM") return false; |
||||
if(p.URL == NULL) return false; |
||||
if(p.URL != "$") return false; |
||||
if(p.ImageID != 0) return false; |
||||
return true; |
||||
} |
||||
|
||||
|
||||
|
||||
void PwDatabase::moveEntry(CEntry* entry,CGroup* dst){ |
||||
entry->GroupID=dst->ID; |
||||
} |
||||
|
||||
|
||||
|
||||
bool CGroup::ReadGroupField(UINT16 FieldType, UINT32 FieldSize, UINT8 *pData) |
||||
{ |
||||
|
||||
switch(FieldType) |
||||
{ |
||||
case 0x0000: |
||||
// Ignore field
|
||||
break; |
||||
case 0x0001: |
||||
memcpy(&ID, pData, 4); |
||||
break; |
||||
case 0x0002: |
||||
//Name.fromUtf8((char*)pData);
|
||||
Name=QString::fromUtf8((char*)pData); |
||||
break; |
||||
case 0x0003: |
||||
Creation.Set(pData); |
||||
break; |
||||
case 0x0004: |
||||
LastMod.Set(pData); |
||||
break; |
||||
case 0x0005: |
||||
LastAccess.Set(pData); |
||||
break; |
||||
case 0x0006: |
||||
Expire.Set(pData); |
||||
break; |
||||
case 0x0007: |
||||
memcpy(&ImageID, pData, 4); |
||||
break; |
||||
case 0x0008: |
||||
memcpy(&Level, pData, 2); |
||||
break; |
||||
case 0x0009: |
||||
memcpy(&Flags, pData, 4); |
||||
break; |
||||
case 0xFFFF: |
||||
break; |
||||
default: |
||||
return false; // Field unsupported
|
||||
} |
||||
|
||||
return true; // Field supported
|
||||
} |
||||
|
||||
PwDatabase::PwDatabase(){ |
||||
SearchGroupID=-1; |
||||
} |
||||
|
||||
PwDatabase::~PwDatabase(){ |
||||
|
||||
} |
||||
|
||||
|
||||
bool CEntry::ReadEntryField(UINT16 FieldType, UINT32 FieldSize, UINT8 *pData){ |
||||
|
||||
|
||||
switch(FieldType) |
||||
{ |
||||
case 0x0000: |
||||
// Ignore field
|
||||
break; |
||||
case 0x0001: |
||||
memcpy(ID, pData, 16); |
||||
break; |
||||
case 0x0002: |
||||
memcpy(&GroupID, pData, 4); |
||||
break; |
||||
case 0x0003: |
||||
memcpy(&ImageID, pData, 4); |
||||
break; |
||||
case 0x0004: |
||||
//Title=(char*)pData;
|
||||
Title=QString::fromUtf8((char*)pData); |
||||
break; |
||||
case 0x0005: |
||||
URL=QString::fromUtf8((char*)pData); |
||||
break; |
||||
case 0x0006: |
||||
UserName=QString::fromUtf8((char*)pData); |
||||
break; |
||||
case 0x0007:{ |
||||
QString s=QString::fromUtf8((char*)pData); |
||||
Password.setString(s,true); |
||||
break;} |
||||
case 0x0008: |
||||
Additional=QString::fromUtf8((char*)pData); |
||||
break; |
||||
case 0x0009: |
||||
Creation.Set(pData); |
||||
break; |
||||
case 0x000A: |
||||
LastMod.Set(pData); |
||||
break; |
||||
case 0x000B: |
||||
LastAccess.Set(pData); |
||||
break; |
||||
case 0x000C: |
||||
Expire.Set(pData); |
||||
break; |
||||
case 0x000D: |
||||
BinaryDesc=(char*)pData; |
||||
break; |
||||
case 0x000E: |
||||
if(FieldSize != 0) |
||||
{ |
||||
///@TODO: im Destruktor löschen
|
||||
///@TODO: im Konstruktor auf Null
|
||||
pBinaryData = new UINT8[FieldSize]; |
||||
memcpy(pBinaryData, pData, FieldSize); |
||||
BinaryDataLength = FieldSize; |
||||
} |
||||
else |
||||
{pBinaryData=0;} |
||||
break; |
||||
case 0xFFFF: |
||||
///@TODO: Alle Elemente geladen - Status setzen oder so was
|
||||
break; |
||||
default: |
||||
return false; // Field unsupported
|
||||
} |
||||
|
||||
return true; // Field processed
|
||||
} |
||||
|
||||
bool PwDatabase::CloseDataBase(){ |
||||
Groups.clear(); |
||||
Entries.clear(); |
||||
return true; |
||||
} |
||||
|
||||
bool PwDatabase::SaveDataBase(QString filename){ |
||||
CGroup SearchGroup; |
||||
UINT32 NumGroups,NumEntries,Signature1,Signature2,Flags,Version; |
||||
UINT8 TrafoRandomSeed[32]; |
||||
UINT8 FinalRandomSeed[16]; |
||||
UINT8 ContentsHash[32]; |
||||
UINT8 EncryptionIV[16]; |
||||
|
||||
if(SearchGroupID!=-1){ |
||||
for(int i=0;i<Groups.size();i++){ |
||||
if(Groups[i].ID==SearchGroupID){ |
||||
SearchGroup=Groups[i]; |
||||
Groups.erase(getGroupIterator(&Groups[i]));} |
||||
} |
||||
} |
||||
if(filename==QString::null)return false; |
||||
QFile file(filename); |
||||
unsigned int FileSize; |
||||
|
||||
//->Add Metastreams
|
||||
FileSize=DB_HEADER_SIZE; |
||||
// Get the size of all groups (94 Byte + length of the name string)
|
||||
for(int i = 0; i < Groups.size(); i++){ |
||||
FileSize += 94 + Groups[i].Name.utf8().length()+1; |
||||
} |
||||
// Get the size of all entries
|
||||
for(int i = 0; i < Entries.size(); i++){ |
||||
FileSize += 134 |
||||
+Entries[i].Title.utf8().length()+1 |
||||
+Entries[i].UserName.utf8().length()+1 |
||||
+Entries[i].URL.utf8().length()+1 |
||||
+Entries[i].Password.length()+1 |
||||
+Entries[i].Additional.utf8().length()+1 |
||||
+Entries[i].BinaryDesc.utf8().length()+1 |
||||
+Entries[i].BinaryDataLength;} |
||||
// Round up filesize to 16-byte boundary for Rijndael/Twofish
|
||||
FileSize = (FileSize + 16) - (FileSize % 16); |
||||
char* buffer=new char[FileSize+16]; |
||||
|
||||
|
||||
Signature1 = PWM_DBSIG_1; |
||||
Signature2 = PWM_DBSIG_2; |
||||
Flags = PWM_FLAG_SHA2; |
||||
if(CryptoAlgorithmus == ALGO_AES) Flags |= PWM_FLAG_RIJNDAEL; |
||||
else if(CryptoAlgorithmus == ALGO_TWOFISH) Flags |= PWM_FLAG_TWOFISH; |
||||
Version = PWM_DBVER_DW; |
||||
NumGroups = Groups.size(); //-> (+MetaStreams)
|
||||
NumEntries = Entries.size(); |
||||
|
||||
getRandomBytes(FinalRandomSeed,1,16,false); |
||||
getRandomBytes(TrafoRandomSeed,1,32,false); |
||||
getRandomBytes(EncryptionIV,1,16,false); |
||||
|
||||
UINT16 FieldType; |
||||
UINT32 FieldSize; |
||||
int pos=DB_HEADER_SIZE; // Skip the header, it will be written later
|
||||
|
||||
for(int i=0; i < Groups.size(); i++){ |
||||
FieldType = 0x0001; FieldSize = 4; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, &Groups[i].ID, 4); pos += 4; |
||||
|
||||
FieldType = 0x0002; FieldSize = Groups[i].Name.utf8().length() + 1; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, Groups[i].Name.utf8(),FieldSize); pos += FieldSize; |
||||
|
||||
FieldType = 0x0003; FieldSize = 5; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
Groups[i].Creation.GetPackedTime((unsigned char*)buffer+pos);pos += 5; |
||||
|
||||
FieldType = 0x0004; FieldSize = 5; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
Groups[i].LastMod.GetPackedTime((unsigned char*)buffer+pos);pos += 5; |
||||
|
||||
FieldType = 0x0005; FieldSize = 5; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
Groups[i].LastAccess.GetPackedTime((unsigned char*)buffer+pos);pos += 5; |
||||
|
||||
FieldType = 0x0006; FieldSize = 5; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
Groups[i].Expire.GetPackedTime((unsigned char*)buffer+pos);pos += 5; |
||||
|
||||
FieldType = 0x0007; FieldSize = 4; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, &Groups[i].ImageID, 4); pos += 4; |
||||
|
||||
FieldType = 0x0008; FieldSize = 2; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, &Groups[i].Level, 2); pos += 2; |
||||
|
||||
FieldType = 0x0009; FieldSize = 4; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, &Groups[i].Flags, 4); pos += 4; |
||||
|
||||
FieldType = 0xFFFF; FieldSize = 0; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
} |
||||
|
||||
for(int i = 0; i < Entries.size(); i++){ |
||||
FieldType = 0x0001; FieldSize = 16; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, &Entries[i].ID, 16); pos += 16; |
||||
|
||||
FieldType = 0x0002; FieldSize = 4; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, &Entries[i].GroupID, 4); pos += 4; |
||||
|
||||
FieldType = 0x0003; FieldSize = 4; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, &Entries[i].ImageID, 4); pos += 4; |
||||
|
||||
|
||||
FieldType = 0x0004; |
||||
FieldSize = Entries[i].Title.utf8().length() + 1; // Add terminating NULL character space
|
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, Entries[i].Title.utf8(),FieldSize); pos += FieldSize; |
||||
|
||||
FieldType = 0x0005; |
||||
FieldSize = Entries[i].URL.utf8().length() + 1; // Add terminating NULL character space
|
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, Entries[i].URL.utf8(),FieldSize); pos += FieldSize; |
||||
|
||||
FieldType = 0x0006; |
||||
FieldSize = Entries[i].UserName.utf8().length() + 1; // Add terminating NULL character space
|
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, Entries[i].UserName.utf8(),FieldSize); pos += FieldSize; |
||||
|
||||
FieldType = 0x0007; |
||||
FieldSize = Entries[i].Password.length() + 1; // Add terminating NULL character space
|
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, Entries[i].Password.getString(),FieldSize); pos += FieldSize; |
||||
Entries[i].Password.delRef(); |
||||
|
||||
FieldType = 0x0008; |
||||
FieldSize = Entries[i].Additional.utf8().length() + 1; // Add terminating NULL character space
|
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, Entries[i].Additional.utf8(),FieldSize); pos += FieldSize; |
||||
|
||||
FieldType = 0x0009; FieldSize = 5; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
Entries[i].Creation.GetPackedTime((unsigned char*)buffer+pos); pos+=5; |
||||
|
||||
|
||||
FieldType = 0x000A; FieldSize = 5; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
Entries[i].LastMod.GetPackedTime((unsigned char*)buffer+pos); pos+=5; |
||||
|
||||
FieldType = 0x000B; FieldSize = 5; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
Entries[i].LastAccess.GetPackedTime((unsigned char*)buffer+pos); pos+=5; |
||||
|
||||
FieldType = 0x000C; FieldSize = 5; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
Entries[i].Expire.GetPackedTime((unsigned char*)buffer+pos); pos+=5; |
||||
|
||||
FieldType = 0x000D; |
||||
FieldSize = Entries[i].BinaryDesc.utf8().length() + 1; // Add terminating NULL character space
|
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
memcpy(buffer+pos, Entries[i].BinaryDesc.utf8(),FieldSize); pos += FieldSize; |
||||
|
||||
FieldType = 0x000E; FieldSize = Entries[i].BinaryDataLength; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
if((Entries[i].pBinaryData != NULL) && (FieldSize != 0)) |
||||
memcpy(buffer+pos, Entries[i].pBinaryData, FieldSize); |
||||
pos += FieldSize; |
||||
|
||||
FieldType = 0xFFFF; FieldSize = 0; |
||||
memcpy(buffer+pos, &FieldType, 2); pos += 2; |
||||
memcpy(buffer+pos, &FieldSize, 4); pos += 4; |
||||
} |
||||
sha256_context context; |
||||
sha256_starts(&context); |
||||
sha256_update(&context,(unsigned char*)buffer+DB_HEADER_SIZE, pos - DB_HEADER_SIZE); |
||||
sha256_finish(&context,(unsigned char*)ContentsHash); |
||||
memcpy(buffer,&Signature1,4); |
||||
memcpy(buffer+4,&Signature2,4); |
||||
memcpy(buffer+8,&Flags,4); |
||||
memcpy(buffer+12,&Version,4); |
||||
memcpy(buffer+16,FinalRandomSeed,16); |
||||
memcpy(buffer+32,EncryptionIV,16); |
||||
memcpy(buffer+48,&NumGroups,4); |
||||
memcpy(buffer+52,&NumEntries,4); |
||||
memcpy(buffer+56,ContentsHash,32); |
||||
memcpy(buffer+88,TrafoRandomSeed,32); |
||||
memcpy(buffer+120,&KeyEncRounds,4); |
||||
transformKey(MasterKey,TransformedMasterKey,TrafoRandomSeed,KeyEncRounds); |
||||
UINT8 FinalKey[32]; |
||||
sha256_starts(&context); |
||||
sha256_update(&context,FinalRandomSeed, 16); |
||||
sha256_update(&context,TransformedMasterKey, 32); |
||||
sha256_finish(&context,FinalKey); |
||||
|
||||
unsigned long EncryptedPartSize; |
||||
|
||||
if(CryptoAlgorithmus == ALGO_AES){ |
||||
Rijndael aes; |
||||
// Initialize Rijndael/AES
|
||||
if(aes.init(Rijndael::CBC, Rijndael::Encrypt, FinalKey,Rijndael::Key32Bytes, EncryptionIV) != RIJNDAEL_SUCCESS){ |
||||
//TODO:ERR_MSG
|
||||
delete [] buffer; |
||||
return false;} |
||||
EncryptedPartSize = (unsigned long)aes.padEncrypt((UINT8*)buffer+DB_HEADER_SIZE, |
||||
pos - DB_HEADER_SIZE, |
||||
(UINT8*)buffer+DB_HEADER_SIZE); |
||||
}else if(CryptoAlgorithmus == ALGO_TWOFISH){ |
||||
CTwofish twofish; |
||||
if(twofish.init(FinalKey, 32, EncryptionIV) == false){ |
||||
//TODO:ERR_MSG
|
||||
delete [] buffer; |
||||
return false;} |
||||
EncryptedPartSize = (unsigned long)twofish.padEncrypt((UINT8*)buffer+DB_HEADER_SIZE, |
||||
pos - DB_HEADER_SIZE, |
||||
(UINT8*)buffer+DB_HEADER_SIZE); |
||||
} |
||||
|
||||
if((EncryptedPartSize > 2147483446) || (EncryptedPartSize == 0)){ |
||||
//TODO:ERR_MSG
|
||||
delete [] buffer; |
||||
return false; |
||||
} |
||||
|
||||
if(file.open(IO_ReadWrite | IO_Truncate)==false){ |
||||
//TODO:ERR_MSG
|
||||
delete [] buffer; |
||||
return false; |
||||
} |
||||
|
||||
if(file.writeBlock(buffer,EncryptedPartSize+DB_HEADER_SIZE)!=EncryptedPartSize+DB_HEADER_SIZE){ |
||||
//TODO:ERR_MSG
|
||||
file.close(); |
||||
delete [] buffer; |
||||
return false; |
||||
} |
||||
|
||||
file.close(); |
||||
delete [] buffer; |
||||
if(SearchGroupID!=-1)Groups.push_back(SearchGroup); |
||||
return true; |
||||
} |
||||
|
||||
bool PwDatabase::NewDataBase(){ |
||||
filename=""; |
||||
SearchGroupID=-1; |
||||
CryptoAlgorithmus=ALGO_AES; |
||||
KeyEncRounds=6000; |
||||
|
||||
CGroup g; |
||||
g.ID=1; |
||||
g.Name=QObject::trUtf8("Standardgruppe"); |
||||
Groups.push_back(g); |
||||
} |
||||
|
||||
GroupItr PwDatabase::getGroupIterator(CGroup* pGroup){ |
||||
//for(vector<CGroup>::iterator i=Groups.begin();i!=Groups.end();i++){
|
||||
//if((*i).ID==pGroup->ID)return i;}
|
||||
return Groups.begin()+(pGroup-&Groups[0]); |
||||
} |
||||
|
||||
|
||||
EntryItr PwDatabase::getEntryIterator(CEntry* pEntry){ |
||||
return Entries.begin()+(pEntry-&Entries[0]); |
||||
} |
||||
|
||||
CGroup* PwDatabase::addGroup(CGroup* parent){ |
||||
CGroup group; |
||||
if(parent)group.Level=parent->Level+1; |
||||
group.ImageID=0; |
||||
group.ID=getNewGroupId(); |
||||
|
||||
if(!Groups.size() || !parent){ |
||||
Groups.push_back(group); |
||||
return &Groups.back(); |
||||
} |
||||
else { GroupItr groupIt; |
||||
groupIt=Groups.insert(getGroupIterator(parent)+1,group); |
||||
return &(*groupIt);} |
||||
} |
||||
|
||||
|
||||
GroupItr PwDatabase::deleteGroup(unsigned long id){ |
||||
for(int i=0;i<Groups.size();i++){ |
||||
if(Groups[i].ID==id) return deleteGroup(&Groups[i]); |
||||
} |
||||
} |
||||
|
||||
GroupItr PwDatabase::deleteGroup(CGroup* group){ |
||||
GroupItr first=getGroupIterator(group); |
||||
GroupItr last=Groups.end(); |
||||
for(GroupItr i=getGroupIterator(group)+1; i!=Groups.end();i++){ |
||||
if((*i).Level<=group->Level){ |
||||
last=i; |
||||
break;} |
||||
} |
||||
|
||||
for(GroupItr g=first;g!=last;g++){ |
||||
for(EntryItr e=Entries.begin();e!=Entries.end();){ |
||||
if((*g).ID==(*e).GroupID)e=deleteEntry(e); |
||||
else e++; |
||||
} |
||||
} |
||||
|
||||
return Groups.erase(first,last); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
int PwDatabase::getGroupIndex(unsigned long ID){ |
||||
int i=0; |
||||
for(i;i<Groups.size();i++){ |
||||
if(Groups[i].ID==ID)break; |
||||
} |
||||
return i; |
||||
} |
||||
|
||||
|
||||
void PwDatabase::merge(PwDatabase* db){ |
||||
for(int i=0;i<db->Groups.size();i++){ |
||||
int NewGroupID; |
||||
if(isGroupIdInUse(db->Groups[i].ID)==true) NewGroupID=getNewGroupId(); |
||||
else NewGroupID=db->Groups[i].ID; |
||||
for(int j=0;j<db->Entries.size();j++){ |
||||
if(db->Entries[j].GroupID==db->Groups[i].ID){ |
||||
Entries.push_back(db->Entries[j]); |
||||
Entries.back().GroupID=NewGroupID; |
||||
Entries.back().sID=getNewEntrySid();} |
||||
} |
||||
Groups.push_back(db->Groups[i]); |
||||
Groups.back().ID=NewGroupID; |
||||
} |
||||
} |
||||
|
||||
bool PwDatabase::isGroupIdInUse(UINT32 id){ |
||||
for(int i=0;i<Groups.size();i++) |
||||
if(Groups[i].ID==id)return true; |
||||
|
||||
return false; |
||||
} |
||||
|
||||
bool PwDatabase::isEntrySidInUse(UINT32 sid){ |
||||
for(int i=0;i<Entries.size();i++) |
||||
if(Entries[i].sID==sid)return true; |
||||
|
||||
return false; |
||||
} |
||||
|
||||
|
||||
UINT32 PwDatabase::getNewGroupId(){ |
||||
UINT32 id; |
||||
bool used; |
||||
while(1){ |
||||
used=false; |
||||
getRandomBytes(&id,4,1,false); |
||||
if(!id)continue; //darf nicht 0 sein (KDB-Format v3)
|
||||
for(int j=0;j<Groups.size();j++){ |
||||
if(Groups[j].ID==id)used=true;} |
||||
if(used==false)break;} |
||||
return id; |
||||
} |
||||
|
||||
UINT32 PwDatabase::getNewEntrySid(){ |
||||
UINT32 sid; |
||||
while(1){ |
||||
getRandomBytes(&sid,4,1,false); |
||||
if(!sid)continue; |
||||
if(!isEntrySidInUse(sid))break; |
||||
} |
||||
return sid; |
||||
} |
@ -0,0 +1,79 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek.saidi@arcor.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#ifndef _PW_MANAGER_H_ |
||||
#define _PW_MANAGER_H_ |
||||
#define DB_HEADER_SIZE 124 |
||||
#define PWM_DBSIG_1 0x9AA2D903 |
||||
#define PWM_DBSIG_2 0xB54BFB65 |
||||
#define PWM_DBVER_DW 0x00030002 |
||||
#define PWM_FLAG_SHA2 1 |
||||
#define PWM_FLAG_RIJNDAEL 2 |
||||
#define PWM_FLAG_ARCFOUR 4 |
||||
#define PWM_FLAG_TWOFISH 8 |
||||
#define PWM_STD_KEYENCROUNDS 6000 |
||||
#define ALGO_AES 0 |
||||
#define ALGO_TWOFISH 1 |
||||
#define KEEPASS_VERSION "0.1.2" |
||||
|
||||
#include <qcolor.h> |
||||
#include <qobject.h> |
||||
#include "lib/SecString.h" |
||||
#include "lib/PwmTime.h" |
||||
#include "Database.h" |
||||
|
||||
|
||||
class PwDatabase:QObject,public Database{ |
||||
Q_OBJECT |
||||
public: |
||||
PwDatabase(); |
||||
~ PwDatabase(); |
||||
bool loadDatabase(QString filename, QString& err); |
||||
bool SaveDataBase(QString filename); |
||||
bool NewDataBase(); |
||||
bool CloseDataBase(); |
||||
bool CalcMasterKeyByPassword(QString& password); |
||||
bool CalcMasterKeyByFile(QString filename); |
||||
bool CalcMasterKeyByFileAndPw(QString filename, QString& password); |
||||
|
||||
CGroup* addGroup(CGroup* parent); |
||||
GroupItr deleteGroup(CGroup* pGroup); |
||||
GroupItr deleteGroup(unsigned long ID); |
||||
int getGroupIndex(unsigned long ID); |
||||
EntryItr deleteEntry(CEntry* pEntry); |
||||
void moveEntry(CEntry* pEntry,CGroup* pDstGroup); |
||||
CEntry* addEntry(); |
||||
void merge(PwDatabase* db2); |
||||
|
||||
|
||||
|
||||
private: |
||||
EntryItr deleteEntry(vector<CEntry>::iterator i); |
||||
EntryItr getEntryIterator(CEntry* pEntry); |
||||
GroupItr getGroupIterator(CGroup* pGroup); |
||||
bool IsMetaStream(CEntry& Entry); |
||||
void transformKey(UINT8* src,UINT8* dst,UINT8* seed,int rounds); |
||||
bool readHeader(char* raw); |
||||
bool isGroupIdInUse(UINT32 GroupID); |
||||
bool isEntrySidInUse(UINT32 sID); |
||||
UINT32 getNewGroupId(); |
||||
UINT32 getNewEntrySid(); |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,135 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include "PwmConfig.h" |
||||
#include <qobject.h> |
||||
#include <qdir.h> |
||||
#include <iostream.h> |
||||
|
||||
bool CConfig::loadFromIni(){ |
||||
CIniFile ini(QDir::homeDirPath()+"/.keepass/config"); |
||||
ini.ReadFile(); |
||||
ClipboardTimeOut=ini.GetValueI("Options","ClipboardTimeOut",20); |
||||
Toolbar=ini.GetValueB("UI","ShowToolbar",true); |
||||
EntryDetails=ini.GetValueB("UI","ShowEntryDetails",true); |
||||
OpenLast=ini.GetValueB("Options","OpenLast",true); |
||||
LastFile=ini.GetValue("Options","LastFile",""); |
||||
ParseColumnString(ini.GetValue("UI","Columns","1111100000"),Columns); |
||||
BannerColor1=ParseColorString(ini.GetValue("Options","BannerColor1","0,104,176")); |
||||
BannerColor2=ParseColorString(ini.GetValue("Options","BannerColor2","213,239,255")); |
||||
BannerTextColor=ParseColorString(ini.GetValue("Options","BannerTextColor","4,0,80")); |
||||
ShowPasswords=ini.GetValueB("Options","ShowPasswords",false); |
||||
OpenUrlCommand=ini.GetValue("Options","UrlCmd","kfmclient openURL %1"); |
||||
Language=ini.GetValue("Options","LangFile",""); |
||||
ParseBoolString(ini.GetValue("Options","SearchOptions","00110111"),SearchOptions,8); |
||||
ListView_HidePasswords=ini.GetValueB("UI","HidePasswords",true); |
||||
ListView_HideUsernames=ini.GetValueB("UI","HideUsernames",false); |
||||
ParseBoolString(ini.GetValue("Options","PwGenOptions","1111100001"),PwGenOptions,10); |
||||
PwGenLength=ini.GetValueI("Options","PwGenLength",25); |
||||
PwGenCharList=ini.GetValue("Options","PwGenCharList",""); |
||||
ExpandGroupTree=ini.GetValueB("Options","ExpandGroupTree",true); |
||||
return true; |
||||
} |
||||
|
||||
bool CConfig::saveToIni(){ |
||||
CIniFile ini(QDir::homeDirPath()+"/.keepass/config"); |
||||
ini.ReadFile(); |
||||
ini.SetValueI("Options","ClipboardTimeOut",ClipboardTimeOut); |
||||
ini.SetValueB("UI","ShowToolbar",Toolbar); |
||||
ini.SetValueB("UI","ShowEntryDetails",EntryDetails); |
||||
if(OpenLast)ini.SetValue("Options","LastFile",LastFile); |
||||
else ini.SetValue("Options","LastFile",""); |
||||
ini.SetValue("UI","Columns",CreateColumnString(),true); |
||||
ini.SetValue("Options","BannerColor1",CreateColorString(BannerColor1),true); |
||||
ini.SetValue("Options","BannerColor2",CreateColorString(BannerColor2),true); |
||||
ini.SetValue("Options","BannerTextColor",CreateColorString(BannerTextColor),true); |
||||
ini.SetValueB("Options","ShowPasswords",ShowPasswords,true); |
||||
ini.SetValue("Options","UrlCmd",OpenUrlCommand,true); |
||||
ini.SetValue("Options","LangFile",Language,true); |
||||
ini.SetValue("Options","SearchOptions",CreateBoolString(SearchOptions,8),true); |
||||
ini.SetValueB("UI","HidePasswords",ListView_HidePasswords); |
||||
ini.SetValueB("UI","HideUsernames",ListView_HideUsernames); |
||||
ini.SetValue("Options","PwGenOptions",CreateBoolString(PwGenOptions,10),true); |
||||
ini.SetValueI("Options","PwGenLength",PwGenLength,true); |
||||
ini.SetValue("Options","PwGenCharList",PwGenCharList,true); |
||||
ini.SetValueB("Options","ExpandGroupTree",ExpandGroupTree,true); |
||||
if(!ini.WriteFile())return false; |
||||
else return true; |
||||
} |
||||
|
||||
void CConfig::ParseColumnString(QString str, bool* dst){ |
||||
if(str.length()<10){ |
||||
bool _default[]={true,true,true,true,true,false,false,false,false,false}; |
||||
memcpy((char*)_default,(char*)dst,10*sizeof(bool));} |
||||
for(int i=0; i<10; i++){ |
||||
if(str[i]==QChar('0')) |
||||
*(dst+i)=false; |
||||
else |
||||
*(dst+i)=true; |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
QString CConfig::CreateColumnString(){ |
||||
QString str=""; |
||||
for(int i=0;i<10;i++){ |
||||
if(Columns[i])str+="1"; |
||||
else str+="0"; |
||||
} |
||||
return str; |
||||
} |
||||
|
||||
QColor CConfig::ParseColorString(QString str){ |
||||
QStringList lst=QStringList::split(',',str); |
||||
if(lst.size()!=3){ |
||||
cout << QObject::trUtf8("Warnung:")+" CConfig::ParseColorString(QString):"+QObject::trUtf8("ungültiger RGB-Farbwert: ") << str << endl; |
||||
return QColor(0,0,0);} |
||||
bool err[3]; |
||||
int r=lst[0].toUInt(err); |
||||
int g=lst[1].toUInt(err+1); |
||||
int b=lst[2].toUInt(err+2); |
||||
if(!err[0] || !err[1] || !err[2]){ |
||||
cout << QObject::trUtf8("Warnung:")+" CConfig::ParseColorString(QString):"+QObject::trUtf8("ungültiger RGB-Farbwert: ") << str << endl; |
||||
return QColor(0,0,0);} |
||||
return QColor(r,g,b); |
||||
} |
||||
|
||||
QString CConfig::CreateColorString(QColor c){ |
||||
return (QString::number(c.red())+","+QString::number(c.green())+","+QString::number(c.blue())); |
||||
} |
||||
|
||||
void CConfig::ParseBoolString(const QString &str,bool* dst, int count){ |
||||
for(int i=0; i<count; i++){ |
||||
if(str[i]==QChar('0')) |
||||
*(dst+i)=false; |
||||
else |
||||
*(dst+i)=true; |
||||
} |
||||
} |
||||
|
||||
QString CConfig::CreateBoolString(bool* src, int count){ |
||||
QString str=""; |
||||
for(int i=0;i<count;i++){ |
||||
if(src[i])str+="1"; |
||||
else str+="0"; |
||||
} |
||||
return str; |
||||
} |
@ -0,0 +1,61 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#ifndef _PWMCONFIG_H_ |
||||
#define _PWMCONFIG_H_ |
||||
|
||||
#include "lib/IniReader.h" |
||||
#include <qcolor.h> |
||||
|
||||
class CConfig{ |
||||
public: |
||||
int TimeFormat; |
||||
int ClipboardTimeOut; |
||||
bool Toolbar; |
||||
bool EntryDetails; |
||||
QString LastFile; |
||||
bool OpenLast; |
||||
bool Columns[10]; |
||||
QColor BannerColor1; |
||||
QColor BannerColor2; |
||||
QColor BannerTextColor; |
||||
bool ShowPasswords; |
||||
QString OpenUrlCommand; |
||||
QString Language; |
||||
bool SearchOptions[8]; |
||||
bool ListView_HidePasswords; |
||||
bool ListView_HideUsernames; |
||||
bool PwGenOptions[10]; |
||||
int PwGenLength; |
||||
QString PwGenCharList; |
||||
bool ExpandGroupTree; |
||||
|
||||
bool loadFromIni(); |
||||
bool saveToIni(); |
||||
|
||||
private: |
||||
void ParseColumnString(QString str, bool* dst); |
||||
void ParseBoolString(const QString &str,bool* dst, int count); |
||||
QString CreateBoolString(bool* src, int count); |
||||
QColor ParseColorString(QString str); |
||||
QString CreateColumnString(); |
||||
QString CreateColorString(QColor); |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,541 @@ |
||||
/* 2003.05.02: Derived from libgcrypt-1.1.12 by Michael Buesch */ |
||||
|
||||
/* blowfish.c - Blowfish encryption
|
||||
* Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. |
||||
* |
||||
* This file is part of Libgcrypt. |
||||
* |
||||
* Libgcrypt is free software; you can redistribute it and/or modify |
||||
* it under the terms of the GNU Lesser general Public License as |
||||
* published by the Free Software Foundation; either version 2.1 of |
||||
* the License, or (at your option) any later version. |
||||
* |
||||
* Libgcrypt is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with this program; if not, write to the Free Software |
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
||||
* |
||||
* For a description of the algorithm, see: |
||||
* Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996. |
||||
* ISBN 0-471-11709-9. Pages 336 ff. |
||||
*/ |
||||
|
||||
/* Test values:
|
||||
* key "abcdefghijklmnopqrstuvwxyz"; |
||||
* plain "BLOWFISH" |
||||
* cipher 32 4E D0 FE F4 13 A2 03 |
||||
* |
||||
*/ |
||||
|
||||
#include <string.h> |
||||
#include <stdlib.h> |
||||
|
||||
#include "blowfish.h" |
||||
|
||||
|
||||
|
||||
/* precomputed S boxes */ |
||||
static const uint32_t ks0[256] = { |
||||
0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, 0xB8E1AFED, 0x6A267E96, |
||||
0xBA7C9045, 0xF12C7F99, 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16, |
||||
0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, 0x0D95748F, 0x728EB658, |
||||
0x718BCD58, 0x82154AEE, 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, |
||||
0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, 0x8E79DCB0, 0x603A180E, |
||||
0x6C9E0E8B, 0xB01E8A3E, 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60, |
||||
0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, 0x55CA396A, 0x2AAB10B6, |
||||
0xB4CC5C34, 0x1141E8CE, 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A, |
||||
0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, 0xAFD6BA33, 0x6C24CF5C, |
||||
0x7A325381, 0x28958677, 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193, |
||||
0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, 0xEF845D5D, 0xE98575B1, |
||||
0xDC262302, 0xEB651B88, 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239, |
||||
0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, 0x21C66842, 0xF6E96C9A, |
||||
0x670C9C61, 0xABD388F0, 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, |
||||
0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, 0xA1F1651D, 0x39AF0176, |
||||
0x66CA593E, 0x82430E88, 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE, |
||||
0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, 0x4ED3AA62, 0x363F7706, |
||||
0x1BFEDF72, 0x429B023D, 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, |
||||
0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, 0xE3FE501A, 0xB6794C3B, |
||||
0x976CE0BD, 0x04C006BA, 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463, |
||||
0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, 0x6DFC511F, 0x9B30952C, |
||||
0xCC814544, 0xAF5EBD09, 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3, |
||||
0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, 0x5579C0BD, 0x1A60320A, |
||||
0xD6A100C6, 0x402C7279, 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, |
||||
0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, 0x323DB5FA, 0xFD238760, |
||||
0x53317B48, 0x3E00DF82, 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB, |
||||
0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, 0x695B27B0, 0xBBCA58C8, |
||||
0xE1FFA35D, 0xB8F011A0, 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, |
||||
0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, 0xE1DDF2DA, 0xA4CB7E33, |
||||
0x62FB1341, 0xCEE4C6E8, 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4, |
||||
0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, 0xD08ED1D0, 0xAFC725E0, |
||||
0x8E3C5B2F, 0x8E7594B7, 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C, |
||||
0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, 0x2F2F2218, 0xBE0E1777, |
||||
0xEA752DFE, 0x8B021FA1, 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, |
||||
0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, 0x165FA266, 0x80957705, |
||||
0x93CC7314, 0x211A1477, 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF, |
||||
0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, 0x00250E2D, 0x2071B35E, |
||||
0x226800BB, 0x57B8E0AF, 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA, |
||||
0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, 0x83260376, 0x6295CFA9, |
||||
0x11C81968, 0x4E734A41, 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915, |
||||
0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, 0x08BA6FB5, 0x571BE91F, |
||||
0xF296EC6B, 0x2A0DD915, 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664, |
||||
0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A |
||||
}; |
||||
|
||||
static const uint32_t ks1[256] = { |
||||
0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623, 0xAD6EA6B0, 0x49A7DF7D, |
||||
0x9CEE60B8, 0x8FEDB266, 0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1, |
||||
0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E, 0x3F54989A, 0x5B429D65, |
||||
0x6B8FE4D6, 0x99F73FD6, 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, |
||||
0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E, 0x09686B3F, 0x3EBAEFC9, |
||||
0x3C971814, 0x6B6A70A1, 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737, |
||||
0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8, 0xB03ADA37, 0xF0500C0D, |
||||
0xF01C1F04, 0x0200B3FF, 0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD, |
||||
0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701, 0x3AE5E581, 0x37C2DADC, |
||||
0xC8B57634, 0x9AF3DDA7, 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41, |
||||
0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331, 0x4E548B38, 0x4F6DB908, |
||||
0x6F420D03, 0xF60A04BF, 0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF, |
||||
0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E, 0x5512721F, 0x2E6B7124, |
||||
0x501ADDE6, 0x9F84CD87, 0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C, |
||||
0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2, 0xEF1C1847, 0x3215D908, |
||||
0xDD433B37, 0x24C2BA16, 0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD, |
||||
0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B, 0x043556F1, 0xD7A3C76B, |
||||
0x3C11183B, 0x5924A509, 0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E, |
||||
0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3, 0x771FE71C, 0x4E3D06FA, |
||||
0x2965DCB9, 0x99E71D0F, 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A, |
||||
0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4, 0xF2F74EA7, 0x361D2B3D, |
||||
0x1939260F, 0x19C27960, 0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66, |
||||
0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28, 0xC332DDEF, 0xBE6C5AA5, |
||||
0x65582185, 0x68AB9802, 0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84, |
||||
0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510, 0x13CCA830, 0xEB61BD96, |
||||
0x0334FE1E, 0xAA0363CF, 0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14, |
||||
0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E, 0x648B1EAF, 0x19BDF0CA, |
||||
0xA02369B9, 0x655ABB50, 0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7, |
||||
0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8, 0xF837889A, 0x97E32D77, |
||||
0x11ED935F, 0x16681281, 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99, |
||||
0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696, 0xCDB30AEB, 0x532E3054, |
||||
0x8FD948E4, 0x6DBC3128, 0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73, |
||||
0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0, 0x45EEE2B6, 0xA3AAABEA, |
||||
0xDB6C4F15, 0xFACB4FD0, 0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105, |
||||
0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250, 0xCF62A1F2, 0x5B8D2646, |
||||
0xFC8883A0, 0xC1C7B6A3, 0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285, |
||||
0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00, 0x58428D2A, 0x0C55F5EA, |
||||
0x1DADF43E, 0x233F7061, 0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB, |
||||
0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E, 0xA6078084, 0x19F8509E, |
||||
0xE8EFD855, 0x61D99735, 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC, |
||||
0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9, 0xDB73DBD3, 0x105588CD, |
||||
0x675FDA79, 0xE3674340, 0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20, |
||||
0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7 |
||||
}; |
||||
|
||||
static const uint32_t ks2[256] = { |
||||
0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934, 0x411520F7, 0x7602D4F7, |
||||
0xBCF46B2E, 0xD4A20068, 0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF, |
||||
0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840, 0x4D95FC1D, 0x96B591AF, |
||||
0x70F4DDD3, 0x66A02F45, 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504, |
||||
0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A, 0x28507825, 0x530429F4, |
||||
0x0A2C86DA, 0xE9B66DFB, 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE, |
||||
0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6, 0xAACE1E7C, 0xD3375FEC, |
||||
0xCE78A399, 0x406B2A42, 0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B, |
||||
0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2, 0x3A6EFA74, 0xDD5B4332, |
||||
0x6841E7F7, 0xCA7820FB, 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527, |
||||
0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B, 0x55A867BC, 0xA1159A58, |
||||
0xCCA92963, 0x99E1DB33, 0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C, |
||||
0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3, 0x95C11548, 0xE4C66D22, |
||||
0x48C1133F, 0xC70F86DC, 0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17, |
||||
0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564, 0x257B7834, 0x602A9C60, |
||||
0xDFF8E8A3, 0x1F636C1B, 0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115, |
||||
0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922, 0x85B2A20E, 0xE6BA0D99, |
||||
0xDE720C8C, 0x2DA2F728, 0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0, |
||||
0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E, 0x0A476341, 0x992EFF74, |
||||
0x3A6F6EAB, 0xF4F8FD37, 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D, |
||||
0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804, 0xF1290DC7, 0xCC00FFA3, |
||||
0xB5390F92, 0x690FED0B, 0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3, |
||||
0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB, 0x37392EB3, 0xCC115979, |
||||
0x8026E297, 0xF42E312D, 0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C, |
||||
0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350, 0x1A6B1018, 0x11CAEDFA, |
||||
0x3D25BDD8, 0xE2E1C3C9, 0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A, |
||||
0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE, 0x9DBC8057, 0xF0F7C086, |
||||
0x60787BF8, 0x6003604D, 0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC, |
||||
0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F, 0x77A057BE, 0xBDE8AE24, |
||||
0x55464299, 0xBF582E61, 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2, |
||||
0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9, 0x7AEB2661, 0x8B1DDF84, |
||||
0x846A0E79, 0x915F95E2, 0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C, |
||||
0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E, 0xB77F19B6, 0xE0A9DC09, |
||||
0x662D09A1, 0xC4324633, 0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10, |
||||
0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169, 0xDCB7DA83, 0x573906FE, |
||||
0xA1E2CE9B, 0x4FCD7F52, 0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027, |
||||
0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5, 0xF0177A28, 0xC0F586E0, |
||||
0x006058AA, 0x30DC7D62, 0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634, |
||||
0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76, 0x6F05E409, 0x4B7C0188, |
||||
0x39720A3D, 0x7C927C24, 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC, |
||||
0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4, 0x1E50EF5E, 0xB161E6F8, |
||||
0xA28514D9, 0x6C51133C, 0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837, |
||||
0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0 |
||||
}; |
||||
|
||||
static const uint32_t ks3[256] = { |
||||
0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, 0x5CB0679E, 0x4FA33742, |
||||
0xD3822740, 0x99BC9BBE, 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B, |
||||
0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4, 0x5748AB2F, 0xBC946E79, |
||||
0xC6A376D2, 0x6549C2C8, 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6, |
||||
0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304, 0xA1FAD5F0, 0x6A2D519A, |
||||
0x63EF8CE2, 0x9A86EE22, 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4, |
||||
0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6, 0x2826A2F9, 0xA73A3AE1, |
||||
0x4BA99586, 0xEF5562E9, 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59, |
||||
0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593, 0xE990FD5A, 0x9E34D797, |
||||
0x2CF0B7D9, 0x022B8B51, 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28, |
||||
0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C, 0xE029AC71, 0xE019A5E6, |
||||
0x47B0ACFD, 0xED93FA9B, 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28, |
||||
0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C, 0x15056DD4, 0x88F46DBA, |
||||
0x03A16125, 0x0564F0BD, 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A, |
||||
0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319, 0x7533D928, 0xB155FDF5, |
||||
0x03563482, 0x8ABA3CBB, 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F, |
||||
0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991, 0xEA7A90C2, 0xFB3E7BCE, |
||||
0x5121CE64, 0x774FBE32, 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680, |
||||
0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166, 0xB39A460A, 0x6445C0DD, |
||||
0x586CDECF, 0x1C20C8AE, 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB, |
||||
0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5, 0x72EACEA8, 0xFA6484BB, |
||||
0x8D6612AE, 0xBF3C6F47, 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370, |
||||
0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D, 0x4040CB08, 0x4EB4E2CC, |
||||
0x34D2466A, 0x0115AF84, 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048, |
||||
0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8, 0x611560B1, 0xE7933FDC, |
||||
0xBB3A792B, 0x344525BD, 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9, |
||||
0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7, 0x1A908749, 0xD44FBD9A, |
||||
0xD0DADECB, 0xD50ADA38, 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F, |
||||
0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C, 0xBF97222C, 0x15E6FC2A, |
||||
0x0F91FC71, 0x9B941525, 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1, |
||||
0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442, 0xE0EC6E0E, 0x1698DB3B, |
||||
0x4C98A0BE, 0x3278E964, 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E, |
||||
0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8, 0xDF359F8D, 0x9B992F2E, |
||||
0xE60B6F47, 0x0FE3F11D, 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F, |
||||
0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299, 0xF523F357, 0xA6327623, |
||||
0x93A83531, 0x56CCCD02, 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC, |
||||
0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614, 0xE6C6C7BD, 0x327A140A, |
||||
0x45E1D006, 0xC3F27B9A, 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6, |
||||
0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B, 0x53113EC0, 0x1640E3D3, |
||||
0x38ABBD60, 0x2547ADF0, 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060, |
||||
0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E, 0x1948C25C, 0x02FB8A8C, |
||||
0x01C36AE4, 0xD6EBE1F9, 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F, |
||||
0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6 |
||||
}; |
||||
|
||||
static const uint32_t ps[BLOWFISH_ROUNDS + 2] = { |
||||
0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, 0xA4093822, 0x299F31D0, |
||||
0x082EFA98, 0xEC4E6C89, 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, |
||||
0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917, 0x9216D5D9, 0x8979FB1B |
||||
}; |
||||
|
||||
Blowfish::Blowfish() |
||||
{ static bool mustSelfTest = false; |
||||
} |
||||
|
||||
void Blowfish::burn_stack(int bytes) |
||||
{ |
||||
char buf[64]; |
||||
|
||||
memset(buf, 0, sizeof buf); |
||||
bytes -= sizeof buf; |
||||
if (bytes > 0) |
||||
burn_stack(bytes); |
||||
} |
||||
|
||||
void Blowfish::do_encrypt(uint32_t * ret_xl, uint32_t * ret_xr) |
||||
{ |
||||
#if BLOWFISH_ROUNDS == 16 |
||||
uint32_t xl, xr, *s0, *s1, *s2, *s3, *p; |
||||
|
||||
xl = *ret_xl; |
||||
xr = *ret_xr; |
||||
p = bc.p; |
||||
s0 = bc.s0; |
||||
s1 = bc.s1; |
||||
s2 = bc.s2; |
||||
s3 = bc.s3; |
||||
|
||||
R(xl, xr, 0, p, s0, s1, s2, s3); |
||||
R(xr, xl, 1, p, s0, s1, s2, s3); |
||||
R(xl, xr, 2, p, s0, s1, s2, s3); |
||||
R(xr, xl, 3, p, s0, s1, s2, s3); |
||||
R(xl, xr, 4, p, s0, s1, s2, s3); |
||||
R(xr, xl, 5, p, s0, s1, s2, s3); |
||||
R(xl, xr, 6, p, s0, s1, s2, s3); |
||||
R(xr, xl, 7, p, s0, s1, s2, s3); |
||||
R(xl, xr, 8, p, s0, s1, s2, s3); |
||||
R(xr, xl, 9, p, s0, s1, s2, s3); |
||||
R(xl, xr, 10, p, s0, s1, s2, s3); |
||||
R(xr, xl, 11, p, s0, s1, s2, s3); |
||||
R(xl, xr, 12, p, s0, s1, s2, s3); |
||||
R(xr, xl, 13, p, s0, s1, s2, s3); |
||||
R(xl, xr, 14, p, s0, s1, s2, s3); |
||||
R(xr, xl, 15, p, s0, s1, s2, s3); |
||||
|
||||
xl ^= p[BLOWFISH_ROUNDS]; |
||||
xr ^= p[BLOWFISH_ROUNDS + 1]; |
||||
|
||||
*ret_xl = xr; |
||||
*ret_xr = xl; |
||||
|
||||
#else |
||||
uint32_t xl, xr, temp, *p; |
||||
int i; |
||||
|
||||
xl = *ret_xl; |
||||
xr = *ret_xr; |
||||
p = bc.p; |
||||
|
||||
for (i = 0; i < BLOWFISH_ROUNDS; i++) { |
||||
xl ^= p[i]; |
||||
xr ^= function_F(xl); |
||||
temp = xl; |
||||
xl = xr; |
||||
xr = temp; |
||||
} |
||||
temp = xl; |
||||
xl = xr; |
||||
xr = temp; |
||||
|
||||
xr ^= p[BLOWFISH_ROUNDS]; |
||||
xl ^= p[BLOWFISH_ROUNDS + 1]; |
||||
|
||||
*ret_xl = xl; |
||||
*ret_xr = xr; |
||||
#endif |
||||
} |
||||
|
||||
void Blowfish::do_decrypt(uint32_t * ret_xl, uint32_t * ret_xr) |
||||
{ |
||||
#if BLOWFISH_ROUNDS == 16 |
||||
uint32_t xl, xr, *s0, *s1, *s2, *s3, *p; |
||||
|
||||
xl = *ret_xl; |
||||
xr = *ret_xr; |
||||
p = bc.p; |
||||
s0 = bc.s0; |
||||
s1 = bc.s1; |
||||
s2 = bc.s2; |
||||
s3 = bc.s3; |
||||
|
||||
R(xl, xr, 17, p, s0, s1, s2, s3); |
||||
R(xr, xl, 16, p, s0, s1, s2, s3); |
||||
R(xl, xr, 15, p, s0, s1, s2, s3); |
||||
R(xr, xl, 14, p, s0, s1, s2, s3); |
||||
R(xl, xr, 13, p, s0, s1, s2, s3); |
||||
R(xr, xl, 12, p, s0, s1, s2, s3); |
||||
R(xl, xr, 11, p, s0, s1, s2, s3); |
||||
R(xr, xl, 10, p, s0, s1, s2, s3); |
||||
R(xl, xr, 9, p, s0, s1, s2, s3); |
||||
R(xr, xl, 8, p, s0, s1, s2, s3); |
||||
R(xl, xr, 7, p, s0, s1, s2, s3); |
||||
R(xr, xl, 6, p, s0, s1, s2, s3); |
||||
R(xl, xr, 5, p, s0, s1, s2, s3); |
||||
R(xr, xl, 4, p, s0, s1, s2, s3); |
||||
R(xl, xr, 3, p, s0, s1, s2, s3); |
||||
R(xr, xl, 2, p, s0, s1, s2, s3); |
||||
|
||||
xl ^= p[1]; |
||||
xr ^= p[0]; |
||||
|
||||
*ret_xl = xr; |
||||
*ret_xr = xl; |
||||
|
||||
#else |
||||
uint32_t xl, xr, temp, *p; |
||||
int i; |
||||
|
||||
xl = *ret_xl; |
||||
xr = *ret_xr; |
||||
p = bc.p; |
||||
|
||||
for (i = BLOWFISH_ROUNDS + 1; i > 1; i--) { |
||||
xl ^= p[i]; |
||||
xr ^= function_F(xl); |
||||
temp = xl; |
||||
xl = xr; |
||||
xr = temp; |
||||
} |
||||
|
||||
temp = xl; |
||||
xl = xr; |
||||
xr = temp; |
||||
|
||||
xr ^= p[1]; |
||||
xl ^= p[0]; |
||||
|
||||
*ret_xl = xl; |
||||
*ret_xr = xr; |
||||
#endif |
||||
} |
||||
|
||||
void Blowfish::do_encrypt_block(byte * outbuf, byte * inbuf) |
||||
{ |
||||
uint32_t d1, d2; |
||||
|
||||
d1 = inbuf[0] << 24 | inbuf[1] << 16 | inbuf[2] << 8 | inbuf[3]; |
||||
d2 = inbuf[4] << 24 | inbuf[5] << 16 | inbuf[6] << 8 | inbuf[7]; |
||||
do_encrypt(&d1, &d2); |
||||
outbuf[0] = (d1 >> 24) & 0xff; |
||||
outbuf[1] = (d1 >> 16) & 0xff; |
||||
outbuf[2] = (d1 >> 8) & 0xff; |
||||
outbuf[3] = d1 & 0xff; |
||||
outbuf[4] = (d2 >> 24) & 0xff; |
||||
outbuf[5] = (d2 >> 16) & 0xff; |
||||
outbuf[6] = (d2 >> 8) & 0xff; |
||||
outbuf[7] = d2 & 0xff; |
||||
} |
||||
|
||||
void Blowfish::encrypt_block(byte * outbuf, byte * inbuf) |
||||
{ |
||||
do_encrypt_block(outbuf, inbuf); |
||||
burn_stack(64); |
||||
} |
||||
|
||||
void Blowfish::do_decrypt_block(byte * outbuf, byte * inbuf) |
||||
{ |
||||
uint32_t d1, d2; |
||||
|
||||
d1 = inbuf[0] << 24 | inbuf[1] << 16 | inbuf[2] << 8 | inbuf[3]; |
||||
d2 = inbuf[4] << 24 | inbuf[5] << 16 | inbuf[6] << 8 | inbuf[7]; |
||||
do_decrypt(&d1, &d2); |
||||
outbuf[0] = (d1 >> 24) & 0xff; |
||||
outbuf[1] = (d1 >> 16) & 0xff; |
||||
outbuf[2] = (d1 >> 8) & 0xff; |
||||
outbuf[3] = d1 & 0xff; |
||||
outbuf[4] = (d2 >> 24) & 0xff; |
||||
outbuf[5] = (d2 >> 16) & 0xff; |
||||
outbuf[6] = (d2 >> 8) & 0xff; |
||||
outbuf[7] = d2 & 0xff; |
||||
} |
||||
|
||||
void Blowfish::decrypt_block(byte * outbuf, byte * inbuf) |
||||
{ |
||||
do_decrypt_block(outbuf, inbuf); |
||||
burn_stack(64); |
||||
} |
||||
|
||||
int Blowfish::do_bf_setkey(byte * key, unsigned int keylen) |
||||
{ |
||||
int i, j; |
||||
uint32_t data, datal, datar; |
||||
|
||||
for (i = 0; i < BLOWFISH_ROUNDS + 2; ++i) |
||||
bc.p[i] = ps[i]; |
||||
for (i = 0; i < 256; ++i) { |
||||
bc.s0[i] = ks0[i]; |
||||
bc.s1[i] = ks1[i]; |
||||
bc.s2[i] = ks2[i]; |
||||
bc.s3[i] = ks3[i]; |
||||
} |
||||
|
||||
for (i = j = 0; i < BLOWFISH_ROUNDS + 2; ++i) { |
||||
#ifdef BIG_ENDIAN_HOST |
||||
((byte *) & data)[0] = key[j]; |
||||
((byte *) & data)[1] = key[(j + 1) % keylen]; |
||||
((byte *) & data)[2] = key[(j + 2) % keylen]; |
||||
((byte *) & data)[3] = key[(j + 3) % keylen]; |
||||
#else |
||||
((byte *) & data)[3] = key[j]; |
||||
((byte *) & data)[2] = key[(j + 1) % keylen]; |
||||
((byte *) & data)[1] = key[(j + 2) % keylen]; |
||||
((byte *) & data)[0] = key[(j + 3) % keylen]; |
||||
#endif |
||||
bc.p[i] ^= data; |
||||
j = (j + 4) % keylen; |
||||
} |
||||
|
||||
datal = datar = 0; |
||||
for (i = 0; i < BLOWFISH_ROUNDS + 2; i += 2) { |
||||
do_encrypt(&datal, &datar); |
||||
bc.p[i] = datal; |
||||
bc.p[i + 1] = datar; |
||||
} |
||||
for (i = 0; i < 256; i += 2) { |
||||
do_encrypt(&datal, &datar); |
||||
bc.s0[i] = datal; |
||||
bc.s0[i + 1] = datar; |
||||
} |
||||
for (i = 0; i < 256; i += 2) { |
||||
do_encrypt(&datal, &datar); |
||||
bc.s1[i] = datal; |
||||
bc.s1[i + 1] = datar; |
||||
} |
||||
for (i = 0; i < 256; i += 2) { |
||||
do_encrypt(&datal, &datar); |
||||
bc.s2[i] = datal; |
||||
bc.s2[i + 1] = datar; |
||||
} |
||||
for (i = 0; i < 256; i += 2) { |
||||
do_encrypt(&datal, &datar); |
||||
bc.s3[i] = datal; |
||||
bc.s3[i + 1] = datar; |
||||
} |
||||
|
||||
/* Check for weak key. A weak key is a key in which a value in */ |
||||
/* the P-array (here c) occurs more than once per table. */ |
||||
for (i = 0; i < 255; ++i) { |
||||
for (j = i + 1; j < 256; ++j) { |
||||
if ((bc.s0[i] == bc.s0[j]) || (bc.s1[i] == bc.s1[j]) || |
||||
(bc.s2[i] == bc.s2[j]) || (bc.s3[i] == bc.s3[j])) |
||||
return 1; |
||||
} |
||||
} |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
int Blowfish::bf_setkey(byte * key, unsigned int keylen) |
||||
{ |
||||
int rc = do_bf_setkey(key, keylen); |
||||
burn_stack(64); |
||||
return rc; |
||||
} |
||||
|
||||
int Blowfish::bf_encrypt(byte * outbuf, byte * inbuf, unsigned int inbuf_len) |
||||
{ |
||||
if (inbuf_len % 8) |
||||
return 1; |
||||
|
||||
unsigned int i = 0; |
||||
while (i < inbuf_len) { |
||||
encrypt_block(outbuf + i, inbuf + i); |
||||
i += 8; |
||||
} |
||||
return 0; |
||||
} |
||||
|
||||
int Blowfish::bf_decrypt(byte * outbuf, byte * inbuf, unsigned int inbuf_len) |
||||
{ |
||||
if (inbuf_len % 8) |
||||
return 1; |
||||
|
||||
unsigned int i = 0; |
||||
while (i < inbuf_len) { |
||||
decrypt_block(outbuf + i, inbuf + i); |
||||
i += 8; |
||||
} |
||||
return 0; |
||||
} |
||||
|
||||
void Blowfish::padNull(string *buf) |
||||
{ |
||||
buf->append(1, (char)0x01); |
||||
string::size_type append_null = 8 - (buf->length() % 8); |
||||
buf->append(append_null, (char)0x00); |
||||
} |
||||
|
||||
bool Blowfish::unpadNull(string *buf) |
||||
{ |
||||
if (buf->size() % 8) |
||||
return false; |
||||
string::size_type pos = buf->length() - 1; |
||||
while ((*buf)[pos] != (char)0x01) { |
||||
if (pos == 0) |
||||
return false; |
||||
--pos; |
||||
} |
||||
buf->erase(pos, buf->length() - pos); |
||||
return true; |
||||
} |
@ -0,0 +1,110 @@ |
||||
/***************************************************************************
|
||||
* * |
||||
* copyright (C) 2003, 2004 by Michael Buesch * |
||||
* email: mbuesch@freenet.de * |
||||
* * |
||||
* blowfish.c - Blowfish encryption * |
||||
* Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License version 2 * |
||||
* as published by the Free Software Foundation. * |
||||
* * |
||||
***************************************************************************/ |
||||
|
||||
#ifndef BLOWFISH_H |
||||
#define BLOWFISH_H |
||||
|
||||
#include <stdint.h> |
||||
#include <string> |
||||
using std::string; |
||||
|
||||
#define BLOWFISH_BLOCKSIZE 8 |
||||
#define BLOWFISH_ROUNDS 16 |
||||
#define CIPHER_ALGO_BLOWFISH 4 /* blowfish 128 bit key */ |
||||
|
||||
typedef uint8_t byte; |
||||
|
||||
/** blowfish encryption algorithm.
|
||||
* Derived from libgcrypt-1.1.12 |
||||
*/ |
||||
|
||||
class Blowfish |
||||
{ |
||||
struct BLOWFISH_context |
||||
{ |
||||
uint32_t s0[256]; |
||||
uint32_t s1[256]; |
||||
uint32_t s2[256]; |
||||
uint32_t s3[256]; |
||||
uint32_t p[BLOWFISH_ROUNDS+2]; |
||||
}; |
||||
|
||||
public: |
||||
Blowfish(); |
||||
|
||||
/** set key to encrypt. if return == 1, it is a weak key. */ |
||||
int bf_setkey( byte *key, unsigned int keylen ); |
||||
/** encrypt inbuf and return it in outbuf.
|
||||
* inbuf and outbuf have to be: buf % 8 == 0 |
||||
* You may check this with getPaddedLen() and pad with NULL. |
||||
*/ |
||||
int bf_encrypt( byte *outbuf, byte *inbuf, unsigned int inbuf_len ); |
||||
/** decrypt inbuf and return it in outbuf.
|
||||
* inbuf and outbuf have to be: buf % 8 == 0 |
||||
* You may check this with getPaddedLen() and pad with NULL. |
||||
*/ |
||||
int bf_decrypt( byte *outbuf, byte *inbuf, unsigned int inbuf_len ); |
||||
/** returns the length, the sting has to be padded to */ |
||||
static unsigned int getPaddedLen(unsigned int inLen) |
||||
{ return ((8 - (inLen % 8)) + inLen); } |
||||
/** pad up to 8 bytes. */ |
||||
static void padNull(string *buf); |
||||
/** remove padded data */ |
||||
static bool unpadNull(string *buf); |
||||
|
||||
protected: |
||||
#if BLOWFISH_ROUNDS != 16 |
||||
uint32_t function_F( uint32_t x) |
||||
{ |
||||
uint16_t a, b, c, d; |
||||
#ifdef BIG_ENDIAN_HOST |
||||
a = ((byte *) & x)[0]; |
||||
b = ((byte *) & x)[1]; |
||||
c = ((byte *) & x)[2]; |
||||
d = ((byte *) & x)[3]; |
||||
#else |
||||
a = ((byte *) & x)[3]; |
||||
b = ((byte *) & x)[2]; |
||||
c = ((byte *) & x)[1]; |
||||
d = ((byte *) & x)[0]; |
||||
#endif |
||||
return ((bc.s0[a] + bc.s1[b]) ^ bc.s2[c]) + bc.s3[d]; |
||||
} |
||||
#endif |
||||
void R(uint32_t &l, uint32_t &r, uint32_t i, uint32_t *p, |
||||
uint32_t *s0, uint32_t *s1, uint32_t *s2, uint32_t *s3) |
||||
{ |
||||
l ^= p[i]; |
||||
#ifdef BIG_ENDIAN_HOST |
||||
r ^= (( s0[((byte*)&l)[0]] + s1[((byte*)&l)[1]]) |
||||
^ s2[((byte*)&l)[2]]) + s3[((byte*)&l)[3]]; |
||||
#else |
||||
r ^= (( s0[((byte*)&l)[3]] + s1[((byte*)&l)[2]]) |
||||
^ s2[((byte*)&l)[1]]) + s3[((byte*)&l)[0]]; |
||||
#endif |
||||
} |
||||
void encrypt_block(byte *outbuf, byte *inbuf); |
||||
void decrypt_block(byte *outbuf, byte *inbuf); |
||||
void burn_stack(int bytes); |
||||
void do_encrypt(uint32_t *ret_xl, uint32_t *ret_xr); |
||||
void do_decrypt(uint32_t *ret_xl, uint32_t *ret_xr); |
||||
void do_encrypt_block(byte *outbuf, byte *inbuf); |
||||
void do_decrypt_block(byte *outbuf, byte *inbuf); |
||||
int do_bf_setkey(byte *key, unsigned int keylen); |
||||
|
||||
protected: |
||||
struct BLOWFISH_context bc; |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,158 @@ |
||||
#ifndef _RIJNDAEL_H_ |
||||
#define _RIJNDAEL_H_ |
||||
|
||||
// This file is based on Szymon Stefanek's Rijndael implementation.
|
||||
// All I have done is changed the variable type definitions, not more.
|
||||
// The original header is below.
|
||||
|
||||
//
|
||||
// File : rijndael.h
|
||||
// Creation date : Sun Nov 5 2000 03:21:05 CEST
|
||||
// Author : Szymon Stefanek (stefanek@tin.it)
|
||||
//
|
||||
// Another implementation of the Rijndael cipher.
|
||||
// This is intended to be an easily usable library file.
|
||||
// This code is public domain.
|
||||
// Based on the Vincent Rijmen and K.U.Leuven implementation 2.4.
|
||||
//
|
||||
|
||||
//
|
||||
// Original Copyright notice:
|
||||
//
|
||||
// rijndael-alg-fst.c v2.4 April '2000
|
||||
// rijndael-alg-fst.h
|
||||
// rijndael-api-fst.c
|
||||
// rijndael-api-fst.h
|
||||
//
|
||||
// Optimised ANSI C code
|
||||
//
|
||||
// authors: v1.0: Antoon Bosselaers
|
||||
// v2.0: Vincent Rijmen, K.U.Leuven
|
||||
// v2.3: Paulo Barreto
|
||||
// v2.4: Vincent Rijmen, K.U.Leuven
|
||||
//
|
||||
// This code is placed in the public domain.
|
||||
//
|
||||
|
||||
//
|
||||
// This implementation works on 128 , 192 , 256 bit keys
|
||||
// and on 128 bit blocks
|
||||
//
|
||||
|
||||
//
|
||||
// Example of usage:
|
||||
//
|
||||
// // Input data
|
||||
// unsigned char key[32]; // The key
|
||||
// initializeYour256BitKey(); // Obviously initialized with sth
|
||||
// const unsigned char * plainText = getYourPlainText(); // Your plain text
|
||||
// int plainTextLen = strlen(plainText); // Plain text length
|
||||
//
|
||||
// // Encrypting
|
||||
// Rijndael rin;
|
||||
// unsigned char output[plainTextLen + 16];
|
||||
//
|
||||
// rin.init(Rijndael::CBC,Rijndael::Encrypt,key,Rijndael::Key32Bytes);
|
||||
// // It is a good idea to check the error code
|
||||
// int len = rin.padEncrypt(plainText,len,output);
|
||||
// if(len >= 0)useYourEncryptedText();
|
||||
// else encryptError(len);
|
||||
//
|
||||
// // Decrypting: we can reuse the same object
|
||||
// unsigned char output2[len];
|
||||
// rin.init(Rijndael::CBC,Rijndael::Decrypt,key,Rijndael::Key32Bytes));
|
||||
// len = rin.padDecrypt(output,len,output2);
|
||||
// if(len >= 0)useYourDecryptedText();
|
||||
// else decryptError(len);
|
||||
//
|
||||
|
||||
#define _MAX_KEY_COLUMNS (256/32) |
||||
#define _MAX_ROUNDS 14 |
||||
#define MAX_IV_SIZE 16 |
||||
|
||||
#include <qglobal.h> |
||||
|
||||
// Error codes
|
||||
#define RIJNDAEL_SUCCESS 0 |
||||
#define RIJNDAEL_UNSUPPORTED_MODE -1 |
||||
#define RIJNDAEL_UNSUPPORTED_DIRECTION -2 |
||||
#define RIJNDAEL_UNSUPPORTED_KEY_LENGTH -3 |
||||
#define RIJNDAEL_BAD_KEY -4 |
||||
#define RIJNDAEL_NOT_INITIALIZED -5 |
||||
#define RIJNDAEL_BAD_DIRECTION -6 |
||||
#define RIJNDAEL_CORRUPTED_DATA -7 |
||||
|
||||
class Rijndael |
||||
{
|
||||
public: |
||||
enum Direction { Encrypt , Decrypt }; |
||||
enum Mode { ECB , CBC , CFB1 }; |
||||
enum KeyLength { Key16Bytes , Key24Bytes , Key32Bytes }; |
||||
//
|
||||
// Creates a Rijndael cipher object
|
||||
// You have to call init() before you can encrypt or decrypt stuff
|
||||
//
|
||||
Rijndael(); |
||||
~Rijndael(); |
||||
protected: |
||||
// Internal stuff
|
||||
enum State { Valid , Invalid }; |
||||
|
||||
State m_state; |
||||
Mode m_mode; |
||||
Direction m_direction; |
||||
UINT8 m_initVector[MAX_IV_SIZE]; |
||||
UINT32 m_uRounds; |
||||
UINT8 m_expandedKey[_MAX_ROUNDS+1][4][4]; |
||||
public: |
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// API
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// init(): Initializes the crypt session
|
||||
// Returns RIJNDAEL_SUCCESS or an error code
|
||||
// mode : Rijndael::ECB, Rijndael::CBC or Rijndael::CFB1
|
||||
// You have to use the same mode for encrypting and decrypting
|
||||
// dir : Rijndael::Encrypt or Rijndael::Decrypt
|
||||
// A cipher instance works only in one direction
|
||||
// (Well , it could be easily modified to work in both
|
||||
// directions with a single init() call, but it looks
|
||||
// useless to me...anyway , it is a matter of generating
|
||||
// two expanded keys)
|
||||
// key : array of unsigned octets , it can be 16 , 24 or 32 bytes long
|
||||
// this CAN be binary data (it is not expected to be null terminated)
|
||||
// keyLen : Rijndael::Key16Bytes , Rijndael::Key24Bytes or Rijndael::Key32Bytes
|
||||
// initVector: initialization vector, you will usually use 0 here
|
||||
int init(Mode mode,Direction dir,const UINT8 *key,KeyLength keyLen,UINT8 * initVector = 0); |
||||
// Encrypts the input array (can be binary data)
|
||||
// The input array length must be a multiple of 16 bytes, the remaining part
|
||||
// is DISCARDED.
|
||||
// so it actually encrypts inputLen / 128 blocks of input and puts it in outBuffer
|
||||
// Input len is in BITS!
|
||||
// outBuffer must be at least inputLen / 8 bytes long.
|
||||
// Returns the encrypted buffer length in BITS or an error code < 0 in case of error
|
||||
int blockEncrypt(const UINT8 *input, int inputLen, UINT8 *outBuffer); |
||||
// Encrypts the input array (can be binary data)
|
||||
// The input array can be any length , it is automatically padded on a 16 byte boundary.
|
||||
// Input len is in BYTES!
|
||||
// outBuffer must be at least (inputLen + 16) bytes long
|
||||
// Returns the encrypted buffer length in BYTES or an error code < 0 in case of error
|
||||
int padEncrypt(const UINT8 *input, int inputOctets, UINT8 *outBuffer); |
||||
// Decrypts the input vector
|
||||
// Input len is in BITS!
|
||||
// outBuffer must be at least inputLen / 8 bytes long
|
||||
// Returns the decrypted buffer length in BITS and an error code < 0 in case of error
|
||||
int blockDecrypt(const UINT8 *input, int inputLen, UINT8 *outBuffer); |
||||
// Decrypts the input vector
|
||||
// Input len is in BYTES!
|
||||
// outBuffer must be at least inputLen bytes long
|
||||
// Returns the decrypted buffer length in BYTES and an error code < 0 in case of error
|
||||
int padDecrypt(const UINT8 *input, int inputOctets, UINT8 *outBuffer); |
||||
protected: |
||||
void keySched(UINT8 key[_MAX_KEY_COLUMNS][4]); |
||||
void keyEncToDec(); |
||||
void encrypt(const UINT8 a[16], UINT8 b[16]); |
||||
void decrypt(const UINT8 a[16], UINT8 b[16]); |
||||
}; |
||||
|
||||
#endif // _RIJNDAEL_H_
|
@ -0,0 +1,261 @@ |
||||
/*
|
||||
100% free public domain implementation of the SHA-1 algorithm |
||||
by Dominik Reichl <dominik.reichl@t-online.de> |
||||
|
||||
Version 1.5 - 2005-01-01 |
||||
- 64-bit compiler compatibility added |
||||
- Made variable wiping optional (define SHA1_WIPE_VARIABLES) |
||||
- Removed unnecessary variable initializations |
||||
- ROL32 improvement for the Microsoft compiler (using _rotl) |
||||
|
||||
======== Test Vectors (from FIPS PUB 180-1) ======== |
||||
|
||||
SHA1("abc") = |
||||
A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D |
||||
|
||||
SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") = |
||||
84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 |
||||
|
||||
SHA1(A million repetitions of "a") = |
||||
34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F |
||||
*/ |
||||
|
||||
#include "sha1.h" |
||||
|
||||
#define SHA1_MAX_FILE_BUFFER 8000 |
||||
|
||||
// Rotate x bits to the left
|
||||
#ifndef ROL32 |
||||
#ifdef _MSC_VER |
||||
#define ROL32(_val32, _nBits) _rotl(_val32, _nBits) |
||||
#else |
||||
#define ROL32(_val32, _nBits) (((_val32)<<(_nBits))|((_val32)>>(32-(_nBits)))) |
||||
#endif |
||||
#endif |
||||
|
||||
#ifdef SHA1_LITTLE_ENDIAN |
||||
#define SHABLK0(i) (m_block->l[i] = \ |
||||
(ROL32(m_block->l[i],24) & 0xFF00FF00) | (ROL32(m_block->l[i],8) & 0x00FF00FF)) |
||||
#else |
||||
#define SHABLK0(i) (m_block->l[i]) |
||||
#endif |
||||
|
||||
#define SHABLK(i) (m_block->l[i&15] = ROL32(m_block->l[(i+13)&15] ^ m_block->l[(i+8)&15] \ |
||||
^ m_block->l[(i+2)&15] ^ m_block->l[i&15],1)) |
||||
|
||||
// SHA-1 rounds
|
||||
#define _R0(v,w,x,y,z,i) { z+=((w&(x^y))^y)+SHABLK0(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); } |
||||
#define _R1(v,w,x,y,z,i) { z+=((w&(x^y))^y)+SHABLK(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); } |
||||
#define _R2(v,w,x,y,z,i) { z+=(w^x^y)+SHABLK(i)+0x6ED9EBA1+ROL32(v,5); w=ROL32(w,30); } |
||||
#define _R3(v,w,x,y,z,i) { z+=(((w|x)&y)|(w&x))+SHABLK(i)+0x8F1BBCDC+ROL32(v,5); w=ROL32(w,30); } |
||||
#define _R4(v,w,x,y,z,i) { z+=(w^x^y)+SHABLK(i)+0xCA62C1D6+ROL32(v,5); w=ROL32(w,30); } |
||||
|
||||
CSHA1::CSHA1() |
||||
{ |
||||
m_block = (SHA1_WORKSPACE_BLOCK *)m_workspace; |
||||
|
||||
Reset(); |
||||
} |
||||
|
||||
CSHA1::~CSHA1() |
||||
{ |
||||
Reset(); |
||||
} |
||||
|
||||
void CSHA1::Reset() |
||||
{ |
||||
// SHA1 initialization constants
|
||||
m_state[0] = 0x67452301; |
||||
m_state[1] = 0xEFCDAB89; |
||||
m_state[2] = 0x98BADCFE; |
||||
m_state[3] = 0x10325476; |
||||
m_state[4] = 0xC3D2E1F0; |
||||
|
||||
m_count[0] = 0; |
||||
m_count[1] = 0; |
||||
} |
||||
void CSHA1::Update(unsigned char* data, int len){ |
||||
|
||||
UINT_32 i, j; |
||||
|
||||
j = (m_count[0] >> 3) & 63; |
||||
|
||||
if((m_count[0] += len << 3) < (len << 3)) m_count[1]++; |
||||
|
||||
m_count[1] += (len >> 29); |
||||
|
||||
if((j + len) > 63) |
||||
{ |
||||
i = 64 - j; |
||||
memcpy(&m_buffer[j], data, i); |
||||
Transform(m_state, m_buffer); |
||||
|
||||
for( ; i + 63 < len; i += 64) Transform(m_state, &data[i]); |
||||
|
||||
j = 0; |
||||
} |
||||
else i = 0; |
||||
|
||||
memcpy(&m_buffer[j], &data[i], len - i); |
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
void CSHA1::Transform(UINT_32 *state, UINT_8 *buffer) |
||||
{ |
||||
// Copy state[] to working vars
|
||||
UINT_32 a = state[0], b = state[1], c = state[2], d = state[3], e = state[4]; |
||||
|
||||
memcpy(m_block, buffer, 64); |
||||
|
||||
// 4 rounds of 20 operations each. Loop unrolled.
|
||||
_R0(a,b,c,d,e, 0); _R0(e,a,b,c,d, 1); _R0(d,e,a,b,c, 2); _R0(c,d,e,a,b, 3); |
||||
_R0(b,c,d,e,a, 4); _R0(a,b,c,d,e, 5); _R0(e,a,b,c,d, 6); _R0(d,e,a,b,c, 7); |
||||
_R0(c,d,e,a,b, 8); _R0(b,c,d,e,a, 9); _R0(a,b,c,d,e,10); _R0(e,a,b,c,d,11); |
||||
_R0(d,e,a,b,c,12); _R0(c,d,e,a,b,13); _R0(b,c,d,e,a,14); _R0(a,b,c,d,e,15); |
||||
_R1(e,a,b,c,d,16); _R1(d,e,a,b,c,17); _R1(c,d,e,a,b,18); _R1(b,c,d,e,a,19); |
||||
_R2(a,b,c,d,e,20); _R2(e,a,b,c,d,21); _R2(d,e,a,b,c,22); _R2(c,d,e,a,b,23); |
||||
_R2(b,c,d,e,a,24); _R2(a,b,c,d,e,25); _R2(e,a,b,c,d,26); _R2(d,e,a,b,c,27); |
||||
_R2(c,d,e,a,b,28); _R2(b,c,d,e,a,29); _R2(a,b,c,d,e,30); _R2(e,a,b,c,d,31); |
||||
_R2(d,e,a,b,c,32); _R2(c,d,e,a,b,33); _R2(b,c,d,e,a,34); _R2(a,b,c,d,e,35); |
||||
_R2(e,a,b,c,d,36); _R2(d,e,a,b,c,37); _R2(c,d,e,a,b,38); _R2(b,c,d,e,a,39); |
||||
_R3(a,b,c,d,e,40); _R3(e,a,b,c,d,41); _R3(d,e,a,b,c,42); _R3(c,d,e,a,b,43); |
||||
_R3(b,c,d,e,a,44); _R3(a,b,c,d,e,45); _R3(e,a,b,c,d,46); _R3(d,e,a,b,c,47); |
||||
_R3(c,d,e,a,b,48); _R3(b,c,d,e,a,49); _R3(a,b,c,d,e,50); _R3(e,a,b,c,d,51); |
||||
_R3(d,e,a,b,c,52); _R3(c,d,e,a,b,53); _R3(b,c,d,e,a,54); _R3(a,b,c,d,e,55); |
||||
_R3(e,a,b,c,d,56); _R3(d,e,a,b,c,57); _R3(c,d,e,a,b,58); _R3(b,c,d,e,a,59); |
||||
_R4(a,b,c,d,e,60); _R4(e,a,b,c,d,61); _R4(d,e,a,b,c,62); _R4(c,d,e,a,b,63); |
||||
_R4(b,c,d,e,a,64); _R4(a,b,c,d,e,65); _R4(e,a,b,c,d,66); _R4(d,e,a,b,c,67); |
||||
_R4(c,d,e,a,b,68); _R4(b,c,d,e,a,69); _R4(a,b,c,d,e,70); _R4(e,a,b,c,d,71); |
||||
_R4(d,e,a,b,c,72); _R4(c,d,e,a,b,73); _R4(b,c,d,e,a,74); _R4(a,b,c,d,e,75); |
||||
_R4(e,a,b,c,d,76); _R4(d,e,a,b,c,77); _R4(c,d,e,a,b,78); _R4(b,c,d,e,a,79); |
||||
|
||||
// Add the working vars back into state
|
||||
state[0] += a; |
||||
state[1] += b; |
||||
state[2] += c; |
||||
state[3] += d; |
||||
state[4] += e; |
||||
|
||||
// Wipe variables
|
||||
#ifdef SHA1_WIPE_VARIABLES |
||||
a = b = c = d = e = 0; |
||||
#endif |
||||
} |
||||
|
||||
|
||||
// Hash in file contents
|
||||
bool CSHA1::HashFile(char *szFileName) |
||||
{ |
||||
unsigned long ulFileSize, ulRest, ulBlocks; |
||||
unsigned long i; |
||||
UINT_8 uData[SHA1_MAX_FILE_BUFFER]; |
||||
FILE *fIn; |
||||
|
||||
if(szFileName == NULL) return false; |
||||
|
||||
fIn = fopen(szFileName, "rb"); |
||||
if(fIn == NULL) return false; |
||||
|
||||
fseek(fIn, 0, SEEK_END); |
||||
ulFileSize = (unsigned long)ftell(fIn); |
||||
fseek(fIn, 0, SEEK_SET); |
||||
|
||||
if(ulFileSize != 0) |
||||
{ |
||||
ulBlocks = ulFileSize / SHA1_MAX_FILE_BUFFER; |
||||
ulRest = ulFileSize % SHA1_MAX_FILE_BUFFER; |
||||
} |
||||
else |
||||
{ |
||||
ulBlocks = 0; |
||||
ulRest = 0; |
||||
} |
||||
|
||||
for(i = 0; i < ulBlocks; i++) |
||||
{ |
||||
fread(uData, 1, SHA1_MAX_FILE_BUFFER, fIn); |
||||
Update((UINT_8 *)uData, SHA1_MAX_FILE_BUFFER); |
||||
} |
||||
|
||||
if(ulRest != 0) |
||||
{ |
||||
fread(uData, 1, ulRest, fIn); |
||||
Update((UINT_8 *)uData, ulRest); |
||||
} |
||||
|
||||
fclose(fIn); fIn = NULL; |
||||
return true; |
||||
} |
||||
|
||||
void CSHA1::Final() |
||||
{ |
||||
UINT_32 i; |
||||
UINT_8 finalcount[8]; |
||||
|
||||
for(i = 0; i < 8; i++) |
||||
finalcount[i] = (UINT_8)((m_count[((i >= 4) ? 0 : 1)] |
||||
>> ((3 - (i & 3)) * 8) ) & 255); // Endian independent
|
||||
|
||||
Update((UINT_8 *)"\200", 1); |
||||
|
||||
while ((m_count[0] & 504) != 448) |
||||
Update((UINT_8 *)"\0", 1); |
||||
|
||||
Update(finalcount, 8); // Cause a SHA1Transform()
|
||||
|
||||
for(i = 0; i < 20; i++) |
||||
{ |
||||
m_digest[i] = (UINT_8)((m_state[i >> 2] >> ((3 - (i & 3)) * 8) ) & 255); |
||||
} |
||||
|
||||
// Wipe variables for security reasons
|
||||
#ifdef SHA1_WIPE_VARIABLES |
||||
i = 0; |
||||
memset(m_buffer, 0, 64); |
||||
memset(m_state, 0, 20); |
||||
memset(m_count, 0, 8); |
||||
memset(finalcount, 0, 8); |
||||
Transform(m_state, m_buffer); |
||||
#endif |
||||
} |
||||
|
||||
// Get the final hash as a pre-formatted string
|
||||
void CSHA1::ReportHash(char *szReport, unsigned char uReportType) |
||||
{ |
||||
unsigned char i; |
||||
char szTemp[16]; |
||||
|
||||
if(szReport == NULL) return; |
||||
|
||||
if(uReportType == REPORT_HEX) |
||||
{ |
||||
sprintf(szTemp, "%02X", m_digest[0]); |
||||
strcat(szReport, szTemp); |
||||
|
||||
for(i = 1; i < 20; i++) |
||||
{ |
||||
sprintf(szTemp, " %02X", m_digest[i]); |
||||
strcat(szReport, szTemp); |
||||
} |
||||
} |
||||
else if(uReportType == REPORT_DIGIT) |
||||
{ |
||||
sprintf(szTemp, "%u", m_digest[0]); |
||||
strcat(szReport, szTemp); |
||||
|
||||
for(i = 1; i < 20; i++) |
||||
{ |
||||
sprintf(szTemp, " %u", m_digest[i]); |
||||
strcat(szReport, szTemp); |
||||
} |
||||
} |
||||
else strcpy(szReport, "Error: Unknown report type!"); |
||||
} |
||||
|
||||
// Get the raw message digest
|
||||
void CSHA1::GetHash(UINT_8 *puDest) |
||||
{ |
||||
memcpy(puDest, m_digest, 20); |
||||
} |
@ -0,0 +1,99 @@ |
||||
/*
|
||||
100% free public domain implementation of the SHA-1 algorithm |
||||
by Dominik Reichl <dominik.reichl@t-online.de> |
||||
|
||||
Version 1.5 - 2005-01-01 |
||||
- 64-bit compiler compatibility added |
||||
- Made variable wiping optional (define SHA1_WIPE_VARIABLES) |
||||
- Removed unnecessary variable initializations |
||||
- ROL32 improvement for the Microsoft compiler (using _rotl) |
||||
|
||||
======== Test Vectors (from FIPS PUB 180-1) ======== |
||||
|
||||
SHA1("abc") = |
||||
A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D |
||||
|
||||
SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") = |
||||
84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 |
||||
|
||||
SHA1(A million repetitions of "a") = |
||||
34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F |
||||
*/ |
||||
|
||||
#ifndef ___SHA1_HDR___ |
||||
#define ___SHA1_HDR___ |
||||
|
||||
#include <stdio.h> // Needed for file access |
||||
#include <memory.h> // Needed for memset and memcpy |
||||
#include <string.h> // Needed for strcat and strcpy |
||||
|
||||
|
||||
// If you're compiling big endian, just comment out the following line
|
||||
#define SHA1_LITTLE_ENDIAN |
||||
|
||||
// #define or #undef this, if you want the CSHA1 class to wipe all
|
||||
// temporary variables after processing
|
||||
#define SHA1_WIPE_VARIABLES |
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Define 8- and 32-bit variables
|
||||
|
||||
#ifndef UINT_32 |
||||
#define UINT_8 unsigned char |
||||
#if (ULONG_MAX == 0xFFFFFFFF) |
||||
#define UINT_32 unsigned long |
||||
#else |
||||
#define UINT_32 unsigned int |
||||
#endif |
||||
#endif |
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Declare SHA1 workspace
|
||||
|
||||
typedef union |
||||
{ |
||||
UINT_8 c[64]; |
||||
UINT_32 l[16]; |
||||
} SHA1_WORKSPACE_BLOCK; |
||||
|
||||
class CSHA1 |
||||
{ |
||||
public: |
||||
// Two different formats for ReportHash(...)
|
||||
enum |
||||
{ |
||||
REPORT_HEX = 0, |
||||
REPORT_DIGIT = 1 |
||||
}; |
||||
|
||||
// Constructor and Destructor
|
||||
CSHA1(); |
||||
~CSHA1(); |
||||
|
||||
UINT_32 m_state[5]; |
||||
UINT_32 m_count[2]; |
||||
UINT_8 m_buffer[64]; |
||||
UINT_8 m_digest[20]; |
||||
|
||||
void Reset(); |
||||
|
||||
// Update the hash value
|
||||
void Update(unsigned char* data, int len); |
||||
bool HashFile(char *szFileName); |
||||
|
||||
// Finalize hash and report
|
||||
void Final(); |
||||
void ReportHash(char *szReport, unsigned char uReportType = REPORT_HEX); |
||||
void GetHash(UINT_8 *puDest); |
||||
|
||||
private: |
||||
// Private SHA-1 transformation
|
||||
void Transform(UINT_32 *state, UINT_8 *buffer); |
||||
|
||||
// Member variables
|
||||
UINT_8 m_workspace[64]; |
||||
SHA1_WORKSPACE_BLOCK *m_block; // SHA1 pointer to the byte array above
|
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,369 @@ |
||||
/*
|
||||
* FIPS-180-2 compliant SHA-256 implementation |
||||
* |
||||
* Copyright (C) 2001-2003 Christophe Devine |
||||
* |
||||
* This program is free software; you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation; either version 2 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program; if not, write to the Free Software |
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||||
*/ |
||||
|
||||
#include <string.h> |
||||
|
||||
#include "sha256.h" |
||||
|
||||
#define GET_UINT32(n,b,i) \ |
||||
{ \
|
||||
(n) = ( (uint32) (b)[(i) ] << 24 ) \
|
||||
| ( (uint32) (b)[(i) + 1] << 16 ) \
|
||||
| ( (uint32) (b)[(i) + 2] << 8 ) \
|
||||
| ( (uint32) (b)[(i) + 3] ); \
|
||||
} |
||||
|
||||
#define PUT_UINT32(n,b,i) \ |
||||
{ \
|
||||
(b)[(i) ] = (uint8) ( (n) >> 24 ); \
|
||||
(b)[(i) + 1] = (uint8) ( (n) >> 16 ); \
|
||||
(b)[(i) + 2] = (uint8) ( (n) >> 8 ); \
|
||||
(b)[(i) + 3] = (uint8) ( (n) ); \
|
||||
} |
||||
|
||||
void sha256_starts( sha256_context *ctx ) |
||||
{ |
||||
ctx->total[0] = 0; |
||||
ctx->total[1] = 0; |
||||
|
||||
ctx->state[0] = 0x6A09E667; |
||||
ctx->state[1] = 0xBB67AE85; |
||||
ctx->state[2] = 0x3C6EF372; |
||||
ctx->state[3] = 0xA54FF53A; |
||||
ctx->state[4] = 0x510E527F; |
||||
ctx->state[5] = 0x9B05688C; |
||||
ctx->state[6] = 0x1F83D9AB; |
||||
ctx->state[7] = 0x5BE0CD19; |
||||
} |
||||
|
||||
void sha256_process( sha256_context *ctx, uint8 data[64] ) |
||||
{ |
||||
uint32 temp1, temp2, W[64]; |
||||
uint32 A, B, C, D, E, F, G, H; |
||||
|
||||
GET_UINT32( W[0], data, 0 ); |
||||
GET_UINT32( W[1], data, 4 ); |
||||
GET_UINT32( W[2], data, 8 ); |
||||
GET_UINT32( W[3], data, 12 ); |
||||
GET_UINT32( W[4], data, 16 ); |
||||
GET_UINT32( W[5], data, 20 ); |
||||
GET_UINT32( W[6], data, 24 ); |
||||
GET_UINT32( W[7], data, 28 ); |
||||
GET_UINT32( W[8], data, 32 ); |
||||
GET_UINT32( W[9], data, 36 ); |
||||
GET_UINT32( W[10], data, 40 ); |
||||
GET_UINT32( W[11], data, 44 ); |
||||
GET_UINT32( W[12], data, 48 ); |
||||
GET_UINT32( W[13], data, 52 ); |
||||
GET_UINT32( W[14], data, 56 ); |
||||
GET_UINT32( W[15], data, 60 ); |
||||
|
||||
#define SHR(x,n) ((x & 0xFFFFFFFF) >> n) |
||||
#define ROTR(x,n) (SHR(x,n) | (x << (32 - n))) |
||||
|
||||
#define S0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3)) |
||||
#define S1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10)) |
||||
|
||||
#define S2(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22)) |
||||
#define S3(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25)) |
||||
|
||||
#define F0(x,y,z) ((x & y) | (z & (x | y))) |
||||
#define F1(x,y,z) (z ^ (x & (y ^ z))) |
||||
|
||||
#define R(t) \ |
||||
( \
|
||||
W[t] = S1(W[t - 2]) + W[t - 7] + \
|
||||
S0(W[t - 15]) + W[t - 16] \
|
||||
) |
||||
|
||||
#define P(a,b,c,d,e,f,g,h,x,K) \ |
||||
{ \
|
||||
temp1 = h + S3(e) + F1(e,f,g) + K + x; \
|
||||
temp2 = S2(a) + F0(a,b,c); \
|
||||
d += temp1; h = temp1 + temp2; \
|
||||
} |
||||
|
||||
A = ctx->state[0]; |
||||
B = ctx->state[1]; |
||||
C = ctx->state[2]; |
||||
D = ctx->state[3]; |
||||
E = ctx->state[4]; |
||||
F = ctx->state[5]; |
||||
G = ctx->state[6]; |
||||
H = ctx->state[7]; |
||||
|
||||
P( A, B, C, D, E, F, G, H, W[ 0], 0x428A2F98 ); |
||||
P( H, A, B, C, D, E, F, G, W[ 1], 0x71374491 ); |
||||
P( G, H, A, B, C, D, E, F, W[ 2], 0xB5C0FBCF ); |
||||
P( F, G, H, A, B, C, D, E, W[ 3], 0xE9B5DBA5 ); |
||||
P( E, F, G, H, A, B, C, D, W[ 4], 0x3956C25B ); |
||||
P( D, E, F, G, H, A, B, C, W[ 5], 0x59F111F1 ); |
||||
P( C, D, E, F, G, H, A, B, W[ 6], 0x923F82A4 ); |
||||
P( B, C, D, E, F, G, H, A, W[ 7], 0xAB1C5ED5 ); |
||||
P( A, B, C, D, E, F, G, H, W[ 8], 0xD807AA98 ); |
||||
P( H, A, B, C, D, E, F, G, W[ 9], 0x12835B01 ); |
||||
P( G, H, A, B, C, D, E, F, W[10], 0x243185BE ); |
||||
P( F, G, H, A, B, C, D, E, W[11], 0x550C7DC3 ); |
||||
P( E, F, G, H, A, B, C, D, W[12], 0x72BE5D74 ); |
||||
P( D, E, F, G, H, A, B, C, W[13], 0x80DEB1FE ); |
||||
P( C, D, E, F, G, H, A, B, W[14], 0x9BDC06A7 ); |
||||
P( B, C, D, E, F, G, H, A, W[15], 0xC19BF174 ); |
||||
P( A, B, C, D, E, F, G, H, R(16), 0xE49B69C1 ); |
||||
P( H, A, B, C, D, E, F, G, R(17), 0xEFBE4786 ); |
||||
P( G, H, A, B, C, D, E, F, R(18), 0x0FC19DC6 ); |
||||
P( F, G, H, A, B, C, D, E, R(19), 0x240CA1CC ); |
||||
P( E, F, G, H, A, B, C, D, R(20), 0x2DE92C6F ); |
||||
P( D, E, F, G, H, A, B, C, R(21), 0x4A7484AA ); |
||||
P( C, D, E, F, G, H, A, B, R(22), 0x5CB0A9DC ); |
||||
P( B, C, D, E, F, G, H, A, R(23), 0x76F988DA ); |
||||
P( A, B, C, D, E, F, G, H, R(24), 0x983E5152 ); |
||||
P( H, A, B, C, D, E, F, G, R(25), 0xA831C66D ); |
||||
P( G, H, A, B, C, D, E, F, R(26), 0xB00327C8 ); |
||||
P( F, G, H, A, B, C, D, E, R(27), 0xBF597FC7 ); |
||||
P( E, F, G, H, A, B, C, D, R(28), 0xC6E00BF3 ); |
||||
P( D, E, F, G, H, A, B, C, R(29), 0xD5A79147 ); |
||||
P( C, D, E, F, G, H, A, B, R(30), 0x06CA6351 ); |
||||
P( B, C, D, E, F, G, H, A, R(31), 0x14292967 ); |
||||
P( A, B, C, D, E, F, G, H, R(32), 0x27B70A85 ); |
||||
P( H, A, B, C, D, E, F, G, R(33), 0x2E1B2138 ); |
||||
P( G, H, A, B, C, D, E, F, R(34), 0x4D2C6DFC ); |
||||
P( F, G, H, A, B, C, D, E, R(35), 0x53380D13 ); |
||||
P( E, F, G, H, A, B, C, D, R(36), 0x650A7354 ); |
||||
P( D, E, F, G, H, A, B, C, R(37), 0x766A0ABB ); |
||||
P( C, D, E, F, G, H, A, B, R(38), 0x81C2C92E ); |
||||
P( B, C, D, E, F, G, H, A, R(39), 0x92722C85 ); |
||||
P( A, B, C, D, E, F, G, H, R(40), 0xA2BFE8A1 ); |
||||
P( H, A, B, C, D, E, F, G, R(41), 0xA81A664B ); |
||||
P( G, H, A, B, C, D, E, F, R(42), 0xC24B8B70 ); |
||||
P( F, G, H, A, B, C, D, E, R(43), 0xC76C51A3 ); |
||||
P( E, F, G, H, A, B, C, D, R(44), 0xD192E819 ); |
||||
P( D, E, F, G, H, A, B, C, R(45), 0xD6990624 ); |
||||
P( C, D, E, F, G, H, A, B, R(46), 0xF40E3585 ); |
||||
P( B, C, D, E, F, G, H, A, R(47), 0x106AA070 ); |
||||
P( A, B, C, D, E, F, G, H, R(48), 0x19A4C116 ); |
||||
P( H, A, B, C, D, E, F, G, R(49), 0x1E376C08 ); |
||||
P( G, H, A, B, C, D, E, F, R(50), 0x2748774C ); |
||||
P( F, G, H, A, B, C, D, E, R(51), 0x34B0BCB5 ); |
||||
P( E, F, G, H, A, B, C, D, R(52), 0x391C0CB3 ); |
||||
P( D, E, F, G, H, A, B, C, R(53), 0x4ED8AA4A ); |
||||
P( C, D, E, F, G, H, A, B, R(54), 0x5B9CCA4F ); |
||||
P( B, C, D, E, F, G, H, A, R(55), 0x682E6FF3 ); |
||||
P( A, B, C, D, E, F, G, H, R(56), 0x748F82EE ); |
||||
P( H, A, B, C, D, E, F, G, R(57), 0x78A5636F ); |
||||
P( G, H, A, B, C, D, E, F, R(58), 0x84C87814 ); |
||||
P( F, G, H, A, B, C, D, E, R(59), 0x8CC70208 ); |
||||
P( E, F, G, H, A, B, C, D, R(60), 0x90BEFFFA ); |
||||
P( D, E, F, G, H, A, B, C, R(61), 0xA4506CEB ); |
||||
P( C, D, E, F, G, H, A, B, R(62), 0xBEF9A3F7 ); |
||||
P( B, C, D, E, F, G, H, A, R(63), 0xC67178F2 ); |
||||
|
||||
ctx->state[0] += A; |
||||
ctx->state[1] += B; |
||||
ctx->state[2] += C; |
||||
ctx->state[3] += D; |
||||
ctx->state[4] += E; |
||||
ctx->state[5] += F; |
||||
ctx->state[6] += G; |
||||
ctx->state[7] += H; |
||||
} |
||||
|
||||
void sha256_update( sha256_context *ctx, uint8 *input, uint32 length ) |
||||
{ |
||||
uint32 left, fill; |
||||
|
||||
if( ! length ) return; |
||||
|
||||
left = ctx->total[0] & 0x3F; |
||||
fill = 64 - left; |
||||
|
||||
ctx->total[0] += length; |
||||
ctx->total[0] &= 0xFFFFFFFF; |
||||
|
||||
if( ctx->total[0] < length ) |
||||
ctx->total[1]++; |
||||
|
||||
if( left && length >= fill ) |
||||
{ |
||||
memcpy( (void *) (ctx->buffer + left), |
||||
(void *) input, fill ); |
||||
sha256_process( ctx, ctx->buffer ); |
||||
length -= fill; |
||||
input += fill; |
||||
left = 0; |
||||
} |
||||
|
||||
while( length >= 64 ) |
||||
{ |
||||
sha256_process( ctx, input ); |
||||
length -= 64; |
||||
input += 64; |
||||
} |
||||
|
||||
if( length ) |
||||
{ |
||||
memcpy( (void *) (ctx->buffer + left), |
||||
(void *) input, length ); |
||||
} |
||||
} |
||||
|
||||
static uint8 sha256_padding[64] = |
||||
{ |
||||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
||||
}; |
||||
|
||||
void sha256_finish( sha256_context *ctx, uint8 digest[32] ) |
||||
{ |
||||
uint32 last, padn; |
||||
uint32 high, low; |
||||
uint8 msglen[8]; |
||||
|
||||
high = ( ctx->total[0] >> 29 ) |
||||
| ( ctx->total[1] << 3 ); |
||||
low = ( ctx->total[0] << 3 ); |
||||
|
||||
PUT_UINT32( high, msglen, 0 ); |
||||
PUT_UINT32( low, msglen, 4 ); |
||||
|
||||
last = ctx->total[0] & 0x3F; |
||||
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); |
||||
|
||||
sha256_update( ctx, sha256_padding, padn ); |
||||
sha256_update( ctx, msglen, 8 ); |
||||
|
||||
PUT_UINT32( ctx->state[0], digest, 0 ); |
||||
PUT_UINT32( ctx->state[1], digest, 4 ); |
||||
PUT_UINT32( ctx->state[2], digest, 8 ); |
||||
PUT_UINT32( ctx->state[3], digest, 12 ); |
||||
PUT_UINT32( ctx->state[4], digest, 16 ); |
||||
PUT_UINT32( ctx->state[5], digest, 20 ); |
||||
PUT_UINT32( ctx->state[6], digest, 24 ); |
||||
PUT_UINT32( ctx->state[7], digest, 28 ); |
||||
} |
||||
|
||||
#ifdef TEST |
||||
|
||||
#include <stdlib.h> |
||||
#include <stdio.h> |
||||
|
||||
/*
|
||||
* those are the standard FIPS-180-2 test vectors |
||||
*/ |
||||
|
||||
static char *msg[] =
|
||||
{ |
||||
"abc", |
||||
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", |
||||
NULL |
||||
}; |
||||
|
||||
static char *val[] = |
||||
{ |
||||
"ba7816bf8f01cfea414140de5dae2223" \
|
||||
"b00361a396177a9cb410ff61f20015ad", |
||||
"248d6a61d20638b8e5c026930c3e6039" \
|
||||
"a33ce45964ff2167f6ecedd419db06c1", |
||||
"cdc76e5c9914fb9281a1c7e284d73e67" \
|
||||
"f1809a48a497200e046d39ccc7112cd0" |
||||
}; |
||||
|
||||
int main( int argc, char *argv[] ) |
||||
{ |
||||
FILE *f; |
||||
int i, j; |
||||
char output[65]; |
||||
sha256_context ctx; |
||||
unsigned char buf[1000]; |
||||
unsigned char sha256sum[32]; |
||||
|
||||
if( argc < 2 ) |
||||
{ |
||||
printf( "\n SHA-256 Validation Tests:\n\n" ); |
||||
|
||||
for( i = 0; i < 3; i++ ) |
||||
{ |
||||
printf( " Test %d ", i + 1 ); |
||||
|
||||
sha256_starts( &ctx ); |
||||
|
||||
if( i < 2 ) |
||||
{ |
||||
sha256_update( &ctx, (uint8 *) msg[i], |
||||
strlen( msg[i] ) ); |
||||
} |
||||
else |
||||
{ |
||||
memset( buf, 'a', 1000 ); |
||||
|
||||
for( j = 0; j < 1000; j++ ) |
||||
{ |
||||
sha256_update( &ctx, (uint8 *) buf, 1000 ); |
||||
} |
||||
} |
||||
|
||||
sha256_finish( &ctx, sha256sum ); |
||||
|
||||
for( j = 0; j < 32; j++ ) |
||||
{ |
||||
sprintf( output + j * 2, "%02x", sha256sum[j] ); |
||||
} |
||||
|
||||
if( memcmp( output, val[i], 64 ) ) |
||||
{ |
||||
printf( "failed!\n" ); |
||||
return( 1 ); |
||||
} |
||||
|
||||
printf( "passed.\n" ); |
||||
} |
||||
|
||||
printf( "\n" ); |
||||
} |
||||
else |
||||
{ |
||||
if( ! ( f = fopen( argv[1], "rb" ) ) ) |
||||
{ |
||||
perror( "fopen" ); |
||||
return( 1 ); |
||||
} |
||||
|
||||
sha256_starts( &ctx ); |
||||
|
||||
while( ( i = fread( buf, 1, sizeof( buf ), f ) ) > 0 ) |
||||
{ |
||||
sha256_update( &ctx, buf, i ); |
||||
} |
||||
|
||||
sha256_finish( &ctx, sha256sum ); |
||||
|
||||
for( j = 0; j < 32; j++ ) |
||||
{ |
||||
printf( "%02x", sha256sum[j] ); |
||||
} |
||||
|
||||
printf( " %s\n", argv[1] ); |
||||
} |
||||
|
||||
return( 0 ); |
||||
} |
||||
|
||||
#endif |
@ -0,0 +1,32 @@ |
||||
#ifndef _SHA256_H |
||||
#define _SHA256_H |
||||
|
||||
#ifndef uint8 |
||||
#define uint8 unsigned char |
||||
#endif |
||||
|
||||
#ifndef uint32 |
||||
#define uint32 unsigned long int |
||||
#endif |
||||
|
||||
typedef struct |
||||
{ |
||||
uint32 total[2]; |
||||
uint32 state[8]; |
||||
uint8 buffer[64]; |
||||
} |
||||
sha256_context; |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { //Für C++ Kompalibilität
|
||||
#endif |
||||
|
||||
extern void sha256_starts( sha256_context *ctx ); |
||||
extern void sha256_update( sha256_context *ctx, uint8 *input, uint32 length ); |
||||
extern void sha256_finish( sha256_context *ctx, uint8 digest[32] ); |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* sha256.h */ |
@ -0,0 +1,148 @@ |
||||
/*
|
||||
Copyright (c) 2003/2004, Dominik Reichl <dominik.reichl@t-online.de> |
||||
All rights reserved. |
||||
|
||||
Redistribution and use in source and binary forms, with or without |
||||
modification, are permitted provided that the following conditions are met: |
||||
|
||||
- Redistributions of source code must retain the above copyright notice, |
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice, |
||||
this list of conditions and the following disclaimer in the documentation |
||||
and/or other materials provided with the distribution. |
||||
- Neither the name of ReichlSoft nor the names of its contributors may be |
||||
used to endorse or promote products derived from this software without |
||||
specific prior written permission. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
||||
POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#include <qstring.h> |
||||
#include "twoclass.h" |
||||
|
||||
static bool g_bInitialized = false; |
||||
|
||||
CTwofish::CTwofish() |
||||
{ |
||||
} |
||||
|
||||
CTwofish::~CTwofish() |
||||
{ |
||||
} |
||||
|
||||
bool CTwofish::init(UINT8 *pKey, unsigned long uKeyLen, UINT8 *initVector) |
||||
{ |
||||
//ASSERT(pKey != NULL);
|
||||
if(pKey == NULL) return false; |
||||
//ASSERT(uKeyLen != 0);
|
||||
if(uKeyLen == 0) return false; |
||||
|
||||
if(g_bInitialized == false) |
||||
{ |
||||
Twofish_initialise(); |
||||
g_bInitialized = true; |
||||
} |
||||
|
||||
Twofish_prepare_key((Twofish_Byte *)pKey, uKeyLen, &m_key); |
||||
|
||||
if(initVector != NULL) memcpy(m_pInitVector, initVector, 16); |
||||
else memset(m_pInitVector, 0, 16); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
int CTwofish::padEncrypt(UINT8 *pInput, int nInputOctets, UINT8 *pOutBuffer) |
||||
{ |
||||
int i, numBlocks, padLen; |
||||
UINT8 block[16], *iv; |
||||
|
||||
//ASSERT((pInput != NULL) && (nInputOctets != NULL) && (pOutBuffer != NULL));
|
||||
if((pInput == NULL) || (nInputOctets <= 0) || (pOutBuffer == NULL)) return 0; |
||||
|
||||
numBlocks = nInputOctets / 16; |
||||
|
||||
iv = m_pInitVector; |
||||
for(i = numBlocks; i > 0; i--) |
||||
{ |
||||
((UINT32*)block)[0] = ((UINT32*)pInput)[0] ^ ((UINT32*)iv)[0]; |
||||
((UINT32*)block)[1] = ((UINT32*)pInput)[1] ^ ((UINT32*)iv)[1]; |
||||
((UINT32*)block)[2] = ((UINT32*)pInput)[2] ^ ((UINT32*)iv)[2]; |
||||
((UINT32*)block)[3] = ((UINT32*)pInput)[3] ^ ((UINT32*)iv)[3]; |
||||
|
||||
Twofish_encrypt(&m_key, (Twofish_Byte *)block, (Twofish_Byte *)pOutBuffer); |
||||
|
||||
iv = pOutBuffer; |
||||
pInput += 16; |
||||
pOutBuffer += 16; |
||||
} |
||||
|
||||
padLen = 16 - (nInputOctets - (16 * numBlocks)); |
||||
|
||||
for (i = 0; i < 16 - padLen; i++) |
||||
{ |
||||
block[i] = (UINT8)(pInput[i] ^ iv[i]); |
||||
} |
||||
|
||||
for (i = 16 - padLen; i < 16; i++) |
||||
{ |
||||
block[i] = (UINT8)((UINT8)padLen ^ iv[i]); |
||||
} |
||||
|
||||
Twofish_encrypt(&m_key, (Twofish_Byte *)block, (Twofish_Byte *)pOutBuffer); |
||||
|
||||
return 16 * (numBlocks + 1); |
||||
} |
||||
|
||||
int CTwofish::padDecrypt(UINT8 *pInput, int nInputOctets, UINT8 *pOutBuffer) |
||||
{ |
||||
int i, numBlocks, padLen; |
||||
UINT8 block[16]; |
||||
UINT32 iv[4]; |
||||
|
||||
//ASSERT((pInput != NULL) && (nInputOctets != NULL) && (pOutBuffer != NULL));
|
||||
if((pInput == NULL) || (nInputOctets <= 0) || (pOutBuffer == NULL)) return 0; |
||||
|
||||
if((nInputOctets % 16) != 0) { /*ASSERT(FALSE);*/ return -1; } |
||||
|
||||
numBlocks = nInputOctets / 16; |
||||
|
||||
memcpy(iv, m_pInitVector, 16); |
||||
|
||||
for(i = numBlocks - 1; i > 0; i--) |
||||
{ |
||||
Twofish_decrypt(&m_key, (Twofish_Byte *)pInput, (Twofish_Byte *)block); |
||||
((UINT32*)block)[0] ^= iv[0]; |
||||
((UINT32*)block)[1] ^= iv[1]; |
||||
((UINT32*)block)[2] ^= iv[2]; |
||||
((UINT32*)block)[3] ^= iv[3]; |
||||
memcpy(iv, pInput, 16); |
||||
memcpy(pOutBuffer, block, 16); |
||||
pInput += 16; |
||||
pOutBuffer += 16; |
||||
} |
||||
|
||||
Twofish_decrypt(&m_key, (Twofish_Byte *)pInput, (Twofish_Byte *)block); |
||||
((UINT32*)block)[0] ^= iv[0]; |
||||
((UINT32*)block)[1] ^= iv[1]; |
||||
((UINT32*)block)[2] ^= iv[2]; |
||||
((UINT32*)block)[3] ^= iv[3]; |
||||
padLen = block[15]; |
||||
if(padLen <= 0 || padLen > 16) return -1; |
||||
for(i = 16 - padLen; i < 16; i++) |
||||
{ |
||||
if(block[i] != padLen) return -1; |
||||
} |
||||
memcpy(pOutBuffer, block, 16 - padLen); |
||||
|
||||
return 16*numBlocks - padLen; |
||||
} |
@ -0,0 +1,52 @@ |
||||
/*
|
||||
Copyright (c) 2003/2004, Dominik Reichl <dominik.reichl@t-online.de> |
||||
All rights reserved. |
||||
|
||||
Redistribution and use in source and binary forms, with or without |
||||
modification, are permitted provided that the following conditions are met: |
||||
|
||||
- Redistributions of source code must retain the above copyright notice, |
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice, |
||||
this list of conditions and the following disclaimer in the documentation |
||||
and/or other materials provided with the distribution. |
||||
- Neither the name of ReichlSoft nor the names of its contributors may be |
||||
used to endorse or promote products derived from this software without |
||||
specific prior written permission. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
||||
POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#ifndef ___TWOFISH_CLASS_H___ |
||||
#define ___TWOFISH_CLASS_H___ |
||||
|
||||
#include "twofish.h" |
||||
#include "crypto/rijndael.h" |
||||
|
||||
class CTwofish |
||||
{ |
||||
public: |
||||
CTwofish(); |
||||
virtual ~CTwofish(); |
||||
|
||||
bool init(UINT8 *pKey, unsigned long uKeyLen, UINT8 *initVector = NULL); |
||||
|
||||
int padEncrypt(UINT8 *pInput, int nInputOctets, UINT8 *pOutBuffer); |
||||
int padDecrypt(UINT8 *pInput, int nInputOctets, UINT8 *pOutBuffer); |
||||
|
||||
private: |
||||
Twofish_key m_key; |
||||
UINT8 m_pInitVector[16]; |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,179 @@ |
||||
/*
|
||||
* Fast, portable, and easy-to-use Twofish implementation,
|
||||
* Version 0.3. |
||||
* Copyright (c) 2002 by Niels Ferguson. |
||||
* |
||||
* See the twofish.c file for the details of the how and why of this code. |
||||
* |
||||
* The author hereby grants a perpetual license to everybody to |
||||
* use this code for any purpose as long as the copyright message is included |
||||
* in the source code of this or any derived work. |
||||
*/ |
||||
|
||||
|
||||
/*
|
||||
* PLATFORM FIXES |
||||
* ============== |
||||
* |
||||
* The following definitions have to be fixed for each particular platform
|
||||
* you work on. If you have a multi-platform program, you no doubt have
|
||||
* portable definitions that you can substitute here without changing
|
||||
* the rest of the code. |
||||
* |
||||
* The defaults provided here should work on most PC compilers. |
||||
*/ |
||||
|
||||
|
||||
/*
|
||||
* A Twofish_Byte must be an unsigned 8-bit integer. |
||||
* It must also be the elementary data size of your C platform, |
||||
* i.e. sizeof( Twofish_Byte ) == 1. |
||||
*/ |
||||
typedef unsigned char Twofish_Byte; |
||||
|
||||
/*
|
||||
* A Twofish_UInt32 must be an unsigned integer of at least 32 bits.
|
||||
*
|
||||
* This type is used only internally in the implementation, so ideally it |
||||
* would not appear in the header file, but it is used inside the |
||||
* Twofish_key structure which means it has to be included here. |
||||
*/ |
||||
typedef unsigned int Twofish_UInt32; |
||||
|
||||
|
||||
/*
|
||||
* END OF PLATFORM FIXES |
||||
* ===================== |
||||
*
|
||||
* You should not have to touch the rest of this file, but the code |
||||
* in twofish.c has a few things you need to fix too. |
||||
*/ |
||||
|
||||
|
||||
/*
|
||||
* Structure that contains a prepared Twofish key. |
||||
* A cipher key is used in two stages. In the first stage it is converted |
||||
* form the original form to an internal representation.
|
||||
* This internal form is then used to encrypt and decrypt data.
|
||||
* This structure contains the internal form. It is rather large: 4256 bytes |
||||
* on a platform with 32-bit unsigned values. |
||||
* |
||||
* Treat this as an opague structure, and don't try to manipulate the |
||||
* elements in it. I wish I could hide the inside of the structure, |
||||
* but C doesn't allow that. |
||||
*/ |
||||
typedef
|
||||
struct
|
||||
{ |
||||
Twofish_UInt32 s[4][256]; /* pre-computed S-boxes */ |
||||
Twofish_UInt32 K[40]; /* Round key words */ |
||||
} |
||||
Twofish_key; |
||||
|
||||
|
||||
/*
|
||||
* Initialise and test the Twofish implementation.
|
||||
*
|
||||
* This function MUST be called before any other function in the
|
||||
* Twofish implementation is called. |
||||
* It only needs to be called once. |
||||
*
|
||||
* Apart from initialising the implementation it performs a self test. |
||||
* If the Twofish_fatal function is not called, the code passed the test. |
||||
* (See the twofish.c file for details on the Twofish_fatal function.) |
||||
*/ |
||||
extern void Twofish_initialise(); |
||||
|
||||
|
||||
/*
|
||||
* Convert a cipher key to the internal form used for
|
||||
* encryption and decryption. |
||||
*
|
||||
* The cipher key is an array of bytes; the Twofish_Byte type is
|
||||
* defined above to a type suitable on your platform.
|
||||
* |
||||
* Any key must be converted to an internal form in the Twofisk_key structure |
||||
* before it can be used. |
||||
* The encryption and decryption functions only work with the internal form. |
||||
* The conversion to internal form need only be done once for each key value. |
||||
* |
||||
* Be sure to wipe all key storage, including the Twofish_key structure,
|
||||
* once you are done with the key data.
|
||||
* A simple memset( TwofishKey, 0, sizeof( TwofishKey ) ) will do just fine. |
||||
* |
||||
* Unlike most implementations, this one allows any key size from 0 bytes
|
||||
* to 32 bytes. According to the Twofish specifications,
|
||||
* irregular key sizes are handled by padding the key with zeroes at the end
|
||||
* until the key size is 16, 24, or 32 bytes, whichever |
||||
* comes first. Note that each key of irregular size is equivalent to exactly |
||||
* one key of 16, 24, or 32 bytes. |
||||
* |
||||
* WARNING: Short keys have low entropy, and result in low security. |
||||
* Anything less than 8 bytes is utterly insecure. For good security |
||||
* use at least 16 bytes. I prefer to use 32-byte keys to prevent |
||||
* any collision attacks on the key. |
||||
* |
||||
* The key length argument key_len must be in the proper range. |
||||
* If key_len is not in the range 0,...,32 this routine attempts to generate
|
||||
* a fatal error (depending on the code environment),
|
||||
* and at best (or worst) returns without having done anything. |
||||
* |
||||
* Arguments: |
||||
* key Array of key bytes |
||||
* key_len Number of key bytes, must be in the range 0,1,...,32.
|
||||
* xkey Pointer to an Twofish_key structure that will be filled
|
||||
* with the internal form of the cipher key. |
||||
*/ |
||||
extern void Twofish_prepare_key(
|
||||
Twofish_Byte key[], |
||||
int key_len,
|
||||
Twofish_key * xkey
|
||||
); |
||||
|
||||
|
||||
/*
|
||||
* Encrypt a single block of data. |
||||
* |
||||
* This function encrypts a single block of 16 bytes of data. |
||||
* If you want to encrypt a larger or variable-length message,
|
||||
* you will have to use a cipher mode, such as CBC or CTR.
|
||||
* These are outside the scope of this implementation. |
||||
* |
||||
* The xkey structure is not modified by this routine, and can be |
||||
* used for further encryption and decryption operations. |
||||
* |
||||
* Arguments: |
||||
* xkey pointer to Twofish_key, internal form of the key |
||||
* produces by Twofish_prepare_key() |
||||
* p Plaintext to be encrypted |
||||
* c Place to store the ciphertext |
||||
*/ |
||||
extern void Twofish_encrypt(
|
||||
Twofish_key * xkey, |
||||
Twofish_Byte p[16],
|
||||
Twofish_Byte c[16] |
||||
); |
||||
|
||||
|
||||
/*
|
||||
* Decrypt a single block of data. |
||||
* |
||||
* This function decrypts a single block of 16 bytes of data. |
||||
* If you want to decrypt a larger or variable-length message,
|
||||
* you will have to use a cipher mode, such as CBC or CTR.
|
||||
* These are outside the scope of this implementation. |
||||
* |
||||
* The xkey structure is not modified by this routine, and can be |
||||
* used for further encryption and decryption operations. |
||||
* |
||||
* Arguments: |
||||
* xkey pointer to Twofish_key, internal form of the key |
||||
* produces by Twofish_prepare_key() |
||||
* c Ciphertext to be decrypted |
||||
* p Place to store the plaintext |
||||
*/ |
||||
extern void Twofish_decrypt(
|
||||
Twofish_key * xkey, |
||||
Twofish_Byte c[16],
|
||||
Twofish_Byte p[16] |
||||
); |
@ -0,0 +1,98 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include "mainwindow.h" |
||||
#include <qmessagebox.h> |
||||
#include <qscrollview.h> |
||||
#include <qlabel.h> |
||||
#include <qdialog.h> |
||||
#include <qfile.h> |
||||
|
||||
#include "AboutDlg.h" |
||||
|
||||
CAboutDialog::CAboutDialog(QWidget* parent, const char* name, bool modal, WFlags fl) |
||||
: AboutDlg(parent,name, modal,fl) |
||||
{ |
||||
mainwnd=((CMainWindow*)parentWidget()); |
||||
mainwnd->CreateBanner(Banner,mainwnd->Icon_Key32x32,trUtf8("Keepass für Linux")); |
||||
Link_Homepage=new LinkLabel(this,"Link_Homepage",trUtf8("http://keepass.de.vu"),80,143); |
||||
Link_EMail=new LinkLabel(this,"Link_EMail",trUtf8("tarek.saidi@arcor.de"),80,163); |
||||
Link_License=new LinkLabel(this,"Link_License",trUtf8("Lizenz"),80,183); |
||||
connect(Link_License,SIGNAL(clicked()),this,SLOT(OnLicenseClicked())); |
||||
connect(Link_EMail,SIGNAL(clicked()),this,SLOT(OnEMailClicked())); |
||||
connect(Link_Homepage,SIGNAL(clicked()),this,SLOT(OnHomepageClicked())); |
||||
Label0->setText(Label0->text().arg(KEEPASS_VERSION)); |
||||
|
||||
} |
||||
|
||||
CAboutDialog::~CAboutDialog() |
||||
{ |
||||
delete Link_Homepage; |
||||
delete Link_EMail; |
||||
delete Link_License; |
||||
} |
||||
|
||||
void CAboutDialog::OnClose() |
||||
{ |
||||
close(); |
||||
} |
||||
|
||||
void CAboutDialog::OnLicenseClicked(){ |
||||
|
||||
QDialog dlg(this,NULL,true); |
||||
QScrollView scroll(&dlg); |
||||
QLabel label(&scroll,"License-Scroll"); |
||||
scroll.addChild(&label); |
||||
QFile gpl(((CMainWindow*)parentWidget())->appdir+"/../share/keepass/license.txt"); |
||||
if(!gpl.exists()){ |
||||
QMessageBox::critical(this,trUtf8("Fehler"),trUtf8("Die Datei '%1' konnte nicht gefunden werden.") |
||||
.arg("'license.txt'")+"\n"+trUtf8("Die Anwendung wurde möglicherweiße nicht korrekt installiert.") |
||||
,trUtf8("OK"),0,0,2,1); |
||||
return; |
||||
} |
||||
|
||||
if(!gpl.open(IO_ReadOnly)){ |
||||
QMessageBox::critical(this,trUtf8("Fehler"),trUtf8("Die Datei '%1' konnte nicht geöffnet werden.") |
||||
.arg("'license.txt'")+trUtf8("Es trat folgender Fehler auf:\n%1").arg(gpl.errorString())
|
||||
,trUtf8("OK"),0,0,2,1); |
||||
return; |
||||
} |
||||
char* buffer=new char[gpl.size()]; |
||||
long l=gpl.readBlock(buffer,gpl.size()); |
||||
gpl.close(); |
||||
label.setText(QString::fromUtf8(buffer,l)); |
||||
label.setGeometry(0,0,500,800); |
||||
dlg.setFixedWidth(500); |
||||
dlg.setFixedHeight(400); |
||||
dlg.setCaption(trUtf8("Lizenz")); |
||||
scroll.setGeometry(0,0,500,400); |
||||
dlg.exec(); |
||||
delete buffer; |
||||
|
||||
} |
||||
|
||||
void CAboutDialog::OnHomepageClicked(){ |
||||
mainwnd->OpenURL("http://keepass.de.vu"); |
||||
} |
||||
|
||||
void CAboutDialog::OnEMailClicked(){ |
||||
mainwnd->OpenURL("mailto:tarek.saidi@arcor.de"); |
||||
} |
||||
|
@ -0,0 +1,57 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#ifndef _ABOUTDIALOG_H_ |
||||
#define _ABOUTDIALOG_H_ |
||||
#include "ui_AboutDlg.h" |
||||
#include "lib/UrlLabel.h" |
||||
#include "mainwindow.h" |
||||
|
||||
|
||||
|
||||
class CAboutDialog : public AboutDlg |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
LinkLabel *Link_Homepage,*Link_EMail,*Link_License; |
||||
public: |
||||
CAboutDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
||||
~CAboutDialog(); |
||||
|
||||
CMainWindow* mainwnd; |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
|
||||
public slots: |
||||
/*$PUBLIC_SLOTS$*/ |
||||
|
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
|
||||
public slots: |
||||
virtual void OnClose(); |
||||
void OnHomepageClicked(); |
||||
void OnEMailClicked(); |
||||
void OnLicenseClicked(); |
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,225 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "mainwindow.h" |
||||
#include "PwManager.h" |
||||
#include "../lib/random.h" |
||||
#include "ChangeKeyDlg.h" |
||||
//QT
|
||||
#include <qlineedit.h> |
||||
#include <qcombobox.h> |
||||
#include <qpushbutton.h> |
||||
#include <qcheckbox.h> |
||||
#include <qdir.h> |
||||
#include <qfiledialog.h> |
||||
#include <qmessagebox.h> |
||||
|
||||
|
||||
|
||||
CChangeKeyDlg::CChangeKeyDlg(QWidget* parent,PwDatabase* _db,const char* name, bool modal, WFlags fl) |
||||
: ChangeKeyDialog(parent,name, modal,fl) |
||||
{ |
||||
db=_db; |
||||
parentwnd=((CMainWindow*)parentWidget()); |
||||
parentwnd->CreateBanner(Banner,parentwnd->Icon_Key32x32,trUtf8("Hauptschlüssel ändern")); |
||||
if(!parentwnd->config.ShowPasswords)ChangeEchoMode(); |
||||
///@PlatformSpecific
|
||||
QDir media("/media"); |
||||
if(media.exists()){ |
||||
Paths=media.entryList("*",QDir::Dirs); |
||||
Paths.erase(Paths.begin()); // delete "."
|
||||
Paths.erase(Paths.begin()); // delete ".."
|
||||
|
||||
for(int i=0;i<Paths.count();i++){ |
||||
Paths[i]="/media/"+Paths[i]; |
||||
} |
||||
Paths.prepend("< none >"); |
||||
} |
||||
for(int i=0;i<Paths.count();i++){ |
||||
Combo_Dirs->insertItem(0,Paths[i]); |
||||
IsFile.append(false); |
||||
} |
||||
} |
||||
|
||||
CChangeKeyDlg::~CChangeKeyDlg() |
||||
{ |
||||
} |
||||
|
||||
void CChangeKeyDlg::OnOK() |
||||
{ |
||||
if(CheckBox_Both->isChecked()){ |
||||
if(password==""){QMessageBox::warning(this,trUtf8("Fehler"),trUtf8("Bitte geben Sie ein Passwort ein.") |
||||
,trUtf8("OK"),"","",0,0); |
||||
return;} |
||||
if(keyfile==""){QMessageBox::warning(this,trUtf8("Fehler"),trUtf8("Bitte wählen Sie eine Schlüsseldatei.") |
||||
,trUtf8("OK"),"","",0,0); |
||||
return;} |
||||
} |
||||
else |
||||
{ |
||||
if(password=="" && keyfile==""){QMessageBox::warning(this,trUtf8("Fehler"),trUtf8("Geben Sie bitte ein Passwort ein oder wählen Sie eine Schlüsseldatei.") |
||||
,trUtf8("OK"),"","",0,0); |
||||
return;} |
||||
} |
||||
|
||||
UINT8 file_key[32]={0}; |
||||
UINT8 pw_key[32]={0}; |
||||
|
||||
if(keyfile!=""){ |
||||
QFile file(keyfile); |
||||
if(file.exists()){ |
||||
int r=QMessageBox::warning(this,trUtf8("Vorhandene Datei überschreiben?"),trUtf8("Unter dem gewählten Dateinamen existiert bereits eine Datei.\nSoll sie überschrieben werden?"),"Ja","Nein",NULL,1,1); |
||||
if(r==1)return;} |
||||
getRandomBytes(file_key,1,32,true); |
||||
if(file.open(IO_WriteOnly | IO_Truncate)==false){ |
||||
QMessageBox::critical(this,trUtf8("Fehler"),trUtf8("Schlüsseldatei konnte nicht geöffnet werden."),"OK",0,0,2,1); |
||||
return; |
||||
} |
||||
if(file.writeBlock((char*)file_key,32)!=32){ |
||||
file.close(); |
||||
QMessageBox::critical(this,trUtf8("Fehler"),trUtf8("Das Schreiben der Schlüsseldatei ist fehlgeschlagen."),"OK",0,0,2,1); |
||||
return; |
||||
} |
||||
file.close(); |
||||
} |
||||
|
||||
if(CheckBox_Both->isChecked() || keyfile==""){ |
||||
if(password!=Edit_Password_2->text()){ |
||||
QMessageBox::critical(this,trUtf8("Fehler"),trUtf8("Passwort und Passwortwiederholung stimmen nicht überein.\nBitte prüfen Sie Ihre Eingabe."),"OK",0,0,2,1); |
||||
return;}} |
||||
|
||||
if(CheckBox_Both->isChecked())db->CalcMasterKeyByFileAndPw(keyfile, password); |
||||
else if(password=="")db->CalcMasterKeyByFile(keyfile); |
||||
else if(keyfile==""){db->CalcMasterKeyByPassword(password);} |
||||
|
||||
done(1); |
||||
} |
||||
|
||||
void CChangeKeyDlg::OnSelect() |
||||
{ |
||||
if(Button_Browse->isEnabled()){ |
||||
keyfile=QFileDialog::getSaveFileName(QDir::homeDirPath(),"",this,trUtf8("Schlüsseldatei öffnen")); |
||||
if(keyfile=="")return; |
||||
Combo_Dirs->insertItem(keyfile); |
||||
Combo_Dirs->setCurrentItem(Combo_Dirs->count()-1); |
||||
if(!CheckBox_Both->isChecked()){ |
||||
Edit_Password->setDisabled(true); |
||||
Edit_Password->setText(""); |
||||
password=""; |
||||
} |
||||
Paths.append(keyfile); |
||||
IsFile.append(true); |
||||
} |
||||
} |
||||
|
||||
|
||||
void CChangeKeyDlg::OnBrowse() |
||||
{ |
||||
QString dir=QFileDialog::getExistingDirectory(QDir::homeDirPath(),NULL,trUtf8("Verzeichnis wählen")); |
||||
if(dir=="")return; |
||||
keyfile=dir+"/pwsafe.key"; |
||||
Combo_Dirs->insertItem(dir); |
||||
Combo_Dirs->setCurrentItem(Combo_Dirs->count()-1); |
||||
if(!CheckBox_Both->isChecked()){ |
||||
Edit_Password->setDisabled(true); |
||||
Edit_Password_2->setDisabled(true); |
||||
Edit_Password->setText(""); |
||||
Edit_Password_2->setText(""); |
||||
password=""; |
||||
} |
||||
Paths.append(dir); |
||||
IsFile.append(false); |
||||
} |
||||
|
||||
|
||||
void CChangeKeyDlg::OnCancel() |
||||
{ |
||||
done(0); |
||||
} |
||||
|
||||
void CChangeKeyDlg::OnPasswordChanged(const QString& str) |
||||
{ |
||||
if(str!="" && !(CheckBox_Both->isChecked())){ |
||||
Combo_Dirs->setDisabled(true); |
||||
Button_Browse->setDisabled(true);} |
||||
else{ |
||||
Combo_Dirs->setEnabled(true); |
||||
Button_Browse->setEnabled(true);} |
||||
Edit_Password_2->setText(""); |
||||
password=str; |
||||
} |
||||
|
||||
void CChangeKeyDlg::OnPassword2Changed(const QString& str) |
||||
{ |
||||
} |
||||
|
||||
void CChangeKeyDlg::OnComboChanged(int i) |
||||
{ |
||||
if(i==0){ |
||||
keyfile=""; |
||||
Edit_Password->setEnabled(true); |
||||
Edit_Password_2->setEnabled(true); |
||||
return; |
||||
} |
||||
if(IsFile[i]==true)keyfile=Paths[i]; |
||||
else keyfile=Paths[i]+"/pwsafe.key"; |
||||
|
||||
if(!CheckBox_Both->isChecked()){ |
||||
Edit_Password->setText(""); |
||||
Edit_Password->setDisabled(true); |
||||
Edit_Password_2->setText(""); |
||||
Edit_Password_2->setDisabled(true);} |
||||
|
||||
} |
||||
|
||||
void CChangeKeyDlg::OnCheckBoxChanged(int i) |
||||
{ |
||||
if(i==QButton::NoChange)return; |
||||
if(i==QButton::On){ |
||||
Combo_Dirs->setEnabled(true); |
||||
Button_Browse->setEnabled(true); |
||||
Edit_Password->setEnabled(true); |
||||
Edit_Password_2->setEnabled(true); |
||||
} |
||||
} |
||||
|
||||
void CChangeKeyDlg::ChangeEchoMode() |
||||
{ |
||||
if(Edit_Password->echoMode()==QLineEdit::Normal){ |
||||
Edit_Password->setEchoMode(QLineEdit::Password); |
||||
Edit_Password_2->setEchoMode(QLineEdit::Password); |
||||
} |
||||
else |
||||
{ |
||||
Edit_Password->setEchoMode(QLineEdit::Normal); |
||||
Edit_Password_2->setEchoMode(QLineEdit::Normal); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*$SPECIALIZATION$*/ |
||||
|
||||
|
||||
//#include "changekeydlg.moc"
|
||||
|
@ -0,0 +1,71 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "mainwindow.h" |
||||
#ifndef _CHANGEKEYDLG_H_ |
||||
#define _CHANGEKEYDLG_H_ |
||||
#include "ui_ChangeKeyDlg.h" |
||||
#include <qstringlist.h> |
||||
#include <qvaluelist.h> |
||||
#include <qfile.h> |
||||
|
||||
class CChangeKeyDlg : public ChangeKeyDialog |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
CChangeKeyDlg(QWidget* parent,PwDatabase* db, const char* name = 0, bool modal = true, WFlags fl = 0 ); |
||||
~CChangeKeyDlg(); |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
|
||||
public slots: |
||||
/*$PUBLIC_SLOTS$*/ |
||||
|
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
|
||||
public slots: |
||||
virtual void OnSelect(); |
||||
virtual void OnBrowse(); |
||||
virtual void OnCancel(); |
||||
virtual void OnOK(); |
||||
virtual void OnComboChanged(int i); |
||||
virtual void OnCheckBoxChanged(int i); |
||||
virtual void OnPasswordChanged(const QString& str); |
||||
virtual void OnPassword2Changed(const QString& str); |
||||
virtual void ChangeEchoMode(); |
||||
|
||||
|
||||
private: |
||||
PwDatabase* db; |
||||
CMainWindow* parentwnd; |
||||
QStringList Paths; |
||||
QValueList<bool> IsFile; |
||||
|
||||
public: |
||||
QString keyfile; |
||||
QFile* pKeyFile; |
||||
QString password; |
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,84 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include <qcombobox.h> |
||||
#include <qlineedit.h> |
||||
#include <qmessagebox.h> |
||||
#include "mainwindow.h" |
||||
#include "DatabaseSettingsDlg.h" |
||||
|
||||
|
||||
CDbSettingsDlg::CDbSettingsDlg(CMainWindow* parent,Database* db, const char* name, bool modal, WFlags fl) |
||||
: dbsettingdlg_base(parent,name, modal,fl) |
||||
{ |
||||
database=db; |
||||
} |
||||
|
||||
CDbSettingsDlg::~CDbSettingsDlg() |
||||
{ |
||||
} |
||||
|
||||
void CDbSettingsDlg::showEvent(QShowEvent *event){ |
||||
if(event->spontaneous()==false){ |
||||
((CMainWindow*)parentWidget())->CreateBanner(Banner,((CMainWindow*)parentWidget())->Icon_Settings32x32,"Einstellungen"); |
||||
ComboAlgo->insertItem(trUtf8("AES(Rijndael): 256 Bit (Standard)"),0); |
||||
ComboAlgo->insertItem(trUtf8("Twofish: 256 Bit"),1); |
||||
ComboAlgo->setCurrentItem(database->CryptoAlgorithmus); //Achtung: AlgoID muss gleich dem ComboBox Index sein!
|
||||
EditRounds->setText(QString::number(database->KeyEncRounds)); |
||||
|
||||
} |
||||
} |
||||
|
||||
void CDbSettingsDlg::OnCancel() |
||||
{ |
||||
close(); |
||||
} |
||||
|
||||
|
||||
void CDbSettingsDlg::OnOK() |
||||
{ |
||||
if(EditRounds->text()==""){ |
||||
QMessageBox::warning(NULL,trUtf8("Fehler"),trUtf8("Geben Sie bitte die Anzahl der Verschlüsselungsrunden an."),trUtf8("OK")); |
||||
return; |
||||
} |
||||
bool valid; |
||||
int rounds=EditRounds->text().toUInt(&valid,10); |
||||
if(valid==false){ |
||||
QMessageBox::warning(NULL,trUtf8("Fehler"),EditRounds->text()+trUtf8(" ist kein gültiger Zahlenwert"),trUtf8("OK")); |
||||
return; |
||||
} |
||||
if(rounds==0){ |
||||
QMessageBox::warning(NULL,trUtf8("Fehler"),trUtf8("Die Anzahl an Verschlüsselungsrunden muss mindestens 1 betragen."),trUtf8("OK")); |
||||
return; |
||||
} |
||||
database->KeyEncRounds=rounds; |
||||
database->CryptoAlgorithmus=ComboAlgo->currentItem(); |
||||
|
||||
close(); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*$SPECIALIZATION$*/ |
||||
|
||||
|
||||
//#include "databasesettingsdlg.moc"
|
||||
|
@ -0,0 +1,54 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#ifndef DBSETTINGSDLG_H |
||||
#define DBSETTINGSDLG_H |
||||
#include "ui_DatabaseSettingsDlg.h" |
||||
#include "mainwindow.h" |
||||
#include "Database.h" |
||||
|
||||
class CDbSettingsDlg : public dbsettingdlg_base |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
CDbSettingsDlg(CMainWindow* parent,Database* db,const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
||||
~CDbSettingsDlg(); |
||||
virtual void showEvent(QShowEvent *); |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
|
||||
public slots: |
||||
/*$PUBLIC_SLOTS$*/ |
||||
|
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
|
||||
public slots: |
||||
virtual void OnCancel(); |
||||
virtual void OnOK(); |
||||
|
||||
private: |
||||
Database* database; |
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,371 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "mainwindow.h" |
||||
|
||||
#include <qpushbutton.h> |
||||
#include <qpalette.h> |
||||
#include <qfont.h> |
||||
#include <qlineedit.h> |
||||
#include <qlabel.h> |
||||
#include <qprogressbar.h> |
||||
#include <qtextedit.h> |
||||
#include <qpixmap.h> |
||||
#include <qcolor.h> |
||||
#include <qcombobox.h> |
||||
#include <qpainter.h> |
||||
#include <qpen.h> |
||||
#include <qfiledialog.h> |
||||
#include <qmessagebox.h> |
||||
|
||||
|
||||
#include "PasswordGenDlg.h" |
||||
#include "EditEntryDlg.h" |
||||
|
||||
|
||||
|
||||
CEditEntryDlg::CEditEntryDlg(QWidget* parent, const char* name, bool modal, WFlags fl) |
||||
: EditEntryDialog(parent,name, modal,fl) |
||||
{ |
||||
|
||||
pw=((CMainWindow*)parentWidget())->db; |
||||
mainwnd=((CMainWindow*)parentWidget()); |
||||
mainwnd->CreateBanner(Banner,mainwnd->Icon_Key32x32,trUtf8("Eintrag bearbeiten")); |
||||
ModFlag=false; |
||||
} |
||||
|
||||
CEditEntryDlg::~CEditEntryDlg() |
||||
{ |
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
void CEditEntryDlg::showEvent(QShowEvent *event){ |
||||
|
||||
if(event->spontaneous()==false){ |
||||
if(entry->pBinaryData==NULL){ |
||||
ButtonSaveAttachment->setDisabled(true); |
||||
ButtonDeleteAttachment->setDisabled(true); |
||||
} |
||||
setCaption(entry->Title); |
||||
setIcon(mainwnd->EntryIcons[entry->ImageID]); |
||||
Edit_Title->setText(entry->Title); |
||||
Edit_UserName->setText(entry->UserName); |
||||
Edit_URL->setText(entry->URL); |
||||
Edit_Password->setText(entry->Password.getString()); |
||||
Edit_Password_w->setText(entry->Password.getString()); |
||||
entry->Password.delRef(); |
||||
if(!mainwnd->config.ShowPasswords)ChangeEchoMode(); |
||||
OnPasswordwLostFocus(); |
||||
int bits=(entry->Password.length()*8); |
||||
Label_Bits->setText(QString::number(bits)+" Bit"); |
||||
if(bits>128)bits=128; |
||||
Progress_Quali->setProgress(bits,128); |
||||
Progress_Quali->setPercentageVisible(false); |
||||
Edit_Attachment->setText(entry->BinaryDesc); |
||||
Edit_Comment->setText(entry->Additional); |
||||
InitGroupComboBox(); |
||||
InitIconComboBox(); |
||||
Edit_Expire_Date->setText((entry->Expire.GetString(0)).mid(0,10)); |
||||
Edit_Expire_Time->setText((entry->Expire.GetString(0)).mid(11,8)); |
||||
if(entry->BinaryDataLength==0){ |
||||
Label_AttachmentSize->setText(""); |
||||
} |
||||
else |
||||
{ |
||||
QString unit; |
||||
int faktor; |
||||
int prec; |
||||
if(entry->BinaryDataLength<1000){unit=" Byte";faktor=1;prec=0;} |
||||
else {if(entry->BinaryDataLength<1000000){unit=" kB";faktor=1000;prec=1;} |
||||
else{unit=" MB";faktor=1000000;prec=1;} |
||||
} |
||||
Label_AttachmentSize->setText(QString::number((float)entry->BinaryDataLength/(float)faktor,'f',prec)+unit); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
void CEditEntryDlg::InitIconComboBox(){ |
||||
for(int i=0;i<52;i++){ |
||||
Combo_IconPicker->insertItem(((CMainWindow*)parentWidget())->EntryIcons[i],"",i); |
||||
} |
||||
Combo_IconPicker->setCurrentItem(entry->ImageID); |
||||
} |
||||
|
||||
|
||||
void CEditEntryDlg::InitGroupComboBox(){ |
||||
QString tmp; |
||||
int i; |
||||
for(i=0;i!=pw->Groups.size();i++){ |
||||
tmp=""; |
||||
for(int j=0;j<pw->Groups[i].Level;j++)tmp+=" "; |
||||
Combo_Group->insertItem(((CMainWindow*)parentWidget())->EntryIcons[pw->Groups[i].ImageID], |
||||
tmp+pw->Groups[i].Name,i); |
||||
} |
||||
Combo_Group->setCurrentItem(pw->getGroupIndex(entry->GroupID)); |
||||
} |
||||
|
||||
void CEditEntryDlg::OnButtonOK() |
||||
{ |
||||
|
||||
if(QString::compare(Edit_Password->text(),Edit_Password_w->text())!=0){ |
||||
QMessageBox::warning(NULL,"Stopp",QString::fromUtf8("Passwort und Passwortwiederholung stimmen\nnicht überein."),"OK"); |
||||
return; |
||||
} |
||||
QString str=Edit_Expire_Date->text(); |
||||
if(CPwmTime::IsValidDate(str)==false){ |
||||
QMessageBox::warning(NULL,"Stopp",QString::fromUtf8(str+" ist kein gültiges Datum."),"OK"); |
||||
return; |
||||
} |
||||
|
||||
str=Edit_Expire_Time->text(); |
||||
if(CPwmTime::IsValidTime(str)==false){ |
||||
QMessageBox::warning(NULL,"Stopp",QString::fromUtf8(str+" ist keine gültige Uhrzeit."),"OK"); |
||||
return; |
||||
} |
||||
|
||||
CPwmTime tmp_Expire; |
||||
tmp_Expire.SetDate(Edit_Expire_Date->text()); |
||||
tmp_Expire.SetTime(Edit_Expire_Time->text()); |
||||
if(tmp_Expire!=entry->Expire) |
||||
ModFlag=true; |
||||
if(entry->Title!=Edit_Title->text()) |
||||
ModFlag=true; |
||||
if(entry->UserName!=Edit_UserName->text()) |
||||
ModFlag=true; |
||||
if(entry->URL!=Edit_URL->text()) |
||||
ModFlag=true; |
||||
if(entry->Additional!=Edit_Comment->text()) |
||||
ModFlag=true; |
||||
QString& passw=entry->Password.getString(); |
||||
if(passw!=Edit_Password->text()) |
||||
ModFlag=true; |
||||
entry->Password.delRef(); |
||||
|
||||
entry->Expire.SetDate(Edit_Expire_Date->text()); |
||||
entry->Expire.SetTime(Edit_Expire_Time->text()); |
||||
entry->LastAccess.SetToNow(); |
||||
if(ModFlag)entry->LastMod.SetToNow(); |
||||
entry->Title=Edit_Title->text(); |
||||
entry->UserName=Edit_UserName->text(); |
||||
entry->URL=Edit_URL->text(); |
||||
QString s=Edit_Password->text(); |
||||
entry->Password.setString(s,true); |
||||
entry->Additional=Edit_Comment->text(); |
||||
if(Combo_Group->currentItem()!=pw->getGroupIndex(entry->GroupID)){ |
||||
pw->moveEntry(entry,&pw->Groups[Combo_Group->currentItem()]); |
||||
} |
||||
entry->ImageID=Combo_IconPicker->currentItem(); |
||||
done(1); |
||||
} |
||||
|
||||
void CEditEntryDlg::OnButtonCancel() |
||||
{ |
||||
entry->LastAccess.SetToNow(); |
||||
done(0); |
||||
} |
||||
|
||||
void CEditEntryDlg::ChangeEchoMode() |
||||
{ |
||||
if(Edit_Password->echoMode()==QLineEdit::Normal){ |
||||
Edit_Password->setEchoMode(QLineEdit::Password); |
||||
Edit_Password_w->setEchoMode(QLineEdit::Password); |
||||
} |
||||
else |
||||
{ |
||||
Edit_Password->setEchoMode(QLineEdit::Normal); |
||||
Edit_Password_w->setEchoMode(QLineEdit::Normal); |
||||
} |
||||
|
||||
|
||||
} |
||||
|
||||
void CEditEntryDlg::OnPasswordTextChanged(const QString& txt) |
||||
{ |
||||
Edit_Password_w->setText(""); |
||||
int bits=(Edit_Password->text().length()*8); |
||||
Label_Bits->setText(QString::number(bits)+" Bit"); |
||||
if(bits>128)bits=128; |
||||
Progress_Quali->setProgress(bits,128); |
||||
} |
||||
|
||||
void CEditEntryDlg::OnPasswordwTextChanged(const QString& w) |
||||
{ |
||||
|
||||
if(QString::compare(Edit_Password_w->text(),Edit_Password->text().mid(0,(Edit_Password_w->text().length())))!=0){ |
||||
Edit_Password_w->setPaletteBackgroundColor(QColor(255,125,125)); |
||||
}else |
||||
{ |
||||
Edit_Password_w->setPaletteBackgroundColor(QColor(255,255,255)); ///@FIXME Standart-Hintergrundfarbe nicht weiß
|
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
|
||||
void CEditEntryDlg::OnPasswordwLostFocus() |
||||
{ |
||||
if(QString::compare(Edit_Password_w->text(),Edit_Password->text())!=0){ |
||||
Edit_Password_w->setPaletteBackgroundColor(QColor(255,125,125)); |
||||
} |
||||
else |
||||
{ |
||||
Edit_Password_w->setPaletteBackgroundColor(QColor(255,255,255)); ///@FIXME Standart-Hintergrundfarbe nicht weiß
|
||||
} |
||||
|
||||
|
||||
} |
||||
|
||||
void CEditEntryDlg::OnExpDateLostFocus() |
||||
{ |
||||
QString str=Edit_Expire_Date->text(); |
||||
if(CPwmTime::IsValidDate(str)==false){ |
||||
Edit_Expire_Date->setPaletteBackgroundColor(QColor(255,125,125)); |
||||
} |
||||
else |
||||
{ |
||||
Edit_Expire_Date->setPaletteBackgroundColor(QColor(255,255,255));///@FIXME Standart-Hintergrundfarbe nicht weiß
|
||||
} |
||||
} |
||||
|
||||
void CEditEntryDlg::OnExpTimeLostFocus() |
||||
{ |
||||
QString str=Edit_Expire_Time->text(); |
||||
if(CPwmTime::IsValidTime(str)==false){ |
||||
Edit_Expire_Time->setPaletteBackgroundColor(QColor(255,125,125)); |
||||
} |
||||
else |
||||
{ |
||||
Edit_Expire_Time->setPaletteBackgroundColor(QColor(255,255,255));///@FIXME Standart-Hintergrundfarbe nicht weiß
|
||||
} |
||||
} |
||||
|
||||
void CEditEntryDlg::OnNewAttachment() |
||||
{ |
||||
QString filename=QFileDialog::getOpenFileName(QDir::homeDirPath(),"",this,QString::fromUtf8("Anhang hinzufügen...")); |
||||
if(filename=="")return; |
||||
QFile file(filename); |
||||
if(file.open(IO_ReadOnly)==false){ |
||||
file.close(); |
||||
QMessageBox::warning(NULL,trUtf8("Fehler"),trUtf8("Datei konnte nicht geöffnet werden."),"OK"); |
||||
return; |
||||
} |
||||
ModFlag=true; |
||||
if(entry->pBinaryData)delete [] entry->pBinaryData; |
||||
entry->pBinaryData = new UINT8 [file.size()]; |
||||
|
||||
if(entry->pBinaryData==NULL){ |
||||
file.close(); |
||||
QMessageBox::critical(NULL,"Fehler",QString::fromUtf8("Es ist nicht genügend Arbeitsspeicher für diesen Vorgang vorhanden."),"OK"); |
||||
return; |
||||
} |
||||
entry->BinaryDataLength=file.size(); |
||||
file.readBlock((char*)entry->pBinaryData,file.size()); |
||||
file.close(); |
||||
QFileInfo info(filename); |
||||
entry->BinaryDesc=info.fileName(); |
||||
file.close(); |
||||
Edit_Attachment->setText(entry->BinaryDesc); |
||||
QString unit; |
||||
int faktor; |
||||
int prec; |
||||
if(entry->BinaryDataLength<1000){unit=" Byte";faktor=1;prec=0;} |
||||
else {if(entry->BinaryDataLength<1000000){unit=" kB";faktor=1000;prec=1;} |
||||
else{unit=" MB";faktor=1000000;prec=1;} |
||||
} |
||||
Label_AttachmentSize->setText(QString::number((float)entry->BinaryDataLength/(float)faktor,'f',prec)+unit); |
||||
ButtonOpenAttachment->setEnabled(true); |
||||
ButtonSaveAttachment->setEnabled(true); |
||||
ButtonDeleteAttachment->setEnabled(true); |
||||
} |
||||
|
||||
void CEditEntryDlg::OnSaveAttachment() |
||||
{ |
||||
QString filename=QFileDialog::getSaveFileName(QDir::homeDirPath(),"",this,trUtf8("Anhang speichern...")); |
||||
if(filename=="")return; |
||||
QFile file(filename); |
||||
if(file.exists()){ |
||||
int r=QMessageBox::warning(this,QString::fromUtf8("Vorhandene Datei überschreiben?"),QString::fromUtf8("Unter dem gewählten Dateinamen existiert bereits eine Datei.\nSoll sie überschrieben werden?"),"Ja","Nein",NULL,1,1); |
||||
if(r==1)return; |
||||
if(file.remove()==false){ |
||||
QMessageBox::critical(NULL,"Fehler",QString::fromUtf8("Datei konnte nicht überschrieben werden."),"OK"); |
||||
return;} |
||||
} |
||||
if(file.open(IO_WriteOnly)==false){ |
||||
QMessageBox::critical(NULL,"Fehler",QString::fromUtf8("Datei konnte nicht erstellt werden."),"OK"); |
||||
return; |
||||
} |
||||
|
||||
int r=file.writeBlock((char*)entry->pBinaryData,entry->BinaryDataLength); |
||||
if(r==-1){ |
||||
file.close(); |
||||
QMessageBox::critical(NULL,"Fehler",QString::fromUtf8("Beim schreiben in der Datei ist ein Fehler aufgetreten."),"OK"); |
||||
return; |
||||
} |
||||
if(r!=entry->BinaryDataLength){ |
||||
file.close(); |
||||
QMessageBox::critical(NULL,"Fehler",QString::fromUtf8("Die Datei konnte nicht vollständig geschrieben werden."),"OK"); |
||||
return; |
||||
} |
||||
file.close(); |
||||
} |
||||
|
||||
void CEditEntryDlg::OnDeleteAttachment() |
||||
{ |
||||
int r=QMessageBox::warning(this,trUtf8("Anhang löschen?"),trUtf8("Sie sind dabei den Anhang zu löschen.\nSind Sie sicher, dass Sie dies tun wollen?"),trUtf8("Ja"),trUtf8("Nein"),NULL,1,1); |
||||
if(r==0){ |
||||
ModFlag=true; |
||||
delete[]entry->pBinaryData; |
||||
entry->pBinaryData=NULL; |
||||
entry->BinaryDataLength=0; |
||||
entry->BinaryDesc=""; |
||||
Edit_Attachment->setText(""); |
||||
Label_AttachmentSize->setText(""); |
||||
ButtonOpenAttachment->setEnabled(true); |
||||
ButtonSaveAttachment->setDisabled(true); |
||||
ButtonDeleteAttachment->setDisabled(true); |
||||
} |
||||
} |
||||
|
||||
void CEditEntryDlg::OnButtonGenPw() |
||||
{ |
||||
CGenPwDialog* pDlg=new CGenPwDialog(this,0,true); |
||||
pDlg->show(); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*$SPECIALIZATION$*/ |
||||
|
||||
|
||||
//#include "editentrydlg.moc"
|
||||
|
@ -0,0 +1,74 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "mainwindow.h" |
||||
#ifndef EDITENTRYDLG_H |
||||
#define EDITENTRYDLG_H |
||||
#include "ui_EditEntryDlg.h" |
||||
|
||||
class CEditEntryDlg : public EditEntryDialog |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
CEditEntryDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); |
||||
~CEditEntryDlg(); |
||||
virtual void showEvent(QShowEvent *); |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
|
||||
public slots: |
||||
virtual void OnButtonOK(); |
||||
/*$PUBLIC_SLOTS$*/ |
||||
|
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
|
||||
public: |
||||
CMainWindow* mainwnd; |
||||
CEntry* entry; |
||||
PwDatabase* pw; |
||||
QPixmap* banner_pixmap; |
||||
bool ModFlag; |
||||
|
||||
|
||||
void CreateBanner(); |
||||
void InitGroupComboBox(); |
||||
void InitIconComboBox(); |
||||
|
||||
|
||||
public slots: |
||||
virtual void OnExpTimeLostFocus(); |
||||
virtual void OnExpDateLostFocus(); |
||||
virtual void OnPasswordwLostFocus(); |
||||
virtual void OnPasswordwTextChanged(const QString&); |
||||
virtual void OnPasswordTextChanged(const QString&); |
||||
virtual void ChangeEchoMode(); |
||||
virtual void OnButtonCancel(); |
||||
virtual void OnNewAttachment(); |
||||
virtual void OnDeleteAttachment(); |
||||
virtual void OnSaveAttachment(); |
||||
virtual void OnButtonGenPw(); |
||||
|
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,68 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include "mainwindow.h" |
||||
|
||||
#include <qcombobox.h> |
||||
#include <qlineedit.h> |
||||
#include "EditGroupDlg.h" |
||||
|
||||
|
||||
CEditGroupDialog::CEditGroupDialog(QWidget* parent, const char* name, bool modal, WFlags fl) |
||||
: EditGroupDialog(parent,name, modal,fl) |
||||
{ |
||||
IconID=0; |
||||
} |
||||
|
||||
CEditGroupDialog::~CEditGroupDialog() |
||||
{ |
||||
} |
||||
|
||||
void CEditGroupDialog::showEvent(QShowEvent *event){ |
||||
if(event->spontaneous()==false){ |
||||
EditTitle->setText(GroupName); |
||||
for(int i=0;i<52;i++){ |
||||
ComboIconPicker->insertItem(((CMainWindow*)parentWidget())->EntryIcons[i],"",i); |
||||
} |
||||
ComboIconPicker->setCurrentItem(IconID); |
||||
}} |
||||
|
||||
void CEditGroupDialog::OnOK() |
||||
{ |
||||
GroupName=EditTitle->text(); |
||||
IconID=ComboIconPicker->currentItem(); |
||||
OK=true; |
||||
close(); |
||||
} |
||||
|
||||
void CEditGroupDialog::OnCancel() |
||||
{ |
||||
OK=false; |
||||
close(); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
/*$SPECIALIZATION$*/ |
||||
|
||||
|
||||
//#include "editgroupdlg.moc"
|
||||
|
@ -0,0 +1,55 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#ifndef EDITGROUPDLG_H |
||||
#define EDITGROUPDLG_H |
||||
|
||||
#include "ui_EditGroupDlg.h" |
||||
#include <qstring.h> |
||||
|
||||
class CEditGroupDialog : public EditGroupDialog |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
CEditGroupDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
||||
~CEditGroupDialog(); |
||||
virtual void showEvent(QShowEvent *event); |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
|
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
|
||||
public: |
||||
int IconID; |
||||
QString GroupName; |
||||
bool OK; |
||||
|
||||
|
||||
public slots: |
||||
virtual void OnOK(); |
||||
virtual void OnCancel(); |
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,149 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "mainwindow.h" |
||||
#include "LanguageDlg.h" |
||||
#include <qtranslator.h> |
||||
#include <qdir.h> |
||||
#include <qstringlist.h> |
||||
#include <qlistview.h> |
||||
#include <qmessagebox.h> |
||||
#include <iostream.h> |
||||
|
||||
const char* infostrings[]={ |
||||
QT_TRANSLATE_NOOP("_INFO","$TRANSL_AUTHOR"), |
||||
QT_TRANSLATE_NOOP("_INFO","$TRANSL_AUTHOR_CONTACT"), |
||||
QT_TRANSLATE_NOOP("_INFO","$TRANSL_LANGUAGE"), |
||||
QT_TRANSLATE_NOOP("_INFO","$TRANSL_VERSION")}; |
||||
const char* msg[]={QT_TRANSLATE_NOOP("_MSG","Die Änderung der Sprache wird erst nach einem Neustart von Keepass wirksam."), |
||||
QT_TRANSLATE_NOOP("_MSG","OK"), |
||||
QT_TRANSLATE_NOOP("_MSG","Hinweis")}; |
||||
|
||||
CLanguageDlg::CLanguageDlg(QWidget* parent, const char* name, WFlags fl) |
||||
: LanguageDlg(parent,name,fl) |
||||
{ |
||||
parentwnd=((CMainWindow*)parentWidget()); |
||||
parentwnd->CreateBanner(Banner,parentwnd->Icon_I18n32x32,trUtf8("Spracheinstellungen")); |
||||
|
||||
QListViewItem* item; |
||||
QString& config_lang=parentwnd->config.Language; |
||||
QStringList files; |
||||
|
||||
QString langdir=parentwnd->appdir+"/../share/keepass/i18n/"; |
||||
QDir dir(langdir); |
||||
if(dir.exists()){ |
||||
files=dir.entryList("*.qm",QDir::Files); |
||||
} |
||||
|
||||
List->insertItem(item=new QListViewItem(List,"","Deutsch","-","-")); |
||||
if(config_lang=="_DEUTSCH_")item->setPixmap(0,*parentwnd->Icon_Ok16x16); |
||||
pItems.push_back(item); |
||||
filenames.push_back("_DEUTSCH_"); |
||||
|
||||
|
||||
for(int i=0;i<files.count();i++){ |
||||
QTranslator translator; |
||||
if(!translator.load(langdir+files[i])){ |
||||
QMessageBox::warning(this,tr("Warnung"),tr("Die Datei '%1' konnte nicht geladen werden.").arg(files[i]),tr("OK"),0,0,2,1); |
||||
continue;} |
||||
List->insertItem(item=new QListViewItem(List,"",translator.findMessage("_INFO","$TRANSL_LANGUAGE").translation() |
||||
,translator.findMessage("_INFO","$TRANSL_VERSION").translation() |
||||
,translator.findMessage("_INFO","$TRANSL_AUTHOR").translation())); |
||||
if(config_lang==files[i])item->setPixmap(0,*parentwnd->Icon_Ok16x16); |
||||
pItems.push_back(item); |
||||
filenames.push_back(files[i]); |
||||
} |
||||
} |
||||
|
||||
CLanguageDlg::~CLanguageDlg() |
||||
{ |
||||
} |
||||
|
||||
void CLanguageDlg::showEvent(QShowEvent *event){ |
||||
if(event->spontaneous()==false){ |
||||
List->setColumnWidth(0,20); |
||||
int width=(List->width()-4-20)/3; |
||||
List->setColumnWidth(1,width); |
||||
List->setColumnWidth(2,width); |
||||
List->setColumnWidth(3,width); |
||||
} |
||||
} |
||||
|
||||
void CLanguageDlg::OnItemRightClick(QListViewItem* item) |
||||
{ |
||||
//CTX-MENU
|
||||
|
||||
} |
||||
|
||||
void CLanguageDlg::OnItemDoubleClicked(QListViewItem* item) // == Slot für Button "wählen"
|
||||
{ |
||||
int i; |
||||
QString langdir=parentwnd->appdir+"/../share/keepass/i18n/"; |
||||
|
||||
for(i=0;i<pItems.size();i++){ |
||||
if(item==pItems[i])break; |
||||
if(i==pItems.size()-1){ |
||||
cout << QString("unexpected error in %1, line %2").arg(__FILE__).arg(__LINE__) << endl; |
||||
exit(-1);} |
||||
} |
||||
if(filenames[i]!="_DEUTSCH_"){ |
||||
QTranslator translator; |
||||
if(!translator.load(langdir+filenames[i])){ |
||||
QMessageBox::warning(this,tr("Warnung"),tr("Die Datei '%1' konnte nicht geladen werden.").arg(filenames[i]),tr("OK"),0,0,2,1); |
||||
return; |
||||
} |
||||
QMessageBox::information(this,translator.findMessage("_MSG",msg[2]).translation() |
||||
,translator.findMessage("_MSG",msg[0]).translation() |
||||
,translator.findMessage("_MSG",msg[1]).translation() |
||||
,0,0,2,1); |
||||
} |
||||
else QMessageBox::information(this,QString::fromUtf8(msg[2]),QString::fromUtf8(msg[0]),QString::fromUtf8(msg[1]),0,0,2,1); |
||||
parentwnd->config.Language=filenames[i]; |
||||
|
||||
for(int j=0;j<pItems.size();j++){ |
||||
if(j==i)pItems[j]->setPixmap(0,*parentwnd->Icon_Ok16x16); |
||||
else pItems[j]->setPixmap(0,0);} |
||||
|
||||
List->setColumnWidth(0,20); |
||||
int width=(List->width()-4-20)/3; |
||||
List->setColumnWidth(1,width); |
||||
List->setColumnWidth(2,width); |
||||
List->setColumnWidth(3,width); |
||||
|
||||
} |
||||
|
||||
void CLanguageDlg::OnApplyButtonClicked() |
||||
{ |
||||
QListViewItem* item=List->selectedItem(); |
||||
if(item)OnItemDoubleClicked(item); |
||||
else QMessageBox::information(this,tr("Hinweis"),trUtf8("Es ist keine Übersetzung aufsgewählt."),tr("OK"),0,0,2,1); |
||||
} |
||||
|
||||
void CLanguageDlg::OnButtonCloseClicked() |
||||
{ |
||||
done(0); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*$SPECIALIZATION$*/ |
||||
|
||||
|
@ -0,0 +1,59 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "mainwindow.h" |
||||
#ifndef _LANGUAGEDLG_H_ |
||||
#define _LANGUAGEDLG_H_ |
||||
#include "ui_LanguageDlg.h" |
||||
#include <qpixmap.h> |
||||
|
||||
|
||||
|
||||
class CLanguageDlg : public LanguageDlg |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
CLanguageDlg(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
||||
~CLanguageDlg(); |
||||
CMainWindow* parentwnd; |
||||
vector<QString> filenames; |
||||
vector<QListViewItem*> pItems; |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
|
||||
public slots: |
||||
/*$PUBLIC_SLOTS$*/ |
||||
|
||||
|
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
virtual void showEvent(QShowEvent *e); |
||||
virtual void OnItemDoubleClicked(QListViewItem* item); |
||||
virtual void OnItemRightClick(QListViewItem* item); |
||||
virtual void OnButtonCloseClicked(); |
||||
virtual void OnApplyButtonClicked(); |
||||
|
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,206 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include "mainwindow.h" |
||||
|
||||
#include "PasswordDlg.h" |
||||
#include <qdir.h> |
||||
#include <qstringlist.h> |
||||
#include <qcheckbox.h> |
||||
#include <qvaluelist.h> |
||||
#include <qlineedit.h> |
||||
#include <qcombobox.h> |
||||
#include <qpushbutton.h> |
||||
#include <qfiledialog.h> |
||||
#include <qmessagebox.h> |
||||
|
||||
|
||||
|
||||
CPasswordDialog::CPasswordDialog(QWidget* parent, const char* name, bool modal, WFlags fl) |
||||
: PasswordDlg(parent,name, modal,fl) |
||||
{ |
||||
parentwnd=((CMainWindow*)parentWidget()); |
||||
parentwnd->CreateBanner(Banner,parentwnd->Icon_Key32x32,trUtf8("Datenbank öffnen")); |
||||
Label_select=new LinkLabel((QWidget*)groupframe,"Select",trUtf8("Datei manuell wählen..."),410,100); |
||||
connect(Label_select,SIGNAL(clicked()),this,SLOT(OnSelectClicked())); |
||||
///@PlatformSpecific
|
||||
QDir media("/media"); |
||||
if(media.exists()){ |
||||
Paths=media.entryList("*",QDir::Dirs); |
||||
Paths.erase(Paths.begin()); // delete "."
|
||||
Paths.erase(Paths.begin()); // delete ".."
|
||||
|
||||
for(int i=0;i<Paths.count();i++){ |
||||
Paths[i]="/media/"+Paths[i]; |
||||
} |
||||
Paths.prepend(trUtf8("< keiner >")); |
||||
} |
||||
for(int i=0;i<Paths.count();i++){ |
||||
Combo_Dirs->insertItem(0,Paths[i]); |
||||
IsFile.append(false); |
||||
} |
||||
|
||||
if(!parentwnd->config.ShowPasswords)ChangeEchoMode(); |
||||
|
||||
} |
||||
|
||||
CPasswordDialog::~CPasswordDialog() |
||||
{ |
||||
delete Label_select; |
||||
} |
||||
|
||||
void CPasswordDialog::OnComboSelectionChanged(int i) |
||||
{ |
||||
if(i==0){ |
||||
keyfile=""; |
||||
Edit_Password->setEnabled(true); |
||||
return; |
||||
} |
||||
QFile file; |
||||
if(IsFile[i]==true)file.setName(Paths[i]); |
||||
else file.setName(Paths[i]+"/pwsafe.key"); |
||||
|
||||
if(file.exists()){ |
||||
keyfile=file.name(); |
||||
if(!CheckBox_Both->isChecked()){ |
||||
Edit_Password->setText(""); |
||||
Edit_Password->setDisabled(true);} |
||||
return; |
||||
} |
||||
QMessageBox::warning(this,"Datei nicht gefunden",QString::fromUtf8("Im gewählten Verzeichnis konnte keine Schlüsseldatei gefunden werden.\nStellen Sie sicher, dass der Schlüssel-Datenträger ordnungsgemäß eingehängt (mounted) ist.\nSollte die Schlüsseldatei nicht den Dateinamen 'pwsafe.key' haben, nutzen Sie bitte die manuelle Dateiauswahl."),"OK","","",0,0); |
||||
Edit_Password->setEnabled(true); |
||||
Combo_Dirs->setCurrentItem(0); |
||||
|
||||
return; |
||||
} |
||||
|
||||
|
||||
void CPasswordDialog::OnButtonBrowse() |
||||
{ |
||||
///@PlatformSpecific
|
||||
QString dir=QFileDialog::getExistingDirectory(QDir::homeDirPath(),NULL,QString::fromUtf8("Verzeichnis wählen")); |
||||
if(dir=="")return; |
||||
|
||||
QFile file(dir+"/pwsafe.key"); |
||||
if(file.exists()){ |
||||
keyfile=dir+"/pwsafe.key"; |
||||
Combo_Dirs->insertItem(dir); |
||||
Combo_Dirs->setCurrentItem(Combo_Dirs->count()-1); |
||||
if(!CheckBox_Both->isChecked()){ |
||||
Edit_Password->setDisabled(true); |
||||
Edit_Password->setText(""); |
||||
password=""; |
||||
} |
||||
Paths.append(dir); |
||||
IsFile.append(false); |
||||
return;} |
||||
QMessageBox::warning(this,"Datei nicht gefunden",QString::fromUtf8("Im gewählten Verzeichnis konnte keine Schlüsseldatei gefunden werden.\nStellen Sie sicher, dass der Schlüssel-Datenträger ordnungsgemäß eingehängt (mounted) ist.\nSollte die Schlüsseldatei nicht den Dateinamen 'pwsafe.key' haben, nutzen Sie bitte die manuelle Dateiauswahl."),"OK","","",0,0); |
||||
} |
||||
|
||||
void CPasswordDialog::OnSelectClicked() |
||||
{ |
||||
if(Button_Browse->isEnabled()){ |
||||
keyfile=QFileDialog::getOpenFileName(QDir::homeDirPath(),"",this,QString::fromUtf8("Schlüsseldatei öffnen")); |
||||
if(keyfile=="")return; |
||||
Combo_Dirs->insertItem(keyfile); |
||||
Combo_Dirs->setCurrentItem(Combo_Dirs->count()-1); |
||||
if(!CheckBox_Both->isChecked()){ |
||||
Edit_Password->setDisabled(true); |
||||
Edit_Password->setText(""); |
||||
password=""; |
||||
} |
||||
Paths.append(keyfile); |
||||
IsFile.append(true); |
||||
} |
||||
} |
||||
|
||||
void CPasswordDialog::OnCancel() |
||||
{ |
||||
canceled=true; |
||||
close(); |
||||
} |
||||
|
||||
void CPasswordDialog::OnOK() |
||||
{ |
||||
canceled=false; |
||||
|
||||
if(CheckBox_Both->isChecked()){ |
||||
if(password==""){QMessageBox::warning(this,trUtf8("Fehler"),trUtf8("Bitte geben Sie ein Passwort ein.") |
||||
,trUtf8("OK"),"","",0,0); |
||||
return;} |
||||
if(keyfile==""){QMessageBox::warning(this,trUtf8("Fehler"),trUtf8("Bitte wählen Sie eine Schlüsseldatei.") |
||||
,trUtf8("OK"),"","",0,0); |
||||
return;} |
||||
} |
||||
else |
||||
{ |
||||
if(password=="" && keyfile==""){QMessageBox::warning(this,trUtf8("Fehler"),trUtf8("Geben Sie bitte ein Passwort ein oder wählen Sie eine Schlüsseldatei.") |
||||
,trUtf8("OK"),"","",0,0); |
||||
return;} |
||||
} |
||||
close(); |
||||
} |
||||
|
||||
void CPasswordDialog::OnPasswordChanged(const QString &txt) |
||||
{ |
||||
password=Edit_Password->text(); |
||||
if(txt!="" && !(CheckBox_Both->isChecked())){ |
||||
Combo_Dirs->setDisabled(true); |
||||
Button_Browse->setDisabled(true);} |
||||
else{ |
||||
Combo_Dirs->setEnabled(true); |
||||
Button_Browse->setEnabled(true);} |
||||
|
||||
} |
||||
|
||||
void CPasswordDialog::OnCheckBox_BothChanged(int state) |
||||
{ |
||||
if(state==QButton::On){ |
||||
Combo_Dirs->setEnabled(true); |
||||
Button_Browse->setEnabled(true); |
||||
Edit_Password->setEnabled(true);} |
||||
else{ |
||||
Edit_Password->setText(""); |
||||
} |
||||
} |
||||
|
||||
void CPasswordDialog::ChangeEchoMode() |
||||
{ |
||||
|
||||
if(Edit_Password->echoMode()==QLineEdit::Normal){ |
||||
Edit_Password->setEchoMode(QLineEdit::Password); |
||||
} |
||||
else |
||||
{ |
||||
Edit_Password->setEchoMode(QLineEdit::Normal); |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*$SPECIALIZATION$*/ |
||||
|
||||
|
||||
//#include "passworddialog.moc"
|
||||
|
@ -0,0 +1,71 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "mainwindow.h" |
||||
#ifndef PASSWORDDIALOG_H |
||||
#define PASSWORDDIALOG_H |
||||
#include "lib/UrlLabel.h" |
||||
#include "ui_PasswordDlg.h" |
||||
|
||||
class CPasswordDialog : public PasswordDlg |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
private: |
||||
CMainWindow* parentwnd; |
||||
int NumComboEntries; |
||||
QStringList Paths; |
||||
QValueList<bool> IsFile; |
||||
LinkLabel* Label_select; |
||||
|
||||
|
||||
public: |
||||
|
||||
QString keyfile; |
||||
QString password; |
||||
bool canceled; |
||||
|
||||
|
||||
public: |
||||
CPasswordDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
||||
~CPasswordDialog(); |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
|
||||
public slots: |
||||
/*$PUBLIC_SLOTS$*/ |
||||
|
||||
virtual void OnOK(); |
||||
virtual void OnCancel(); |
||||
virtual void OnSelectClicked(); |
||||
virtual void OnButtonBrowse(); |
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
|
||||
public slots: |
||||
virtual void OnComboSelectionChanged(int); |
||||
virtual void OnPasswordChanged(const QString &txt); |
||||
virtual void OnCheckBox_BothChanged(int state); |
||||
virtual void ChangeEchoMode(); |
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,236 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include <fstream> |
||||
#include <qspinbox.h> |
||||
#include <qmessagebox.h> |
||||
#include "PasswordGenDlg.h" |
||||
#include <qradiobutton.h> |
||||
#include <qlineedit.h> |
||||
#include <qcheckbox.h> |
||||
#include <qprogressbar.h> |
||||
|
||||
CGenPwDialog::CGenPwDialog(QWidget* parent, const char* name, bool modal, WFlags fl) |
||||
: GenPwDlg(parent,name, modal,fl) |
||||
{ |
||||
mainwnd=(CMainWindow*)(((CEditEntryDlg*)parentWidget())->parentWidget()); |
||||
mainwnd->CreateBanner(Banner,mainwnd->Icon_Key32x32,QString::fromUtf8("Passwort generieren")); |
||||
|
||||
|
||||
|
||||
Radio_1->setChecked(true); |
||||
|
||||
Edit_chars->setDisabled(true); |
||||
} |
||||
|
||||
CGenPwDialog::~CGenPwDialog() |
||||
{ |
||||
} |
||||
|
||||
void CGenPwDialog::OnRadio1StateChanged(int state) |
||||
{ |
||||
switch (state){ |
||||
case QButton::On: |
||||
Radio_2->setChecked(false); |
||||
checkBox1->setEnabled(true); |
||||
checkBox2->setEnabled(true); |
||||
checkBox3->setEnabled(true); |
||||
checkBox4->setEnabled(true); |
||||
checkBox5->setEnabled(true); |
||||
checkBox6->setEnabled(true); |
||||
checkBox7->setEnabled(true); |
||||
checkBox8->setEnabled(true); |
||||
break; |
||||
case QButton::Off: |
||||
if(Radio_2->isChecked()==false)Radio_2->setChecked(true); |
||||
checkBox1->setDisabled(true); |
||||
checkBox2->setDisabled(true); |
||||
checkBox3->setDisabled(true); |
||||
checkBox4->setDisabled(true); |
||||
checkBox5->setDisabled(true); |
||||
checkBox6->setDisabled(true); |
||||
checkBox7->setDisabled(true); |
||||
checkBox8->setDisabled(true); |
||||
|
||||
break; |
||||
case QButton::NoChange: |
||||
break; |
||||
} |
||||
|
||||
} |
||||
|
||||
void CGenPwDialog::OnRadio2StateChanged(int state) |
||||
{ |
||||
switch (state){ |
||||
case QButton::On: |
||||
Radio_1->setChecked(false); |
||||
Edit_chars->setEnabled(true); |
||||
break; |
||||
case QButton::Off: |
||||
if(Radio_1->isChecked()==false)Radio_1->setChecked(true); |
||||
Edit_chars->setDisabled(true); |
||||
break; |
||||
case QButton::NoChange: |
||||
break; |
||||
} |
||||
|
||||
} |
||||
|
||||
void CGenPwDialog::OnGeneratePw() |
||||
{ |
||||
/*
|
||||
Großbuchstaben 65...90 |
||||
Kleinbuchstaben 97...122 |
||||
Zahlen 48...57 |
||||
Sonderzeichen 33...47;58...64;91...96;123...126 |
||||
Minus 45 |
||||
Unterstrich 95 |
||||
ANSI >127 |
||||
*/ |
||||
|
||||
int num=0; |
||||
char assoctable[255]; |
||||
|
||||
if(Radio_1->isChecked()){ |
||||
if(checkBox1->isChecked()){ |
||||
num+=AddToAssoctable(assoctable,65,90,num); |
||||
} |
||||
|
||||
if(checkBox2->isChecked()){ |
||||
num+=AddToAssoctable(assoctable,97,122,num); |
||||
} |
||||
|
||||
if(checkBox3->isChecked()){ |
||||
num+=AddToAssoctable(assoctable,48,57,num); |
||||
} |
||||
|
||||
if(checkBox4->isChecked()){ |
||||
num+=AddToAssoctable(assoctable,33,47,num); |
||||
num+=AddToAssoctable(assoctable,58,64,num); |
||||
num+=AddToAssoctable(assoctable,91,96,num); |
||||
num+=AddToAssoctable(assoctable,123,126,num); |
||||
} |
||||
|
||||
if(checkBox5->isChecked()){ |
||||
num+=AddToAssoctable(assoctable,32,32,num); |
||||
} |
||||
|
||||
|
||||
if(checkBox6->isChecked() && !checkBox4->isChecked()){ |
||||
num+=AddToAssoctable(assoctable,45,45,num); |
||||
} |
||||
|
||||
if(checkBox7->isChecked() && !checkBox4->isChecked()){ |
||||
num+=AddToAssoctable(assoctable,95,95,num); |
||||
} |
||||
|
||||
if(checkBox8->isChecked()){ |
||||
num+=AddToAssoctable(assoctable,128,255,num); |
||||
} |
||||
}else |
||||
{ |
||||
QString str=Edit_chars->text(); |
||||
int i=0; |
||||
while(str.length()>0){ |
||||
assoctable[i]=(char)((QChar)str[0]); |
||||
str.remove(str[0]); |
||||
i++; |
||||
num++; |
||||
} |
||||
} |
||||
if(num==0){ |
||||
if(Radio_2->isChecked())QMessageBox::information(this,"Hinweis",QString::fromUtf8("Es wird mindestens ein Zeichen benötigt"),"OK"); |
||||
else QMessageBox::information(this,"Hinweis",QString::fromUtf8("Es muss mindestens ein Gruppe von Zeichen gewählt werden"),"OK"); |
||||
return; |
||||
} |
||||
int length=Spin_Num->value(); |
||||
char* buffer=new char[length+1]; |
||||
buffer[length]=0; |
||||
FILE *dev_random; |
||||
if(Check_strongrandom->isChecked()){ |
||||
dev_random = fopen("/dev/random","r");} |
||||
else |
||||
{dev_random = fopen("/dev/urandom","r");} |
||||
|
||||
if (dev_random==NULL){ |
||||
QMessageBox::critical(this,"Fehler",QString::fromUtf8("'/dev/random' bzw. '/dev/urandom' konnte nicht zum lesen geöffnet werden."),"OK"); |
||||
return; |
||||
} |
||||
unsigned char tmp; |
||||
|
||||
for(int i=0;i<length;i++){ |
||||
|
||||
do{ |
||||
fread(&tmp,1,1,dev_random); |
||||
}while(trim(tmp,num)==false); |
||||
|
||||
buffer[i]=assoctable[tmp]; |
||||
} |
||||
|
||||
Edit_dest->setText(buffer); |
||||
delete [] buffer; |
||||
fclose(dev_random); |
||||
|
||||
int bits; |
||||
if(checkBox8->isChecked())bits=length*8; |
||||
else bits=length*7; |
||||
Label_Bits->setText(QString::number(bits)+" Bit"); |
||||
if(bits>128)bits=128; |
||||
Progress_Quali->setProgress(bits,128); |
||||
Progress_Quali->setPercentageVisible(false); |
||||
} |
||||
|
||||
int CGenPwDialog::AddToAssoctable(char* table,int start,int end,int pos){ |
||||
for(int i=start;i<=end;i++){ |
||||
table[pos]=i; |
||||
pos++; |
||||
} |
||||
return (end-start)+1; |
||||
} |
||||
|
||||
|
||||
bool CGenPwDialog::trim(unsigned char &x, int r){ |
||||
if(x<r)return true; |
||||
if(256%r!=0)return false; |
||||
x=x-(x/r)*r; |
||||
return true; |
||||
} |
||||
|
||||
void CGenPwDialog::OnAccept() |
||||
{ |
||||
((CEditEntryDlg*)parentWidget())->Edit_Password->setText(Edit_dest->text()); |
||||
((CEditEntryDlg*)parentWidget())->Edit_Password_w->setText(Edit_dest->text()); |
||||
((CEditEntryDlg*)parentWidget())->ModFlag=true; |
||||
close(); |
||||
} |
||||
|
||||
void CGenPwDialog::OnCancel() |
||||
{ |
||||
close(); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
/*$SPECIALIZATION$*/ |
||||
|
||||
|
||||
//#include "genpwdialog.moc"
|
||||
|
@ -0,0 +1,60 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "mainwindow.h" |
||||
#ifndef GENPWDIALOG_H |
||||
#define GENPWDIALOG_H |
||||
#include "ui_PasswordGenDlg.h" |
||||
#include "EditEntryDlg.h" |
||||
|
||||
|
||||
|
||||
class CGenPwDialog : public GenPwDlg |
||||
{ |
||||
Q_OBJECT |
||||
private: |
||||
int AddToAssoctable(char* table,int start,int end,int pos); |
||||
bool trim(unsigned char &value,int range); |
||||
public: |
||||
CGenPwDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
||||
~CGenPwDialog(); |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
|
||||
public slots: |
||||
/*$PUBLIC_SLOTS$*/ |
||||
|
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
public: |
||||
CMainWindow* mainwnd; |
||||
public slots: |
||||
virtual void OnGeneratePw(); |
||||
public slots: |
||||
virtual void OnRadio2StateChanged(int); |
||||
public slots: |
||||
virtual void OnRadio1StateChanged(int); |
||||
virtual void OnCancel(); |
||||
virtual void OnAccept(); |
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,97 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include "PwManager.h" |
||||
#include "SearchDlg.h" |
||||
#include <qlineedit.h> |
||||
#include <qcheckbox.h> |
||||
#include <qregexp.h> |
||||
#include <qmessagebox.h> |
||||
|
||||
CSearchDlg::CSearchDlg(CGroup* pGroup,QWidget* parent, const char* name, bool modal, WFlags fl) |
||||
: Search_Dlg(parent,name, modal,fl) |
||||
{ |
||||
parentwnd=(CMainWindow*)parent; |
||||
parentwnd->CreateBanner(Banner,parentwnd->Icon_Search32x32,tr("Suchen")); |
||||
group=pGroup; |
||||
pw=parentwnd->db; |
||||
|
||||
checkBox_Cs->setChecked(parentwnd->config.SearchOptions[0]); |
||||
checkBox_regExp->setChecked(parentwnd->config.SearchOptions[1]); |
||||
checkBox_Title->setChecked(parentwnd->config.SearchOptions[2]); |
||||
checkBox_Username->setChecked(parentwnd->config.SearchOptions[3]); |
||||
checkBox_Password->setChecked(parentwnd->config.SearchOptions[4]); |
||||
checkBox_Comment->setChecked(parentwnd->config.SearchOptions[5]); |
||||
checkBox_URL->setChecked(parentwnd->config.SearchOptions[6]); |
||||
checkBox_Attachment->setChecked(parentwnd->config.SearchOptions[7]); |
||||
} |
||||
|
||||
CSearchDlg::~CSearchDlg() |
||||
{ |
||||
parentwnd->config.SearchOptions[0]=checkBox_Cs->isChecked(); |
||||
parentwnd->config.SearchOptions[1]=checkBox_regExp->isChecked(); |
||||
parentwnd->config.SearchOptions[2]=checkBox_Title->isChecked(); |
||||
parentwnd->config.SearchOptions[3]=checkBox_Username->isChecked(); |
||||
parentwnd->config.SearchOptions[4]=checkBox_Password->isChecked(); |
||||
parentwnd->config.SearchOptions[5]=checkBox_Comment->isChecked(); |
||||
parentwnd->config.SearchOptions[6]=checkBox_URL->isChecked(); |
||||
parentwnd->config.SearchOptions[7]=checkBox_Attachment->isChecked(); |
||||
} |
||||
|
||||
void CSearchDlg::OnButtonClose() |
||||
{ |
||||
done(0); |
||||
} |
||||
|
||||
|
||||
void CSearchDlg::OnButtonSearch() |
||||
{ |
||||
txt=Edit_Search->text(); |
||||
regexp=checkBox_regExp->isChecked(); |
||||
if(txt==""){ |
||||
QMessageBox::information(this,trUtf8("Hinweis"),trUtf8("Bitte geben Sie einen Suchbegriff ein."),"OK",0,0); |
||||
return;} |
||||
|
||||
for(int i=0;i<pw->Entries.size();i++){ |
||||
if(group){if(pw->Entries[i].GroupID != group->ID)continue;} |
||||
bool hit=false; |
||||
if(checkBox_Title->isChecked()) hit=hit||search(pw->Entries[i].Title); |
||||
if(checkBox_Username->isChecked()) hit=hit||search(pw->Entries[i].UserName); |
||||
if(checkBox_URL->isChecked()) hit=hit||search(pw->Entries[i].URL); |
||||
if(checkBox_Comment->isChecked()) hit=hit||search(pw->Entries[i].Additional); |
||||
if(checkBox_Attachment->isChecked()) hit=hit||search(pw->Entries[i].BinaryDesc); |
||||
if(checkBox_Password->isChecked()) hit=hit||search(pw->Entries[i].Password.getString()); |
||||
pw->Entries[i].Password.delRef(); |
||||
if(hit)hits.push_back(&pw->Entries[i]); |
||||
} |
||||
done(1); |
||||
} |
||||
bool CSearchDlg::search(QString& str){ |
||||
if(regexp){ |
||||
QRegExp exp(txt,checkBox_Cs->isChecked()); |
||||
if(str.contains(exp)==0)return false;} |
||||
else{ |
||||
if(str.contains(txt,checkBox_Cs->isChecked())==0)return false;} |
||||
return true; |
||||
} |
||||
|
||||
/*$SPECIALIZATION$*/ |
||||
|
||||
|
@ -0,0 +1,63 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "mainwindow.h" |
||||
#ifndef SEARCHDLG_H |
||||
#define SEARCHDLG_H |
||||
#include "ui_SearchDlg.h" |
||||
|
||||
class CSearchDlg : public Search_Dlg |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
CSearchDlg(CGroup* pGroup=NULL,QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
||||
~CSearchDlg(); |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
|
||||
public slots: |
||||
/*$PUBLIC_SLOTS$*/ |
||||
|
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
|
||||
public slots: |
||||
virtual void OnButtonClose(); |
||||
public slots: |
||||
virtual void OnButtonSearch(); |
||||
|
||||
|
||||
private: |
||||
CMainWindow* parentwnd; |
||||
CGroup* group; |
||||
PwDatabase* pw; |
||||
QString txt; |
||||
bool regexp; |
||||
bool search(QString&); |
||||
|
||||
public:
|
||||
vector<CEntry*> hits; |
||||
|
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,125 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "mainwindow.h" |
||||
#include <qpixmap.h> |
||||
#include <qcheckbox.h> |
||||
#include <qspinbox.h> |
||||
#include <qcolordialog.h> |
||||
#include <qlineedit.h> |
||||
#include "SettingsDlg.h" |
||||
|
||||
|
||||
CSettingsDlg::CSettingsDlg(QWidget* parent, const char* name, bool modal, WFlags fl) |
||||
: SettingsDialog(parent,name, modal,fl) |
||||
{ |
||||
pw=((CMainWindow*)parentWidget())->db; |
||||
mainwnd=((CMainWindow*)parentWidget()); |
||||
mainwnd->CreateBanner(Banner,mainwnd->Icon_Settings32x32,trUtf8("Einstellungen")); |
||||
|
||||
CheckBox_OpenLast->setChecked(mainwnd->config.OpenLast); |
||||
SpinBox_ClipboardTime->setValue(mainwnd->config.ClipboardTimeOut); |
||||
pixmTextColor->setPixmap(*(new QPixmap(pixmTextColor->width(),pixmTextColor->height()))); |
||||
pixmTextColor->pixmap()->fill(mainwnd->config.BannerTextColor); |
||||
|
||||
pixmColor1->setPixmap(*(new QPixmap(pixmColor1->width(),pixmColor1->height()))); |
||||
pixmColor1->pixmap()->fill(mainwnd->config.BannerColor1); |
||||
|
||||
pixmColor2->setPixmap(*(new QPixmap(pixmColor2->width(),pixmColor2->height()))); |
||||
pixmColor2->pixmap()->fill(mainwnd->config.BannerColor2); |
||||
|
||||
color1=mainwnd->config.BannerColor1; |
||||
color2=mainwnd->config.BannerColor2; |
||||
textcolor=mainwnd->config.BannerTextColor; |
||||
|
||||
CheckBox_ShowPasswords->setChecked(mainwnd->config.ShowPasswords); |
||||
Edit_BrowserCmd->setText(mainwnd->config.OpenUrlCommand); |
||||
CheckBox_ExpandGroupTree->setChecked(mainwnd->config.ExpandGroupTree); |
||||
|
||||
} |
||||
|
||||
CSettingsDlg::~CSettingsDlg() |
||||
{ |
||||
} |
||||
|
||||
void CSettingsDlg::OnOK() |
||||
{ |
||||
mainwnd->config.OpenLast=CheckBox_OpenLast->isChecked(); |
||||
mainwnd->config.ClipboardTimeOut=SpinBox_ClipboardTime->value(); |
||||
mainwnd->config.BannerColor1=color1; |
||||
mainwnd->config.BannerColor2=color2; |
||||
mainwnd->config.BannerTextColor=textcolor; |
||||
mainwnd->config.ShowPasswords=CheckBox_ShowPasswords->isChecked(); |
||||
mainwnd->config.OpenUrlCommand=Edit_BrowserCmd->text(); |
||||
mainwnd->config.ExpandGroupTree=CheckBox_ExpandGroupTree->isChecked(); |
||||
close(); |
||||
} |
||||
|
||||
void CSettingsDlg::OnCancel() |
||||
{ |
||||
close(); |
||||
} |
||||
|
||||
void CSettingsDlg::OnTextColor() |
||||
{ |
||||
QColor c=QColorDialog::getColor(textcolor,this); |
||||
if(c.isValid()){ |
||||
textcolor=c; |
||||
QPixmap *px=new QPixmap(pixmTextColor->width(),pixmTextColor->height()); |
||||
px->fill(c); |
||||
pixmTextColor->clear(); |
||||
pixmTextColor->setPixmap(*px); |
||||
mainwnd->CreateBanner(Banner,mainwnd->Icon_Settings32x32,trUtf8("Einstellungen"),color1,color2,textcolor);} |
||||
} |
||||
|
||||
|
||||
void CSettingsDlg::OnColor2() |
||||
{ |
||||
QColor c=QColorDialog::getColor(color2,this); |
||||
if(c.isValid()){ |
||||
color2=c; |
||||
QPixmap *px=new QPixmap(pixmColor2->width(),pixmColor2->height()); |
||||
px->fill(c); |
||||
pixmColor2->clear(); |
||||
pixmColor2->setPixmap(*px); |
||||
mainwnd->CreateBanner(Banner,mainwnd->Icon_Settings32x32,trUtf8("Einstellungen"),color1,color2,textcolor);} |
||||
} |
||||
|
||||
|
||||
void CSettingsDlg::OnColor1() |
||||
{ |
||||
QColor c=QColorDialog::getColor(color1,this); |
||||
if(c.isValid()){ |
||||
color1=c; |
||||
QPixmap *px=new QPixmap(pixmColor1->width(),pixmColor1->height()); |
||||
px->fill(c); |
||||
pixmColor1->clear(); |
||||
pixmColor1->setPixmap(*px); |
||||
mainwnd->CreateBanner(Banner,mainwnd->Icon_Settings32x32,trUtf8("Einstellungen"),color1,color2,textcolor); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
/*$SPECIALIZATION$*/ |
||||
|
||||
|
||||
//#include "settingsdlg.moc"
|
||||
|
@ -0,0 +1,60 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "mainwindow.h" |
||||
#ifndef SETTINGSDLG_H |
||||
#define SETTINGSDLG_H |
||||
|
||||
#include "ui_SettingsDlg.h" |
||||
#include <qcolor.h> |
||||
|
||||
class CSettingsDlg : public SettingsDialog |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
CMainWindow* mainwnd; |
||||
PwDatabase* pw; |
||||
CSettingsDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
||||
~CSettingsDlg(); |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
|
||||
public slots: |
||||
/*$PUBLIC_SLOTS$*/ |
||||
|
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
|
||||
public slots: |
||||
virtual void OnCancel(); |
||||
public slots: |
||||
virtual void OnOK(); |
||||
virtual void OnTextColor(); |
||||
virtual void OnColor2(); |
||||
virtual void OnColor1(); |
||||
|
||||
private: |
||||
QColor color1,color2,textcolor; |
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,58 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
|
||||
#include "SimplePasswordDlg.h" |
||||
#include <qlineedit.h> |
||||
#include <qpushbutton.h> |
||||
|
||||
CSimplePasswordDialog::CSimplePasswordDialog(bool HidePw,QWidget* parent, const char* name, bool modal, WFlags fl) |
||||
: SimplePasswordDialog(parent,name, modal,fl) |
||||
{ |
||||
if(HidePw)Button_HidePassword->toggle(); |
||||
} |
||||
|
||||
CSimplePasswordDialog::~CSimplePasswordDialog() |
||||
{ |
||||
} |
||||
|
||||
void CSimplePasswordDialog::OnCancel() |
||||
{ |
||||
done(0); |
||||
} |
||||
|
||||
|
||||
void CSimplePasswordDialog::OnOK() |
||||
{ |
||||
password=EditPassword->text(); |
||||
done(1); |
||||
} |
||||
|
||||
|
||||
void CSimplePasswordDialog::OnHidePasswordToggled(bool state) |
||||
{ |
||||
if(state)EditPassword->setEchoMode(QLineEdit::Password); |
||||
else EditPassword->setEchoMode(QLineEdit::Normal); |
||||
} |
||||
|
||||
|
||||
/*$SPECIALIZATION$*/ |
||||
|
||||
|
@ -0,0 +1,54 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#ifndef _SIMPLEPASSWORDDIALOG_H |
||||
#define _SIMPLEPASSWORDDIALOG_H |
||||
|
||||
#include "ui_SimplePasswordDlg.h" |
||||
|
||||
class CSimplePasswordDialog : public SimplePasswordDialog |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
CSimplePasswordDialog(bool HidePw,QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
||||
~CSimplePasswordDialog(); |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
|
||||
public slots: |
||||
/*$PUBLIC_SLOTS$*/ |
||||
|
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
public: QString password; |
||||
|
||||
public slots: |
||||
virtual void OnCancel(); |
||||
public slots: |
||||
virtual void OnOK(); |
||||
public slots: |
||||
virtual void OnHidePasswordToggled(bool state); |
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,2 @@ |
||||
Mit QMake 4.x bekommen die vom uic erstellten Header |
||||
automatisch den Präfix ui_* - also vor der Portierung entfernen! |
@ -0,0 +1,196 @@ |
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
||||
<class>AboutDlg</class> |
||||
<widget class="QDialog"> |
||||
<property name="name"> |
||||
<cstring>AboutDlg</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>419</width> |
||||
<height>211</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy> |
||||
<hsizetype>0</hsizetype> |
||||
<vsizetype>0</vsizetype> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>419</width> |
||||
<height>211</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>211</width> |
||||
<height>32767</height> |
||||
</size> |
||||
</property> |
||||
<property name="caption"> |
||||
<string>Über...</string> |
||||
</property> |
||||
<widget class="Line"> |
||||
<property name="name"> |
||||
<cstring>line1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>120</y> |
||||
<width>400</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="frameShape"> |
||||
<enum>HLine</enum> |
||||
</property> |
||||
<property name="frameShadow"> |
||||
<enum>Sunken</enum> |
||||
</property> |
||||
<property name="orientation"> |
||||
<enum>Horizontal</enum> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Label3</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>140</y> |
||||
<width>60</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Homepage:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Banner</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>420</width> |
||||
<height>50</height> |
||||
</rect> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Label4</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>160</y> |
||||
<width>54</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>EMail:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonClose</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>326</x> |
||||
<y>183</y> |
||||
<width>80</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Schlie&ßen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ß</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Label2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>100</y> |
||||
<width>400</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Keepass/L steht unter der General Public License.</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Label1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>80</y> |
||||
<width>240</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Copyright (c) Tarek Saidi 2005</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Label0</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>60</y> |
||||
<width>220</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Keepass/L Version %1</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<images> |
||||
<image name="image0"> |
||||
<data format="XPM.GZ" length="4833">789c8597596f23470e80dfe75718c3b7c182e9eabb11ec834fc9873cbeaf601fc86ec9966df994cfc5fef794483633934d10c836fcb9582cde55fee5dbd2d9de68e9db2f5f9ee7349fb64bed153d2d7deb5e66b38fdffef3efff7ef99aa64b8baf2c5b4abffeebcb57dc5c6a9720499290640b8613e110ff22eb941b07657e7256f90be742e4a7c6a9ed076791c7a1732efbd784d3f817615a71167db0e55c0a17ce95c88f8ced3c7e74d6f306cea29fd159f583b3e8a75367d18f5bce8df0b63389be67e3ccfcd97716fd78e22cfaf1d459edefedcbedbc63e75af4cf85b33edeb8616cfef1b5b39eb7e72cf6c28b7166fb53678df7b5b3fadf388b3d503a8b3d40c6b9eaa35767d9cf37c6a5e53f73d6f3769d55bedf5f2789ac6bfcf2de1fda33ce4cdfbb716eeb6fce1acf1de3c2f2bbe7acf573605cdafe2b67f5efd359f20bb97165febe38b3c453fd2bfa7cd0a67165fea97c9db416ff1de3b1e9d77a6d12567bf8c159ed9d1ab7969fc2b8d378e2ba304579c93769bd719457fd524f2184cae221f51bd250a8fd3c35ae4cfec1b8b6fa06e3c6eaffc859d651f215b2d0c7efdab8327b969d459e9e8d7bfd57c68df587c43be4c1e20b685c1b9f0b17c1e283cfce927f96f911ca40d63fcbce7afebd31eb3a91b3fa37376ead9e64dea5759606a94f546eb23499883d9bc69932bef4acf22cf594725c1f8bfca9b3c8d3aa711e82c82bb73de3817111a4fe2171d67e1a1b97ba8e87ce5a8f12bfb48b2cfae8ceb85206894f9666135bff2e5c45d6fae894a3393a3f5be13aaeb7729eca4ff2d6ce3f5b701ef2b1c95f0aa7715dfb4de657519675d0fc8d8c9ba0f527f12faab234fd8fc695f1ab716dfa3f84ebb2089dec5f779678d381711d74beae398b7f540b3751bfd6e39ab1c9033b6bbd07e326687dcb3c2da8ecf47cfa301e9bbe37e389c94b3c0a2edba0f5f361dc194b3c8b36eed77acf9c453fab7f6d95587e6e8d83c957c25dc9668fdc5fc538b2c6e3a6e754e7adcc836252b6a9d69bccffb2ad535d67e98fb2ab538befaab3e8439947e5b84e82f6ffa17165f1bd7096fcc1ccb8b67a981b375a0f20f92d2775b078493dd54c75aaef0de9dfba75167fea2eb2f683dc5771388d753fbe396b7fca7c6b52ea2c5e57ce621fcbfdd26464f1812767ed8f63e3ced665de34c464fe9e1bb3d5b3f45bc3dca67a7fc9fba7697b46a9bf66cc13cb8fcc8b66c2960f3832b6f3988dad1e2828b799c53371d6f9766b9c5b7f4afe286983f5c3aeb3be177ace6c1ecc9cb51f6a678def8a7169f351fca710f5a93d9db3d64febacf9981aa76a2f5e3b6b7d5d1af7f6df3aebfb67e4acf93f72d6f972675cd83c7d77d67cac3bebfdfce9acf7eb87b3c66b665cdabc5feed9f44bfd51caade59395dbc4fc3f33cecc9f9b9e35bf786fdccfffc459e7ffc059eb7fe2acefcfd459df13dbceda5f4367bddffed8affdf0665c243a6f769c351f6367f51f7ad6fcefcf9dd57e72567fd959e3dd3a6bbc3b677daf34ce6affadb3dadbdb57263a5f46ce7adf8e9dd5dededfbe5e2f9cb5de5b678df7bb71a5fa59f767dccf77cd57d6f7136c185b7e79d359f3159cf53df7e8acf19e19f7f57ee5acef9b0d67f5b733b6fa844b63f38f07ceea9fcc3fca5b9bef58199b3dbce5acefa53567bd6fee8c73d54f95b3fa3b34b6fcc3b3b3f6dba1b3f6afe6a788fb6bad9f1f3f08f19b90b18ddff0f3dafefc2fe4bb284948f1b7f1e2e73fca4ff012af708ad77883b77f2f8f33bc8b9aeff1011ff1099f718e2ff88a6ff88e1ff8196da33fc92fe30aaee21aaee3060e70889bb885dbb88323dc8d7a407df941be8dd2dfa3ec5e94dac7033cc4233cc6133cc5333cc78bffb327c18029669863812556d1ef1a9ba8168080a1850ec608daaf30814bb882296ec035dc486426700b33b8837b78c0213cc2133ce367af3f7a93c01c5e700b5ee10d6fe11d093ee01396610556f104d6601d36a2d77abf0da2f41036610bb6b1841d18c12e7c873dd887033884233886133885b318297d3fc558e114cee1021208d1e01432c8a180122aa8e3c5190f2322c63bb507995aea62bc37698c9f34a14bba822d9ad235ddd02dcde80e87744f0f7fc823d1233de1363d634d737aa1577aa3ebf8047ba70ffaa4655aa1555aa375b37f0c298e6923ca0fb0a1212cd3266dd136edd08876e93bedd13e1dd0211d997e88f6031dd3099d624e67744e17f15f8b40296594cb273ef61632aa5ff34515d5d43032707c19449fd6e993db283b8217ee62fc0630fa31bf1cdf037c493bb1724ef98a162d30e56bcae185467cc3b731dfa0f935f919dff13daef1033ff2133fc77d039e73d41da55ff90d268b8afba17ea27d30a18edff9833f7999577895d7a88421aff31b6fc0e04ff5c6314acc031ef2266cc4c7ce036ff12ca66a10ff75d95eacfd2ccf3b0bfd38e651ac93f7d83b77f84e47d1e6f1222e0bf9c5ef3ff7a3f690766f4ffd0490aa85affffbf5cbef985d44a8</data> |
||||
</image> |
||||
</images> |
||||
<connections> |
||||
<connection> |
||||
<sender>ButtonClose</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>AboutDlg</receiver> |
||||
<slot>OnClose()</slot> |
||||
</connection> |
||||
</connections> |
||||
<slots> |
||||
<slot>OnClose()</slot> |
||||
</slots> |
||||
<layoutdefaults spacing="6" margin="11"/> |
||||
</UI> |
@ -0,0 +1,345 @@ |
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
||||
<class>ChangeKeyDialog</class> |
||||
<widget class="QDialog"> |
||||
<property name="name"> |
||||
<cstring>ChangeKeyDialog</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>560</width> |
||||
<height>270</height> |
||||
</rect> |
||||
</property> |
||||
<property name="caption"> |
||||
<string>Hauptschlüssel ändern</string> |
||||
</property> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Banner</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>560</width> |
||||
<height>50</height> |
||||
</rect> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>56</y> |
||||
<width>450</width> |
||||
<height>16</height> |
||||
</rect> |
||||
</property> |
||||
<property name="frameShape"> |
||||
<enum>NoFrame</enum> |
||||
</property> |
||||
<property name="frameShadow"> |
||||
<enum>Plain</enum> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Geben Sie das Passwort ein und/oder wählen Sie eine Schlüsseldatei.</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonCancel</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>457</x> |
||||
<y>240</y> |
||||
<width>90</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Abb&rechen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+R</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonOK</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>360</x> |
||||
<y>240</y> |
||||
<width>90</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>O&K</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+K</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QGroupBox"> |
||||
<property name="name"> |
||||
<cstring>groupBox1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>80</y> |
||||
<width>540</width> |
||||
<height>150</height> |
||||
</rect> |
||||
</property> |
||||
<property name="title"> |
||||
<string>Schlüssel</string> |
||||
</property> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel3</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>90</y> |
||||
<width>177</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Schlüsseldatei oder Datenträger:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>30</y> |
||||
<width>180</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Passwort:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1_2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>30</x> |
||||
<y>118</y> |
||||
<width>300</width> |
||||
<height>18</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Passwort <b>und</b> Schlüsseldatei verwenden</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QComboBox"> |
||||
<property name="name"> |
||||
<cstring>Combo_Dirs</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>201</x> |
||||
<y>90</y> |
||||
<width>240</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>Button_Browse</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>450</x> |
||||
<y>90</y> |
||||
<width>80</width> |
||||
<height>22</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>W&ählen...</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ä</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>CheckBox_Both</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>120</y> |
||||
<width>16</width> |
||||
<height>16</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string></string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_Password</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>200</x> |
||||
<y>30</y> |
||||
<width>310</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_Password_2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>200</x> |
||||
<y>60</y> |
||||
<width>310</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonChangeEchoMode</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>510</x> |
||||
<y>30</y> |
||||
<width>20</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>...</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1_3</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>60</y> |
||||
<width>180</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Passwortwiederholung:</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
</widget> |
||||
<images> |
||||
<image name="image0"> |
||||
<data format="XPM.GZ" length="4833">789c8597596f23470e80dfe75718c3b7c182e9eabb11ec834fc9873cbeaf601fc86ec9966df994cfc5fef794483633934d10c836fcb9582cde55fee5dbd2d9de68e9db2f5f9ee7349fb64bed153d2d7deb5e66b38fdffef3efff7ef99aa64b8baf2c5b4abffeebcb57dc5c6a9720499290640b8613e110ff22eb941b07657e7256f90be742e4a7c6a9ed076791c7a1732efbd784d3f817615a71167db0e55c0a17ce95c88f8ced3c7e74d6f306cea29fd159f583b3e8a75367d18f5bce8df0b63389be67e3ccfcd97716fd78e22cfaf1d459edefedcbedbc63e75af4cf85b33edeb8616cfef1b5b39eb7e72cf6c28b7166fb53678df7b5b3fadf388b3d503a8b3d40c6b9eaa35767d9cf37c6a5e53f73d6f3769d55bedf5f2789ac6bfcf2de1fda33ce4cdfbb716eeb6fce1acf1de3c2f2bbe7acf573605cdafe2b67f5efd359f20bb97165febe38b3c453fd2bfa7cd0a67165fea97c9db416ff1de3b1e9d77a6d12567bf8c159ed9d1ab7969fc2b8d378e2ba304579c93769bd719457fd524f2184cae221f51bd250a8fd3c35ae4cfec1b8b6fa06e3c6eaffc859d651f215b2d0c7efdab8327b969d459e9e8d7bfd57c68df587c43be4c1e20b685c1b9f0b17c1e283cfce927f96f911ca40d63fcbce7afebd31eb3a91b3fa37376ead9e64dea5759606a94f546eb23499883d9bc69932bef4acf22cf594725c1f8bfca9b3c8d3aa711e82c82bb73de3817111a4fe2171d67e1a1b97ba8e87ce5a8f12bfb48b2cfae8ceb85206894f9666135bff2e5c45d6fae894a3393a3f5be13aaeb7729eca4ff2d6ce3f5b701ef2b1c95f0aa7715dfb4de657519675d0fc8d8c9ba0f527f12faab234fd8fc695f1ab716dfa3f84ebb2089dec5f779678d381711d74beae398b7f540b3751bfd6e39ab1c9033b6bbd07e326687dcb3c2da8ecf47cfa301e9bbe37e389c94b3c0a2edba0f5f361dc194b3c8b36eed77acf9c453fab7f6d95587e6e8d83c957c25dc9668fdc5fc538b2c6e3a6e754e7adcc836252b6a9d69bccffb2ad535d67e98fb2ab538befaab3e8439947e5b84e82f6ffa17165f1bd7096fcc1ccb8b67a981b375a0f20f92d2775b078493dd54c75aaef0de9dfba75167fea2eb2f683dc5771388d753fbe396b7fca7c6b52ea2c5e57ce621fcbfdd26464f1812767ed8f63e3ced665de34c464fe9e1bb3d5b3f45bc3dca67a7fc9fba7697b46a9bf66cc13cb8fcc8b66c2960f3832b6f3988dad1e2828b799c53371d6f9766b9c5b7f4afe286983f5c3aeb3be177ace6c1ecc9cb51f6a678def8a7169f351fca710f5a93d9db3d64febacf9981aa76a2f5e3b6b7d5d1af7f6df3aebfb67e4acf93f72d6f972675cd83c7d77d67cac3bebfdfce9acf7eb87b3c66b665cdabc5feed9f44bfd51caade59395dbc4fc3f33cecc9f9b9e35bf786fdccfffc459e7ffc059eb7fe2acefcfd459df13dbceda5f4367bddffed8affdf0665c243a6f769c351f6367f51f7ad6fcefcf9dd57e72567fd959e3dd3a6bbc3b677daf34ce6affadb3dadbdb57263a5f46ce7adf8e9dd5dededfbe5e2f9cb5de5b678df7bb71a5fa59f767dccf77cd57d6f7136c185b7e79d359f3159cf53df7e8acf19e19f7f57ee5acef9b0d67f5b733b6fa844b63f38f07ceea9fcc3fca5b9bef58199b3dbce5acefa53567bd6fee8c73d54f95b3fa3b34b6fcc3b3b3f6dba1b3f6afe6a788fb6bad9f1f3f08f19b90b18ddff0f3dafefc2fe4bb284948f1b7f1e2e73fca4ff012af708ad77883b77f2f8f33bc8b9aeff1011ff1099f718e2ff88a6ff88e1ff8196da33fc92fe30aaee21aaee3060e70889bb885dbb88323dc8d7a407df941be8dd2dfa3ec5e94dac7033cc4233cc6133cc5333cc78bffb327c18029669863812556d1ef1a9ba8168080a1850ec608daaf30814bb882296ec035dc486426700b33b8837b78c0213cc2133ce367af3f7a93c01c5e700b5ee10d6fe11d093ee01396610556f104d6601d36a2d77abf0da2f41036610bb6b1841d18c12e7c873dd887033884233886133885b318297d3fc558e114cee1021208d1e01432c8a180122aa8e3c5190f2322c63bb507995aea62bc37698c9f34a14bba822d9ad235ddd02dcde80e87744f0f7fc823d1233de1363d634d737aa1577aa3ebf8047ba70ffaa4655aa1555aa375b37f0c298e6923ca0fb0a1212cd3266dd136edd08876e93bedd13e1dd0211d997e88f6031dd3099d624e67744e17f15f8b40296594cb273ef61632aa5ff34515d5d43032707c19449fd6e993db283b8217ee62fc0630fa31bf1cdf037c493bb1724ef98a162d30e56bcae185467cc3b731dfa0f935f919dff13daef1033ff2133fc77d039e73d41da55ff90d268b8afba17ea27d30a18edff9833f7999577895d7a88421aff31b6fc0e04ff5c6314acc031ef2266cc4c7ce036ff12ca66a10ff75d95eacfd2ccf3b0bfd38e651ac93f7d83b77f84e47d1e6f1222e0bf9c5ef3ff7a3f690766f4ffd0490aa85affffbf5cbef985d44a8</data> |
||||
</image> |
||||
</images> |
||||
<connections> |
||||
<connection> |
||||
<sender>ButtonOK</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>ChangeKeyDialog</receiver> |
||||
<slot>OnOK()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonCancel</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>ChangeKeyDialog</receiver> |
||||
<slot>OnCancel()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Button_Browse</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>ChangeKeyDialog</receiver> |
||||
<slot>OnBrowse()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Edit_Password</sender> |
||||
<signal>textChanged(const QString&)</signal> |
||||
<receiver>ChangeKeyDialog</receiver> |
||||
<slot>OnPasswordChanged(const QString&)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Edit_Password_2</sender> |
||||
<signal>textChanged(const QString&)</signal> |
||||
<receiver>ChangeKeyDialog</receiver> |
||||
<slot>OnPassword2Changed(const QString&)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Combo_Dirs</sender> |
||||
<signal>activated(int)</signal> |
||||
<receiver>ChangeKeyDialog</receiver> |
||||
<slot>OnComboChanged(int)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>CheckBox_Both</sender> |
||||
<signal>stateChanged(int)</signal> |
||||
<receiver>ChangeKeyDialog</receiver> |
||||
<slot>OnCheckBoxChanged(int)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonChangeEchoMode</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>ChangeKeyDialog</receiver> |
||||
<slot>ChangeEchoMode()</slot> |
||||
</connection> |
||||
</connections> |
||||
<tabstops> |
||||
<tabstop>Edit_Password</tabstop> |
||||
<tabstop>Edit_Password_2</tabstop> |
||||
<tabstop>Combo_Dirs</tabstop> |
||||
<tabstop>Button_Browse</tabstop> |
||||
<tabstop>CheckBox_Both</tabstop> |
||||
<tabstop>ButtonOK</tabstop> |
||||
<tabstop>ButtonCancel</tabstop> |
||||
<tabstop>ButtonChangeEchoMode</tabstop> |
||||
</tabstops> |
||||
<slots> |
||||
<slot>OnOK()</slot> |
||||
<slot>OnCancel()</slot> |
||||
<slot>OnBrowse()</slot> |
||||
<slot>OnSelect()</slot> |
||||
<slot>OnPasswordChanged(const QString& str)</slot> |
||||
<slot>OnPassword2Changed(const QString& str)</slot> |
||||
<slot>OnCheckBoxChanged(int i)</slot> |
||||
<slot>OnComboChanged(int i)</slot> |
||||
<slot>ChangeEchoMode()</slot> |
||||
</slots> |
||||
<layoutdefaults spacing="6" margin="11"/> |
||||
</UI> |
@ -0,0 +1,220 @@ |
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
||||
<class>dbsettingdlg_base</class> |
||||
<widget class="QDialog"> |
||||
<property name="name"> |
||||
<cstring>dbsettingdlg_base</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>440</width> |
||||
<height>213</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy> |
||||
<hsizetype>0</hsizetype> |
||||
<vsizetype>0</vsizetype> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>440</width> |
||||
<height>213</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>440</width> |
||||
<height>213</height> |
||||
</size> |
||||
</property> |
||||
<property name="caption"> |
||||
<string>Datenbankeinstellungen</string> |
||||
</property> |
||||
<widget class="QGroupBox"> |
||||
<property name="name"> |
||||
<cstring>groupBox1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>60</y> |
||||
<width>420</width> |
||||
<height>110</height> |
||||
</rect> |
||||
</property> |
||||
<property name="title"> |
||||
<string>Verschlüsselung</string> |
||||
</property> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>30</y> |
||||
<width>90</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Algorithmus:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>pushButton1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>390</x> |
||||
<y>0</y> |
||||
<width>20</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>?</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string></string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QComboBox"> |
||||
<property name="name"> |
||||
<cstring>ComboAlgo</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>109</x> |
||||
<y>30</y> |
||||
<width>300</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>EditRounds</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>180</x> |
||||
<y>70</y> |
||||
<width>230</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel3</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>70</y> |
||||
<width>150</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Verschlüsselungsrunden:</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Banner</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>440</width> |
||||
<height>51</height> |
||||
</rect> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonOK</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>210</x> |
||||
<y>180</y> |
||||
<width>102</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>O&K</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+K</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonCancel</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>320</x> |
||||
<y>180</y> |
||||
<width>102</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Abbre&chen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+C</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<images> |
||||
<image name="image0"> |
||||
<data format="XPM.GZ" length="4833">789c8597596f23470e80dfe75718c3b7c182e9eabb11ec834fc9873cbeaf601fc86ec9966df994cfc5fef794483633934d10c836fcb9582cde55fee5dbd2d9de68e9db2f5f9ee7349fb64bed153d2d7deb5e66b38fdffef3efff7ef99aa64b8baf2c5b4abffeebcb57dc5c6a9720499290640b8613e110ff22eb941b07657e7256f90be742e4a7c6a9ed076791c7a1732efbd784d3f817615a71167db0e55c0a17ce95c88f8ced3c7e74d6f306cea29fd159f583b3e8a75367d18f5bce8df0b63389be67e3ccfcd97716fd78e22cfaf1d459edefedcbedbc63e75af4cf85b33edeb8616cfef1b5b39eb7e72cf6c28b7166fb53678df7b5b3fadf388b3d503a8b3d40c6b9eaa35767d9cf37c6a5e53f73d6f3769d55bedf5f2789ac6bfcf2de1fda33ce4cdfbb716eeb6fce1acf1de3c2f2bbe7acf573605cdafe2b67f5efd359f20bb97165febe38b3c453fd2bfa7cd0a67165fea97c9db416ff1de3b1e9d77a6d12567bf8c159ed9d1ab7969fc2b8d378e2ba304579c93769bd719457fd524f2184cae221f51bd250a8fd3c35ae4cfec1b8b6fa06e3c6eaffc859d651f215b2d0c7efdab8327b969d459e9e8d7bfd57c68df587c43be4c1e20b685c1b9f0b17c1e283cfce927f96f911ca40d63fcbce7afebd31eb3a91b3fa37376ead9e64dea5759606a94f546eb23499883d9bc69932bef4acf22cf594725c1f8bfca9b3c8d3aa711e82c82bb73de3817111a4fe2171d67e1a1b97ba8e87ce5a8f12bfb48b2cfae8ceb85206894f9666135bff2e5c45d6fae894a3393a3f5be13aaeb7729eca4ff2d6ce3f5b701ef2b1c95f0aa7715dfb4de657519675d0fc8d8c9ba0f527f12faab234fd8fc695f1ab716dfa3f84ebb2089dec5f779678d381711d74beae398b7f540b3751bfd6e39ab1c9033b6bbd07e326687dcb3c2da8ecf47cfa301e9bbe37e389c94b3c0a2edba0f5f361dc194b3c8b36eed77acf9c453fab7f6d95587e6e8d83c957c25dc9668fdc5fc538b2c6e3a6e754e7adcc836252b6a9d69bccffb2ad535d67e98fb2ab538befaab3e8439947e5b84e82f6ffa17165f1bd7096fcc1ccb8b67a981b375a0f20f92d2775b078493dd54c75aaef0de9dfba75167fea2eb2f683dc5771388d753fbe396b7fca7c6b52ea2c5e57ce621fcbfdd26464f1812767ed8f63e3ced665de34c464fe9e1bb3d5b3f45bc3dca67a7fc9fba7697b46a9bf66cc13cb8fcc8b66c2960f3832b6f3988dad1e2828b799c53371d6f9766b9c5b7f4afe286983f5c3aeb3be177ace6c1ecc9cb51f6a678def8a7169f351fca710f5a93d9db3d64febacf9981aa76a2f5e3b6b7d5d1af7f6df3aebfb67e4acf93f72d6f972675cd83c7d77d67cac3bebfdfce9acf7eb87b3c66b665cdabc5feed9f44bfd51caade59395dbc4fc3f33cecc9f9b9e35bf786fdccfffc459e7ffc059eb7fe2acefcfd459df13dbceda5f4367bddffed8affdf0665c243a6f769c351f6367f51f7ad6fcefcf9dd57e72567fd959e3dd3a6bbc3b677daf34ce6affadb3dadbdb57263a5f46ce7adf8e9dd5dededfbe5e2f9cb5de5b678df7bb71a5fa59f767dccf77cd57d6f7136c185b7e79d359f3159cf53df7e8acf19e19f7f57ee5acef9b0d67f5b733b6fa844b63f38f07ceea9fcc3fca5b9bef58199b3dbce5acefa53567bd6fee8c73d54f95b3fa3b34b6fcc3b3b3f6dba1b3f6afe6a788fb6bad9f1f3f08f19b90b18ddff0f3dafefc2fe4bb284948f1b7f1e2e73fca4ff012af708ad77883b77f2f8f33bc8b9aeff1011ff1099f718e2ff88a6ff88e1ff8196da33fc92fe30aaee21aaee3060e70889bb885dbb88323dc8d7a407df941be8dd2dfa3ec5e94dac7033cc4233cc6133cc5333cc78bffb327c18029669863812556d1ef1a9ba8168080a1850ec608daaf30814bb882296ec035dc486426700b33b8837b78c0213cc2133ce367af3f7a93c01c5e700b5ee10d6fe11d093ee01396610556f104d6601d36a2d77abf0da2f41036610bb6b1841d18c12e7c873dd887033884233886133885b318297d3fc558e114cee1021208d1e01432c8a180122aa8e3c5190f2322c63bb507995aea62bc37698c9f34a14bba822d9ad235ddd02dcde80e87744f0f7fc823d1233de1363d634d737aa1577aa3ebf8047ba70ffaa4655aa1555aa375b37f0c298e6923ca0fb0a1212cd3266dd136edd08876e93bedd13e1dd0211d997e88f6031dd3099d624e67744e17f15f8b40296594cb273ef61632aa5ff34515d5d43032707c19449fd6e993db283b8217ee62fc0630fa31bf1cdf037c493bb1724ef98a162d30e56bcae185467cc3b731dfa0f935f919dff13daef1033ff2133fc77d039e73d41da55ff90d268b8afba17ea27d30a18edff9833f7999577895d7a88421aff31b6fc0e04ff5c6314acc031ef2266cc4c7ce036ff12ca66a10ff75d95eacfd2ccf3b0bfd38e651ac93f7d83b77f84e47d1e6f1222e0bf9c5ef3ff7a3f690766f4ffd0490aa85affffbf5cbef985d44a8</data> |
||||
</image> |
||||
</images> |
||||
<connections> |
||||
<connection> |
||||
<sender>ButtonOK</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>dbsettingdlg_base</receiver> |
||||
<slot>OnOK()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonCancel</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>dbsettingdlg_base</receiver> |
||||
<slot>OnCancel()</slot> |
||||
</connection> |
||||
</connections> |
||||
<tabstops> |
||||
<tabstop>ComboAlgo</tabstop> |
||||
<tabstop>EditRounds</tabstop> |
||||
<tabstop>ButtonOK</tabstop> |
||||
<tabstop>ButtonCancel</tabstop> |
||||
<tabstop>pushButton1</tabstop> |
||||
</tabstops> |
||||
<slots> |
||||
<slot>OnOK()</slot> |
||||
<slot>OnCancel()</slot> |
||||
</slots> |
||||
<layoutdefaults spacing="6" margin="11"/> |
||||
</UI> |
@ -0,0 +1,712 @@ |
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
||||
<class>EditEntryDialog</class> |
||||
<widget class="QDialog"> |
||||
<property name="name"> |
||||
<cstring>EditEntryDialog</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>493</width> |
||||
<height>526</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy> |
||||
<hsizetype>1</hsizetype> |
||||
<vsizetype>1</vsizetype> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>493</width> |
||||
<height>526</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>493</width> |
||||
<height>526</height> |
||||
</size> |
||||
</property> |
||||
<property name="caption"> |
||||
<string>Eintrag bearbeiten</string> |
||||
</property> |
||||
<property name="modal"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_Title</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>111</x> |
||||
<y>90</y> |
||||
<width>370</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_Expire_Time</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>220</x> |
||||
<y>410</y> |
||||
<width>260</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Label_Bits</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>400</x> |
||||
<y>228</y> |
||||
<width>44</width> |
||||
<height>14</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>120 Bits</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonDeleteAttachment</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>450</x> |
||||
<y>440</y> |
||||
<width>31</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string></string> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonGenPw</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>450</x> |
||||
<y>200</y> |
||||
<width>31</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Ge&n.</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_Password_w</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>111</x> |
||||
<y>200</y> |
||||
<width>330</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QProgressBar"> |
||||
<property name="name"> |
||||
<cstring>Progress_Quali</cstring> |
||||
</property> |
||||
<property name="enabled"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>111</x> |
||||
<y>226</y> |
||||
<width>280</width> |
||||
<height>22</height> |
||||
</rect> |
||||
</property> |
||||
<property name="progress"> |
||||
<number>50</number> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_UserName</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>111</x> |
||||
<y>120</y> |
||||
<width>370</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_Attachment</cstring> |
||||
</property> |
||||
<property name="enabled"> |
||||
<bool>false</bool> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>110</x> |
||||
<y>440</y> |
||||
<width>280</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_Password</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>111</x> |
||||
<y>180</y> |
||||
<width>330</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>400</x> |
||||
<y>60</y> |
||||
<width>27</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Icon:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonEchoMode</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>450</x> |
||||
<y>180</y> |
||||
<width>31</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>...</string> |
||||
</property> |
||||
<property name="flat"> |
||||
<bool>false</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonSaveAttachment</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>420</x> |
||||
<y>440</y> |
||||
<width>31</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string></string> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image1</pixmap> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonOpenAttachment</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>390</x> |
||||
<y>440</y> |
||||
<width>30</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string></string> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image2</pixmap> |
||||
</property> |
||||
</widget> |
||||
<widget class="QComboBox"> |
||||
<property name="name"> |
||||
<cstring>Combo_Group</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>110</x> |
||||
<y>60</y> |
||||
<width>220</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QComboBox"> |
||||
<property name="name"> |
||||
<cstring>Combo_IconPicker</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>431</x> |
||||
<y>60</y> |
||||
<width>50</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel5</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>120</y> |
||||
<width>90</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Benutzername:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel8</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>200</y> |
||||
<width>97</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Passwort Wdhlg.:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel4</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>90</y> |
||||
<width>90</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Titel:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel7</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>150</y> |
||||
<width>90</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>URL:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel6</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>180</y> |
||||
<width>100</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Passwort:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel9</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>225</y> |
||||
<width>90</width> |
||||
<height>16</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Qualität:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel10</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>250</y> |
||||
<width>100</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Kommentar:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_Expire_Date</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>110</x> |
||||
<y>410</y> |
||||
<width>110</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="maxLength"> |
||||
<number>10</number> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel11</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>410</y> |
||||
<width>100</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>gültig bis:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel12</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>440</y> |
||||
<width>90</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Anhang:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_URL</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>111</x> |
||||
<y>150</y> |
||||
<width>370</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel3</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>60</y> |
||||
<width>90</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Gruppe:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Banner</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>493</width> |
||||
<height>50</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy> |
||||
<hsizetype>7</hsizetype> |
||||
<vsizetype>5</vsizetype> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="Line"> |
||||
<property name="name"> |
||||
<cstring>line1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>476</y> |
||||
<width>490</width> |
||||
<height>16</height> |
||||
</rect> |
||||
</property> |
||||
<property name="frameShape"> |
||||
<enum>HLine</enum> |
||||
</property> |
||||
<property name="frameShadow"> |
||||
<enum>Sunken</enum> |
||||
</property> |
||||
<property name="orientation"> |
||||
<enum>Horizontal</enum> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Label_AttachmentSize</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>110</x> |
||||
<y>461</y> |
||||
<width>120</width> |
||||
<height>16</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>5,30 MB</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonCancel</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>380</x> |
||||
<y>497</y> |
||||
<width>104</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Abbre&chen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+C</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonOK</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>270</x> |
||||
<y>497</y> |
||||
<width>103</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>O&K</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+K</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QTextEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_Comment</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>111</x> |
||||
<y>250</y> |
||||
<width>370</width> |
||||
<height>151</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<images> |
||||
<image name="image0"> |
||||
<data format="PNG" length="219">89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff61000000a249444154388da553c10d8440081cece03ad0a74fb7246bf35ab00bf79e57c69530be301c82c62c09c926300303ac90448b754d684b50a5b04a79dcce41f0c5ef20ba02f8b8f819684261950c6c63a71968d0574a894986be61e2829efeed3d2550e0868933108249e66bb412862c2993a0952339b7123cf88ee44f82b6ad37e1b733e285b70cf11d58cdd10df8229ad379d08acfd5c85058c57678bac4a7d6fc1b77b26fedbde105cdd30000000049454e44ae426082</data> |
||||
</image> |
||||
<image name="image1"> |
||||
<data format="PNG" length="441">89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff610000018049444154388d8d933d4b034110869f88c51e58ec818507165e619172c5346727dad8fa135269fe81a412ff820a622c84945ac6c6fa2c2eb8a5a58d7081087b85982902671192dce5fc7aab6566e7e19d99dd5a9ee714757e715e0ab8cce16b1ff7ee00f0577d5ac7adda34bf5cbcdcbdede6bd871eca5368fd4ab46d0856c1345e01b009f41e2d403e859400006b414ae7c800a6108dc0804d62dcd0e13237cb2c2d02aa8aca2c80f1fc5872202288d4c1447f73ffef602eed6fe1ad78a55865064abd80551317169e89b109c47d4b96851568053048039a9796413a98ad4e440008d6e5f716642c8c3e46d804d2b77456a8b59eb8f3d4df0ebc156f5658172112c1c8135bc021d516be1d625384589ee86001b0953dfe00983e90de6648b3714df7ea93ddfb3bccd11cb0d846750b9ee2604fd36c00ec40667197d0c1e0866eb2c6e55f0000f42dcfdc60fb8638310cd60394a708b526dc08699fb4bfff4c003212ba43cd7d7a80f635c17e40a875a9a8a8dae2773e3b3dcba7d89f8a8afa0278938fbf2fda853f0000000049454e44ae426082</data> |
||||
</image> |
||||
<image name="image2"> |
||||
<data format="PNG" length="290">89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff61000000e949444154388da593416ec32010451f56b3e87140cd26d741e2465115247a9c6c9232c7e9a28be902db01ecda51fb25160cff7ffe8cc0a82affc14bbdc9d1356e2e64b3eba0aaa82a9f17ab3dc61a5bcba82a393a752103a9b3f7e4e8562f9ed2552df4e2522bc62d7274a4e0d4c76cda19c8196e3dfdbc9ac0be410a461f0642111f2dce8e69bebfe0f0ba544b02eb91bba95bb896deece9d1ce61f5f2990bd50c32f21b7b810c20c56498ab37e0f8845ac021c8fb073e6a3b44871d49d735699b60c4d09cd8d3ae784e3bc24c7fa17fc65b903bf8581e92a93f530acf994ce285c15f30ec53b6f103005182147f92e4240000000049454e44ae426082</data> |
||||
</image> |
||||
</images> |
||||
<connections> |
||||
<connection> |
||||
<sender>ButtonEchoMode</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>ChangeEchoMode()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Edit_Password</sender> |
||||
<signal>textChanged(const QString&)</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>OnPasswordTextChanged(const QString&)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Edit_Password_w</sender> |
||||
<signal>textChanged(const QString&)</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>OnPasswordwTextChanged(const QString&)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Edit_Password_w</sender> |
||||
<signal>lostFocus()</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>OnPasswordwLostFocus()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Edit_Expire_Date</sender> |
||||
<signal>lostFocus()</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>OnExpDateLostFocus()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Edit_Expire_Time</sender> |
||||
<signal>lostFocus()</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>OnExpTimeLostFocus()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonOpenAttachment</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>OnNewAttachment()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonSaveAttachment</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>OnSaveAttachment()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonDeleteAttachment</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>OnDeleteAttachment()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonGenPw</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>OnButtonGenPw()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonOK</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>OnButtonOK()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonCancel</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>EditEntryDialog</receiver> |
||||
<slot>OnButtonCancel()</slot> |
||||
</connection> |
||||
</connections> |
||||
<tabstops> |
||||
<tabstop>Combo_Group</tabstop> |
||||
<tabstop>Combo_IconPicker</tabstop> |
||||
<tabstop>Edit_Title</tabstop> |
||||
<tabstop>Edit_UserName</tabstop> |
||||
<tabstop>Edit_URL</tabstop> |
||||
<tabstop>Edit_Password</tabstop> |
||||
<tabstop>Edit_Password_w</tabstop> |
||||
<tabstop>Edit_Comment</tabstop> |
||||
<tabstop>Edit_Expire_Date</tabstop> |
||||
<tabstop>Edit_Expire_Time</tabstop> |
||||
<tabstop>Edit_Attachment</tabstop> |
||||
<tabstop>ButtonOpenAttachment</tabstop> |
||||
<tabstop>ButtonSaveAttachment</tabstop> |
||||
<tabstop>ButtonDeleteAttachment</tabstop> |
||||
<tabstop>ButtonEchoMode</tabstop> |
||||
<tabstop>ButtonGenPw</tabstop> |
||||
</tabstops> |
||||
<slots> |
||||
<slot>OnButtonOK()</slot> |
||||
<slot>OnButtonCancel()</slot> |
||||
<slot>ChangeEchoMode()</slot> |
||||
<slot>OnPasswordTextChanged(const QString&)</slot> |
||||
<slot>OnPasswordwTextChanged(const QString&)</slot> |
||||
<slot>OnPasswordwLostFocus()</slot> |
||||
<slot>OnExpDateLostFocus()</slot> |
||||
<slot>OnExpTimeLostFocus()</slot> |
||||
<slot>OnNewAttachment()</slot> |
||||
<slot>OnSaveAttachment()</slot> |
||||
<slot>OnDeleteAttachment()</slot> |
||||
<slot>OnButtonGenPw()</slot> |
||||
</slots> |
||||
<layoutdefaults spacing="6" margin="11"/> |
||||
</UI> |
@ -0,0 +1,174 @@ |
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
||||
<class>EditGroupDialog</class> |
||||
<widget class="QDialog"> |
||||
<property name="name"> |
||||
<cstring>EditGroupDialog</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>302</width> |
||||
<height>105</height> |
||||
</rect> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>200</width> |
||||
<height>105</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>302</width> |
||||
<height>100</height> |
||||
</size> |
||||
</property> |
||||
<property name="caption"> |
||||
<string>Gruppeneigenschaften</string> |
||||
</property> |
||||
<widget class="Line"> |
||||
<property name="name"> |
||||
<cstring>line1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>62</y> |
||||
<width>290</width> |
||||
<height>16</height> |
||||
</rect> |
||||
</property> |
||||
<property name="frameShape"> |
||||
<enum>HLine</enum> |
||||
</property> |
||||
<property name="frameShadow"> |
||||
<enum>Sunken</enum> |
||||
</property> |
||||
<property name="orientation"> |
||||
<enum>Horizontal</enum> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>EditTitle</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>70</x> |
||||
<y>10</y> |
||||
<width>230</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Label1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>10</y> |
||||
<width>27</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Titel:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Label2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>40</y> |
||||
<width>43</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Symbol:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QComboBox"> |
||||
<property name="name"> |
||||
<cstring>ComboIconPicker</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>70</x> |
||||
<y>40</y> |
||||
<width>50</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonCancel</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>226</x> |
||||
<y>80</y> |
||||
<width>70</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Abbre&chen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+C</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonOK</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>147</x> |
||||
<y>80</y> |
||||
<width>70</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>O&K</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+K</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<connections> |
||||
<connection> |
||||
<sender>ButtonOK</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>EditGroupDialog</receiver> |
||||
<slot>OnOK()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonCancel</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>EditGroupDialog</receiver> |
||||
<slot>OnCancel()</slot> |
||||
</connection> |
||||
</connections> |
||||
<tabstops> |
||||
<tabstop>EditTitle</tabstop> |
||||
<tabstop>ComboIconPicker</tabstop> |
||||
<tabstop>ButtonOK</tabstop> |
||||
<tabstop>ButtonCancel</tabstop> |
||||
</tabstops> |
||||
<slots> |
||||
<slot>OnOK()</slot> |
||||
<slot>OnCancel()</slot> |
||||
</slots> |
||||
<layoutdefaults spacing="6" margin="11"/> |
||||
</UI> |
@ -0,0 +1,215 @@ |
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
||||
<class>LanguageDlg</class> |
||||
<widget class="QDialog"> |
||||
<property name="name"> |
||||
<cstring>LanguageDlg</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>500</width> |
||||
<height>252</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy> |
||||
<hsizetype>0</hsizetype> |
||||
<vsizetype>0</vsizetype> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>500</width> |
||||
<height>252</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>500</width> |
||||
<height>252</height> |
||||
</size> |
||||
</property> |
||||
<property name="caption"> |
||||
<string>Keepass</string> |
||||
</property> |
||||
<property name="sizeGripEnabled"> |
||||
<bool>false</bool> |
||||
</property> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Banner</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>500</width> |
||||
<height>50</height> |
||||
</rect> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonClose</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>407</x> |
||||
<y>220</y> |
||||
<width>80</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Schlie&ßen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ß</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QListView"> |
||||
<column> |
||||
<property name="text"> |
||||
<string>*</string> |
||||
</property> |
||||
<property name="clickable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<property name="resizable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</column> |
||||
<column> |
||||
<property name="text"> |
||||
<string>Sprache</string> |
||||
</property> |
||||
<property name="clickable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<property name="resizable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</column> |
||||
<column> |
||||
<property name="text"> |
||||
<string>Version</string> |
||||
</property> |
||||
<property name="clickable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<property name="resizable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</column> |
||||
<column> |
||||
<property name="text"> |
||||
<string>Autor</string> |
||||
</property> |
||||
<property name="clickable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<property name="resizable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</column> |
||||
<property name="name"> |
||||
<cstring>List</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>60</y> |
||||
<width>480</width> |
||||
<height>150</height> |
||||
</rect> |
||||
</property> |
||||
<property name="allColumnsShowFocus"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<property name="showSortIndicator"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<property name="resizeMode"> |
||||
<enum>NoColumn</enum> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonApply</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>20</x> |
||||
<y>220</y> |
||||
<width>80</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Fes&tlegen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+T</string> |
||||
</property> |
||||
<property name="toolTip" stdset="0"> |
||||
<string></string> |
||||
</property> |
||||
<property name="whatsThis" stdset="0"> |
||||
<string>Legt die aktuell markierte Sprache |
||||
als Übersetzung für Keepass fest.</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<images> |
||||
<image name="image0"> |
||||
<data format="XPM.GZ" length="4833">789c8597596f23470e80dfe75718c3b7c182e9eabb11ec834fc9873cbeaf601fc86ec9966df994cfc5fef794483633934d10c836fcb9582cde55fee5dbd2d9de68e9db2f5f9ee7349fb64bed153d2d7deb5e66b38fdffef3efff7ef99aa64b8baf2c5b4abffeebcb57dc5c6a9720499290640b8613e110ff22eb941b07657e7256f90be742e4a7c6a9ed076791c7a1732efbd784d3f817615a71167db0e55c0a17ce95c88f8ced3c7e74d6f306cea29fd159f583b3e8a75367d18f5bce8df0b63389be67e3ccfcd97716fd78e22cfaf1d459edefedcbedbc63e75af4cf85b33edeb8616cfef1b5b39eb7e72cf6c28b7166fb53678df7b5b3fadf388b3d503a8b3d40c6b9eaa35767d9cf37c6a5e53f73d6f3769d55bedf5f2789ac6bfcf2de1fda33ce4cdfbb716eeb6fce1acf1de3c2f2bbe7acf573605cdafe2b67f5efd359f20bb97165febe38b3c453fd2bfa7cd0a67165fea97c9db416ff1de3b1e9d77a6d12567bf8c159ed9d1ab7969fc2b8d378e2ba304579c93769bd719457fd524f2184cae221f51bd250a8fd3c35ae4cfec1b8b6fa06e3c6eaffc859d651f215b2d0c7efdab8327b969d459e9e8d7bfd57c68df587c43be4c1e20b685c1b9f0b17c1e283cfce927f96f911ca40d63fcbce7afebd31eb3a91b3fa37376ead9e64dea5759606a94f546eb23499883d9bc69932bef4acf22cf594725c1f8bfca9b3c8d3aa711e82c82bb73de3817111a4fe2171d67e1a1b97ba8e87ce5a8f12bfb48b2cfae8ceb85206894f9666135bff2e5c45d6fae894a3393a3f5be13aaeb7729eca4ff2d6ce3f5b701ef2b1c95f0aa7715dfb4de657519675d0fc8d8c9ba0f527f12faab234fd8fc695f1ab716dfa3f84ebb2089dec5f779678d381711d74beae398b7f540b3751bfd6e39ab1c9033b6bbd07e326687dcb3c2da8ecf47cfa301e9bbe37e389c94b3c0a2edba0f5f361dc194b3c8b36eed77acf9c453fab7f6d95587e6e8d83c957c25dc9668fdc5fc538b2c6e3a6e754e7adcc836252b6a9d69bccffb2ad535d67e98fb2ab538befaab3e8439947e5b84e82f6ffa17165f1bd7096fcc1ccb8b67a981b375a0f20f92d2775b078493dd54c75aaef0de9dfba75167fea2eb2f683dc5771388d753fbe396b7fca7c6b52ea2c5e57ce621fcbfdd26464f1812767ed8f63e3ced665de34c464fe9e1bb3d5b3f45bc3dca67a7fc9fba7697b46a9bf66cc13cb8fcc8b66c2960f3832b6f3988dad1e2828b799c53371d6f9766b9c5b7f4afe286983f5c3aeb3be177ace6c1ecc9cb51f6a678def8a7169f351fca710f5a93d9db3d64febacf9981aa76a2f5e3b6b7d5d1af7f6df3aebfb67e4acf93f72d6f972675cd83c7d77d67cac3bebfdfce9acf7eb87b3c66b665cdabc5feed9f44bfd51caade59395dbc4fc3f33cecc9f9b9e35bf786fdccfffc459e7ffc059eb7fe2acefcfd459df13dbceda5f4367bddffed8affdf0665c243a6f769c351f6367f51f7ad6fcefcf9dd57e72567fd959e3dd3a6bbc3b677daf34ce6affadb3dadbdb57263a5f46ce7adf8e9dd5dededfbe5e2f9cb5de5b678df7bb71a5fa59f767dccf77cd57d6f7136c185b7e79d359f3159cf53df7e8acf19e19f7f57ee5acef9b0d67f5b733b6fa844b63f38f07ceea9fcc3fca5b9bef58199b3dbce5acefa53567bd6fee8c73d54f95b3fa3b34b6fcc3b3b3f6dba1b3f6afe6a788fb6bad9f1f3f08f19b90b18ddff0f3dafefc2fe4bb284948f1b7f1e2e73fca4ff012af708ad77883b77f2f8f33bc8b9aeff1011ff1099f718e2ff88a6ff88e1ff8196da33fc92fe30aaee21aaee3060e70889bb885dbb88323dc8d7a407df941be8dd2dfa3ec5e94dac7033cc4233cc6133cc5333cc78bffb327c18029669863812556d1ef1a9ba8168080a1850ec608daaf30814bb882296ec035dc486426700b33b8837b78c0213cc2133ce367af3f7a93c01c5e700b5ee10d6fe11d093ee01396610556f104d6601d36a2d77abf0da2f41036610bb6b1841d18c12e7c873dd887033884233886133885b318297d3fc558e114cee1021208d1e01432c8a180122aa8e3c5190f2322c63bb507995aea62bc37698c9f34a14bba822d9ad235ddd02dcde80e87744f0f7fc823d1233de1363d634d737aa1577aa3ebf8047ba70ffaa4655aa1555aa375b37f0c298e6923ca0fb0a1212cd3266dd136edd08876e93bedd13e1dd0211d997e88f6031dd3099d624e67744e17f15f8b40296594cb273ef61632aa5ff34515d5d43032707c19449fd6e993db283b8217ee62fc0630fa31bf1cdf037c493bb1724ef98a162d30e56bcae185467cc3b731dfa0f935f919dff13daef1033ff2133fc77d039e73d41da55ff90d268b8afba17ea27d30a18edff9833f7999577895d7a88421aff31b6fc0e04ff5c6314acc031ef2266cc4c7ce036ff12ca66a10ff75d95eacfd2ccf3b0bfd38e651ac93f7d83b77f84e47d1e6f1222e0bf9c5ef3ff7a3f690766f4ffd0490aa85affffbf5cbef985d44a8</data> |
||||
</image> |
||||
</images> |
||||
<connections> |
||||
<connection> |
||||
<sender>List</sender> |
||||
<signal>doubleClicked(QListViewItem*)</signal> |
||||
<receiver>LanguageDlg</receiver> |
||||
<slot>OnItemDoubleClicked(QListViewItem*)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>List</sender> |
||||
<signal>rightButtonClicked(QListViewItem*,const QPoint&,int)</signal> |
||||
<receiver>LanguageDlg</receiver> |
||||
<slot>OnItemRightClick(QListViewItem*,const QPoint&)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonApply</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>LanguageDlg</receiver> |
||||
<slot>OnApplyButtonClicked()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonClose</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>LanguageDlg</receiver> |
||||
<slot>OnButtonCloseClicked()</slot> |
||||
</connection> |
||||
</connections> |
||||
<tabstops> |
||||
<tabstop>List</tabstop> |
||||
<tabstop>ButtonApply</tabstop> |
||||
<tabstop>ButtonClose</tabstop> |
||||
</tabstops> |
||||
<slots> |
||||
<slot>OnItemRightClick(QListViewItem* item, const QPoint& p)</slot> |
||||
<slot>OnItemDoubleClicked(QListViewItem* item)</slot> |
||||
<slot>OnApplyButtonClicked()</slot> |
||||
<slot>OnButtonCloseClicked()</slot> |
||||
</slots> |
||||
<layoutdefaults spacing="6" margin="11"/> |
||||
</UI> |
@ -0,0 +1,328 @@ |
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
||||
<class>PasswordDlg</class> |
||||
<widget class="QDialog"> |
||||
<property name="name"> |
||||
<cstring>PasswordDlg</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>562</width> |
||||
<height>250</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy> |
||||
<hsizetype>1</hsizetype> |
||||
<vsizetype>1</vsizetype> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>562</width> |
||||
<height>250</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>562</width> |
||||
<height>250</height> |
||||
</size> |
||||
</property> |
||||
<property name="caption"> |
||||
<string>Datenbank öffnen</string> |
||||
</property> |
||||
<property name="sizeGripEnabled"> |
||||
<bool>false</bool> |
||||
</property> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>56</y> |
||||
<width>450</width> |
||||
<height>16</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Geben Sie das Passwort ein oder wählen Sie eine Schlüsseldatei.</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Banner</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>562</width> |
||||
<height>51</height> |
||||
</rect> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonCancel</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>460</x> |
||||
<y>220</y> |
||||
<width>90</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Abbre&chen</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonOK</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>360</x> |
||||
<y>220</y> |
||||
<width>90</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>O&K</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+K</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QGroupBox"> |
||||
<property name="name"> |
||||
<cstring>groupframe</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>80</y> |
||||
<width>540</width> |
||||
<height>130</height> |
||||
</rect> |
||||
</property> |
||||
<property name="title"> |
||||
<string>Schlüssel</string> |
||||
</property> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonChangeEchoMode</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>510</x> |
||||
<y>30</y> |
||||
<width>20</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>...</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>Button_Browse</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>450</x> |
||||
<y>70</y> |
||||
<width>80</width> |
||||
<height>22</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>W&ählen...</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ä</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QComboBox"> |
||||
<property name="name"> |
||||
<cstring>Combo_Dirs</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>201</x> |
||||
<y>70</y> |
||||
<width>240</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>30</y> |
||||
<width>180</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Passwort:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel3</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>70</y> |
||||
<width>180</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Schlüsseldatei oder Datenträger:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>CheckBox_Both</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>100</y> |
||||
<width>16</width> |
||||
<height>16</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string></string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_Password</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>200</x> |
||||
<y>30</y> |
||||
<width>310</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1_2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>30</x> |
||||
<y>98</y> |
||||
<width>300</width> |
||||
<height>18</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Passwort <b>und</b> Schlüsseldatei verwenden</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
</widget> |
||||
<images> |
||||
<image name="image0"> |
||||
<data format="XPM.GZ" length="4833">789c8597596f23470e80dfe75718c3b7c182e9eabb11ec834fc9873cbeaf601fc86ec9966df994cfc5fef794483633934d10c836fcb9582cde55fee5dbd2d9de68e9db2f5f9ee7349fb64bed153d2d7deb5e66b38fdffef3efff7ef99aa64b8baf2c5b4abffeebcb57dc5c6a9720499290640b8613e110ff22eb941b07657e7256f90be742e4a7c6a9ed076791c7a1732efbd784d3f817615a71167db0e55c0a17ce95c88f8ced3c7e74d6f306cea29fd159f583b3e8a75367d18f5bce8df0b63389be67e3ccfcd97716fd78e22cfaf1d459edefedcbedbc63e75af4cf85b33edeb8616cfef1b5b39eb7e72cf6c28b7166fb53678df7b5b3fadf388b3d503a8b3d40c6b9eaa35767d9cf37c6a5e53f73d6f3769d55bedf5f2789ac6bfcf2de1fda33ce4cdfbb716eeb6fce1acf1de3c2f2bbe7acf573605cdafe2b67f5efd359f20bb97165febe38b3c453fd2bfa7cd0a67165fea97c9db416ff1de3b1e9d77a6d12567bf8c159ed9d1ab7969fc2b8d378e2ba304579c93769bd719457fd524f2184cae221f51bd250a8fd3c35ae4cfec1b8b6fa06e3c6eaffc859d651f215b2d0c7efdab8327b969d459e9e8d7bfd57c68df587c43be4c1e20b685c1b9f0b17c1e283cfce927f96f911ca40d63fcbce7afebd31eb3a91b3fa37376ead9e64dea5759606a94f546eb23499883d9bc69932bef4acf22cf594725c1f8bfca9b3c8d3aa711e82c82bb73de3817111a4fe2171d67e1a1b97ba8e87ce5a8f12bfb48b2cfae8ceb85206894f9666135bff2e5c45d6fae894a3393a3f5be13aaeb7729eca4ff2d6ce3f5b701ef2b1c95f0aa7715dfb4de657519675d0fc8d8c9ba0f527f12faab234fd8fc695f1ab716dfa3f84ebb2089dec5f779678d381711d74beae398b7f540b3751bfd6e39ab1c9033b6bbd07e326687dcb3c2da8ecf47cfa301e9bbe37e389c94b3c0a2edba0f5f361dc194b3c8b36eed77acf9c453fab7f6d95587e6e8d83c957c25dc9668fdc5fc538b2c6e3a6e754e7adcc836252b6a9d69bccffb2ad535d67e98fb2ab538befaab3e8439947e5b84e82f6ffa17165f1bd7096fcc1ccb8b67a981b375a0f20f92d2775b078493dd54c75aaef0de9dfba75167fea2eb2f683dc5771388d753fbe396b7fca7c6b52ea2c5e57ce621fcbfdd26464f1812767ed8f63e3ced665de34c464fe9e1bb3d5b3f45bc3dca67a7fc9fba7697b46a9bf66cc13cb8fcc8b66c2960f3832b6f3988dad1e2828b799c53371d6f9766b9c5b7f4afe286983f5c3aeb3be177ace6c1ecc9cb51f6a678def8a7169f351fca710f5a93d9db3d64febacf9981aa76a2f5e3b6b7d5d1af7f6df3aebfb67e4acf93f72d6f972675cd83c7d77d67cac3bebfdfce9acf7eb87b3c66b665cdabc5feed9f44bfd51caade59395dbc4fc3f33cecc9f9b9e35bf786fdccfffc459e7ffc059eb7fe2acefcfd459df13dbceda5f4367bddffed8affdf0665c243a6f769c351f6367f51f7ad6fcefcf9dd57e72567fd959e3dd3a6bbc3b677daf34ce6affadb3dadbdb57263a5f46ce7adf8e9dd5dededfbe5e2f9cb5de5b678df7bb71a5fa59f767dccf77cd57d6f7136c185b7e79d359f3159cf53df7e8acf19e19f7f57ee5acef9b0d67f5b733b6fa844b63f38f07ceea9fcc3fca5b9bef58199b3dbce5acefa53567bd6fee8c73d54f95b3fa3b34b6fcc3b3b3f6dba1b3f6afe6a788fb6bad9f1f3f08f19b90b18ddff0f3dafefc2fe4bb284948f1b7f1e2e73fca4ff012af708ad77883b77f2f8f33bc8b9aeff1011ff1099f718e2ff88a6ff88e1ff8196da33fc92fe30aaee21aaee3060e70889bb885dbb88323dc8d7a407df941be8dd2dfa3ec5e94dac7033cc4233cc6133cc5333cc78bffb327c18029669863812556d1ef1a9ba8168080a1850ec608daaf30814bb882296ec035dc486426700b33b8837b78c0213cc2133ce367af3f7a93c01c5e700b5ee10d6fe11d093ee01396610556f104d6601d36a2d77abf0da2f41036610bb6b1841d18c12e7c873dd887033884233886133885b318297d3fc558e114cee1021208d1e01432c8a180122aa8e3c5190f2322c63bb507995aea62bc37698c9f34a14bba822d9ad235ddd02dcde80e87744f0f7fc823d1233de1363d634d737aa1577aa3ebf8047ba70ffaa4655aa1555aa375b37f0c298e6923ca0fb0a1212cd3266dd136edd08876e93bedd13e1dd0211d997e88f6031dd3099d624e67744e17f15f8b40296594cb273ef61632aa5ff34515d5d43032707c19449fd6e993db283b8217ee62fc0630fa31bf1cdf037c493bb1724ef98a162d30e56bcae185467cc3b731dfa0f935f919dff13daef1033ff2133fc77d039e73d41da55ff90d268b8afba17ea27d30a18edff9833f7999577895d7a88421aff31b6fc0e04ff5c6314acc031ef2266cc4c7ce036ff12ca66a10ff75d95eacfd2ccf3b0bfd38e651ac93f7d83b77f84e47d1e6f1222e0bf9c5ef3ff7a3f690766f4ffd0490aa85affffbf5cbef985d44a8</data> |
||||
</image> |
||||
</images> |
||||
<connections> |
||||
<connection> |
||||
<sender>Combo_Dirs</sender> |
||||
<signal>activated(int)</signal> |
||||
<receiver>PasswordDlg</receiver> |
||||
<slot>OnComboSelectionChanged(int)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Button_Browse</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>PasswordDlg</receiver> |
||||
<slot>OnButtonBrowse()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonCancel</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>PasswordDlg</receiver> |
||||
<slot>OnCancel()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Edit_Password</sender> |
||||
<signal>textChanged(const QString&)</signal> |
||||
<receiver>PasswordDlg</receiver> |
||||
<slot>OnPasswordChanged(const QString&)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonOK</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>PasswordDlg</receiver> |
||||
<slot>OnOK()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>CheckBox_Both</sender> |
||||
<signal>stateChanged(int)</signal> |
||||
<receiver>PasswordDlg</receiver> |
||||
<slot>OnCheckBox_BothChanged(int)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonChangeEchoMode</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>PasswordDlg</receiver> |
||||
<slot>ChangeEchoMode()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Edit_Password</sender> |
||||
<signal>returnPressed()</signal> |
||||
<receiver>PasswordDlg</receiver> |
||||
<slot>OnOK()</slot> |
||||
</connection> |
||||
</connections> |
||||
<tabstops> |
||||
<tabstop>Edit_Password</tabstop> |
||||
<tabstop>Combo_Dirs</tabstop> |
||||
<tabstop>Button_Browse</tabstop> |
||||
<tabstop>CheckBox_Both</tabstop> |
||||
<tabstop>ButtonOK</tabstop> |
||||
<tabstop>ButtonCancel</tabstop> |
||||
<tabstop>ButtonChangeEchoMode</tabstop> |
||||
</tabstops> |
||||
<slots> |
||||
<slot>OnComboSelectionChanged(int)</slot> |
||||
<slot>OnButtonBrowse()</slot> |
||||
<slot>OnSelectClicked()</slot> |
||||
<slot>OnCancel()</slot> |
||||
<slot>OnPasswordChanged(const QString &txt)</slot> |
||||
<slot>OnOK()</slot> |
||||
<slot>OnCheckBox_BothChanged(int state)</slot> |
||||
<slot>ChangeEchoMode()</slot> |
||||
</slots> |
||||
<layoutdefaults spacing="6" margin="11"/> |
||||
</UI> |
@ -0,0 +1,551 @@ |
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
||||
<class>GenPwDlg</class> |
||||
<widget class="QDialog"> |
||||
<property name="name"> |
||||
<cstring>GenPwDlg</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>460</width> |
||||
<height>470</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy> |
||||
<hsizetype>0</hsizetype> |
||||
<vsizetype>0</vsizetype> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>460</width> |
||||
<height>470</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>460</width> |
||||
<height>470</height> |
||||
</size> |
||||
</property> |
||||
<property name="caption"> |
||||
<string>Passwort Generator</string> |
||||
</property> |
||||
<widget class="QProgressBar"> |
||||
<property name="name"> |
||||
<cstring>Progress_Quali</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>130</x> |
||||
<y>400</y> |
||||
<width>180</width> |
||||
<height>15</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_dest</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>130</x> |
||||
<y>370</y> |
||||
<width>250</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Label_Bits</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>320</x> |
||||
<y>399</y> |
||||
<width>60</width> |
||||
<height>16</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string></string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Banner</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>460</width> |
||||
<height>50</height> |
||||
</rect> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonOK</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>263</x> |
||||
<y>440</y> |
||||
<width>90</width> |
||||
<height>25</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Akzep&tieren</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>Button_Cancel</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>360</x> |
||||
<y>440</y> |
||||
<width>90</width> |
||||
<height>25</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Abbre&chen</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonGenerate</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>381</x> |
||||
<y>370</y> |
||||
<width>70</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Generieren</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel4</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>20</x> |
||||
<y>370</y> |
||||
<width>110</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Neues Passwort:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel5</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>20</x> |
||||
<y>400</y> |
||||
<width>110</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Qualität:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="Line"> |
||||
<property name="name"> |
||||
<cstring>line3</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>420</y> |
||||
<width>460</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="frameShape"> |
||||
<enum>HLine</enum> |
||||
</property> |
||||
<property name="frameShadow"> |
||||
<enum>Sunken</enum> |
||||
</property> |
||||
<property name="orientation"> |
||||
<enum>Horizontal</enum> |
||||
</property> |
||||
</widget> |
||||
<widget class="QGroupBox"> |
||||
<property name="name"> |
||||
<cstring>groupBox1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>60</y> |
||||
<width>440</width> |
||||
<height>280</height> |
||||
</rect> |
||||
</property> |
||||
<property name="title"> |
||||
<string>Optionen</string> |
||||
</property> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_chars</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>30</x> |
||||
<y>170</y> |
||||
<width>400</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QSpinBox"> |
||||
<property name="name"> |
||||
<cstring>Spin_Num</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>120</x> |
||||
<y>220</y> |
||||
<width>310</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="maxValue"> |
||||
<number>1000</number> |
||||
</property> |
||||
<property name="minValue"> |
||||
<number>1</number> |
||||
</property> |
||||
<property name="value"> |
||||
<number>20</number> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>120</x> |
||||
<y>40</y> |
||||
<width>131</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Gro&ßbuchstaben</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ß</string> |
||||
</property> |
||||
<property name="checked"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>120</x> |
||||
<y>60</y> |
||||
<width>140</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>&Kleinbuchstaben</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+K</string> |
||||
</property> |
||||
<property name="checked"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox3</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>120</x> |
||||
<y>80</y> |
||||
<width>140</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>&Zahlen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+Z</string> |
||||
</property> |
||||
<property name="checked"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox4</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>120</x> |
||||
<y>100</y> |
||||
<width>140</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>S&onderzeichen</string> |
||||
</property> |
||||
<property name="checked"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox6</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>260</x> |
||||
<y>60</y> |
||||
<width>170</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Bindestriche</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox7</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>260</x> |
||||
<y>80</y> |
||||
<width>170</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>&Unterstriche</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+U</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox8</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>260</x> |
||||
<y>100</y> |
||||
<width>170</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>h&öhere ANSI-Zeichen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ö</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QRadioButton"> |
||||
<property name="name"> |
||||
<cstring>Radio_2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>150</y> |
||||
<width>420</width> |
||||
<height>16</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>&nur folgende Zeichen benutzen:</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+N</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>220</y> |
||||
<width>110</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Zeichenanzahl:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>Check_strongrandom</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>120</x> |
||||
<y>250</y> |
||||
<width>310</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>"/dev/rando&m" nutzen (empfohlen)</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+M</string> |
||||
</property> |
||||
<property name="checked"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QRadioButton"> |
||||
<property name="name"> |
||||
<cstring>Radio_1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>20</y> |
||||
<width>420</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>folgende Zeichengruppen &verwenden:</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+V</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox5</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>260</x> |
||||
<y>40</y> |
||||
<width>170</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>&Leerzeichen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+L</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
</widget> |
||||
<images> |
||||
<image name="image0"> |
||||
<data format="XPM.GZ" length="4833">789c8597596f23470e80dfe75718c3b7c182e9eabb11ec834fc9873cbeaf601fc86ec9966df994cfc5fef794483633934d10c836fcb9582cde55fee5dbd2d9de68e9db2f5f9ee7349fb64bed153d2d7deb5e66b38fdffef3efff7ef99aa64b8baf2c5b4abffeebcb57dc5c6a9720499290640b8613e110ff22eb941b07657e7256f90be742e4a7c6a9ed076791c7a1732efbd784d3f817615a71167db0e55c0a17ce95c88f8ced3c7e74d6f306cea29fd159f583b3e8a75367d18f5bce8df0b63389be67e3ccfcd97716fd78e22cfaf1d459edefedcbedbc63e75af4cf85b33edeb8616cfef1b5b39eb7e72cf6c28b7166fb53678df7b5b3fadf388b3d503a8b3d40c6b9eaa35767d9cf37c6a5e53f73d6f3769d55bedf5f2789ac6bfcf2de1fda33ce4cdfbb716eeb6fce1acf1de3c2f2bbe7acf573605cdafe2b67f5efd359f20bb97165febe38b3c453fd2bfa7cd0a67165fea97c9db416ff1de3b1e9d77a6d12567bf8c159ed9d1ab7969fc2b8d378e2ba304579c93769bd719457fd524f2184cae221f51bd250a8fd3c35ae4cfec1b8b6fa06e3c6eaffc859d651f215b2d0c7efdab8327b969d459e9e8d7bfd57c68df587c43be4c1e20b685c1b9f0b17c1e283cfce927f96f911ca40d63fcbce7afebd31eb3a91b3fa37376ead9e64dea5759606a94f546eb23499883d9bc69932bef4acf22cf594725c1f8bfca9b3c8d3aa711e82c82bb73de3817111a4fe2171d67e1a1b97ba8e87ce5a8f12bfb48b2cfae8ceb85206894f9666135bff2e5c45d6fae894a3393a3f5be13aaeb7729eca4ff2d6ce3f5b701ef2b1c95f0aa7715dfb4de657519675d0fc8d8c9ba0f527f12faab234fd8fc695f1ab716dfa3f84ebb2089dec5f779678d381711d74beae398b7f540b3751bfd6e39ab1c9033b6bbd07e326687dcb3c2da8ecf47cfa301e9bbe37e389c94b3c0a2edba0f5f361dc194b3c8b36eed77acf9c453fab7f6d95587e6e8d83c957c25dc9668fdc5fc538b2c6e3a6e754e7adcc836252b6a9d69bccffb2ad535d67e98fb2ab538befaab3e8439947e5b84e82f6ffa17165f1bd7096fcc1ccb8b67a981b375a0f20f92d2775b078493dd54c75aaef0de9dfba75167fea2eb2f683dc5771388d753fbe396b7fca7c6b52ea2c5e57ce621fcbfdd26464f1812767ed8f63e3ced665de34c464fe9e1bb3d5b3f45bc3dca67a7fc9fba7697b46a9bf66cc13cb8fcc8b66c2960f3832b6f3988dad1e2828b799c53371d6f9766b9c5b7f4afe286983f5c3aeb3be177ace6c1ecc9cb51f6a678def8a7169f351fca710f5a93d9db3d64febacf9981aa76a2f5e3b6b7d5d1af7f6df3aebfb67e4acf93f72d6f972675cd83c7d77d67cac3bebfdfce9acf7eb87b3c66b665cdabc5feed9f44bfd51caade59395dbc4fc3f33cecc9f9b9e35bf786fdccfffc459e7ffc059eb7fe2acefcfd459df13dbceda5f4367bddffed8affdf0665c243a6f769c351f6367f51f7ad6fcefcf9dd57e72567fd959e3dd3a6bbc3b677daf34ce6affadb3dadbdb57263a5f46ce7adf8e9dd5dededfbe5e2f9cb5de5b678df7bb71a5fa59f767dccf77cd57d6f7136c185b7e79d359f3159cf53df7e8acf19e19f7f57ee5acef9b0d67f5b733b6fa844b63f38f07ceea9fcc3fca5b9bef58199b3dbce5acefa53567bd6fee8c73d54f95b3fa3b34b6fcc3b3b3f6dba1b3f6afe6a788fb6bad9f1f3f08f19b90b18ddff0f3dafefc2fe4bb284948f1b7f1e2e73fca4ff012af708ad77883b77f2f8f33bc8b9aeff1011ff1099f718e2ff88a6ff88e1ff8196da33fc92fe30aaee21aaee3060e70889bb885dbb88323dc8d7a407df941be8dd2dfa3ec5e94dac7033cc4233cc6133cc5333cc78bffb327c18029669863812556d1ef1a9ba8168080a1850ec608daaf30814bb882296ec035dc486426700b33b8837b78c0213cc2133ce367af3f7a93c01c5e700b5ee10d6fe11d093ee01396610556f104d6601d36a2d77abf0da2f41036610bb6b1841d18c12e7c873dd887033884233886133885b318297d3fc558e114cee1021208d1e01432c8a180122aa8e3c5190f2322c63bb507995aea62bc37698c9f34a14bba822d9ad235ddd02dcde80e87744f0f7fc823d1233de1363d634d737aa1577aa3ebf8047ba70ffaa4655aa1555aa375b37f0c298e6923ca0fb0a1212cd3266dd136edd08876e93bedd13e1dd0211d997e88f6031dd3099d624e67744e17f15f8b40296594cb273ef61632aa5ff34515d5d43032707c19449fd6e993db283b8217ee62fc0630fa31bf1cdf037c493bb1724ef98a162d30e56bcae185467cc3b731dfa0f935f919dff13daef1033ff2133fc77d039e73d41da55ff90d268b8afba17ea27d30a18edff9833f7999577895d7a88421aff31b6fc0e04ff5c6314acc031ef2266cc4c7ce036ff12ca66a10ff75d95eacfd2ccf3b0bfd38e651ac93f7d83b77f84e47d1e6f1222e0bf9c5ef3ff7a3f690766f4ffd0490aa85affffbf5cbef985d44a8</data> |
||||
</image> |
||||
</images> |
||||
<connections> |
||||
<connection> |
||||
<sender>Radio_1</sender> |
||||
<signal>stateChanged(int)</signal> |
||||
<receiver>GenPwDlg</receiver> |
||||
<slot>OnRadio1StateChanged(int)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Radio_2</sender> |
||||
<signal>stateChanged(int)</signal> |
||||
<receiver>GenPwDlg</receiver> |
||||
<slot>OnRadio2StateChanged(int)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonGenerate</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>GenPwDlg</receiver> |
||||
<slot>OnGeneratePw()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonOK</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>GenPwDlg</receiver> |
||||
<slot>OnAccept()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Button_Cancel</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>GenPwDlg</receiver> |
||||
<slot>OnCancel()</slot> |
||||
</connection> |
||||
</connections> |
||||
<tabstops> |
||||
<tabstop>Radio_1</tabstop> |
||||
<tabstop>checkBox1</tabstop> |
||||
<tabstop>checkBox2</tabstop> |
||||
<tabstop>checkBox3</tabstop> |
||||
<tabstop>checkBox4</tabstop> |
||||
<tabstop>checkBox5</tabstop> |
||||
<tabstop>checkBox6</tabstop> |
||||
<tabstop>checkBox7</tabstop> |
||||
<tabstop>checkBox8</tabstop> |
||||
<tabstop>Radio_2</tabstop> |
||||
<tabstop>Edit_chars</tabstop> |
||||
<tabstop>Spin_Num</tabstop> |
||||
<tabstop>Check_strongrandom</tabstop> |
||||
<tabstop>Edit_dest</tabstop> |
||||
<tabstop>ButtonGenerate</tabstop> |
||||
<tabstop>ButtonOK</tabstop> |
||||
<tabstop>Button_Cancel</tabstop> |
||||
</tabstops> |
||||
<slots> |
||||
<slot>OnRadio1StateChanged(int)</slot> |
||||
<slot>OnRadio2StateChanged(int)</slot> |
||||
<slot>OnGeneratePw()</slot> |
||||
<slot>OnAccept()</slot> |
||||
<slot>OnCancel()</slot> |
||||
</slots> |
||||
<layoutdefaults spacing="6" margin="11"/> |
||||
</UI> |
@ -0,0 +1,327 @@ |
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
||||
<class>Search_Dlg</class> |
||||
<widget class="QDialog"> |
||||
<property name="name"> |
||||
<cstring>Search_Dlg</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>390</width> |
||||
<height>246</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy> |
||||
<hsizetype>0</hsizetype> |
||||
<vsizetype>0</vsizetype> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>390</width> |
||||
<height>246</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>390</width> |
||||
<height>246</height> |
||||
</size> |
||||
</property> |
||||
<property name="caption"> |
||||
<string>Suche...</string> |
||||
</property> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Banner</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>390</width> |
||||
<height>50</height> |
||||
</rect> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QGroupBox"> |
||||
<property name="name"> |
||||
<cstring>groupBox1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>130</y> |
||||
<width>370</width> |
||||
<height>70</height> |
||||
</rect> |
||||
</property> |
||||
<property name="title"> |
||||
<string>Suche nach</string> |
||||
</property> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox_Title</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>20</x> |
||||
<y>20</y> |
||||
<width>110</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>&Titel</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+T</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox_Username</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>20</x> |
||||
<y>40</y> |
||||
<width>110</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Benut&zername</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+Z</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox_Comment</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>140</x> |
||||
<y>40</y> |
||||
<width>120</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>&Kommentar</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+K</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox_URL</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>260</x> |
||||
<y>20</y> |
||||
<width>100</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>&URL</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+U</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox_Attachment</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>260</x> |
||||
<y>40</y> |
||||
<width>100</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>A&nhang</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+N</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox_Password</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>140</x> |
||||
<y>20</y> |
||||
<width>110</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Pass&wort</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+W</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>Button_Close</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>280</x> |
||||
<y>210</y> |
||||
<width>97</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>S&chließen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+C</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>60</y> |
||||
<width>90</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Suchbegriff:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>Button_Search</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>170</x> |
||||
<y>210</y> |
||||
<width>97</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Suchen</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_Search</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>110</x> |
||||
<y>60</y> |
||||
<width>270</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox_regExp</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>110</x> |
||||
<y>110</y> |
||||
<width>170</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>regul&ärer Ausdruck</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ä</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>checkBox_Cs</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>110</x> |
||||
<y>90</y> |
||||
<width>250</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Gro&ß- und Kleinschreibung beachten</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ß</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<images> |
||||
<image name="image0"> |
||||
<data format="XPM.GZ" length="4833">789c8597596f23470e80dfe75718c3b7c182e9eabb11ec834fc9873cbeaf601fc86ec9966df994cfc5fef794483633934d10c836fcb9582cde55fee5dbd2d9de68e9db2f5f9ee7349fb64bed153d2d7deb5e66b38fdffef3efff7ef99aa64b8baf2c5b4abffeebcb57dc5c6a9720499290640b8613e110ff22eb941b07657e7256f90be742e4a7c6a9ed076791c7a1732efbd784d3f817615a71167db0e55c0a17ce95c88f8ced3c7e74d6f306cea29fd159f583b3e8a75367d18f5bce8df0b63389be67e3ccfcd97716fd78e22cfaf1d459edefedcbedbc63e75af4cf85b33edeb8616cfef1b5b39eb7e72cf6c28b7166fb53678df7b5b3fadf388b3d503a8b3d40c6b9eaa35767d9cf37c6a5e53f73d6f3769d55bedf5f2789ac6bfcf2de1fda33ce4cdfbb716eeb6fce1acf1de3c2f2bbe7acf573605cdafe2b67f5efd359f20bb97165febe38b3c453fd2bfa7cd0a67165fea97c9db416ff1de3b1e9d77a6d12567bf8c159ed9d1ab7969fc2b8d378e2ba304579c93769bd719457fd524f2184cae221f51bd250a8fd3c35ae4cfec1b8b6fa06e3c6eaffc859d651f215b2d0c7efdab8327b969d459e9e8d7bfd57c68df587c43be4c1e20b685c1b9f0b17c1e283cfce927f96f911ca40d63fcbce7afebd31eb3a91b3fa37376ead9e64dea5759606a94f546eb23499883d9bc69932bef4acf22cf594725c1f8bfca9b3c8d3aa711e82c82bb73de3817111a4fe2171d67e1a1b97ba8e87ce5a8f12bfb48b2cfae8ceb85206894f9666135bff2e5c45d6fae894a3393a3f5be13aaeb7729eca4ff2d6ce3f5b701ef2b1c95f0aa7715dfb4de657519675d0fc8d8c9ba0f527f12faab234fd8fc695f1ab716dfa3f84ebb2089dec5f779678d381711d74beae398b7f540b3751bfd6e39ab1c9033b6bbd07e326687dcb3c2da8ecf47cfa301e9bbe37e389c94b3c0a2edba0f5f361dc194b3c8b36eed77acf9c453fab7f6d95587e6e8d83c957c25dc9668fdc5fc538b2c6e3a6e754e7adcc836252b6a9d69bccffb2ad535d67e98fb2ab538befaab3e8439947e5b84e82f6ffa17165f1bd7096fcc1ccb8b67a981b375a0f20f92d2775b078493dd54c75aaef0de9dfba75167fea2eb2f683dc5771388d753fbe396b7fca7c6b52ea2c5e57ce621fcbfdd26464f1812767ed8f63e3ced665de34c464fe9e1bb3d5b3f45bc3dca67a7fc9fba7697b46a9bf66cc13cb8fcc8b66c2960f3832b6f3988dad1e2828b799c53371d6f9766b9c5b7f4afe286983f5c3aeb3be177ace6c1ecc9cb51f6a678def8a7169f351fca710f5a93d9db3d64febacf9981aa76a2f5e3b6b7d5d1af7f6df3aebfb67e4acf93f72d6f972675cd83c7d77d67cac3bebfdfce9acf7eb87b3c66b665cdabc5feed9f44bfd51caade59395dbc4fc3f33cecc9f9b9e35bf786fdccfffc459e7ffc059eb7fe2acefcfd459df13dbceda5f4367bddffed8affdf0665c243a6f769c351f6367f51f7ad6fcefcf9dd57e72567fd959e3dd3a6bbc3b677daf34ce6affadb3dadbdb57263a5f46ce7adf8e9dd5dededfbe5e2f9cb5de5b678df7bb71a5fa59f767dccf77cd57d6f7136c185b7e79d359f3159cf53df7e8acf19e19f7f57ee5acef9b0d67f5b733b6fa844b63f38f07ceea9fcc3fca5b9bef58199b3dbce5acefa53567bd6fee8c73d54f95b3fa3b34b6fcc3b3b3f6dba1b3f6afe6a788fb6bad9f1f3f08f19b90b18ddff0f3dafefc2fe4bb284948f1b7f1e2e73fca4ff012af708ad77883b77f2f8f33bc8b9aeff1011ff1099f718e2ff88a6ff88e1ff8196da33fc92fe30aaee21aaee3060e70889bb885dbb88323dc8d7a407df941be8dd2dfa3ec5e94dac7033cc4233cc6133cc5333cc78bffb327c18029669863812556d1ef1a9ba8168080a1850ec608daaf30814bb882296ec035dc486426700b33b8837b78c0213cc2133ce367af3f7a93c01c5e700b5ee10d6fe11d093ee01396610556f104d6601d36a2d77abf0da2f41036610bb6b1841d18c12e7c873dd887033884233886133885b318297d3fc558e114cee1021208d1e01432c8a180122aa8e3c5190f2322c63bb507995aea62bc37698c9f34a14bba822d9ad235ddd02dcde80e87744f0f7fc823d1233de1363d634d737aa1577aa3ebf8047ba70ffaa4655aa1555aa375b37f0c298e6923ca0fb0a1212cd3266dd136edd08876e93bedd13e1dd0211d997e88f6031dd3099d624e67744e17f15f8b40296594cb273ef61632aa5ff34515d5d43032707c19449fd6e993db283b8217ee62fc0630fa31bf1cdf037c493bb1724ef98a162d30e56bcae185467cc3b731dfa0f935f919dff13daef1033ff2133fc77d039e73d41da55ff90d268b8afba17ea27d30a18edff9833f7999577895d7a88421aff31b6fc0e04ff5c6314acc031ef2266cc4c7ce036ff12ca66a10ff75d95eacfd2ccf3b0bfd38e651ac93f7d83b77f84e47d1e6f1222e0bf9c5ef3ff7a3f690766f4ffd0490aa85affffbf5cbef985d44a8</data> |
||||
</image> |
||||
</images> |
||||
<connections> |
||||
<connection> |
||||
<sender>Button_Search</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>Search_Dlg</receiver> |
||||
<slot>OnButtonSearch()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>Button_Close</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>Search_Dlg</receiver> |
||||
<slot>OnButtonClose()</slot> |
||||
</connection> |
||||
</connections> |
||||
<tabstops> |
||||
<tabstop>Edit_Search</tabstop> |
||||
<tabstop>checkBox_Cs</tabstop> |
||||
<tabstop>checkBox_regExp</tabstop> |
||||
<tabstop>checkBox_Title</tabstop> |
||||
<tabstop>checkBox_Username</tabstop> |
||||
<tabstop>checkBox_Password</tabstop> |
||||
<tabstop>checkBox_Comment</tabstop> |
||||
<tabstop>checkBox_URL</tabstop> |
||||
<tabstop>checkBox_Attachment</tabstop> |
||||
<tabstop>Button_Search</tabstop> |
||||
<tabstop>Button_Close</tabstop> |
||||
</tabstops> |
||||
<slots> |
||||
<slot>OnButtonSearch()</slot> |
||||
<slot>OnButtonClose()</slot> |
||||
</slots> |
||||
<layoutdefaults spacing="6" margin="11"/> |
||||
</UI> |
@ -0,0 +1,492 @@ |
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
||||
<class>SettingsDialog</class> |
||||
<widget class="QDialog"> |
||||
<property name="name"> |
||||
<cstring>SettingsDialog</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>571</width> |
||||
<height>341</height> |
||||
</rect> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>571</width> |
||||
<height>341</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>571</width> |
||||
<height>341</height> |
||||
</size> |
||||
</property> |
||||
<property name="caption"> |
||||
<string>Einstellungen</string> |
||||
</property> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonCancel</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>470</x> |
||||
<y>310</y> |
||||
<width>90</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Abbre&chen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+C</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>Banner</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>570</width> |
||||
<height>50</height> |
||||
</rect> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonOK</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>380</x> |
||||
<y>310</y> |
||||
<width>80</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>O&K</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+K</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QTabWidget"> |
||||
<property name="name"> |
||||
<cstring>tabWidget4</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>60</y> |
||||
<width>550</width> |
||||
<height>240</height> |
||||
</rect> |
||||
</property> |
||||
<widget class="QWidget"> |
||||
<property name="name"> |
||||
<cstring>tab</cstring> |
||||
</property> |
||||
<attribute name="title"> |
||||
<string>Sicherhei&t</string> |
||||
</attribute> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>20</y> |
||||
<width>180</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Zwischenablage löschen nach:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>280</x> |
||||
<y>20</y> |
||||
<width>100</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Sekunden</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QSpinBox"> |
||||
<property name="name"> |
||||
<cstring>SpinBox_ClipboardTime</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>190</x> |
||||
<y>20</y> |
||||
<width>80</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>CheckBox_ShowPasswords</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>50</y> |
||||
<width>420</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Passw&örter standardmäßig in Klartext anzeigen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ö</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<widget class="QWidget"> |
||||
<property name="name"> |
||||
<cstring>TabPage</cstring> |
||||
</property> |
||||
<attribute name="title"> |
||||
<string>E&rscheinungsbild</string> |
||||
</attribute> |
||||
<widget class="QGroupBox"> |
||||
<property name="name"> |
||||
<cstring>groupBox1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>10</y> |
||||
<width>520</width> |
||||
<height>90</height> |
||||
</rect> |
||||
</property> |
||||
<property name="title"> |
||||
<string>Bannerfarbverlauf</string> |
||||
</property> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1_3</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>20</y> |
||||
<width>53</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Farbe 1</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>pixmColor1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>70</x> |
||||
<y>20</y> |
||||
<width>22</width> |
||||
<height>22</height> |
||||
</rect> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonColor1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>100</x> |
||||
<y>20</y> |
||||
<width>60</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>&ändern...</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ä</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel3</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>190</x> |
||||
<y>20</y> |
||||
<width>60</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Farbe 2</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>pixmTextColor</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>70</x> |
||||
<y>50</y> |
||||
<width>22</width> |
||||
<height>22</height> |
||||
</rect> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonTextColor</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>100</x> |
||||
<y>50</y> |
||||
<width>60</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>ändern...</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string></string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel2_2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>50</y> |
||||
<width>54</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Textfarbe</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>pixmColor2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>250</x> |
||||
<y>20</y> |
||||
<width>22</width> |
||||
<height>22</height> |
||||
</rect> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap>image0</pixmap> |
||||
</property> |
||||
<property name="scaledContents"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonColor2</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>280</x> |
||||
<y>20</y> |
||||
<width>60</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>ändern...</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string></string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>CheckBox_ExpandGroupTree</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>110</y> |
||||
<width>380</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Gruppenbaum beim &Öffnen aufklappen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ö</string> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<widget class="QWidget"> |
||||
<property name="name"> |
||||
<cstring>tab</cstring> |
||||
</property> |
||||
<attribute name="title"> |
||||
<string>S&onstiges</string> |
||||
</attribute> |
||||
<widget class="QCheckBox"> |
||||
<property name="name"> |
||||
<cstring>CheckBox_OpenLast</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>20</y> |
||||
<width>380</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>zuletzt geöffnete Datei bei Programmstart &öffnen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+ö</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1_4</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>50</y> |
||||
<width>110</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Browseraufruf:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>Edit_BrowserCmd</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>120</x> |
||||
<y>50</y> |
||||
<width>190</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
</widget> |
||||
</widget> |
||||
<images> |
||||
<image name="image0"> |
||||
<data format="XPM.GZ" length="4833">789c8597596f23470e80dfe75718c3b7c182e9eabb11ec834fc9873cbeaf601fc86ec9966df994cfc5fef794483633934d10c836fcb9582cde55fee5dbd2d9de68e9db2f5f9ee7349fb64bed153d2d7deb5e66b38fdffef3efff7ef99aa64b8baf2c5b4abffeebcb57dc5c6a9720499290640b8613e110ff22eb941b07657e7256f90be742e4a7c6a9ed076791c7a1732efbd784d3f817615a71167db0e55c0a17ce95c88f8ced3c7e74d6f306cea29fd159f583b3e8a75367d18f5bce8df0b63389be67e3ccfcd97716fd78e22cfaf1d459edefedcbedbc63e75af4cf85b33edeb8616cfef1b5b39eb7e72cf6c28b7166fb53678df7b5b3fadf388b3d503a8b3d40c6b9eaa35767d9cf37c6a5e53f73d6f3769d55bedf5f2789ac6bfcf2de1fda33ce4cdfbb716eeb6fce1acf1de3c2f2bbe7acf573605cdafe2b67f5efd359f20bb97165febe38b3c453fd2bfa7cd0a67165fea97c9db416ff1de3b1e9d77a6d12567bf8c159ed9d1ab7969fc2b8d378e2ba304579c93769bd719457fd524f2184cae221f51bd250a8fd3c35ae4cfec1b8b6fa06e3c6eaffc859d651f215b2d0c7efdab8327b969d459e9e8d7bfd57c68df587c43be4c1e20b685c1b9f0b17c1e283cfce927f96f911ca40d63fcbce7afebd31eb3a91b3fa37376ead9e64dea5759606a94f546eb23499883d9bc69932bef4acf22cf594725c1f8bfca9b3c8d3aa711e82c82bb73de3817111a4fe2171d67e1a1b97ba8e87ce5a8f12bfb48b2cfae8ceb85206894f9666135bff2e5c45d6fae894a3393a3f5be13aaeb7729eca4ff2d6ce3f5b701ef2b1c95f0aa7715dfb4de657519675d0fc8d8c9ba0f527f12faab234fd8fc695f1ab716dfa3f84ebb2089dec5f779678d381711d74beae398b7f540b3751bfd6e39ab1c9033b6bbd07e326687dcb3c2da8ecf47cfa301e9bbe37e389c94b3c0a2edba0f5f361dc194b3c8b36eed77acf9c453fab7f6d95587e6e8d83c957c25dc9668fdc5fc538b2c6e3a6e754e7adcc836252b6a9d69bccffb2ad535d67e98fb2ab538befaab3e8439947e5b84e82f6ffa17165f1bd7096fcc1ccb8b67a981b375a0f20f92d2775b078493dd54c75aaef0de9dfba75167fea2eb2f683dc5771388d753fbe396b7fca7c6b52ea2c5e57ce621fcbfdd26464f1812767ed8f63e3ced665de34c464fe9e1bb3d5b3f45bc3dca67a7fc9fba7697b46a9bf66cc13cb8fcc8b66c2960f3832b6f3988dad1e2828b799c53371d6f9766b9c5b7f4afe286983f5c3aeb3be177ace6c1ecc9cb51f6a678def8a7169f351fca710f5a93d9db3d64febacf9981aa76a2f5e3b6b7d5d1af7f6df3aebfb67e4acf93f72d6f972675cd83c7d77d67cac3bebfdfce9acf7eb87b3c66b665cdabc5feed9f44bfd51caade59395dbc4fc3f33cecc9f9b9e35bf786fdccfffc459e7ffc059eb7fe2acefcfd459df13dbceda5f4367bddffed8affdf0665c243a6f769c351f6367f51f7ad6fcefcf9dd57e72567fd959e3dd3a6bbc3b677daf34ce6affadb3dadbdb57263a5f46ce7adf8e9dd5dededfbe5e2f9cb5de5b678df7bb71a5fa59f767dccf77cd57d6f7136c185b7e79d359f3159cf53df7e8acf19e19f7f57ee5acef9b0d67f5b733b6fa844b63f38f07ceea9fcc3fca5b9bef58199b3dbce5acefa53567bd6fee8c73d54f95b3fa3b34b6fcc3b3b3f6dba1b3f6afe6a788fb6bad9f1f3f08f19b90b18ddff0f3dafefc2fe4bb284948f1b7f1e2e73fca4ff012af708ad77883b77f2f8f33bc8b9aeff1011ff1099f718e2ff88a6ff88e1ff8196da33fc92fe30aaee21aaee3060e70889bb885dbb88323dc8d7a407df941be8dd2dfa3ec5e94dac7033cc4233cc6133cc5333cc78bffb327c18029669863812556d1ef1a9ba8168080a1850ec608daaf30814bb882296ec035dc486426700b33b8837b78c0213cc2133ce367af3f7a93c01c5e700b5ee10d6fe11d093ee01396610556f104d6601d36a2d77abf0da2f41036610bb6b1841d18c12e7c873dd887033884233886133885b318297d3fc558e114cee1021208d1e01432c8a180122aa8e3c5190f2322c63bb507995aea62bc37698c9f34a14bba822d9ad235ddd02dcde80e87744f0f7fc823d1233de1363d634d737aa1577aa3ebf8047ba70ffaa4655aa1555aa375b37f0c298e6923ca0fb0a1212cd3266dd136edd08876e93bedd13e1dd0211d997e88f6031dd3099d624e67744e17f15f8b40296594cb273ef61632aa5ff34515d5d43032707c19449fd6e993db283b8217ee62fc0630fa31bf1cdf037c493bb1724ef98a162d30e56bcae185467cc3b731dfa0f935f919dff13daef1033ff2133fc77d039e73d41da55ff90d268b8afba17ea27d30a18edff9833f7999577895d7a88421aff31b6fc0e04ff5c6314acc031ef2266cc4c7ce036ff12ca66a10ff75d95eacfd2ccf3b0bfd38e651ac93f7d83b77f84e47d1e6f1222e0bf9c5ef3ff7a3f690766f4ffd0490aa85affffbf5cbef985d44a8</data> |
||||
</image> |
||||
</images> |
||||
<connections> |
||||
<connection> |
||||
<sender>ButtonOK</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>SettingsDialog</receiver> |
||||
<slot>OnOK()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonCancel</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>SettingsDialog</receiver> |
||||
<slot>OnCancel()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonColor1</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>SettingsDialog</receiver> |
||||
<slot>OnColor1()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonColor2</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>SettingsDialog</receiver> |
||||
<slot>OnColor2()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonTextColor</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>SettingsDialog</receiver> |
||||
<slot>OnTextColor()</slot> |
||||
</connection> |
||||
</connections> |
||||
<tabstops> |
||||
<tabstop>tabWidget4</tabstop> |
||||
<tabstop>SpinBox_ClipboardTime</tabstop> |
||||
<tabstop>CheckBox_ShowPasswords</tabstop> |
||||
<tabstop>ButtonColor1</tabstop> |
||||
<tabstop>ButtonTextColor</tabstop> |
||||
<tabstop>ButtonColor2</tabstop> |
||||
<tabstop>CheckBox_OpenLast</tabstop> |
||||
<tabstop>Edit_BrowserCmd</tabstop> |
||||
<tabstop>ButtonOK</tabstop> |
||||
<tabstop>ButtonCancel</tabstop> |
||||
</tabstops> |
||||
<slots> |
||||
<slot>OnOK()</slot> |
||||
<slot>OnCancel()</slot> |
||||
<slot>OnColor1()</slot> |
||||
<slot>OnColor2()</slot> |
||||
<slot>OnTextColor()</slot> |
||||
<slot>newSlot()</slot> |
||||
</slots> |
||||
<layoutdefaults spacing="6" margin="11"/> |
||||
</UI> |
@ -0,0 +1,154 @@ |
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
||||
<class>SimplePasswordDialog</class> |
||||
<widget class="QDialog"> |
||||
<property name="name"> |
||||
<cstring>SimplePasswordDialog</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>2</x> |
||||
<y>3</y> |
||||
<width>345</width> |
||||
<height>90</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy> |
||||
<hsizetype>0</hsizetype> |
||||
<vsizetype>0</vsizetype> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>345</width> |
||||
<height>90</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>345</width> |
||||
<height>90</height> |
||||
</size> |
||||
</property> |
||||
<property name="caption"> |
||||
<string>Passworteingabe</string> |
||||
</property> |
||||
<widget class="QLabel"> |
||||
<property name="name"> |
||||
<cstring>textLabel1</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>10</x> |
||||
<y>20</y> |
||||
<width>60</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Passwort:</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QLineEdit"> |
||||
<property name="name"> |
||||
<cstring>EditPassword</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>80</x> |
||||
<y>20</y> |
||||
<width>240</width> |
||||
<height>21</height> |
||||
</rect> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonOK</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>170</x> |
||||
<y>60</y> |
||||
<width>80</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>O&K</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+K</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>ButtonCancel</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>257</x> |
||||
<y>60</y> |
||||
<width>80</width> |
||||
<height>23</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>Abbre&chen</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string>Alt+C</string> |
||||
</property> |
||||
</widget> |
||||
<widget class="QPushButton"> |
||||
<property name="name"> |
||||
<cstring>Button_HidePassword</cstring> |
||||
</property> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>320</x> |
||||
<y>20</y> |
||||
<width>20</width> |
||||
<height>20</height> |
||||
</rect> |
||||
</property> |
||||
<property name="text"> |
||||
<string>...</string> |
||||
</property> |
||||
<property name="accel"> |
||||
<string></string> |
||||
</property> |
||||
<property name="toggleButton"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
</widget> |
||||
<connections> |
||||
<connection> |
||||
<sender>Button_HidePassword</sender> |
||||
<signal>toggled(bool)</signal> |
||||
<receiver>SimplePasswordDialog</receiver> |
||||
<slot>OnHidePasswordToggled(bool)</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonOK</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>SimplePasswordDialog</receiver> |
||||
<slot>OnOK()</slot> |
||||
</connection> |
||||
<connection> |
||||
<sender>ButtonCancel</sender> |
||||
<signal>clicked()</signal> |
||||
<receiver>SimplePasswordDialog</receiver> |
||||
<slot>OnCancel()</slot> |
||||
</connection> |
||||
</connections> |
||||
<slots> |
||||
<slot>OnHidePasswordToggled(bool state)</slot> |
||||
<slot>OnOK()</slot> |
||||
<slot>OnCancel()</slot> |
||||
</slots> |
||||
<layoutdefaults spacing="6" margin="11"/> |
||||
</UI> |
@ -0,0 +1,121 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include "Import_KWalletXml.h" |
||||
#include <iostream.h> |
||||
#include <qobject.h> |
||||
#include <qfile.h> |
||||
#include <qdom.h> |
||||
|
||||
bool Import_KWalletXml::importFile(QString FileName,PwDatabase* pwm,QString& err){ |
||||
QFile file(FileName); |
||||
if(!file.exists()){ |
||||
err+=QObject::trUtf8("Datei nicht gefunden"); |
||||
return false;} |
||||
if(!file.open(IO_ReadOnly)){ |
||||
err+=QObject::trUtf8("Datei konnte nicht geöffnet werden"); |
||||
return false;} |
||||
int len=file.size(); |
||||
if(len==0){ |
||||
err+=QObject::trUtf8("Datei ist leer"); |
||||
return false;} |
||||
UINT8* buffer=new UINT8[len]; |
||||
file.readBlock((char*)buffer,len); |
||||
file.close(); |
||||
QDomDocument doc; |
||||
QString xmlerr; |
||||
int col,line; |
||||
if(!doc.setContent(QString::fromUtf8((char*)buffer,len),false,&xmlerr,&line,&col)){ |
||||
cout << "Import_PwManager::parseXmlContent():" << endl; |
||||
cout << (xmlerr+" (Line:%1 Column:%2)").arg(line).arg(col) << endl; |
||||
err+=QObject::trUtf8("Ungültiges XML-Dokument"); |
||||
delete [] buffer; |
||||
return false;} |
||||
delete [] buffer; |
||||
QDomElement root=doc.documentElement(); |
||||
if(root.tagName()!="wallet"){err+=QObject::trUtf8("Ungültiges XML-Dokument"); return false;} |
||||
QDomNodeList groups=root.elementsByTagName("folder"); |
||||
if(!groups.length()){err+=QObject::trUtf8("Dokument enthält keine Daten"); return false;} |
||||
for(int i=0;i<groups.length();i++){ |
||||
if(!groups.item(i).isElement()){err+=QObject::trUtf8("Ungültiges XML-Dokument"); return false;} |
||||
QDomElement CurrGroup=groups.item(i).toElement(); |
||||
if(!CurrGroup.hasAttribute("name")){err+=QObject::trUtf8("Ungültiges XML-Dokument"); return false;} |
||||
CGroup* NewGroup=pwm->addGroup(NULL); |
||||
NewGroup->Name=CurrGroup.attribute("name"); |
||||
QDomNodeList entries=CurrGroup.elementsByTagName("password"); |
||||
for(int j=0;j<entries.length();j++){ |
||||
if(!entries.item(j).isElement()){err+=QObject::trUtf8("Ungültiges XML-Dokument"); return false;} |
||||
QDomElement CurrEntry=entries.item(j).toElement(); |
||||
if(!CurrEntry.hasAttribute("name")){err+=QObject::trUtf8("Ungültiges XML-Dokument"); return false;} |
||||
CEntry* NewEntry=pwm->addEntry(); |
||||
NewEntry->Title=CurrEntry.attribute("name"); |
||||
NewEntry->GroupID=NewGroup->ID; |
||||
QString pw=CurrEntry.text(); |
||||
NewEntry->Password.setString(pw,true); |
||||
} |
||||
} |
||||
pwm->filename=""; |
||||
pwm->SearchGroupID=-1; |
||||
pwm->CryptoAlgorithmus=ALGO_AES; |
||||
pwm->KeyEncRounds=6000; |
||||
return true; |
||||
} |
||||
|
||||
|
||||
// unvollständiger Schnippsel zum Lesen des Binärformats
|
||||
/*
|
||||
QFile file(FileName); |
||||
if(!file.exists()){ |
||||
err+=QObject::trUtf8("Datei nicht gefunden"); |
||||
return false;} |
||||
if(!file.open(IO_ReadOnly)){ |
||||
err+=QObject::trUtf8("Datei konnte nicht geöffnet werden"); |
||||
return false;} |
||||
int len=file.size(); |
||||
int offset=0; |
||||
if(len<48){ |
||||
err+=QObject::trUtf8("Unerwartete Dateilänge"); |
||||
return false;} |
||||
UINT8* buffer=new UINT8[len]; |
||||
int df=file.readBlock((char*)buffer,len); |
||||
file.close(); |
||||
|
||||
if(memcmp(buffer,"KWALLET\n\r\0\r\n",12)){ |
||||
err+=QObject::trUtf8("Keine gültige KWallet-Datei"); |
||||
return false;} |
||||
offset+=12; |
||||
MajorVersion=buffer[offset]; |
||||
offset++; |
||||
MinorVersion=buffer[offset]; |
||||
offset++; |
||||
if(MajorVersion != 0 || MinorVersion !=0){ |
||||
err+=QObject::trUtf8("Nicht unterstützte Format Version"); |
||||
return false;} |
||||
CryptAlgo=buffer[offset]; |
||||
offset++; |
||||
if(CryptAlgo != 0){ |
||||
err+=QObject::trUtf8("Nicht unterstützter Verschlüsselungsalgorithmus"); |
||||
return false;} |
||||
HashAlgo=buffer[offset]; |
||||
offset++; |
||||
if(HashAlgo != 0){ |
||||
err+=QObject::trUtf8("Nicht unterstützter Hash-Algorithmus"); |
||||
return false;} |
||||
*/ |
@ -0,0 +1,32 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#ifndef _IMPORT_KWALLET_H_ |
||||
#define _IMPORT_KWALLET_H_ |
||||
#include <qstring.h> |
||||
#include "PwManager.h" |
||||
|
||||
class Import_KWalletXml{ |
||||
public: |
||||
bool importFile(QString FileName,PwDatabase* db,QString& err); |
||||
private: |
||||
|
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,165 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include <qobject.h> |
||||
#include <qfile.h> |
||||
#include <iostream.h> |
||||
#include <qdom.h> |
||||
#include "crypto/blowfish.h" |
||||
#include "crypto/sha1.h" |
||||
#include "Import_PwManager.h" |
||||
|
||||
|
||||
bool Import_PwManager::importFile(QString filename, QString password, PwDatabase* db, QString& err){ |
||||
database=db; |
||||
QFile file(filename); |
||||
char* buffer=NULL; |
||||
int offset=0; |
||||
int len=0; |
||||
if(!file.exists()){err+=QObject::trUtf8("Die angegebene Datei existiert nicht."); return false;} |
||||
if(!file.open(IO_ReadOnly)){err+=QObject::trUtf8("Datei konnte nicht geöffnet werden."); return false;} |
||||
if(len=file.size()) buffer=new char[len]; |
||||
else {err+=QObject::trUtf8("Datei ist leer"); return false;} |
||||
file.readBlock(buffer,len); |
||||
file.close(); |
||||
if(QString::fromAscii(buffer,17)!="PWM_PASSWORD_FILE") |
||||
{err+=QObject::trUtf8("Keine gültige PwManager-Datei"); return false;} |
||||
offset+=17; |
||||
if(buffer[offset]!=0x05) |
||||
{err+=QObject::trUtf8("Nicht unterstützte Version"); return false;} |
||||
offset++; |
||||
if(buffer[offset]!=0x01) |
||||
{err+=QObject::trUtf8("Nicht unterstützter Hash-Algorithmus"); return false;} |
||||
offset++; |
||||
if(buffer[offset]!=0x01) |
||||
{err+=QObject::trUtf8("Nicht unterstützter Hash-Algorithmus"); return false;} |
||||
offset++; |
||||
if(buffer[offset]!=0x01) |
||||
{err+=QObject::trUtf8("Nicht unterstützter Verschlüsselungs-Algorithmus"); return false;} |
||||
offset++; |
||||
if(buffer[offset]==0x00)Compression=0; |
||||
if(buffer[offset]==0x01)Compression=1; |
||||
if(buffer[offset]==0x02)Compression=2; |
||||
///@TODO Compression
|
||||
if(buffer[offset]) |
||||
{err+=QObject::trUtf8("Komprimierte PwManager-Dateien werden nicht unterstützt"); return false;} |
||||
offset++; |
||||
if(buffer[offset]==0x00)KeyFlag=true; |
||||
else KeyFlag=false; |
||||
offset++; |
||||
//Reserved Bytes (64)
|
||||
offset+=64; |
||||
memcpy(KeyHash,buffer+offset,20); |
||||
offset+=20; |
||||
memcpy(DataHash,buffer+offset,20); |
||||
offset+=20; |
||||
|
||||
Blowfish blowfish; |
||||
int pwlen=password.length(); |
||||
byte* Key=new byte[pwlen]; |
||||
byte* xml=new byte[len-offset+1]; |
||||
xml[len-offset]=0; |
||||
memcpy(Key,password.ascii(),pwlen); |
||||
char* key_hash=new char[20]; |
||||
CSHA1 sha; |
||||
sha.Update(Key,pwlen); |
||||
sha.Final(); |
||||
sha.GetHash((unsigned char*)key_hash); |
||||
if(memcmp(key_hash,KeyHash,20)){ |
||||
delete[] Key; delete [] key_hash; delete [] buffer; |
||||
err+=QObject::trUtf8("Falsches Passwort"); |
||||
return false; |
||||
} |
||||
delete [] key_hash; |
||||
blowfish.bf_setkey(Key,password.length()); |
||||
blowfish.bf_decrypt(xml,(byte*)buffer+offset,len-offset); |
||||
delete [] Key; |
||||
delete [] buffer; |
||||
char* content_hash=new char[20]; |
||||
sha.Reset(); |
||||
sha.Update(xml,strlen((char*)xml)-1); |
||||
sha.Final(); |
||||
sha.GetHash((unsigned char*)content_hash); |
||||
if(memcmp(content_hash,DataHash,20)){ |
||||
delete [] content_hash; delete [] xml; |
||||
err+=QObject::trUtf8("Dateiinhalt ungültig (Hash-Test fehlgeschlagen)"); |
||||
return false; |
||||
} |
||||
delete[] content_hash; |
||||
|
||||
if(!parseXmlContent((char*)xml)){ |
||||
delete [] xml; |
||||
err+=QObject::trUtf8("Ungültiger XML-Inhalt"); return false;} |
||||
return true; |
||||
} |
||||
|
||||
bool Import_PwManager::parseXmlContent(char* content){ |
||||
QDomDocument db; |
||||
QString err; |
||||
int col,line; |
||||
if(!db.setContent(QString::fromUtf8(content,strlen(content)-1),false,&err,&line,&col)){ |
||||
cout << "Import_PwManager::parseXmlContent():" << endl; |
||||
cout << (err+" (Line:%1 Column:%2)").arg(line).arg(col) << endl; |
||||
return false;} |
||||
QDomElement root=db.documentElement(); |
||||
if(root.tagName()!="P")return false; |
||||
//Kommentar und Kategorie haben das selbe Tag "c"
|
||||
if(!root.elementsByTagName("c").item(0).isElement())return false; |
||||
QDomElement groups=root.elementsByTagName("c").item(0).toElement(); |
||||
|
||||
int i=0; |
||||
while(1){ |
||||
QDomElement CurrGroup; |
||||
if(!groups.elementsByTagName("c"+QString::number(i)).length())break; |
||||
if(groups.elementsByTagName("c"+QString::number(i)).length()>1)return false; |
||||
if(!groups.elementsByTagName("c"+QString::number(i)).item(0).isElement())return false; |
||||
CurrGroup=groups.elementsByTagName("c"+QString::number(i)).item(0).toElement(); |
||||
if(!CurrGroup.hasAttribute("n"))return false; |
||||
CGroup* NewGroup=database->addGroup(NULL); |
||||
NewGroup->Name=CurrGroup.attribute("n"); |
||||
int j=0; |
||||
while(1){ |
||||
QDomElement CurrEntry; |
||||
if(!CurrGroup.elementsByTagName("e"+QString::number(j)).length())break; |
||||
if(CurrGroup.elementsByTagName("e"+QString::number(j)).length()>1)return false; |
||||
if(!CurrGroup.elementsByTagName("e"+QString::number(j)).item(0).isElement())return false; |
||||
CurrEntry=CurrGroup.elementsByTagName("e"+QString::number(j)).item(0).toElement(); |
||||
if(!xml_parseEntryAttributes(&CurrEntry,NewGroup))return false; |
||||
j++; |
||||
} |
||||
i++; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
bool Import_PwManager::xml_parseEntryAttributes(QDomElement* EntryElement,CGroup* NewGroup){ |
||||
CEntry* e=database->addEntry(); |
||||
e->Title=EntryElement->elementsByTagName("d").item(0).toElement().text(); |
||||
e->UserName=EntryElement->elementsByTagName("n").item(0).toElement().text(); |
||||
QString pw=EntryElement->elementsByTagName("p").item(0).toElement().text(); |
||||
e->Password.setString(pw,true); |
||||
e->Additional=EntryElement->elementsByTagName("c").item(0).toElement().text(); |
||||
e->Additional=e->Additional.replace("$>--endl--<$","\n"); |
||||
e->URL=EntryElement->elementsByTagName("u").item(0).toElement().text(); |
||||
e->GroupID=NewGroup->ID; |
||||
return true; |
||||
} |
||||
|
@ -0,0 +1,41 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#ifndef _IMPORT_PWMANAGER_ |
||||
#define _IMPORT_PWMANAGER_ |
||||
#include <qdom.h> |
||||
#include <qstring.h> |
||||
#include "PwManager.h" |
||||
|
||||
class Import_PwManager{ |
||||
public: |
||||
bool importFile(QString FileName, QString Password,PwDatabase* db,QString& err); |
||||
private: |
||||
bool KeyFlag; // true=Password, false=Chipcard
|
||||
int Compression; // 0=none, 1=gzip, 2=bzip2
|
||||
unsigned char KeyHash[20]; |
||||
unsigned char DataHash[20]; |
||||
PwDatabase* database; |
||||
|
||||
bool parseXmlContent(char* content); |
||||
bool xml_parseEntryAttributes(QDomElement* EntryTag,CGroup* parent); |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,488 @@ |
||||
// IniFile.cpp: Implementation of the CIniFile class.
|
||||
// Written by: Adam Clauss
|
||||
// Email: cabadam@houston.rr.com
|
||||
// You may use this class/code as you wish in your programs. Feel free to distribute it, and
|
||||
// email suggested changes to me.
|
||||
//
|
||||
// Rewritten by: Shane Hill
|
||||
// Date: 21/08/2001
|
||||
// Email: Shane.Hill@dsto.defence.gov.au
|
||||
// Reason: Remove dependancy on MFC. Code should compile on any
|
||||
// platform.
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// C++ Includes
|
||||
#include <iostream> |
||||
#include <fstream> |
||||
#include <strstream> |
||||
|
||||
using namespace std; |
||||
|
||||
// C Includes
|
||||
#include <stdio.h> |
||||
#include <stdarg.h> |
||||
#include <ctype.h> |
||||
|
||||
// Local Includes
|
||||
#include "IniReader.h" |
||||
|
||||
#if defined(WIN32) |
||||
#define iniEOL endl |
||||
#else |
||||
#define iniEOL '\r' << endl |
||||
#endif |
||||
|
||||
CIniFile::CIniFile( string const iniPath) |
||||
{ |
||||
Path( iniPath); |
||||
caseInsensitive = true; |
||||
} |
||||
|
||||
bool CIniFile::ReadFile() |
||||
{ |
||||
// Normally you would use ifstream, but the SGI CC compiler has
|
||||
// a few bugs with ifstream. So ... fstream used.
|
||||
fstream f; |
||||
string line; |
||||
string keyname, valuename, value; |
||||
string::size_type pLeft, pRight; |
||||
|
||||
f.open( path.c_str(), ios::in); |
||||
if ( f.fail()) |
||||
return false; |
||||
|
||||
while( getline( f, line)) { |
||||
// To be compatible with Win32, check for existence of '\r'.
|
||||
// Win32 files have the '\r' and Unix files don't at the end of a line.
|
||||
// Note that the '\r' will be written to INI files from
|
||||
// Unix so that the created INI file can be read under Win32
|
||||
// without change.
|
||||
if ( line[line.length() - 1] == '\r') |
||||
line = line.substr( 0, line.length() - 1); |
||||
|
||||
if ( line.length()) { |
||||
// Check that the user hasn't openned a binary file by checking the first
|
||||
// character of each line!
|
||||
if ( !isprint( line[0])) { |
||||
printf( "Failing on char %d\n", line[0]); |
||||
f.close(); |
||||
return false; |
||||
} |
||||
if (( pLeft = line.find_first_of(";#[=")) != string::npos) { |
||||
switch ( line[pLeft]) { |
||||
case '[': |
||||
if ((pRight = line.find_last_of("]")) != string::npos && |
||||
pRight > pLeft) { |
||||
keyname = line.substr( pLeft + 1, pRight - pLeft - 1); |
||||
AddKeyName( keyname); |
||||
} |
||||
break; |
||||
|
||||
case '=': |
||||
valuename = line.substr( 0, pLeft); |
||||
value = line.substr( pLeft + 1); |
||||
SetValue( keyname, valuename, value); |
||||
break; |
||||
|
||||
case ';': |
||||
case '#': |
||||
if ( !names.size()) |
||||
HeaderComment( line.substr( pLeft + 1)); |
||||
else |
||||
KeyComment( keyname, line.substr( pLeft + 1)); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
f.close(); |
||||
if ( names.size()) |
||||
return true; |
||||
return false; |
||||
} |
||||
|
||||
bool CIniFile::WriteFile() |
||||
{ |
||||
unsigned commentID, keyID, valueID; |
||||
// Normally you would use ofstream, but the SGI CC compiler has
|
||||
// a few bugs with ofstream. So ... fstream used.
|
||||
fstream f; |
||||
|
||||
f.open( path.c_str(), ios::out); |
||||
if ( f.fail()) |
||||
return false; |
||||
|
||||
// Write header comments.
|
||||
for ( commentID = 0; commentID < comments.size(); ++commentID) |
||||
f << ';' << comments[commentID] << iniEOL; |
||||
if ( comments.size()) |
||||
f << iniEOL; |
||||
|
||||
// Write keys and values.
|
||||
for ( keyID = 0; keyID < keys.size(); ++keyID) { |
||||
f << '[' << names[keyID] << ']' << iniEOL; |
||||
// Comments.
|
||||
for ( commentID = 0; commentID < keys[keyID].comments.size(); ++commentID) |
||||
f << ';' << keys[keyID].comments[commentID] << iniEOL; |
||||
// Values.
|
||||
for ( valueID = 0; valueID < keys[keyID].names.size(); ++valueID) |
||||
f << keys[keyID].names[valueID] << '=' << keys[keyID].values[valueID] << iniEOL; |
||||
f << iniEOL; |
||||
} |
||||
f.close(); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
long CIniFile::FindKey( string const keyname) const |
||||
{ |
||||
for ( unsigned keyID = 0; keyID < names.size(); ++keyID) |
||||
if ( CheckCase( names[keyID]) == CheckCase( keyname)) |
||||
return long(keyID); |
||||
return noID; |
||||
} |
||||
|
||||
long CIniFile::FindValue( unsigned const keyID, string const valuename) const |
||||
{ |
||||
if ( !keys.size() || keyID >= keys.size()) |
||||
return noID; |
||||
|
||||
for ( unsigned valueID = 0; valueID < keys[keyID].names.size(); ++valueID) |
||||
if ( CheckCase( keys[keyID].names[valueID]) == CheckCase( valuename)) |
||||
return long(valueID); |
||||
return noID; |
||||
} |
||||
|
||||
unsigned CIniFile::AddKeyName( string const keyname) |
||||
{ |
||||
names.resize( names.size() + 1, keyname); |
||||
keys.resize( keys.size() + 1); |
||||
return names.size() - 1; |
||||
} |
||||
|
||||
string CIniFile::KeyName( unsigned const keyID) const |
||||
{ |
||||
if ( keyID < names.size()) |
||||
return names[keyID]; |
||||
else |
||||
return ""; |
||||
} |
||||
|
||||
unsigned CIniFile::NumValues( unsigned const keyID) |
||||
{ |
||||
if ( keyID < keys.size()) |
||||
return keys[keyID].names.size(); |
||||
return 0; |
||||
} |
||||
|
||||
unsigned CIniFile::NumValues( string const keyname) |
||||
{ |
||||
long keyID = FindKey( keyname); |
||||
if ( keyID == noID) |
||||
return 0; |
||||
return keys[keyID].names.size(); |
||||
} |
||||
|
||||
string CIniFile::ValueName( unsigned const keyID, unsigned const valueID) const |
||||
{ |
||||
if ( keyID < keys.size() && valueID < keys[keyID].names.size()) |
||||
return keys[keyID].names[valueID]; |
||||
return ""; |
||||
} |
||||
|
||||
string CIniFile::ValueName( string const keyname, unsigned const valueID) const |
||||
{ |
||||
long keyID = FindKey( keyname); |
||||
if ( keyID == noID) |
||||
return ""; |
||||
return ValueName( keyID, valueID); |
||||
} |
||||
|
||||
bool CIniFile::SetValue( unsigned const keyID, unsigned const valueID, string const value) |
||||
{ |
||||
if ( keyID < keys.size() && valueID < keys[keyID].names.size()) |
||||
keys[keyID].values[valueID] = value; |
||||
|
||||
return false; |
||||
} |
||||
|
||||
bool CIniFile::SetValue( string const keyname, string const valuename, string const value, bool const create) |
||||
{ |
||||
long keyID = FindKey( keyname); |
||||
if ( keyID == noID) { |
||||
if ( create) |
||||
keyID = long( AddKeyName( keyname)); |
||||
else |
||||
return false; |
||||
} |
||||
|
||||
long valueID = FindValue( unsigned(keyID), valuename); |
||||
if ( valueID == noID) { |
||||
if ( !create) |
||||
return false; |
||||
keys[keyID].names.resize( keys[keyID].names.size() + 1, valuename); |
||||
keys[keyID].values.resize( keys[keyID].values.size() + 1, value); |
||||
} else |
||||
keys[keyID].values[valueID] = value; |
||||
|
||||
return true; |
||||
} |
||||
|
||||
bool CIniFile::SetValueI( string const keyname, string const valuename, int const value, bool const create) |
||||
{ |
||||
char svalue[MAX_VALUEDATA]; |
||||
|
||||
sprintf( svalue, "%d", value); |
||||
return SetValue( keyname, valuename, svalue); |
||||
} |
||||
|
||||
bool CIniFile::SetValueF( string const keyname, string const valuename, double const value, bool const create) |
||||
{ |
||||
char svalue[MAX_VALUEDATA]; |
||||
|
||||
sprintf( svalue, "%f", value); |
||||
return SetValue( keyname, valuename, svalue); |
||||
} |
||||
|
||||
bool CIniFile::SetValueV( string const keyname, string const valuename, char *format, ...) |
||||
{ |
||||
va_list args; |
||||
char value[MAX_VALUEDATA]; |
||||
|
||||
va_start( args, format); |
||||
vsprintf( value, format, args); |
||||
va_end( args); |
||||
return SetValue( keyname, valuename, value); |
||||
} |
||||
|
||||
string CIniFile::GetValue( unsigned const keyID, unsigned const valueID, string const defValue) const |
||||
{ |
||||
if ( keyID < keys.size() && valueID < keys[keyID].names.size()) |
||||
return keys[keyID].values[valueID]; |
||||
return defValue; |
||||
} |
||||
|
||||
string CIniFile::GetValue( string const keyname, string const valuename, string const defValue) const |
||||
{ |
||||
long keyID = FindKey( keyname); |
||||
if ( keyID == noID) |
||||
return defValue; |
||||
|
||||
long valueID = FindValue( unsigned(keyID), valuename); |
||||
if ( valueID == noID) |
||||
return defValue; |
||||
|
||||
return keys[keyID].values[valueID]; |
||||
} |
||||
|
||||
int CIniFile::GetValueI(string const keyname, string const valuename, int const defValue) const |
||||
{ |
||||
char svalue[MAX_VALUEDATA]; |
||||
|
||||
sprintf( svalue, "%d", defValue); |
||||
return atoi( GetValue( keyname, valuename, svalue).c_str());
|
||||
} |
||||
|
||||
double CIniFile::GetValueF(string const keyname, string const valuename, double const defValue) const |
||||
{ |
||||
char svalue[MAX_VALUEDATA]; |
||||
|
||||
sprintf( svalue, "%f", defValue); |
||||
return atof( GetValue( keyname, valuename, svalue).c_str());
|
||||
} |
||||
|
||||
// 16 variables may be a bit of over kill, but hey, it's only code.
|
||||
unsigned CIniFile::GetValueV( string const keyname, string const valuename, char *format, |
||||
void *v1, void *v2, void *v3, void *v4, |
||||
void *v5, void *v6, void *v7, void *v8, |
||||
void *v9, void *v10, void *v11, void *v12, |
||||
void *v13, void *v14, void *v15, void *v16) |
||||
{ |
||||
string value; |
||||
// va_list args;
|
||||
unsigned nVals; |
||||
|
||||
|
||||
value = GetValue( keyname, valuename); |
||||
if ( !value.length()) |
||||
return false; |
||||
// Why is there not vsscanf() function. Linux man pages say that there is
|
||||
// but no compiler I've seen has it defined. Bummer!
|
||||
//
|
||||
// va_start( args, format);
|
||||
// nVals = vsscanf( value.c_str(), format, args);
|
||||
// va_end( args);
|
||||
|
||||
nVals = sscanf( value.c_str(), format, |
||||
v1, v2, v3, v4, v5, v6, v7, v8, |
||||
v9, v10, v11, v12, v13, v14, v15, v16); |
||||
|
||||
return nVals; |
||||
} |
||||
|
||||
bool CIniFile::DeleteValue( string const keyname, string const valuename) |
||||
{ |
||||
long keyID = FindKey( keyname); |
||||
if ( keyID == noID) |
||||
return false; |
||||
|
||||
long valueID = FindValue( unsigned(keyID), valuename); |
||||
if ( valueID == noID) |
||||
return false; |
||||
|
||||
// This looks strange, but is neccessary.
|
||||
vector<string>::iterator npos = keys[keyID].names.begin() + valueID; |
||||
vector<string>::iterator vpos = keys[keyID].values.begin() + valueID; |
||||
keys[keyID].names.erase( npos, npos + 1); |
||||
keys[keyID].values.erase( vpos, vpos + 1); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
bool CIniFile::DeleteKey( string const keyname) |
||||
{ |
||||
long keyID = FindKey( keyname); |
||||
if ( keyID == noID) |
||||
return false; |
||||
|
||||
// Now hopefully this destroys the vector lists within keys.
|
||||
// Looking at <vector> source, this should be the case using the destructor.
|
||||
// If not, I may have to do it explicitly. Memory leak check should tell.
|
||||
// memleak_test.cpp shows that the following not required.
|
||||
//keys[keyID].names.clear();
|
||||
//keys[keyID].values.clear();
|
||||
|
||||
vector<string>::iterator npos = names.begin() + keyID; |
||||
vector<key>::iterator kpos = keys.begin() + keyID; |
||||
names.erase( npos, npos + 1); |
||||
keys.erase( kpos, kpos + 1); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
void CIniFile::Erase() |
||||
{ |
||||
// This loop not needed. The vector<> destructor seems to do
|
||||
// all the work itself. memleak_test.cpp shows this.
|
||||
//for ( unsigned i = 0; i < keys.size(); ++i) {
|
||||
// keys[i].names.clear();
|
||||
// keys[i].values.clear();
|
||||
//}
|
||||
names.clear(); |
||||
keys.clear(); |
||||
comments.clear(); |
||||
} |
||||
|
||||
void CIniFile::HeaderComment( string const comment) |
||||
{ |
||||
comments.resize( comments.size() + 1, comment); |
||||
} |
||||
|
||||
string CIniFile::HeaderComment( unsigned const commentID) const |
||||
{ |
||||
if ( commentID < comments.size()) |
||||
return comments[commentID]; |
||||
return ""; |
||||
} |
||||
|
||||
bool CIniFile::DeleteHeaderComment( unsigned commentID) |
||||
{ |
||||
if ( commentID < comments.size()) { |
||||
vector<string>::iterator cpos = comments.begin() + commentID; |
||||
comments.erase( cpos, cpos + 1); |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
unsigned CIniFile::NumKeyComments( unsigned const keyID) const |
||||
{ |
||||
if ( keyID < keys.size()) |
||||
return keys[keyID].comments.size(); |
||||
return 0; |
||||
} |
||||
|
||||
unsigned CIniFile::NumKeyComments( string const keyname) const |
||||
{ |
||||
long keyID = FindKey( keyname); |
||||
if ( keyID == noID) |
||||
return 0; |
||||
return keys[keyID].comments.size(); |
||||
} |
||||
|
||||
bool CIniFile::KeyComment( unsigned const keyID, string const comment) |
||||
{ |
||||
if ( keyID < keys.size()) { |
||||
keys[keyID].comments.resize( keys[keyID].comments.size() + 1, comment); |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
bool CIniFile::KeyComment( string const keyname, string const comment) |
||||
{ |
||||
long keyID = FindKey( keyname); |
||||
if ( keyID == noID) |
||||
return false; |
||||
return KeyComment( unsigned(keyID), comment); |
||||
} |
||||
|
||||
string CIniFile::KeyComment( unsigned const keyID, unsigned const commentID) const |
||||
{ |
||||
if ( keyID < keys.size() && commentID < keys[keyID].comments.size()) |
||||
return keys[keyID].comments[commentID]; |
||||
return ""; |
||||
} |
||||
|
||||
string CIniFile::KeyComment( string const keyname, unsigned const commentID) const |
||||
{ |
||||
long keyID = FindKey( keyname); |
||||
if ( keyID == noID) |
||||
return ""; |
||||
return KeyComment( unsigned(keyID), commentID); |
||||
} |
||||
|
||||
bool CIniFile::DeleteKeyComment( unsigned const keyID, unsigned const commentID) |
||||
{ |
||||
if ( keyID < keys.size() && commentID < keys[keyID].comments.size()) { |
||||
vector<string>::iterator cpos = keys[keyID].comments.begin() + commentID; |
||||
keys[keyID].comments.erase( cpos, cpos + 1); |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
bool CIniFile::DeleteKeyComment( string const keyname, unsigned const commentID) |
||||
{ |
||||
long keyID = FindKey( keyname); |
||||
if ( keyID == noID) |
||||
return false; |
||||
return DeleteKeyComment( unsigned(keyID), commentID); |
||||
} |
||||
|
||||
bool CIniFile::DeleteKeyComments( unsigned const keyID) |
||||
{ |
||||
if ( keyID < keys.size()) { |
||||
keys[keyID].comments.clear(); |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
bool CIniFile::DeleteKeyComments( string const keyname) |
||||
{ |
||||
long keyID = FindKey( keyname); |
||||
if ( keyID == noID) |
||||
return false; |
||||
return DeleteKeyComments( unsigned(keyID)); |
||||
} |
||||
|
||||
string CIniFile::CheckCase( string s) const |
||||
{ |
||||
if ( caseInsensitive) |
||||
for ( string::size_type i = 0; i < s.length(); ++i) |
||||
s[i] = tolower(s[i]); |
||||
return s; |
||||
} |
@ -0,0 +1,180 @@ |
||||
// IniFile.cpp: Implementation of the CIniFile class.
|
||||
// Written by: Adam Clauss
|
||||
// Email: cabadam@tamu.edu
|
||||
// You may use this class/code as you wish in your programs. Feel free to distribute it, and
|
||||
// email suggested changes to me.
|
||||
//
|
||||
// Rewritten by: Shane Hill
|
||||
// Date: 21/08/2001
|
||||
// Email: Shane.Hill@dsto.defence.gov.au
|
||||
// Reason: Remove dependancy on MFC. Code should compile on any
|
||||
// platform. Tested on Windows/Linux/Irix
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef CIniFile_H |
||||
#define CIniFile_H |
||||
using namespace std; |
||||
// C++ Includes
|
||||
#include <string> |
||||
#include <vector> |
||||
|
||||
// C Includes
|
||||
#include <stdlib.h> |
||||
|
||||
#define MAX_KEYNAME 128 |
||||
#define MAX_VALUENAME 128 |
||||
#define MAX_VALUEDATA 2048 |
||||
|
||||
class CIniFile
|
||||
{ |
||||
private: |
||||
bool caseInsensitive; |
||||
string path; |
||||
struct key { |
||||
vector<string> names; |
||||
vector<string> values;
|
||||
vector<string> comments; |
||||
}; |
||||
vector<key> keys;
|
||||
vector<string> names;
|
||||
vector<string> comments; |
||||
string CheckCase( string s) const; |
||||
|
||||
public: |
||||
enum errors{ noID = -1}; |
||||
CIniFile( string const iniPath = ""); |
||||
virtual ~CIniFile() {} |
||||
|
||||
// Sets whether or not keynames and valuenames should be case sensitive.
|
||||
// The default is case insensitive.
|
||||
void CaseSensitive() {caseInsensitive = false;} |
||||
void CaseInsensitive() {caseInsensitive = true;} |
||||
|
||||
// Sets path of ini file to read and write from.
|
||||
void Path(string const newPath) {path = newPath;} |
||||
string Path() const {return path;} |
||||
void SetPath(string const newPath) {Path( newPath);} |
||||
|
||||
// Reads ini file specified using path.
|
||||
// Returns true if successful, false otherwise.
|
||||
bool ReadFile(); |
||||
|
||||
// Writes data stored in class to ini file.
|
||||
bool WriteFile();
|
||||
|
||||
// Deletes all stored ini data.
|
||||
void Erase(); |
||||
void Clear() {Erase();} |
||||
void Reset() {Erase();} |
||||
|
||||
// Returns index of specified key, or noID if not found.
|
||||
long FindKey( string const keyname) const; |
||||
|
||||
// Returns index of specified value, in the specified key, or noID if not found.
|
||||
long FindValue( unsigned const keyID, string const valuename) const; |
||||
|
||||
// Returns number of keys currently in the ini.
|
||||
unsigned NumKeys() const {return names.size();} |
||||
unsigned GetNumKeys() const {return NumKeys();} |
||||
|
||||
// Add a key name.
|
||||
unsigned AddKeyName( string const keyname); |
||||
|
||||
// Returns key names by index.
|
||||
string KeyName( unsigned const keyID) const; |
||||
string GetKeyName( unsigned const keyID) const {return KeyName(keyID);} |
||||
|
||||
// Returns number of values stored for specified key.
|
||||
unsigned NumValues( unsigned const keyID); |
||||
unsigned GetNumValues( unsigned const keyID) {return NumValues( keyID);} |
||||
unsigned NumValues( string const keyname); |
||||
unsigned GetNumValues( string const keyname) {return NumValues( keyname);} |
||||
|
||||
// Returns value name by index for a given keyname or keyID.
|
||||
string ValueName( unsigned const keyID, unsigned const valueID) const; |
||||
string GetValueName( unsigned const keyID, unsigned const valueID) const { |
||||
return ValueName( keyID, valueID); |
||||
} |
||||
string ValueName( string const keyname, unsigned const valueID) const; |
||||
string GetValueName( string const keyname, unsigned const valueID) const { |
||||
return ValueName( keyname, valueID); |
||||
} |
||||
|
||||
// Gets value of [keyname] valuename =.
|
||||
// Overloaded to return string, int, and double.
|
||||
// Returns defValue if key/value not found.
|
||||
string GetValue( unsigned const keyID, unsigned const valueID, string const defValue = "") const; |
||||
string GetValue(string const keyname, string const valuename, string const defValue = "") const;
|
||||
int GetValueI(string const keyname, string const valuename, int const defValue = 0) const; |
||||
bool GetValueB(string const keyname, string const valuename, bool const defValue = false) const { |
||||
return bool( GetValueI( keyname, valuename, int( defValue))); |
||||
} |
||||
double GetValueF(string const keyname, string const valuename, double const defValue = 0.0) const; |
||||
// This is a variable length formatted GetValue routine. All these voids
|
||||
// are required because there is no vsscanf() like there is a vsprintf().
|
||||
// Only a maximum of 8 variable can be read.
|
||||
unsigned GetValueV( string const keyname, string const valuename, char *format, |
||||
void *v1 = 0, void *v2 = 0, void *v3 = 0, void *v4 = 0, |
||||
void *v5 = 0, void *v6 = 0, void *v7 = 0, void *v8 = 0, |
||||
void *v9 = 0, void *v10 = 0, void *v11 = 0, void *v12 = 0, |
||||
void *v13 = 0, void *v14 = 0, void *v15 = 0, void *v16 = 0); |
||||
|
||||
// Sets value of [keyname] valuename =.
|
||||
// Specify the optional paramter as false (0) if you do not want it to create
|
||||
// the key if it doesn't exist. Returns true if data entered, false otherwise.
|
||||
// Overloaded to accept string, int, and double.
|
||||
bool SetValue( unsigned const keyID, unsigned const valueID, string const value); |
||||
bool SetValue( string const keyname, string const valuename, string const value, bool const create = true); |
||||
bool SetValueI( string const keyname, string const valuename, int const value, bool const create = true); |
||||
bool SetValueB( string const keyname, string const valuename, bool const value, bool const create = true) { |
||||
return SetValueI( keyname, valuename, int(value), create); |
||||
} |
||||
bool SetValueF( string const keyname, string const valuename, double const value, bool const create = true); |
||||
bool SetValueV( string const keyname, string const valuename, char *format, ...); |
||||
|
||||
// Deletes specified value.
|
||||
// Returns true if value existed and deleted, false otherwise.
|
||||
bool DeleteValue( string const keyname, string const valuename); |
||||
|
||||
// Deletes specified key and all values contained within.
|
||||
// Returns true if key existed and deleted, false otherwise.
|
||||
bool DeleteKey(string keyname); |
||||
|
||||
// Header comment functions.
|
||||
// Header comments are those comments before the first key.
|
||||
//
|
||||
// Number of header comments.
|
||||
unsigned NumHeaderComments() {return comments.size();} |
||||
// Add a header comment.
|
||||
void HeaderComment( string const comment); |
||||
// Return a header comment.
|
||||
string HeaderComment( unsigned const commentID) const; |
||||
// Delete a header comment.
|
||||
bool DeleteHeaderComment( unsigned commentID); |
||||
// Delete all header comments.
|
||||
void DeleteHeaderComments() {comments.clear();} |
||||
|
||||
// Key comment functions.
|
||||
// Key comments are those comments within a key. Any comments
|
||||
// defined within value names will be added to this list. Therefore,
|
||||
// these comments will be moved to the top of the key definition when
|
||||
// the CIniFile::WriteFile() is called.
|
||||
//
|
||||
// Number of key comments.
|
||||
unsigned NumKeyComments( unsigned const keyID) const; |
||||
unsigned NumKeyComments( string const keyname) const; |
||||
// Add a key comment.
|
||||
bool KeyComment( unsigned const keyID, string const comment); |
||||
bool KeyComment( string const keyname, string const comment); |
||||
// Return a key comment.
|
||||
string KeyComment( unsigned const keyID, unsigned const commentID) const; |
||||
string KeyComment( string const keyname, unsigned const commentID) const; |
||||
// Delete a key comment.
|
||||
bool DeleteKeyComment( unsigned const keyID, unsigned const commentID); |
||||
bool DeleteKeyComment( string const keyname, unsigned const commentID); |
||||
// Delete all comments for a key.
|
||||
bool DeleteKeyComments( unsigned const keyID); |
||||
bool DeleteKeyComments( string const keyname); |
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,175 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include "PwmTime.h" |
||||
|
||||
|
||||
void CPwmTime::Set(unsigned char* pBytes){ |
||||
UINT32 dw1, dw2, dw3, dw4, dw5; |
||||
dw1 = (UINT32)pBytes[0]; dw2 = (UINT32)pBytes[1]; dw3 = (UINT32)pBytes[2]; |
||||
dw4 = (UINT32)pBytes[3]; dw5 = (UINT32)pBytes[4]; |
||||
// Unpack 5 byte structure to date and time
|
||||
///@FIXME nicht Endian-sicher
|
||||
Year = (dw1 << 6) | (dw2 >> 2); |
||||
Month = ((dw2 & 0x00000003) << 2) | (dw3 >> 6); |
||||
Day = (dw3 >> 1) & 0x0000001F; |
||||
Hour = ((dw3 & 0x00000001) << 4) | (dw4 >> 4); |
||||
Minute = ((dw4 & 0x0000000F) << 2) | (dw5 >> 6); |
||||
Second = dw5 & 0x0000003F; |
||||
} |
||||
|
||||
void CPwmTime::GetPackedTime(unsigned char* pBytes){ |
||||
///@FIXME nicht Endian-sicher
|
||||
pBytes[0] = (UINT8)(((UINT32)Year >> 6) & 0x0000003F); |
||||
pBytes[1] = (UINT8)((((UINT32)Year & 0x0000003F) << 2) | (((UINT32)Month >> 2) & 0x00000003)); |
||||
pBytes[2] = (UINT8)((((UINT32)Month & 0x00000003) << 6) | (((UINT32)Day & 0x0000001F) << 1) | (((UINT32)Hour >> 4) & 0x00000001)); |
||||
pBytes[3] = (UINT8)((((UINT32)Hour & 0x0000000F) << 4) | (((UINT32)Minute >> 2) & 0x0000000F)); |
||||
pBytes[4] = (UINT8)((((UINT32)Minute & 0x00000003) << 6) | ((UINT32)Second & 0x0000003F)); |
||||
} |
||||
|
||||
QString CPwmTime::GetString(UINT16 format){ |
||||
QString str; |
||||
switch(format){ |
||||
case 0: |
||||
//DD.MM.YYYY HH:MM:SS
|
||||
str=(QString)"%1.%2.%3 %4:%5:%6"; |
||||
break; |
||||
|
||||
case 1: |
||||
//MM/DD/YYYY HH:MM:SS
|
||||
str=(QString)"%2/%1/%3 %4:%5:%6"; |
||||
break; |
||||
}; |
||||
|
||||
|
||||
if(Day<10){ |
||||
str=str.arg(((QString)"0"+QString::number(Day))); |
||||
}else{ |
||||
str=str.arg(Day);} |
||||
|
||||
if(Month<10){ |
||||
str=str.arg(((QString)"0"+QString::number(Month))); |
||||
}else{ |
||||
str=str.arg(Month);} |
||||
|
||||
str=str.arg(Year); |
||||
|
||||
if(Hour<10){ |
||||
str=str.arg(((QString)"0"+QString::number(Hour))); |
||||
}else{ |
||||
str=str.arg(Hour);} |
||||
|
||||
if(Minute<10){ |
||||
str=str.arg(((QString)"0"+QString::number(Minute))); |
||||
}else{ |
||||
str=str.arg(Minute);} |
||||
|
||||
if(Second<10){ |
||||
str=str.arg(((QString)"0"+QString::number(Second))); |
||||
}else{ |
||||
str=str.arg(Second);} |
||||
|
||||
return str; |
||||
} |
||||
|
||||
void CPwmTime::Set(UINT8 iDay,UINT8 iMonth,UINT16 iYear,UINT8 iHour,UINT8 iMinute,UINT8 iSecond){ |
||||
Day=iDay; |
||||
Month=iMonth; |
||||
Year=iYear; |
||||
Hour=iHour; |
||||
Minute=iMinute; |
||||
Second=iSecond; |
||||
} |
||||
|
||||
bool CPwmTime::IsValidDate(QString& s){ |
||||
|
||||
if(s.length()>10)return false; |
||||
|
||||
int count=0; |
||||
for(int i=0;i<s.length();i++){ |
||||
if(s[i]=='.')count++; |
||||
} |
||||
if(count!=2)return false; |
||||
bool conv_error[3]; |
||||
int day=s.section(".",0,0).toInt(&conv_error[0]); |
||||
int month=s.section(".",1,1).toInt(&conv_error[1]); |
||||
int year=s.section(".",2,2).toInt(&conv_error[2]); |
||||
if(conv_error[0]==false || conv_error[1]==false || conv_error[2]==false)return false; |
||||
if(day>31 || day<1 || month>12 || month<1 || year<0 || year>2999)return false; |
||||
return true; |
||||
} |
||||
|
||||
bool CPwmTime::IsValidTime(QString& s){ |
||||
|
||||
if(s.length()>8)return false; |
||||
|
||||
int count=0; |
||||
for(int i=0;i<s.length();i++){ |
||||
if(s[i]==':')count++; |
||||
} |
||||
if(count!=2)return false; |
||||
bool conv_error[3]; |
||||
int hour=s.section(":",0,0).toInt(&conv_error[0]); |
||||
int minute=s.section(":",1,1).toInt(&conv_error[1]); |
||||
int second=s.section(":",2,2).toInt(&conv_error[2]); |
||||
if(conv_error[0]==false || conv_error[1]==false || conv_error[2]==false)return false; |
||||
if(hour>23 || hour<0 || minute>59 || minute<0 || second>59 || second<0)return false; |
||||
return true; |
||||
} |
||||
|
||||
bool CPwmTime::SetDate(QString s){ |
||||
if(IsValidDate(s)==false)return false; |
||||
Day=s.section(".",0,0).toInt(); |
||||
Month=s.section(".",1,1).toInt(); |
||||
Year=s.section(".",2,2).toInt(); |
||||
return true; |
||||
} |
||||
|
||||
bool CPwmTime::SetTime(QString s){ |
||||
if(IsValidTime(s)==false)return false; |
||||
Hour=s.section(":",0,0).toInt(); |
||||
Minute=s.section(":",1,1).toInt(); |
||||
Second=s.section(":",2,2).toInt(); |
||||
return true; |
||||
} |
||||
|
||||
void CPwmTime::SetToNow(){ |
||||
time_t curTime=time(NULL); |
||||
tm* current=localtime(&curTime); |
||||
Year=current->tm_year+1900; |
||||
Month=current->tm_mon; |
||||
Day=current->tm_mday; |
||||
Hour=current->tm_hour; |
||||
Minute=current->tm_min; |
||||
Second=current->tm_sec; |
||||
} |
||||
|
||||
bool CPwmTime::operator==(const CPwmTime& t){ |
||||
if( Year==t.Year |
||||
&& Month==t.Month |
||||
&& Day==t.Day |
||||
&& Hour==t.Hour |
||||
&& Minute==t.Minute |
||||
&& Second==t.Second) return true; |
||||
else return false; |
||||
} |
||||
|
||||
bool CPwmTime::operator!=(const CPwmTime& t){ |
||||
return !(*this==t); |
||||
} |
@ -0,0 +1,51 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#ifndef _PWMTIME_H_ |
||||
#define _PWMTIME_H_ |
||||
|
||||
#include <qglobal.h> |
||||
#include <qstring.h> |
||||
class CPwmTime; |
||||
class CPwmTime{ |
||||
public: |
||||
UINT16 Year; |
||||
UINT8 Month; |
||||
UINT8 Day; |
||||
UINT8 Hour; |
||||
UINT8 Minute; |
||||
UINT8 Second; |
||||
|
||||
QString GetString(UINT16 format); |
||||
void Set(UINT8,UINT8,UINT16,UINT8,UINT8,UINT8); |
||||
void Set(unsigned char* packedTime); |
||||
void GetPackedTime(unsigned char* dst); |
||||
static bool IsValidDate(QString& string); |
||||
static bool IsValidTime(QString& string); |
||||
bool SetDate(QString string); |
||||
bool SetTime(QString string); |
||||
void SetToNow(); |
||||
bool operator==(const CPwmTime& t); |
||||
bool operator!=(const CPwmTime& t); |
||||
// bool operator>(const CPwmTime& t);
|
||||
// bool operator<(const CPwmTime& t);
|
||||
|
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,105 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include "SecString.h" |
||||
#include <qmessagebox.h> |
||||
#include <iostream.h> |
||||
#include "random.h" |
||||
|
||||
UINT8 SecString::Key[32]={0}; |
||||
|
||||
SecString::SecString(){ |
||||
data=NULL; |
||||
len=0; |
||||
cryptlen=0; |
||||
} |
||||
|
||||
|
||||
SecString::~SecString(){ |
||||
//if(data)delete [] data; ///@FIXME zerschießt den Stack, aber warum???
|
||||
overwrite(plaintext); |
||||
} |
||||
|
||||
void SecString::getString(QString & str){ |
||||
if(data){ |
||||
Rijndael aes; |
||||
int r=aes.init(Rijndael::CBC, Rijndael::Decrypt,Key,Rijndael::Key32Bytes); |
||||
if(r){ cout << "AES error, code " << r << endl; |
||||
exit(-1);} |
||||
char* out=new char[len]; |
||||
r=aes.padDecrypt((unsigned char*)data,cryptlen,(unsigned char*)out); |
||||
if(r!=len){ cout << "AES error in SecString::getString(), r!=length, r=" << r << endl; |
||||
exit(-1);} |
||||
str=QString::fromUtf8(out,len); |
||||
overwrite(out,len); |
||||
delete [] out; |
||||
} |
||||
} |
||||
|
||||
QString& SecString::getString(){ |
||||
getString(plaintext); |
||||
return plaintext; |
||||
} |
||||
|
||||
void SecString::delRef(){ |
||||
overwrite(plaintext); |
||||
} |
||||
|
||||
void SecString::setString(QString& str,bool DelSrc){ |
||||
Rijndael aes; |
||||
int r=aes.init(Rijndael::CBC, Rijndael::Encrypt,Key,Rijndael::Key32Bytes); |
||||
if(r){ cout << "AES error, code " << r << endl; |
||||
exit(-1);} |
||||
int il=str.length(); |
||||
char* input=new char[il]; |
||||
char* output=new char[il+16]; |
||||
memcpy(input,str.utf8(),il); |
||||
r=aes.padEncrypt((unsigned char*)input,il,(unsigned char*)output); |
||||
if(r<0){ cout << "AES error, code " << r << endl; |
||||
exit(-1);} |
||||
cryptlen=r; |
||||
len=il; |
||||
if(data)delete [] data; |
||||
data=output; |
||||
overwrite(input,il); |
||||
delete [] input; |
||||
if(DelSrc)overwrite(str); |
||||
} |
||||
|
||||
void SecString::overwrite(char* str,int strlen){ |
||||
if(strlen==0 || str==NULL)return; |
||||
getRandomBytes(str,strlen,1,false); |
||||
} |
||||
|
||||
void SecString::overwrite(QString &str){ |
||||
if(str.length()==0)return; |
||||
char* tmp=new char[str.length()]; |
||||
getRandomBytes(tmp,str.length(),1,false); |
||||
str=tmp; |
||||
delete [] tmp; |
||||
} |
||||
|
||||
int SecString::length(){ |
||||
return len; |
||||
} |
||||
|
||||
void SecString::generateSessionKey(){ |
||||
getRandomBytes(Key,32,1,false); |
||||
} |
@ -0,0 +1,51 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#ifndef _SECSTRING_H_ |
||||
#define _SECSTRING_H_ |
||||
|
||||
#include <qstring.h> |
||||
#include <qglobal.h> |
||||
#include "crypto/rijndael.h" |
||||
|
||||
class SecString{ |
||||
public: |
||||
SecString(unsigned char* key); |
||||
SecString(); |
||||
~SecString(); |
||||
|
||||
void getString(QString& str); |
||||
QString& getString(); |
||||
void setString(QString& str, bool DelSrc=false); |
||||
void delRef(); |
||||
static void overwrite(char* str,int len); |
||||
static void overwrite(QString& str); |
||||
int length(); |
||||
static void generateSessionKey(); |
||||
|
||||
private: |
||||
static UINT8 Key[32]; |
||||
QString plaintext; |
||||
char* data; |
||||
int len; |
||||
int cryptlen; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,55 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
|
||||
#include "UrlLabel.h" |
||||
#include <qfont.h> |
||||
#include <qcolor.h> |
||||
#include <qcursor.h> |
||||
#include <qfontmetrics.h> |
||||
|
||||
LinkLabel::LinkLabel(QWidget *parent, const char* name,const QString& text, int x, int y,WFlags f) : QLabel(parent,name,f){ |
||||
QFont font(parentWidget()->font()); font.setUnderline(true); |
||||
setFont(font); |
||||
setPaletteForegroundColor(QColor(20,20,255)); |
||||
setCursor(PointingHandCursor); |
||||
setText(text); |
||||
setPos(x,y); |
||||
} |
||||
|
||||
LinkLabel::~LinkLabel(){ |
||||
|
||||
} |
||||
|
||||
void LinkLabel::mouseReleaseEvent(QMouseEvent* event){ |
||||
if(event->button()==LeftButton) |
||||
clicked(); |
||||
} |
||||
|
||||
void LinkLabel::setPos(int x,int y){ |
||||
QFontMetrics fm(font()); |
||||
setGeometry(x,y,fm.width(text()),fm.height()); |
||||
|
||||
} |
||||
|
||||
void LinkLabel::setText(const QString& text){ |
||||
QLabel::setText(text); |
||||
setPos(geometry().x(),geometry().y()); |
||||
} |
@ -0,0 +1,45 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#ifndef _LINKLABEL_H_ |
||||
#define _LINKLABEL_H_ |
||||
#include <qlabel.h> |
||||
#include <qsignal.h> |
||||
|
||||
class LinkLabel : public QLabel{ |
||||
Q_OBJECT |
||||
public: |
||||
LinkLabel(QWidget *parent, const char* name = 0,const QString& text=QString::null, int x=0, int y=0,WFlags f=0); |
||||
~LinkLabel(); |
||||
void setPos(int x,int y); |
||||
|
||||
public slots: |
||||
virtual void setText(const QString&); |
||||
|
||||
|
||||
signals: |
||||
void clicked(); |
||||
|
||||
protected: |
||||
virtual void mouseReleaseEvent(QMouseEvent* event); |
||||
|
||||
}; |
||||
|
||||
#endif |
@ -0,0 +1,47 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
#include <iostream.h> |
||||
#include <fstream.h> |
||||
#include <qdatetime.h> |
||||
#include <qobject.h> |
||||
#include "random.h" |
||||
|
||||
void getRandomBytes(void* buffer,int NumBlocks,int BlockSize,bool Strong){ |
||||
FILE *dev_random; |
||||
if(Strong){ |
||||
dev_random = fopen("/dev/random","r");} |
||||
else{ |
||||
dev_random = fopen("/dev/urandom","r");} |
||||
|
||||
if (dev_random==NULL){ |
||||
cout << QObject::tr("/dev/random konnte nicht geöffnet werden - nutze Standardbibliothek (stdlib)") << endl; |
||||
srand(QTime(0,0,0).secsTo(QTime::currentTime())); |
||||
for(int i=0;i<NumBlocks*BlockSize;i++){ |
||||
UINT8 rnd=rand()%256; |
||||
((UINT8*)buffer)[i]=rnd; |
||||
} |
||||
return; |
||||
} |
||||
else{ |
||||
fread(buffer,BlockSize,NumBlocks,dev_random); |
||||
fclose(dev_random); |
||||
return; |
||||
} |
||||
} |
@ -0,0 +1,20 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* mail@tarek-saidi.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
extern void getRandomBytes(void* buffer,int NumBlocks,int BlockSize,bool Strong=false); |
@ -0,0 +1,92 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
|
||||
#include "pwsafe.h" |
||||
#include <qapplication.h> |
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv) |
||||
{ |
||||
QApplication app(argc,argv); |
||||
PwSafe *mainWin = 0; |
||||
/// @todo do something with the command line args here
|
||||
mainWin = new PwSafe(&app); |
||||
app.setMainWidget( mainWin ); |
||||
mainWin->show(); |
||||
return app.exec(); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
/********* KDE **************
|
||||
#include <kapplication.h> |
||||
#include <kaboutdata.h> |
||||
#include <kcmdlineargs.h> |
||||
#include <klocale.h> |
||||
|
||||
static const char description[] = |
||||
I18N_NOOP("A KDE KPart Application"); |
||||
|
||||
static const char version[] = "0.1"; |
||||
|
||||
static KCmdLineOptions options[] = |
||||
{ |
||||
// { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
|
||||
KCmdLineLastOption |
||||
}; |
||||
|
||||
int main(int argc, char **argv) |
||||
{ |
||||
KAboutData about("Keepass", I18N_NOOP("Keepass"), version, description, |
||||
KAboutData::License_BSD, "(C) %{YEAR} Tarek Saidi", 0, 0, "tareks@arcor.de"); |
||||
about.addAuthor( "Tarek Saidi", 0, "tareks@arcor.de" ); |
||||
KCmdLineArgs::init(argc, argv, &about); |
||||
KCmdLineArgs::addCmdLineOptions( options ); |
||||
KApplication app; |
||||
PwSafe *mainWin = 0; |
||||
|
||||
if (app.isRestored()) |
||||
{ |
||||
RESTORE(PwSafe); |
||||
} |
||||
else |
||||
{ |
||||
// no session.. just start up normally
|
||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); |
||||
|
||||
/// @todo do something with the command line args here
|
||||
|
||||
mainWin = new PwSafe(); |
||||
app.setMainWidget( mainWin ); |
||||
mainWin->show(); |
||||
|
||||
args->clear(); |
||||
} |
||||
|
||||
// mainWin has WDestructiveClose flag by default, so it will delete itself.
|
||||
return app.exec(); |
||||
} |
||||
|
||||
*/ |
||||
|
||||
|
@ -0,0 +1,167 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek.saidi@arcor.de * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
|
||||
#ifndef MAINWINDOW_H |
||||
#define MAINWINDOW_H |
||||
#include <qimage.h> |
||||
#include <qpixmap.h> |
||||
#include <qpainter.h> |
||||
#include <qfont.h> |
||||
#include <qlabel.h> |
||||
#include <qtimer.h> |
||||
#include <qapplication.h> |
||||
#include "ui_MainWindow.h" |
||||
#include "ListViews.h" |
||||
#include "PwmConfig.h" |
||||
|
||||
typedef vector<GroupItem*>::iterator GroupItemItr; |
||||
typedef vector<EntryItem*>::iterator EntryItemItr; |
||||
|
||||
class CMainWindow : public MainFrame{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
/*$PUBLIC_FUNCTIONS$*/ |
||||
CMainWindow(QApplication* app, QWidget* parent = 0,const char* name = 0, WFlags fl = 0 ); |
||||
~CMainWindow(); |
||||
protected: |
||||
/*$PROTECTED_FUNCTIONS$*/ |
||||
|
||||
protected slots: |
||||
/*$PROTECTED_SLOTS$*/ |
||||
virtual void showEvent(QShowEvent *e); |
||||
|
||||
public slots: |
||||
/*$PUBLIC_SLOTS$*/ |
||||
virtual void OnClose(); |
||||
virtual void OnMainWinResize(); |
||||
virtual void OnFileOpen(); |
||||
virtual void OnGroupChanged(QListViewItem*); |
||||
virtual void OnEntryChanged(QListViewItem*); |
||||
virtual void OnEntryDoubleClicked(QListViewItem*,const QPoint&,int); |
||||
virtual void OnMenu_closeDB(); |
||||
virtual void OnFileSaveAs(); |
||||
virtual void OnFileSave(); |
||||
virtual void OnMenuExit(); |
||||
virtual void OnAddGroup(); |
||||
virtual void OnUserNameToClipboard(); |
||||
virtual void OnPasswordToClipboard(); |
||||
virtual void OnDeleteGroup(); |
||||
virtual void OnEditGroup(); |
||||
virtual void OnAddSubGroup(); |
||||
virtual void OnClipboardTimerEvent(); |
||||
virtual void OnOpenURL(); |
||||
virtual void OnGroupSearch(); |
||||
virtual void OnGlobalSearch(); |
||||
virtual void OnDeleteEntry(); |
||||
virtual void OnCopyEntry(); |
||||
virtual void OnEditEntry(); |
||||
virtual void OnAddEntry(); |
||||
virtual void OnSaveAttachment(); |
||||
virtual void OnEntryRightClicked(QListViewItem* item, const QPoint& pos,int column); |
||||
virtual void OnEntryCtxMenuClicked(int id); |
||||
virtual void OnGroupRightClicked(QListViewItem* item, const QPoint& pos, int column); |
||||
virtual void OnGroupCtxMenuClicked(int id); |
||||
virtual void OnChangeDbKey(); |
||||
virtual void OnDbSettings(); |
||||
virtual void OnFileNew(); |
||||
virtual void OnViewToolbarToggled(bool toggled); |
||||
virtual void OnViewEntryDetailsToggled(bool toggled); |
||||
virtual void OnHelpAbout(); |
||||
virtual void OnSettings(); |
||||
virtual void OnView_ColumnUrlToggled(bool value); |
||||
virtual void OnView_ColumnTitleToggled(bool value); |
||||
virtual void OnView_ColumnCreationToggled(bool value); |
||||
virtual void OnView_ColumnLastAccessToggled(bool value); |
||||
virtual void OnView_ColumnLastModToggled(bool value); |
||||
virtual void OnView_ColumnCommentToggled(bool value); |
||||
virtual void OnView_ColumnPasswordToggled(bool value); |
||||
virtual void OnView_ColumnAttachmentToggled(bool value); |
||||
virtual void OnView_ColumnExpireToggled(bool value); |
||||
virtual void OnView_ColumnUsernameToggled(bool value); |
||||
virtual void OnExtrasLanguage(); |
||||
virtual void OnSearchGroupCtxMenuClicked(int); |
||||
virtual void OnQickSearch(); |
||||
virtual void OnGroupItemExpanded(QListViewItem* item); |
||||
virtual void OnGroupItemCollapsed(QListViewItem* item); |
||||
virtual void DEBUG_OnPrintDbStucture(); |
||||
virtual void OnImportPwManagerFile(); |
||||
virtual void OnView_HideUsernamesToggled(bool state); |
||||
virtual void OnView_HidePasswordsToggled(bool state); |
||||
virtual void OnGroupViewDrop(QDropEvent* e); |
||||
virtual void OnHelpAboutQt(); |
||||
virtual void OnImportKWalletXML(); |
||||
|
||||
|
||||
public: |
||||
PwDatabase* db; |
||||
vector<GroupItem*> GroupItems; |
||||
vector<EntryItem*> EntryItems; |
||||
vector<unsigned long> SearchResults; |
||||
QString img_res_dir; |
||||
QPixmap* EntryIcons; |
||||
QPixmap* Icon_Key32x32; |
||||
QPixmap* Icon_Settings32x32; |
||||
QPixmap* Icon_Search32x32; |
||||
QPixmap* Icon_I18n32x32; |
||||
QPixmap* Icon_Ok16x16; |
||||
QTimer ClipboardTimer; |
||||
QString appdir; |
||||
CConfig config; |
||||
|
||||
enum FileMenuState{STATE_FileOpen, |
||||
STATE_NoFileOpen}; |
||||
enum EditMenuState{STATE_NoGroupSelected, |
||||
STATE_NoEntrySelected, |
||||
STATE_SingleGroupSelected, |
||||
STATE_SingleEntrySelected}; |
||||
void InitMenus(); |
||||
void SetFileMenuState(FileMenuState status); |
||||
void SetEditMenuState(EditMenuState status); |
||||
void LoadImg(QString name,QImage &tmpImg); |
||||
void SetupColumns(); |
||||
void ResizeColumns(); |
||||
void OpenDatabase(QString filename); |
||||
void CreateBanner(QLabel *Banner,QPixmap* symbol,QString text); |
||||
void CreateBanner(QLabel *Banner,QPixmap* symbol,QString text,QColor color1,QColor color2,QColor textcolor); |
||||
void CloseDataBase(); |
||||
void OpenURL(QString url); |
||||
GroupItem* getLastSameLevelItem(int i); |
||||
|
||||
void setCurrentGroup(GroupItem* item); |
||||
void updateEntryView(); |
||||
void updateGroupView(); |
||||
GroupItem* CurrentGroup; |
||||
EntryItem* CurrentEntry; |
||||
QClipboard* Clipboard; |
||||
|
||||
private: |
||||
bool isInSearchResults(CEntry*); |
||||
void Search(CGroup* pGroup=NULL); |
||||
QApplication* App; |
||||
QTranslator* translator; |
||||
bool modflag; |
||||
void setModFlag(bool); |
||||
bool FileOpen; |
||||
}; |
||||
|
||||
#endif |
||||
|
@ -0,0 +1,33 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include "mainwindow.h" |
||||
#include "pwsafe.h" |
||||
|
||||
PwSafe::PwSafe(QApplication* app):QMainWindow( 0, "Keepass",WDestructiveClose) |
||||
{ mainWin=new CMainWindow(app,this); |
||||
setCentralWidget( mainWin ); |
||||
} |
||||
|
||||
PwSafe::~PwSafe() |
||||
{ |
||||
delete mainWin; |
||||
} |
||||
|
@ -0,0 +1,48 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 by Tarek Saidi * |
||||
* tarek@linux * |
||||
* * |
||||
* This program is free software; you can redistribute it and/or modify * |
||||
* it under the terms of the GNU General Public License as published by * |
||||
* the Free Software Foundation; either version 2 of the License, or * |
||||
* (at your option) any later version. * |
||||
* * |
||||
* This program is distributed in the hope that it will be useful, * |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||||
* GNU General Public License for more details. * |
||||
* * |
||||
* You should have received a copy of the GNU General Public License * |
||||
* along with this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
|
||||
#ifndef _PWSAFE_H_ |
||||
#define _PWSAFE_H_ |
||||
|
||||
#include <qapplication.h> |
||||
#include <qmainwindow.h> |
||||
|
||||
class CMainWindow; |
||||
|
||||
class PwSafe : public QMainWindow |
||||
{ |
||||
Q_OBJECT |
||||
public: |
||||
/**
|
||||
* Default Constructor |
||||
*/ |
||||
PwSafe(QApplication*); |
||||
|
||||
/**
|
||||
* Default Destructor |
||||
*/ |
||||
virtual ~PwSafe(); |
||||
|
||||
private: |
||||
CMainWindow *mainWin; |
||||
}; |
||||
|
||||
#endif // _PWSAFE_H_
|
@ -0,0 +1,96 @@ |
||||
# Diese Datei wurde mit dem qmake-Manager von KDevelop erstellt. |
||||
# ------------------------------------------- |
||||
# Unterordner relativ zum Projektordner: ./src |
||||
# Das Target ist eine Anwendung: ../bin/keepass |
||||
|
||||
INSTALLS += Share \ |
||||
target |
||||
target.path = /usr/local/bin |
||||
Share.files += ../share/keepass/* |
||||
Share.path = /usr/local/share/keepass |
||||
MOC_DIR = ../build/moc |
||||
UI_DIR = ../build/ui |
||||
OBJECTS_DIR = ../build/ |
||||
TARGET = ../bin/keepass |
||||
CONFIG += debug \ |
||||
warn_off \ |
||||
qt \ |
||||
thread \ |
||||
exceptions \ |
||||
stl |
||||
TEMPLATE = app |
||||
FORMS += forms/ui_EditGroupDlg.ui \ |
||||
forms/ui_SearchDlg.ui \ |
||||
forms/ui_AboutDlg.ui \ |
||||
forms/ui_LanguageDlg.ui \ |
||||
forms/ui_SettingsDlg.ui \ |
||||
forms/ui_ChangeKeyDlg.ui \ |
||||
forms/ui_MainWindow.ui \ |
||||
forms/ui_SimplePasswordDlg.ui \ |
||||
forms/ui_DatabaseSettingsDlg.ui \ |
||||
forms/ui_PasswordDlg.ui \ |
||||
forms/ui_EditEntryDlg.ui \ |
||||
forms/ui_PasswordGenDlg.ui |
||||
TRANSLATIONS += translations/english.ts \ |
||||
translations/russian.ts |
||||
HEADERS += lib/IniReader.h \ |
||||
lib/UrlLabel.h \ |
||||
mainwindow.h \ |
||||
PwManager.h \ |
||||
pwsafe.h \ |
||||
crypto/rijndael.h \ |
||||
lib/SecString.h \ |
||||
crypto/sha256.h \ |
||||
crypto/twoclass.h \ |
||||
crypto/twofish.h \ |
||||
ListViews.h \ |
||||
import/Import_PwManager.h \ |
||||
crypto/blowfish.h \ |
||||
crypto/sha1.h \ |
||||
import/Import_KWalletXml.h \ |
||||
PwmConfig.h \ |
||||
dialogs/AboutDlg.h \ |
||||
dialogs/EditGroupDlg.h \ |
||||
dialogs/SearchDlg.h \ |
||||
dialogs/ChangeKeyDlg.h \ |
||||
dialogs/LanguageDlg.h \ |
||||
dialogs/SettingsDlg.h \ |
||||
dialogs/DatabaseSettingsDlg.h \ |
||||
dialogs/PasswordDlg.h \ |
||||
dialogs/SimplePasswordDlg.h \ |
||||
dialogs/EditEntryDlg.h \ |
||||
dialogs/PasswordGenDlg.h \ |
||||
lib/random.h \ |
||||
Database.h \ |
||||
lib/PwmTime.h |
||||
SOURCES += lib/IniReader.cpp \ |
||||
lib/UrlLabel.cpp \ |
||||
main.cpp \ |
||||
mainwindow.cpp \ |
||||
PwManager.cpp \ |
||||
pwsafe.cpp \ |
||||
crypto/rijndael.cpp \ |
||||
lib/SecString.cpp \ |
||||
crypto/sha256.c \ |
||||
crypto/twoclass.cpp \ |
||||
crypto/twofish.cpp \ |
||||
ListViews.cpp \ |
||||
import/Import_PwManager.cpp \ |
||||
crypto/blowfish.cpp \ |
||||
crypto/sha1.cpp \ |
||||
import/Import_KWalletXml.cpp \ |
||||
PwmConfig.cpp \ |
||||
dialogs/AboutDlg.cpp \ |
||||
dialogs/EditGroupDlg.cpp \ |
||||
dialogs/SearchDlg.cpp \ |
||||
dialogs/ChangeKeyDlg.cpp \ |
||||
dialogs/LanguageDlg.cpp \ |
||||
dialogs/SettingsDlg.cpp \ |
||||
dialogs/DatabaseSettingsDlg.cpp \ |
||||
dialogs/PasswordDlg.cpp \ |
||||
dialogs/SimplePasswordDlg.cpp \ |
||||
dialogs/EditEntryDlg.cpp \ |
||||
dialogs/PasswordGenDlg.cpp \ |
||||
lib/random.cpp \ |
||||
Database.cpp \ |
||||
lib/PwmTime.cpp |