summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2006-02-24 19:41:06 (UTC)
committer zautrix <zautrix>2006-02-24 19:41:06 (UTC)
commit4e2553b95b2787ed7917073f6b628819b1f017c3 (patch) (side-by-side diff)
treeda5cb746bf3373cb2a368afda082999e6c22751f
parent08605356c77351d64e14e0fdd69bdb769f933909 (diff)
downloadkdepimpi-4e2553b95b2787ed7917073f6b628819b1f017c3.zip
kdepimpi-4e2553b95b2787ed7917073f6b628819b1f017c3.tar.gz
kdepimpi-4e2553b95b2787ed7917073f6b628819b1f017c3.tar.bz2
gcc4 fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt5
-rw-r--r--gammu/emb/common/phone/alcatel/alcatel.c2
-rw-r--r--gammu/emb/gammu/depend/nokia/dct3.c2
-rw-r--r--gammu/emb/gammu/depend/nokia/dct3trac/wmx.c2
-rw-r--r--gammu/emb/gammu/depend/nokia/dct4.c2
-rw-r--r--gammu/emb/gammu/depend/siemens/dsiemens.c2
-rw-r--r--kaddressbook/addresseeeditorwidget.h1
-rw-r--r--pwmanager/libcrypt/cipher/serpent.c4
-rw-r--r--pwmanager/pwmanager/binentrygen.cpp5
-rw-r--r--pwmanager/pwmanager/binentrygen.h2
-rw-r--r--pwmanager/pwmanager/blowfish.cpp2
-rw-r--r--pwmanager/pwmanager/blowfish.h4
-rw-r--r--pwmanager/pwmanager/genpasswd.cpp1
-rw-r--r--pwmanager/pwmanager/libgcryptif.h4
-rw-r--r--pwmanager/pwmanager/pwmexception.h3
-rw-r--r--pwmanager/pwmanager/randomizer.h1
16 files changed, 28 insertions, 14 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index cd37aac..9879ef0 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,62 +1,67 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 2.2.8 ************
I forgot what I fixed...
Some minor fixes in KA/Pi and KO/Pi.
KA/Pi uses popup menu now for quick category selection in contact edit dialog.
In the Pi-syc mode of KO/Pi it is now possible to define specific resources which can be synced with the remote pi-sync server.
This feature must be considered as unstable - it still needs some more testing.
+On Wintendo now KA/Pi can sync with Outlook. The configuration of the sync needs some moer tweking.
+Fixed some gcc 4.xx compilation probs.
+Fixed an annoying cursor focus reset problem when editing and (auto-)saving journal enries in KO/Pi.
+
+
********** VERSION 2.2.7 ************
Added for Desktop Versions (Windows + Linux) the possibility to specify an email client to call if the user clicks on an emailaddress.
(Menu: Config->Global Settings->Extern.Applications: E-mail).
Added as default (and example) Mozilla Thunderbird settings.
If the path to the binary in this Mozilla Thunderbird example is not matching your environment you can take these settings as an template and configure "User defined email client".
********** VERSION 2.2.6 ************
KO/Pi:
Made navigation in datepicker more userfriendly when using keyboard for scrolling.
KO/Pi Alarm applet:
Made font size for the two popup menus with larger font configurable:
Change size with menu:
Play Beeps->Font Size
Save settings such that it will be restored after next reboot with menu:
Play Beeps->Config->Save.
KA/Pi:
Big change! Needed for the upcoming Outlook sync:
(Outlook sync available appr. end of 2005)
Telephone number types are now fixed in KA/Pi
(but still compatible with the vCard standard, of cource)
and they are compatible with the types used by the evil empire.
That makes syncing with OL possible and make it possible to sync better with mobile devices.
NOTE:
All your telephone types will be converted automatically at loading/importing!
Such that it may be a good idea to make a backup of the data before starting KA/Pi.
But the editing of phone numbers and types has changed completely such that it is now much faster to edit/change types and numbers.
HINT:
To see whether there was some number for some contact not converted senseful, choose
Menu: View->Modify view
and add "Other Phone" ( in German "Sonst. Telefon") to the view.
If a type was not converted senseful to some of the 18 new, fixed types, it will get the "Other" type.
********** VERSION 2.2.5 ************
Bugfixes in KO/Pi, KA/Pi and OM/Pi.
Added possibility to disable auto saving in KO/Pi.
How to disable it? Good question! Next question, please?
Added info about count of events/todos/journals to calendar info.
********** VERSION 2.2.4 ************
KO/Pi alarm applet: Made font smaller and added a dealy before starting KO/Pi to avoid problems accessing data storage when an alarm did wake up the Z.
Added 3 sec notification about a started timer.
KO/Pi:
diff --git a/gammu/emb/common/phone/alcatel/alcatel.c b/gammu/emb/common/phone/alcatel/alcatel.c
index b75077f..718d91e 100644
--- a/gammu/emb/common/phone/alcatel/alcatel.c
+++ b/gammu/emb/common/phone/alcatel/alcatel.c
@@ -11,97 +11,97 @@
* - BH4 series (535/735)
* For some functions it uses normal AT mode (not implemented here, look at
* ../at/atgen.[ch]) for others it switches into binary mode and initialises
* underlaying protocol (see ../../protocol/alcatel/alcabus.[ch]) and
* communicates over it. Don't ask me why Alcatel uses such silly thing...
*
* Notes for future features:
* - max phone number length is 61 (BE5)
* - max name length is 50 (BE5)
*/
#include "../../gsmstate.h"
#ifdef GSM_ENABLE_ALCATEL
#ifdef GSM_ENABLE_ATGEN
#include <string.h>
#include <time.h>
#include "../../gsmcomon.h"
#include "../../misc/coding/coding.h"
#include "../../misc/misc.h"
#include "../../service/sms/gsmsms.h"
#include "../pfunc.h"
#include "alcatel.h"
/* Timeout for GSM_WaitFor calls. */
#define ALCATEL_TIMEOUT 64
/* Some magic numbers for protocol follow */
/* synchronisation types (for everything except begin transfer): */
#define ALCATEL_SYNC_TYPE_CALENDAR 0x64
#define ALCATEL_SYNC_TYPE_TODO 0x68
#define ALCATEL_SYNC_TYPE_CONTACTS 0x6C
/* synchronisation types (for begin transfer): */
#define ALCATEL_BEGIN_SYNC_CALENDAR 0x00
#define ALCATEL_BEGIN_SYNC_TODO 0x02
#define ALCATEL_BEGIN_SYNC_CONTACTS 0x01
/* category types */
#define ALCATEL_LIST_TODO_CAT 0x9B
#define ALCATEL_LIST_CONTACTS_CAT 0x96
/* We need lot of ATGEN functions, because Alcatel is an AT device. */
-extern GSM_Reply_Function ALCATELReplyFunctions[];
+static GSM_Reply_Function ALCATELReplyFunctions[];
extern GSM_Reply_Function ATGENReplyFunctions[];
extern GSM_Error ATGEN_Initialise (GSM_StateMachine *s);
extern GSM_Error ATGEN_Terminate (GSM_StateMachine *s);
extern GSM_Error ATGEN_GetIMEI (GSM_StateMachine *s);
extern GSM_Error ATGEN_GetFirmware (GSM_StateMachine *s);
extern GSM_Error ATGEN_GetModel (GSM_StateMachine *s);
extern GSM_Error ATGEN_GetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time);
extern GSM_Error ATGEN_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
extern GSM_Error ATGEN_GetNextMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry, bool start);
extern GSM_Error ATGEN_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
extern GSM_Error ATGEN_AddMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
extern GSM_Error ATGEN_DeleteMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
extern GSM_Error ATGEN_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *Status);
extern GSM_Error ATGEN_GetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc);
extern GSM_Error ATGEN_SetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc);
extern GSM_Error ATGEN_GetSMSFolders (GSM_StateMachine *s, GSM_SMSFolders *folders);
extern GSM_Error ATGEN_GetSMSStatus (GSM_StateMachine *s, GSM_SMSMemoryStatus *status);
extern GSM_Error ATGEN_GetSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms);
extern GSM_Error ATGEN_GetNextSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms, bool start);
extern GSM_Error ATGEN_SendSavedSMS (GSM_StateMachine *s, int Folder, int Location);
extern GSM_Error ATGEN_SendSMS (GSM_StateMachine *s, GSM_SMSMessage *sms);
extern GSM_Error ATGEN_DeleteSMS (GSM_StateMachine *s, GSM_SMSMessage *sms);
extern GSM_Error ATGEN_AddSMS (GSM_StateMachine *s, GSM_SMSMessage *sms);
extern GSM_Error ATGEN_GetBatteryCharge (GSM_StateMachine *s, GSM_BatteryCharge *bat);
extern GSM_Error ATGEN_GetSignalQuality (GSM_StateMachine *s, GSM_SignalQuality *sig);
extern GSM_Error ATGEN_DialVoice (GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber);
extern GSM_Error ATGEN_AnswerCall (GSM_StateMachine *s, int ID, bool all);
extern GSM_Error ATGEN_CancelCall (GSM_StateMachine *s, int ID, bool all);
extern GSM_Error ATGEN_SetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time);
extern GSM_Error ATGEN_EnterSecurityCode (GSM_StateMachine *s, GSM_SecurityCode Code);
extern GSM_Error ATGEN_GetSecurityStatus (GSM_StateMachine *s, GSM_SecurityCodeType *Status);
extern GSM_Error ATGEN_ResetPhoneSettings (GSM_StateMachine *s, GSM_ResetSettingsType Type);
extern GSM_Error ATGEN_SendDTMF (GSM_StateMachine *s, char *sequence);
extern GSM_Error ATGEN_GetSIMIMSI (GSM_StateMachine *s, char *IMSI);
extern GSM_Error ATGEN_HandleCMSError (GSM_StateMachine *s);
extern GSM_Error ATGEN_GetNetworkInfo (GSM_StateMachine *s, GSM_NetworkInfo *netinfo);
extern GSM_Error ATGEN_Reset (GSM_StateMachine *s, bool hard);
extern GSM_Error ATGEN_PressKey (GSM_StateMachine *s, GSM_KeyCode Key, bool Press);
extern GSM_Error ATGEN_GetDisplayStatus (GSM_StateMachine *s, GSM_DisplayFeatures *features);
extern GSM_Error ATGEN_SetAutoNetworkLogin (GSM_StateMachine *s);
extern GSM_Error ATGEN_DeleteAllMemory (GSM_StateMachine *s, GSM_MemoryType type);
extern GSM_Error ATGEN_DispatchMessage (GSM_StateMachine *s);
extern GSM_Error ATGEN_SetFastSMSSending (GSM_StateMachine *s, bool enable);
extern GSM_Error ATGEN_SetIncomingCB (GSM_StateMachine *s, bool enable);
extern GSM_Error ATGEN_SetIncomingSMS (GSM_StateMachine *s, bool enable);
diff --git a/gammu/emb/gammu/depend/nokia/dct3.c b/gammu/emb/gammu/depend/nokia/dct3.c
index b9e47ea..bda7532 100644
--- a/gammu/emb/gammu/depend/nokia/dct3.c
+++ b/gammu/emb/gammu/depend/nokia/dct3.c
@@ -1,66 +1,66 @@
/* (c) 2002-2004 by Marcin Wiacek */
/* MSID by Walek */
#include "../../../common/gsmstate.h"
#ifdef GSM_ENABLE_NOKIA_DCT3
#include <string.h>
#include <signal.h>
#include "../../../common/misc/coding/coding.h"
#include "../../../common/gsmcomon.h"
#include "../../../common/service/gsmpbk.h"
#include "../../../common/phone/nokia/dct3/dct3func.h"
#include "../../../common/phone/pfunc.h"
#include "../../gammu.h"
-extern GSM_Reply_Function UserReplyFunctions3[];
+static GSM_Reply_Function UserReplyFunctions3[];
/* ------- some usefull functions ----------------------------------------- */
GSM_Error CheckDCT3Only()
{
bool found = false;
/* Checking if phone is DCT3 */
#ifdef GSM_ENABLE_NOKIA6110
if (strstr(N6110Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
#endif
#ifdef GSM_ENABLE_NOKIA7110
if (strstr(N7110Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
#endif
#ifdef GSM_ENABLE_NOKIA9210
if (strstr(N9210Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
#endif
if (!found) return ERR_NOTSUPPORTED;
if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 &&
s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_FBUS2BLUE &&
s.ConnectionType!=GCT_FBUS2IRDA && s.ConnectionType!=GCT_IRDAPHONET &&
s.ConnectionType!=GCT_BLUEFBUS2) {
return ERR_OTHERCONNECTIONREQUIRED;
}
return ERR_NONE;
}
static void CheckDCT3()
{
GSM_Error error;
error = CheckDCT3Only();
switch (error) {
case ERR_NOTSUPPORTED:
Print_Error(ERR_NOTSUPPORTED);
break;
case ERR_OTHERCONNECTIONREQUIRED:
printf("Can't do it with current phone protocol\n");
GSM_TerminateConnection(&s);
exit(-1);
default:
break;
}
}
static bool answer_yes3(char *text)
{
diff --git a/gammu/emb/gammu/depend/nokia/dct3trac/wmx.c b/gammu/emb/gammu/depend/nokia/dct3trac/wmx.c
index 64eda37..e46d9dd 100644
--- a/gammu/emb/gammu/depend/nokia/dct3trac/wmx.c
+++ b/gammu/emb/gammu/depend/nokia/dct3trac/wmx.c
@@ -1,79 +1,79 @@
/**
* Nokia DCT3 Firmware Debug Trace Monitor
* wumpus 2003 -- www.blacksphere.tk
* SIM stuff by The Monty
*
* Command line arguments:
* gammu --nokiadebug v00-0F,20,21
* (v=verbose)
*/
#include "../../../../common/gsmstate.h"
#ifdef GSM_ENABLE_NOKIA_DCT3
#include <string.h>
#include <signal.h>
#include "../../../../common/misc/coding/coding.h"
#include "../../../../common/gsmcomon.h"
#include "../../../../common/gsmstate.h"
#include "../../../../common/service/gsmpbk.h"
#include "../../../../common/phone/nokia/dct3/dct3func.h"
#include "../../../gammu.h"
#include "../dct3.h"
#include "wmx.h"
#include "wmx-util.h"
#include "wmx-gsm.h"
#include "wmx-sim.h"
#include "wmx-list.h"
-extern GSM_Reply_Function UserReplyFunctionsX[];
+static GSM_Reply_Function UserReplyFunctionsX[];
/* Global variables suck */
GSMDecoder *gsmdec;
struct wmx_tracestruct *traces;
static GSM_Error DCT3_ReplySwitchDebug(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
switch(msg.Buffer[2]) {
case 0x70:
printf("Debug Trace Enabled\n");
break;
case 0x71:
printf("Debug Trace Disabled\n");
break;
}
return ERR_NONE;
}
/**
* RPC confirmation/reply
*/
static GSM_Error DCT3_ReplyRPC(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
printf("RPC Reply ");
printf("call=%02x rettype=%02x data=", msg.Buffer[2], msg.Buffer[3]);
if(msg.Buffer[3] == 3) {
/* string */
printf("%s", &msg.Buffer[4]);
} else {
dumpraw("RPC Reply data", &msg.Buffer[4], msg.Length-4);
}
printf("\n");
return ERR_NONE;
}
/* disassemble mdisnd (0x18xx) packet */
static void mdisnd_data(unsigned char type, unsigned char *buffer, size_t length)
{
GSMDecoder_l1l2data dat;
size_t x;
int ch;
if(type==0x1B && length>2) {
/* channel packet */
ch = buffer[1];
dat.tx = GSMDECODER_SEND;
dat.ch = ch;
printf("%02X ch=%02X ",buffer[0],ch);
diff --git a/gammu/emb/gammu/depend/nokia/dct4.c b/gammu/emb/gammu/depend/nokia/dct4.c
index 4bf958d..43d8f09 100644
--- a/gammu/emb/gammu/depend/nokia/dct4.c
+++ b/gammu/emb/gammu/depend/nokia/dct4.c
@@ -1,64 +1,64 @@
/* (c) 2002-2004 by Marcin Wiacek */
#include "../../../common/gsmstate.h"
#ifdef GSM_ENABLE_NOKIA_DCT4
#include <string.h>
#include "dct4.h"
#include "../../gammu.h"
#include "../../../common/phone/pfunc.h"
#include "../../../common/phone/nokia/nfunc.h"
#include "../../../common/phone/nokia/dct4/dct4func.h"
#include "../../../common/misc/coding/coding.h"
-extern GSM_Reply_Function UserReplyFunctions4[];
+static GSM_Reply_Function UserReplyFunctions4[];
/* ------- some usefull functions ----------------------------------------- */
GSM_Error CheckDCT4Only()
{
bool found = false;
/* Checking if phone is DCT4 */
#ifdef GSM_ENABLE_NOKIA3650
if (strstr(N3650Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
#endif
#ifdef GSM_ENABLE_NOKIA6510
if (strstr(N6510Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
#endif
#ifdef GSM_ENABLE_NOKIA3320
if (strstr(N3320Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
#endif
if (!found) return ERR_NOTSUPPORTED;
if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 &&
s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_PHONETBLUE &&
s.ConnectionType!=GCT_IRDAPHONET && s.ConnectionType!=GCT_BLUEPHONET &&
s.ConnectionType!=GCT_FBUS2DKU5) {
return ERR_OTHERCONNECTIONREQUIRED;
}
return ERR_NONE;
}
static void CheckDCT4()
{
GSM_Error error;
error = CheckDCT4Only();
switch (error) {
case ERR_NOTSUPPORTED:
Print_Error(ERR_NOTSUPPORTED);
break;
case ERR_OTHERCONNECTIONREQUIRED:
printf("Can't do it with current phone protocol\n");
GSM_TerminateConnection(&s);
exit(-1);
default:
break;
}
}
static bool answer_yes2(char *text)
{
diff --git a/gammu/emb/gammu/depend/siemens/dsiemens.c b/gammu/emb/gammu/depend/siemens/dsiemens.c
index dc54102..a34bc3b 100644
--- a/gammu/emb/gammu/depend/siemens/dsiemens.c
+++ b/gammu/emb/gammu/depend/siemens/dsiemens.c
@@ -1,68 +1,68 @@
/* (c) by Walek */
#include "../../../common/gsmstate.h"
#ifdef GSM_ENABLE_ATGEN
#include <string.h>
#include "../../../common/misc/coding/coding.h"
#include "../../../common/gsmcomon.h"
#include "../../../common/service/gsmnet.h"
#include "../../../common/phone/at/atgen.h"
#include "../../gammu.h"
#include "dsiemens.h"
#include "chiffre.h"
extern GSM_Error ATGEN_GetSIMIMSI (GSM_StateMachine *s, char *IMSI);
extern GSM_Error ATGEN_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *status);
extern GSM_Error ATGEN_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *pbk);
-extern GSM_Reply_Function UserReplyFunctionsAtS[];
+static GSM_Reply_Function UserReplyFunctionsAtS[];
bool new_variable;
GSM_Error CheckSiemens()
{
if (s.Phone.Data.Priv.ATGEN.Manufacturer != AT_Siemens) return ERR_NOTSUPPORTED;
return ERR_NONE;
}
GSM_Error ATSIEMENS_Reply_GetSAT(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
GSM_Phone_ATGENData *Priv = &s->Phone.Data.Priv.ATGEN;
GSM_SAT_Measure_results MeasureResult;
unsigned char buf[256];
int length,i,rep,ChNo=1,j=0,result=0,origARFCN=0;
int freq_tmp,frequency[24];
GSM_NetworkInfo Network;
if (Priv->ReplyState!=AT_Reply_OK) return ERR_UNKNOWN;
if (s->Protocol.Data.AT.EditMode) s->Protocol.Data.AT.EditMode = false;
if (strstr(GetLineString(msg.Buffer,Priv->Lines,2),"SSTK")) {
length = strlen(GetLineString(msg.Buffer,Priv->Lines,2))-7;
DecodeHexBin(buf, GetLineString(msg.Buffer,Priv->Lines,2)+7,length);
if (buf[0]==0x7f) {
new_variable=true;
return ERR_NONE;
}
else return ERR_UNKNOWN;
}
if (!strstr(GetLineString(msg.Buffer,Priv->Lines,3),"SSTK")) return ERR_UNKNOWN;
length = strlen(GetLineString(msg.Buffer,Priv->Lines,3))-7;
DecodeHexBin(buf, GetLineString(msg.Buffer,Priv->Lines,3)+7,length);
if (buf[3]!=0x26) return ERR_UNKNOWN;
#ifdef DEBUG
dbgprintf ("SAT command: Provide Local Information\nFunction: ");
switch (buf[4]) {
case 00: dbgprintf ("Loc Info\n"); break;
case 01: dbgprintf ("IMEI\n"); break;
case 02: dbgprintf ("Network Measure\n"); break;
case 03: dbgprintf ("Date time and timezone\n"); break;
case 04: dbgprintf ("Language setting\n"); break;
case 05: dbgprintf ("Timing advance\n"); break;
}
#endif
/* Loc Info (MCC, MNC, LAC, Cell ID) */
if (buf[4]==00) {
diff --git a/kaddressbook/addresseeeditorwidget.h b/kaddressbook/addresseeeditorwidget.h
index df9965d..816bbb5 100644
--- a/kaddressbook/addresseeeditorwidget.h
+++ b/kaddressbook/addresseeeditorwidget.h
@@ -1,76 +1,77 @@
/*
This file is part of KAddressBook.
Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
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.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef ADDRESSEEEDITORWIDGET_H
#define ADDRESSEEEDITORWIDGET_H
#include <qdatetime.h>
#include <qpopupmenu.h>
+#include <qcombobox.h>
#include <kabc/addressee.h>
#include <kdialogbase.h>
#include <kjanuswidget.h>
#include "extensionwidget.h"
class AddresseeConfig;
class QCheckBox;
class QSpinBox;
class QTabWidget;
#ifndef KAB_EMBEDDED
class QTextEdit;
#else //KAB_EMBEDDED
class QMultiLineEdit;
#endif //KAB_EMBEDDED
class KComboBox;
class KDateEdit;
class KLineEdit;
class KSqueezedTextLabel;
class AddressEditWidget;
class EmailEditWidget;
class GeoWidget;
class ImageWidget;
class KABCore;
class KeyWidget;
class PhoneEditWidget;
class SecrecyWidget;
class SoundWidget;
namespace KPIM
{
class CategorySelectDialog;
class CategoryEditDialog;
}
namespace KABC { class AddressBook; }
class AddresseeEditorWidget : public ExtensionWidget
{
Q_OBJECT
public:
AddresseeEditorWidget( KABCore *core, bool isExtension,
QWidget *parent, const char *name = 0 );
diff --git a/pwmanager/libcrypt/cipher/serpent.c b/pwmanager/libcrypt/cipher/serpent.c
index d606d9f..fb5df20 100644
--- a/pwmanager/libcrypt/cipher/serpent.c
+++ b/pwmanager/libcrypt/cipher/serpent.c
@@ -628,111 +628,111 @@ serpent_subkeys_generate (serpent_key_t key, serpent_subkeys_t subkeys)
SBOX (0, w, k, 12);
SBOX (7, w, k, 16);
SBOX (6, w, k, 20);
SBOX (5, w, k, 24);
SBOX (4, w, k, 28);
SBOX (3, w, k, 32);
SBOX (2, w, k, 36);
SBOX (1, w, k, 40);
SBOX (0, w, k, 44);
SBOX (7, w, k, 48);
SBOX (6, w, k, 52);
SBOX (5, w, k, 56);
SBOX (4, w, k, 60);
SBOX (3, w, k, 64);
SBOX (2, w, k, 68);
SBOX (1, w, k, 72);
SBOX (0, w, k, 76);
SBOX (7, w, k, 80);
SBOX (6, w, k, 84);
SBOX (5, w, k, 88);
SBOX (4, w, k, 92);
SBOX (3, w, k, 96);
SBOX (2, w, k, 100);
SBOX (1, w, k, 104);
SBOX (0, w, k, 108);
SBOX (7, w, k, 112);
SBOX (6, w, k, 116);
SBOX (5, w, k, 120);
SBOX (4, w, k, 124);
SBOX (3, w, k, 128);
/* Renumber subkeys. */
for (i = 0; i < ROUNDS + 1; i++)
for (j = 0; j < 4; j++)
subkeys[i][j] = k[4 * i + j];
}
/* Initialize CONTEXT with the key KEY of KEY_LENGTH bits. */
static void
serpent_setkey_internal (serpent_context_t *context,
const byte_t *key, unsigned int key_length)
{
serpent_key_t key_prepared;
serpent_key_prepare (key, key_length, key_prepared);
serpent_subkeys_generate (key_prepared, context->keys);
_gcry_burn_stack (272 * sizeof (u32_t));
}
-
+ static const char *serpent_test (void);
/* Initialize CTX with the key KEY of KEY_LENGTH bytes. */
static gcry_err_code_t
serpent_setkey (void *ctx,
const byte_t *key, unsigned int key_length)
{
serpent_context_t *context = ctx;
static const char *serpent_test_ret;
static int serpent_init_done;
gcry_err_code_t ret = GPG_ERR_NO_ERROR;
if (! serpent_init_done)
{
/* Execute a self-test the first time, Serpent is used. */
- static const char *serpent_test (void);
+
serpent_test_ret = serpent_test ();
if (serpent_test_ret)
log_error ("Serpent test failure: %s\n", serpent_test_ret);
serpent_init_done = 1;
}
if (serpent_test_ret)
ret = GPG_ERR_SELFTEST_FAILED;
else
{
serpent_setkey_internal (context, key, key_length);
_gcry_burn_stack (sizeof (serpent_key_t));
}
return ret;
}
static void
serpent_encrypt_internal (serpent_context_t *context,
const serpent_block_t input, serpent_block_t output)
{
serpent_block_t b, b_next;
int round = 0;
#ifdef WORDS_BIGENDIAN
b[0] = byte_swap_32 (input[0]);
b[1] = byte_swap_32 (input[1]);
b[2] = byte_swap_32 (input[2]);
b[3] = byte_swap_32 (input[3]);
#else
b[0] = input[0];
b[1] = input[1];
b[2] = input[2];
b[3] = input[3];
#endif
ROUND (0, context->keys, b, b_next);
ROUND (1, context->keys, b, b_next);
ROUND (2, context->keys, b, b_next);
ROUND (3, context->keys, b, b_next);
ROUND (4, context->keys, b, b_next);
ROUND (5, context->keys, b, b_next);
ROUND (6, context->keys, b, b_next);
ROUND (7, context->keys, b, b_next);
ROUND (0, context->keys, b, b_next);
ROUND (1, context->keys, b, b_next);
ROUND (2, context->keys, b, b_next);
diff --git a/pwmanager/pwmanager/binentrygen.cpp b/pwmanager/pwmanager/binentrygen.cpp
index 7d5ae45..f156a5e 100644
--- a/pwmanager/pwmanager/binentrygen.cpp
+++ b/pwmanager/pwmanager/binentrygen.cpp
@@ -1,71 +1,72 @@
/***************************************************************************
* *
* copyright (C) 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* 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. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
-
#include "binentrygen.h"
#include "base64.h"
-#include "pwmexception.h"
+#include "pwmexception.h"
+#include "globalstuff.h"
void BinEntryGen::encode(const QByteArray &data,
PwMDataItem *ret,
DataType type)
{
ret->clear();
ret->name = tostr(static_cast<int>(type));
ret->binary = true;
if (data.size() == 0)
return;
Base64 b64;
string d(data.data(), data.size());
ret->pw = b64.encode(d);
}
void BinEntryGen::decode(const PwMDataItem &data,
QByteArray *ret,
DataType *type)
{
BUG_ON(!data.binary);
int t = strtol(data.name.c_str(), 0, 10);
*type = static_cast<DataType>(t);
switch (*type) {
case None:
case KWalletMap:
case KWalletStream:
break;
default:
*type = None;
}
if (data.pw == "") {
ret->fill(0);
ret->resize(0);
return;
}
Base64 b64;
string d(b64.decode(data.pw));
ret->duplicate(d.c_str(), d.length());
}
BinEntryGen::DataType BinEntryGen::binType(const PwMDataItem &data)
{
if (!data.binary)
return None;
int type = strtol(data.name.c_str(), 0, 10);
return (static_cast<DataType>(type));
}
+
diff --git a/pwmanager/pwmanager/binentrygen.h b/pwmanager/pwmanager/binentrygen.h
index a58cd42..49288aa 100644
--- a/pwmanager/pwmanager/binentrygen.h
+++ b/pwmanager/pwmanager/binentrygen.h
@@ -1,65 +1,65 @@
/***************************************************************************
* *
* copyright (C) 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* 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. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#ifndef __BINENTRYGEN_H
#define __BINENTRYGEN_H
-#include "pwmdoc.h"
#include <qcstring.h>
+#include "pwmdoc.h"
/** Binary entry generator.
* This generator generates a normal struct PwMDataItem
* from binary data (using base64 encoding).
* This mechanism is used to support the binary interface functions
* of the KWallet emulation, for example.
*
* The format of the encoded binary data as a PwMDataItem is as follows:
*
* PwMDataItem::desc contains the normal description string for
* this entry. Nothing surprising.
* PwMDataItem::name contains the "DataType" number in ascii format.
* PwMDataItem::pw contains the base64 encoded data stream.
* PwMDataItem::binary is always true for binary entries.
* All other PwMDataItems are currently unused by BinEntryGen.
*/
class BinEntryGen
{
public:
enum DataType
{
None = 0,
KWalletMap,
KWalletStream
};
public:
BinEntryGen() { }
/** Encode the binary "data" and return it in "ret" */
void encode(const QByteArray &data, PwMDataItem *ret, DataType type);
/** Decode the "data" and return it as binary "ret" */
void decode(const PwMDataItem &data, QByteArray *ret, DataType *type);
/** Return the data type for this binary data item */
DataType binType(const PwMDataItem &data);
};
#endif // __BINENTRYGEN_H
diff --git a/pwmanager/pwmanager/blowfish.cpp b/pwmanager/pwmanager/blowfish.cpp
index 2ca58ce..ee29756 100644
--- a/pwmanager/pwmanager/blowfish.cpp
+++ b/pwmanager/pwmanager/blowfish.cpp
@@ -1,96 +1,96 @@
/* 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
*
*/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#include <string.h>
#include <stdlib.h>
-#include "blowfish.h"
#include "globalstuff.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
};
diff --git a/pwmanager/pwmanager/blowfish.h b/pwmanager/pwmanager/blowfish.h
index 5129eab..862cccb 100644
--- a/pwmanager/pwmanager/blowfish.h
+++ b/pwmanager/pwmanager/blowfish.h
@@ -1,94 +1,96 @@
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#ifndef BLOWFISH_H
#define BLOWFISH_H
-#include "pwmexception.h"
+//#include "pwmexception.h"
#ifndef _WIN32_
#include <stdint.h>
#else
#endif
#include <string>
using std::string;
#define BLOWFISH_BLOCKSIZE 8
#define BLOWFISH_ROUNDS 16
#define CIPHER_ALGO_BLOWFISH 4 /* blowfish 128 bit key */
#ifndef _WIN32_
typedef uint8_t byte;
#else
#define uint8_t Q_UINT8
#define byte Q_UINT8
#define uint32_t Q_UINT32
#endif
+//#include "pwmexception.h"
+
/** 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() {}
static bool selfTest();
/** 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];
diff --git a/pwmanager/pwmanager/genpasswd.cpp b/pwmanager/pwmanager/genpasswd.cpp
index b0cceff..41078b3 100644
--- a/pwmanager/pwmanager/genpasswd.cpp
+++ b/pwmanager/pwmanager/genpasswd.cpp
@@ -1,70 +1,71 @@
/***************************************************************************
* *
* copyright (C) 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* 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. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#include "genpasswd.h"
#include "pwmexception.h"
#include "randomizer.h"
+#include "globalstuff.h"
/* how often can a char of the same charset be reused in order */
#define FILTER_MAX_CHARSET_REUSE 3
/* re-randomize all charsets on every iteration (0/1) */
#define RERAND_CHARSET 0
struct staticCharsetStruct
{
const char *lower;
const char *upper;
const char *num;
const char *special;
const char *blank;
};
static struct staticCharsetStruct staticCharset = {
"abcdefghijklmnopqrstuvwxyz",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"0123456789",
"!\"§$%&/()=?,.-;:_+",
" "
};
GenPasswd::GenPasswd()
: length (8)
, useFilter (true)
{
dynCharset.setAutoDelete(true);
}
void GenPasswd::setCharset(bool lower,
bool upper,
bool num,
bool special,
bool blank,
QString user)
{
unsigned int sanityCheck = 0;
dynCharset_element *tmpElement;
dynCharset.clear();
if (lower) {
tmpElement = new dynCharset_element;
tmpElement->refCnt = 0;
tmpElement->data = staticCharset.lower;
dynCharset.append(tmpElement);
diff --git a/pwmanager/pwmanager/libgcryptif.h b/pwmanager/pwmanager/libgcryptif.h
index 9a987a2..a08d678 100644
--- a/pwmanager/pwmanager/libgcryptif.h
+++ b/pwmanager/pwmanager/libgcryptif.h
@@ -1,90 +1,92 @@
/***************************************************************************
* *
* copyright (C) 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* hashPassphrase() is derived from GnuPG and is *
* Copyright (C) 1998, 1999, 2000, 2001, 2003 *
* 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. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#ifndef __LIBGCRYPTIF_H
#define __LIBGCRYPTIF_H
-#include "pwmexception.h"
//#undef CONFIG_PWMANAGER_GCRY // for debugging only.
#ifdef CONFIG_PWMANAGER_GCRY
#include <stddef.h>
#include <sys/types.h>
#ifndef _WIN32_
#include <stdint.h>
#else
#define uint8_t Q_UINT8
#define byte Q_UINT8
#define uint32_t Q_UINT32
#endif
#define STRING2KEY_SALTLEN 8
+#include "pwmexception.h"
+
+
/** interface class for the libgcrypt cipher and hash algorithms
* NOTE: Always allocate 1024 extra bytes for the inBuf (for padding)
*/
class LibGCryptIf
{
protected:
struct STRING2KEY
{
int mode;
int hash_algo;
uint8_t salt[STRING2KEY_SALTLEN];
uint32_t count;
};
struct DEK
{
size_t keylen;
uint8_t key[32]; // this is the largest used keylen (256 bit)
};
public:
LibGCryptIf() { }
/** is libgcrypt available? */
static bool available()
{ return true; }
/** encrypt data. _algo is the PWM_CRYPT_* ID
* of the algorithm.
*/
PwMerror encrypt(unsigned char **outBuf,
size_t *outBufLen,
unsigned char *inBuf,
size_t inBufLen,
const unsigned char *key,
size_t keylen,
char _algo,
char _hashalgo //US BUG: pass _hashalgo because we need it in hashPassphrase
);
/** decrypt data. _algo is the PWM_CRYPT_* ID
* of the algorithm.
*/
PwMerror decrypt(unsigned char **outBuf,
size_t *outBufLen,
const unsigned char *inBuf,
size_t inBufLen,
const unsigned char *key,
size_t keylen,
char _algo,
char _hashalgo //US BUG: pass _hashalgo because we need it in hashPassphrase
);
diff --git a/pwmanager/pwmanager/pwmexception.h b/pwmanager/pwmanager/pwmexception.h
index 301ebd7..7f5a3a6 100644
--- a/pwmanager/pwmanager/pwmexception.h
+++ b/pwmanager/pwmanager/pwmexception.h
@@ -1,71 +1,71 @@
/***************************************************************************
* *
* copyright (C) 2003, 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* 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. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#ifndef __PWMEXCEPTION_H
#define __PWMEXCEPTION_H
-#include "globalstuff.h"
+//#include "globalstuff.h"
#include <iostream>
#include <string>
using std::string;
using std::cerr;
using std::cout;
using std::endl;
/* This is an internal function to reduce code-overhead
* of the BUG(), WARN(), TOD0() and FiXME() macros. Please use
* these macros instead of calling this function directly.
*/
void pwmFatal(const char *id,
const char *file,
int line);
/** Use PWM_ASSERT(condition) for debugging assertions.
* "condition" is eaten up and replaced with a NOP
* when debugging is disabled.
*
* PWM_ASSERT_NOEAT(condition) is the same as PWM_ASSERT(condition),
* but it does _not_ eat up "condition" and ensures that
* condition is always evaluated.
*/
#ifdef PWM_ASSERT
# undef PWM_ASSERT
#endif
#ifdef PWM_ASSERT_NOEAT
# undef PWM_ASSERT_NOEAT
#endif
#ifdef PWM_DEBUG
# define PWM_ASSERT(x) do { \
if (unlikely(!(x))) { \
cerr << "PWM_ASSERT failed: (" << #x \
<< ") in " << __FILE__ \
<< ":" << __LINE__ \
<< endl; \
} \
} while (0)
# define PWM_ASSERT_NOEAT(x) do { PWM_ASSERT(x); } while (0)
#else // PWM_DEBUG
# define PWM_ASSERT(x) do { } while (0)
# define PWM_ASSERT_NOEAT(x) do { if (x) ; } while (0)
#endif // PWM_DEBUG
/** Insert a BUG() into code paths which clearly show
* a bug in the code and which should, under normal
* circumstances, never execute.
@@ -169,49 +169,50 @@ class PwMException
{
public:
enum exceptionId
{
EX_GENERIC = 0,
EX_OPEN,
EX_CLOSE,
EX_READ,
EX_WRITE,
EX_LOAD_MODULE,
EX_PARSE
};
public:
PwMException(exceptionId id = EX_GENERIC,
const char *message = "")
{
exId = id;
exMsg = message;
}
exceptionId getId()
{ return exId; }
const char* getMessage()
{ return exMsg; }
protected:
/** ID of this exception */
exceptionId exId;
/** additional error-message for this exception */
const char *exMsg;
};
void __printInfo(const string &msg);
void __printWarn(const string &msg);
void __printError(const string &msg);
#ifdef PWM_DEBUG
void __printDebug(const string &msg);
# define printDebug(x) __printDebug(x)
#else
# define printDebug(x) do { } while (0)
#endif
#define printInfo(x) __printInfo(x)
#define printWarn(x) __printWarn(x)
#define printError(x) __printError(x)
+#include "globalstuff.h"
#endif // __PWMEXCEPTION_H
diff --git a/pwmanager/pwmanager/randomizer.h b/pwmanager/pwmanager/randomizer.h
index f2a6015..44cc28e 100644
--- a/pwmanager/pwmanager/randomizer.h
+++ b/pwmanager/pwmanager/randomizer.h
@@ -1,71 +1,72 @@
/***************************************************************************
* *
* copyright (C) 2003, 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* 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. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#ifndef __RANDOMIZER_H
#define __RANDOMIZER_H
#include "pwmexception.h"
+#include "globalstuff.h"
#ifndef PWM_EMBEDDED
#include <qmutex.h>
#endif
#include <string>
using std::string;
class QFile;
/** Randomizer to get random values.
* This class is thread-safe.
* You should always use the instance returned by
* obj() to use it.
*/
class Randomizer
{
public:
Randomizer();
~Randomizer();
static Randomizer * obj()
{
PWM_ASSERT(rndObj);
return rndObj;
}
static void init()
{
PWM_ASSERT(!rndObj);
rndObj = new Randomizer;
}
static void cleanup()
{
delete_ifnot_null(rndObj);
}
/** generate random char */
char genRndChar();
/** generate random int */
int genRndInt();
/** generate a random unsigned int */
unsigned int genRndUInt();
/** returns a buffer with random data */
string genRndBuf(size_t len);
/** returns a buffer with random data */
void genRndBuf(unsigned char *buf, size_t len);