-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | gammu/emb/common/phone/alcatel/alcatel.c | 2 | ||||
-rw-r--r-- | gammu/emb/gammu/depend/nokia/dct3.c | 2 | ||||
-rw-r--r-- | gammu/emb/gammu/depend/nokia/dct3trac/wmx.c | 2 | ||||
-rw-r--r-- | gammu/emb/gammu/depend/nokia/dct4.c | 2 | ||||
-rw-r--r-- | gammu/emb/gammu/depend/siemens/dsiemens.c | 2 | ||||
-rw-r--r-- | kaddressbook/addresseeeditorwidget.h | 1 | ||||
-rw-r--r-- | pwmanager/libcrypt/cipher/serpent.c | 4 | ||||
-rw-r--r-- | pwmanager/pwmanager/binentrygen.cpp | 5 | ||||
-rw-r--r-- | pwmanager/pwmanager/binentrygen.h | 2 | ||||
-rw-r--r-- | pwmanager/pwmanager/blowfish.cpp | 2 | ||||
-rw-r--r-- | pwmanager/pwmanager/blowfish.h | 4 | ||||
-rw-r--r-- | pwmanager/pwmanager/genpasswd.cpp | 1 | ||||
-rw-r--r-- | pwmanager/pwmanager/libgcryptif.h | 4 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmexception.h | 3 | ||||
-rw-r--r-- | pwmanager/pwmanager/randomizer.h | 1 |
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 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.2.8 ************ | 3 | ********** VERSION 2.2.8 ************ |
4 | 4 | ||
5 | 5 | ||
6 | I forgot what I fixed... | 6 | I forgot what I fixed... |
7 | 7 | ||
8 | Some minor fixes in KA/Pi and KO/Pi. | 8 | Some minor fixes in KA/Pi and KO/Pi. |
9 | 9 | ||
10 | KA/Pi uses popup menu now for quick category selection in contact edit dialog. | 10 | KA/Pi uses popup menu now for quick category selection in contact edit dialog. |
11 | 11 | ||
12 | 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. | 12 | 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. |
13 | This feature must be considered as unstable - it still needs some more testing. | 13 | This feature must be considered as unstable - it still needs some more testing. |
14 | 14 | ||
15 | On Wintendo now KA/Pi can sync with Outlook. The configuration of the sync needs some moer tweking. | ||
16 | Fixed some gcc 4.xx compilation probs. | ||
17 | Fixed an annoying cursor focus reset problem when editing and (auto-)saving journal enries in KO/Pi. | ||
18 | |||
19 | |||
15 | ********** VERSION 2.2.7 ************ | 20 | ********** VERSION 2.2.7 ************ |
16 | 21 | ||
17 | Added for Desktop Versions (Windows + Linux) the possibility to specify an email client to call if the user clicks on an emailaddress. | 22 | Added for Desktop Versions (Windows + Linux) the possibility to specify an email client to call if the user clicks on an emailaddress. |
18 | (Menu: Config->Global Settings->Extern.Applications: E-mail). | 23 | (Menu: Config->Global Settings->Extern.Applications: E-mail). |
19 | Added as default (and example) Mozilla Thunderbird settings. | 24 | Added as default (and example) Mozilla Thunderbird settings. |
20 | 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". | 25 | 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". |
21 | 26 | ||
22 | ********** VERSION 2.2.6 ************ | 27 | ********** VERSION 2.2.6 ************ |
23 | 28 | ||
24 | KO/Pi: | 29 | KO/Pi: |
25 | Made navigation in datepicker more userfriendly when using keyboard for scrolling. | 30 | Made navigation in datepicker more userfriendly when using keyboard for scrolling. |
26 | KO/Pi Alarm applet: | 31 | KO/Pi Alarm applet: |
27 | Made font size for the two popup menus with larger font configurable: | 32 | Made font size for the two popup menus with larger font configurable: |
28 | Change size with menu: | 33 | Change size with menu: |
29 | Play Beeps->Font Size | 34 | Play Beeps->Font Size |
30 | Save settings such that it will be restored after next reboot with menu: | 35 | Save settings such that it will be restored after next reboot with menu: |
31 | Play Beeps->Config->Save. | 36 | Play Beeps->Config->Save. |
32 | KA/Pi: | 37 | KA/Pi: |
33 | Big change! Needed for the upcoming Outlook sync: | 38 | Big change! Needed for the upcoming Outlook sync: |
34 | (Outlook sync available appr. end of 2005) | 39 | (Outlook sync available appr. end of 2005) |
35 | Telephone number types are now fixed in KA/Pi | 40 | Telephone number types are now fixed in KA/Pi |
36 | (but still compatible with the vCard standard, of cource) | 41 | (but still compatible with the vCard standard, of cource) |
37 | and they are compatible with the types used by the evil empire. | 42 | and they are compatible with the types used by the evil empire. |
38 | That makes syncing with OL possible and make it possible to sync better with mobile devices. | 43 | That makes syncing with OL possible and make it possible to sync better with mobile devices. |
39 | NOTE: | 44 | NOTE: |
40 | All your telephone types will be converted automatically at loading/importing! | 45 | All your telephone types will be converted automatically at loading/importing! |
41 | Such that it may be a good idea to make a backup of the data before starting KA/Pi. | 46 | Such that it may be a good idea to make a backup of the data before starting KA/Pi. |
42 | But the editing of phone numbers and types has changed completely such that it is now much faster to edit/change types and numbers. | 47 | But the editing of phone numbers and types has changed completely such that it is now much faster to edit/change types and numbers. |
43 | HINT: | 48 | HINT: |
44 | To see whether there was some number for some contact not converted senseful, choose | 49 | To see whether there was some number for some contact not converted senseful, choose |
45 | Menu: View->Modify view | 50 | Menu: View->Modify view |
46 | and add "Other Phone" ( in German "Sonst. Telefon") to the view. | 51 | and add "Other Phone" ( in German "Sonst. Telefon") to the view. |
47 | If a type was not converted senseful to some of the 18 new, fixed types, it will get the "Other" type. | 52 | If a type was not converted senseful to some of the 18 new, fixed types, it will get the "Other" type. |
48 | 53 | ||
49 | ********** VERSION 2.2.5 ************ | 54 | ********** VERSION 2.2.5 ************ |
50 | 55 | ||
51 | Bugfixes in KO/Pi, KA/Pi and OM/Pi. | 56 | Bugfixes in KO/Pi, KA/Pi and OM/Pi. |
52 | Added possibility to disable auto saving in KO/Pi. | 57 | Added possibility to disable auto saving in KO/Pi. |
53 | How to disable it? Good question! Next question, please? | 58 | How to disable it? Good question! Next question, please? |
54 | Added info about count of events/todos/journals to calendar info. | 59 | Added info about count of events/todos/journals to calendar info. |
55 | 60 | ||
56 | 61 | ||
57 | ********** VERSION 2.2.4 ************ | 62 | ********** VERSION 2.2.4 ************ |
58 | 63 | ||
59 | 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. | 64 | 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. |
60 | Added 3 sec notification about a started timer. | 65 | Added 3 sec notification about a started timer. |
61 | 66 | ||
62 | KO/Pi: | 67 | 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 @@ | |||
11 | * - BH4 series (535/735) | 11 | * - BH4 series (535/735) |
12 | * For some functions it uses normal AT mode (not implemented here, look at | 12 | * For some functions it uses normal AT mode (not implemented here, look at |
13 | * ../at/atgen.[ch]) for others it switches into binary mode and initialises | 13 | * ../at/atgen.[ch]) for others it switches into binary mode and initialises |
14 | * underlaying protocol (see ../../protocol/alcatel/alcabus.[ch]) and | 14 | * underlaying protocol (see ../../protocol/alcatel/alcabus.[ch]) and |
15 | * communicates over it. Don't ask me why Alcatel uses such silly thing... | 15 | * communicates over it. Don't ask me why Alcatel uses such silly thing... |
16 | * | 16 | * |
17 | * Notes for future features: | 17 | * Notes for future features: |
18 | * - max phone number length is 61 (BE5) | 18 | * - max phone number length is 61 (BE5) |
19 | * - max name length is 50 (BE5) | 19 | * - max name length is 50 (BE5) |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include "../../gsmstate.h" | 22 | #include "../../gsmstate.h" |
23 | 23 | ||
24 | #ifdef GSM_ENABLE_ALCATEL | 24 | #ifdef GSM_ENABLE_ALCATEL |
25 | #ifdef GSM_ENABLE_ATGEN | 25 | #ifdef GSM_ENABLE_ATGEN |
26 | 26 | ||
27 | #include <string.h> | 27 | #include <string.h> |
28 | #include <time.h> | 28 | #include <time.h> |
29 | 29 | ||
30 | #include "../../gsmcomon.h" | 30 | #include "../../gsmcomon.h" |
31 | #include "../../misc/coding/coding.h" | 31 | #include "../../misc/coding/coding.h" |
32 | #include "../../misc/misc.h" | 32 | #include "../../misc/misc.h" |
33 | #include "../../service/sms/gsmsms.h" | 33 | #include "../../service/sms/gsmsms.h" |
34 | #include "../pfunc.h" | 34 | #include "../pfunc.h" |
35 | #include "alcatel.h" | 35 | #include "alcatel.h" |
36 | 36 | ||
37 | /* Timeout for GSM_WaitFor calls. */ | 37 | /* Timeout for GSM_WaitFor calls. */ |
38 | #define ALCATEL_TIMEOUT 64 | 38 | #define ALCATEL_TIMEOUT 64 |
39 | 39 | ||
40 | /* Some magic numbers for protocol follow */ | 40 | /* Some magic numbers for protocol follow */ |
41 | 41 | ||
42 | /* synchronisation types (for everything except begin transfer): */ | 42 | /* synchronisation types (for everything except begin transfer): */ |
43 | #define ALCATEL_SYNC_TYPE_CALENDAR0x64 | 43 | #define ALCATEL_SYNC_TYPE_CALENDAR0x64 |
44 | #define ALCATEL_SYNC_TYPE_TODO 0x68 | 44 | #define ALCATEL_SYNC_TYPE_TODO 0x68 |
45 | #define ALCATEL_SYNC_TYPE_CONTACTS0x6C | 45 | #define ALCATEL_SYNC_TYPE_CONTACTS0x6C |
46 | 46 | ||
47 | /* synchronisation types (for begin transfer): */ | 47 | /* synchronisation types (for begin transfer): */ |
48 | #define ALCATEL_BEGIN_SYNC_CALENDAR0x00 | 48 | #define ALCATEL_BEGIN_SYNC_CALENDAR0x00 |
49 | #define ALCATEL_BEGIN_SYNC_TODO 0x02 | 49 | #define ALCATEL_BEGIN_SYNC_TODO 0x02 |
50 | #define ALCATEL_BEGIN_SYNC_CONTACTS0x01 | 50 | #define ALCATEL_BEGIN_SYNC_CONTACTS0x01 |
51 | 51 | ||
52 | /* category types */ | 52 | /* category types */ |
53 | #define ALCATEL_LIST_TODO_CAT 0x9B | 53 | #define ALCATEL_LIST_TODO_CAT 0x9B |
54 | #define ALCATEL_LIST_CONTACTS_CAT0x96 | 54 | #define ALCATEL_LIST_CONTACTS_CAT0x96 |
55 | 55 | ||
56 | 56 | ||
57 | /* We need lot of ATGEN functions, because Alcatel is an AT device. */ | 57 | /* We need lot of ATGEN functions, because Alcatel is an AT device. */ |
58 | 58 | ||
59 | extern GSM_Reply_Function ALCATELReplyFunctions[]; | 59 | static GSM_Reply_Function ALCATELReplyFunctions[]; |
60 | extern GSM_Reply_Function ATGENReplyFunctions[]; | 60 | extern GSM_Reply_Function ATGENReplyFunctions[]; |
61 | 61 | ||
62 | extern GSM_Error ATGEN_Initialise (GSM_StateMachine *s); | 62 | extern GSM_Error ATGEN_Initialise (GSM_StateMachine *s); |
63 | extern GSM_Error ATGEN_Terminate (GSM_StateMachine *s); | 63 | extern GSM_Error ATGEN_Terminate (GSM_StateMachine *s); |
64 | extern GSM_Error ATGEN_GetIMEI (GSM_StateMachine *s); | 64 | extern GSM_Error ATGEN_GetIMEI (GSM_StateMachine *s); |
65 | extern GSM_Error ATGEN_GetFirmware (GSM_StateMachine *s); | 65 | extern GSM_Error ATGEN_GetFirmware (GSM_StateMachine *s); |
66 | extern GSM_Error ATGEN_GetModel (GSM_StateMachine *s); | 66 | extern GSM_Error ATGEN_GetModel (GSM_StateMachine *s); |
67 | extern GSM_Error ATGEN_GetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time); | 67 | extern GSM_Error ATGEN_GetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time); |
68 | extern GSM_Error ATGEN_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); | 68 | extern GSM_Error ATGEN_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); |
69 | extern GSM_Error ATGEN_GetNextMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry, bool start); | 69 | extern GSM_Error ATGEN_GetNextMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry, bool start); |
70 | extern GSM_Error ATGEN_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); | 70 | extern GSM_Error ATGEN_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); |
71 | extern GSM_Error ATGEN_AddMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); | 71 | extern GSM_Error ATGEN_AddMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); |
72 | extern GSM_Error ATGEN_DeleteMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); | 72 | extern GSM_Error ATGEN_DeleteMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); |
73 | extern GSM_Error ATGEN_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *Status); | 73 | extern GSM_Error ATGEN_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *Status); |
74 | extern GSM_Error ATGEN_GetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc); | 74 | extern GSM_Error ATGEN_GetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc); |
75 | extern GSM_Error ATGEN_SetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc); | 75 | extern GSM_Error ATGEN_SetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc); |
76 | extern GSM_Error ATGEN_GetSMSFolders (GSM_StateMachine *s, GSM_SMSFolders *folders); | 76 | extern GSM_Error ATGEN_GetSMSFolders (GSM_StateMachine *s, GSM_SMSFolders *folders); |
77 | extern GSM_Error ATGEN_GetSMSStatus (GSM_StateMachine *s, GSM_SMSMemoryStatus *status); | 77 | extern GSM_Error ATGEN_GetSMSStatus (GSM_StateMachine *s, GSM_SMSMemoryStatus *status); |
78 | extern GSM_Error ATGEN_GetSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms); | 78 | extern GSM_Error ATGEN_GetSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms); |
79 | extern GSM_Error ATGEN_GetNextSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms, bool start); | 79 | extern GSM_Error ATGEN_GetNextSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms, bool start); |
80 | extern GSM_Error ATGEN_SendSavedSMS (GSM_StateMachine *s, int Folder, int Location); | 80 | extern GSM_Error ATGEN_SendSavedSMS (GSM_StateMachine *s, int Folder, int Location); |
81 | extern GSM_Error ATGEN_SendSMS (GSM_StateMachine *s, GSM_SMSMessage *sms); | 81 | extern GSM_Error ATGEN_SendSMS (GSM_StateMachine *s, GSM_SMSMessage *sms); |
82 | extern GSM_Error ATGEN_DeleteSMS (GSM_StateMachine *s, GSM_SMSMessage *sms); | 82 | extern GSM_Error ATGEN_DeleteSMS (GSM_StateMachine *s, GSM_SMSMessage *sms); |
83 | extern GSM_Error ATGEN_AddSMS (GSM_StateMachine *s, GSM_SMSMessage *sms); | 83 | extern GSM_Error ATGEN_AddSMS (GSM_StateMachine *s, GSM_SMSMessage *sms); |
84 | extern GSM_Error ATGEN_GetBatteryCharge (GSM_StateMachine *s, GSM_BatteryCharge *bat); | 84 | extern GSM_Error ATGEN_GetBatteryCharge (GSM_StateMachine *s, GSM_BatteryCharge *bat); |
85 | extern GSM_Error ATGEN_GetSignalQuality (GSM_StateMachine *s, GSM_SignalQuality *sig); | 85 | extern GSM_Error ATGEN_GetSignalQuality (GSM_StateMachine *s, GSM_SignalQuality *sig); |
86 | extern GSM_Error ATGEN_DialVoice (GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber); | 86 | extern GSM_Error ATGEN_DialVoice (GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber); |
87 | extern GSM_Error ATGEN_AnswerCall (GSM_StateMachine *s, int ID, bool all); | 87 | extern GSM_Error ATGEN_AnswerCall (GSM_StateMachine *s, int ID, bool all); |
88 | extern GSM_Error ATGEN_CancelCall (GSM_StateMachine *s, int ID, bool all); | 88 | extern GSM_Error ATGEN_CancelCall (GSM_StateMachine *s, int ID, bool all); |
89 | extern GSM_Error ATGEN_SetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time); | 89 | extern GSM_Error ATGEN_SetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time); |
90 | extern GSM_Error ATGEN_EnterSecurityCode(GSM_StateMachine *s, GSM_SecurityCode Code); | 90 | extern GSM_Error ATGEN_EnterSecurityCode(GSM_StateMachine *s, GSM_SecurityCode Code); |
91 | extern GSM_Error ATGEN_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status); | 91 | extern GSM_Error ATGEN_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status); |
92 | extern GSM_Error ATGEN_ResetPhoneSettings(GSM_StateMachine *s, GSM_ResetSettingsType Type); | 92 | extern GSM_Error ATGEN_ResetPhoneSettings(GSM_StateMachine *s, GSM_ResetSettingsType Type); |
93 | extern GSM_Error ATGEN_SendDTMF (GSM_StateMachine *s, char *sequence); | 93 | extern GSM_Error ATGEN_SendDTMF (GSM_StateMachine *s, char *sequence); |
94 | extern GSM_Error ATGEN_GetSIMIMSI (GSM_StateMachine *s, char *IMSI); | 94 | extern GSM_Error ATGEN_GetSIMIMSI (GSM_StateMachine *s, char *IMSI); |
95 | extern GSM_Error ATGEN_HandleCMSError (GSM_StateMachine *s); | 95 | extern GSM_Error ATGEN_HandleCMSError (GSM_StateMachine *s); |
96 | extern GSM_Error ATGEN_GetNetworkInfo (GSM_StateMachine *s, GSM_NetworkInfo *netinfo); | 96 | extern GSM_Error ATGEN_GetNetworkInfo (GSM_StateMachine *s, GSM_NetworkInfo *netinfo); |
97 | extern GSM_Error ATGEN_Reset (GSM_StateMachine *s, bool hard); | 97 | extern GSM_Error ATGEN_Reset (GSM_StateMachine *s, bool hard); |
98 | extern GSM_Error ATGEN_PressKey (GSM_StateMachine *s, GSM_KeyCode Key, bool Press); | 98 | extern GSM_Error ATGEN_PressKey (GSM_StateMachine *s, GSM_KeyCode Key, bool Press); |
99 | extern GSM_Error ATGEN_GetDisplayStatus (GSM_StateMachine *s, GSM_DisplayFeatures *features); | 99 | extern GSM_Error ATGEN_GetDisplayStatus (GSM_StateMachine *s, GSM_DisplayFeatures *features); |
100 | extern GSM_Error ATGEN_SetAutoNetworkLogin(GSM_StateMachine *s); | 100 | extern GSM_Error ATGEN_SetAutoNetworkLogin(GSM_StateMachine *s); |
101 | extern GSM_Error ATGEN_DeleteAllMemory (GSM_StateMachine *s, GSM_MemoryType type); | 101 | extern GSM_Error ATGEN_DeleteAllMemory (GSM_StateMachine *s, GSM_MemoryType type); |
102 | 102 | ||
103 | extern GSM_Error ATGEN_DispatchMessage (GSM_StateMachine *s); | 103 | extern GSM_Error ATGEN_DispatchMessage (GSM_StateMachine *s); |
104 | extern GSM_Error ATGEN_SetFastSMSSending(GSM_StateMachine *s, bool enable); | 104 | extern GSM_Error ATGEN_SetFastSMSSending(GSM_StateMachine *s, bool enable); |
105 | extern GSM_Error ATGEN_SetIncomingCB (GSM_StateMachine *s, bool enable); | 105 | extern GSM_Error ATGEN_SetIncomingCB (GSM_StateMachine *s, bool enable); |
106 | extern GSM_Error ATGEN_SetIncomingSMS (GSM_StateMachine *s, bool enable); | 106 | extern GSM_Error ATGEN_SetIncomingSMS (GSM_StateMachine *s, bool enable); |
107 | 107 | ||
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 @@ | |||
1 | /* (c) 2002-2004 by Marcin Wiacek */ | 1 | /* (c) 2002-2004 by Marcin Wiacek */ |
2 | /* MSID by Walek */ | 2 | /* MSID by Walek */ |
3 | 3 | ||
4 | #include "../../../common/gsmstate.h" | 4 | #include "../../../common/gsmstate.h" |
5 | 5 | ||
6 | #ifdef GSM_ENABLE_NOKIA_DCT3 | 6 | #ifdef GSM_ENABLE_NOKIA_DCT3 |
7 | 7 | ||
8 | #include <string.h> | 8 | #include <string.h> |
9 | #include <signal.h> | 9 | #include <signal.h> |
10 | 10 | ||
11 | #include "../../../common/misc/coding/coding.h" | 11 | #include "../../../common/misc/coding/coding.h" |
12 | #include "../../../common/gsmcomon.h" | 12 | #include "../../../common/gsmcomon.h" |
13 | #include "../../../common/service/gsmpbk.h" | 13 | #include "../../../common/service/gsmpbk.h" |
14 | #include "../../../common/phone/nokia/dct3/dct3func.h" | 14 | #include "../../../common/phone/nokia/dct3/dct3func.h" |
15 | #include "../../../common/phone/pfunc.h" | 15 | #include "../../../common/phone/pfunc.h" |
16 | #include "../../gammu.h" | 16 | #include "../../gammu.h" |
17 | 17 | ||
18 | extern GSM_Reply_Function UserReplyFunctions3[]; | 18 | static GSM_Reply_Function UserReplyFunctions3[]; |
19 | 19 | ||
20 | /* ------- some usefull functions ----------------------------------------- */ | 20 | /* ------- some usefull functions ----------------------------------------- */ |
21 | 21 | ||
22 | GSM_Error CheckDCT3Only() | 22 | GSM_Error CheckDCT3Only() |
23 | { | 23 | { |
24 | bool found = false; | 24 | bool found = false; |
25 | 25 | ||
26 | /* Checking if phone is DCT3 */ | 26 | /* Checking if phone is DCT3 */ |
27 | #ifdef GSM_ENABLE_NOKIA6110 | 27 | #ifdef GSM_ENABLE_NOKIA6110 |
28 | if (strstr(N6110Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; | 28 | if (strstr(N6110Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; |
29 | #endif | 29 | #endif |
30 | #ifdef GSM_ENABLE_NOKIA7110 | 30 | #ifdef GSM_ENABLE_NOKIA7110 |
31 | if (strstr(N7110Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; | 31 | if (strstr(N7110Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; |
32 | #endif | 32 | #endif |
33 | #ifdef GSM_ENABLE_NOKIA9210 | 33 | #ifdef GSM_ENABLE_NOKIA9210 |
34 | if (strstr(N9210Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; | 34 | if (strstr(N9210Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; |
35 | #endif | 35 | #endif |
36 | if (!found) return ERR_NOTSUPPORTED; | 36 | if (!found) return ERR_NOTSUPPORTED; |
37 | 37 | ||
38 | if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 && | 38 | if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 && |
39 | s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_FBUS2BLUE && | 39 | s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_FBUS2BLUE && |
40 | s.ConnectionType!=GCT_FBUS2IRDA && s.ConnectionType!=GCT_IRDAPHONET && | 40 | s.ConnectionType!=GCT_FBUS2IRDA && s.ConnectionType!=GCT_IRDAPHONET && |
41 | s.ConnectionType!=GCT_BLUEFBUS2) { | 41 | s.ConnectionType!=GCT_BLUEFBUS2) { |
42 | return ERR_OTHERCONNECTIONREQUIRED; | 42 | return ERR_OTHERCONNECTIONREQUIRED; |
43 | } | 43 | } |
44 | return ERR_NONE; | 44 | return ERR_NONE; |
45 | } | 45 | } |
46 | 46 | ||
47 | static void CheckDCT3() | 47 | static void CheckDCT3() |
48 | { | 48 | { |
49 | GSM_Error error; | 49 | GSM_Error error; |
50 | 50 | ||
51 | error = CheckDCT3Only(); | 51 | error = CheckDCT3Only(); |
52 | switch (error) { | 52 | switch (error) { |
53 | case ERR_NOTSUPPORTED: | 53 | case ERR_NOTSUPPORTED: |
54 | Print_Error(ERR_NOTSUPPORTED); | 54 | Print_Error(ERR_NOTSUPPORTED); |
55 | break; | 55 | break; |
56 | case ERR_OTHERCONNECTIONREQUIRED: | 56 | case ERR_OTHERCONNECTIONREQUIRED: |
57 | printf("Can't do it with current phone protocol\n"); | 57 | printf("Can't do it with current phone protocol\n"); |
58 | GSM_TerminateConnection(&s); | 58 | GSM_TerminateConnection(&s); |
59 | exit(-1); | 59 | exit(-1); |
60 | default: | 60 | default: |
61 | break; | 61 | break; |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | static bool answer_yes3(char *text) | 65 | static bool answer_yes3(char *text) |
66 | { | 66 | { |
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 @@ | |||
1 | /** | 1 | /** |
2 | * Nokia DCT3 Firmware Debug Trace Monitor | 2 | * Nokia DCT3 Firmware Debug Trace Monitor |
3 | * wumpus 2003 -- www.blacksphere.tk | 3 | * wumpus 2003 -- www.blacksphere.tk |
4 | * SIM stuff by The Monty | 4 | * SIM stuff by The Monty |
5 | * | 5 | * |
6 | * Command line arguments: | 6 | * Command line arguments: |
7 | * gammu --nokiadebug v00-0F,20,21 | 7 | * gammu --nokiadebug v00-0F,20,21 |
8 | * (v=verbose) | 8 | * (v=verbose) |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include "../../../../common/gsmstate.h" | 11 | #include "../../../../common/gsmstate.h" |
12 | 12 | ||
13 | #ifdef GSM_ENABLE_NOKIA_DCT3 | 13 | #ifdef GSM_ENABLE_NOKIA_DCT3 |
14 | 14 | ||
15 | #include <string.h> | 15 | #include <string.h> |
16 | #include <signal.h> | 16 | #include <signal.h> |
17 | 17 | ||
18 | #include "../../../../common/misc/coding/coding.h" | 18 | #include "../../../../common/misc/coding/coding.h" |
19 | #include "../../../../common/gsmcomon.h" | 19 | #include "../../../../common/gsmcomon.h" |
20 | #include "../../../../common/gsmstate.h" | 20 | #include "../../../../common/gsmstate.h" |
21 | #include "../../../../common/service/gsmpbk.h" | 21 | #include "../../../../common/service/gsmpbk.h" |
22 | #include "../../../../common/phone/nokia/dct3/dct3func.h" | 22 | #include "../../../../common/phone/nokia/dct3/dct3func.h" |
23 | #include "../../../gammu.h" | 23 | #include "../../../gammu.h" |
24 | #include "../dct3.h" | 24 | #include "../dct3.h" |
25 | #include "wmx.h" | 25 | #include "wmx.h" |
26 | #include "wmx-util.h" | 26 | #include "wmx-util.h" |
27 | #include "wmx-gsm.h" | 27 | #include "wmx-gsm.h" |
28 | #include "wmx-sim.h" | 28 | #include "wmx-sim.h" |
29 | #include "wmx-list.h" | 29 | #include "wmx-list.h" |
30 | 30 | ||
31 | extern GSM_Reply_Function UserReplyFunctionsX[]; | 31 | static GSM_Reply_Function UserReplyFunctionsX[]; |
32 | 32 | ||
33 | /* Global variables suck */ | 33 | /* Global variables suck */ |
34 | GSMDecoder *gsmdec; | 34 | GSMDecoder *gsmdec; |
35 | struct wmx_tracestruct *traces; | 35 | struct wmx_tracestruct *traces; |
36 | 36 | ||
37 | static GSM_Error DCT3_ReplySwitchDebug(GSM_Protocol_Message msg, GSM_StateMachine *s) | 37 | static GSM_Error DCT3_ReplySwitchDebug(GSM_Protocol_Message msg, GSM_StateMachine *s) |
38 | { | 38 | { |
39 | switch(msg.Buffer[2]) { | 39 | switch(msg.Buffer[2]) { |
40 | case 0x70: | 40 | case 0x70: |
41 | printf("Debug Trace Enabled\n"); | 41 | printf("Debug Trace Enabled\n"); |
42 | break; | 42 | break; |
43 | case 0x71: | 43 | case 0x71: |
44 | printf("Debug Trace Disabled\n"); | 44 | printf("Debug Trace Disabled\n"); |
45 | break; | 45 | break; |
46 | } | 46 | } |
47 | return ERR_NONE; | 47 | return ERR_NONE; |
48 | } | 48 | } |
49 | 49 | ||
50 | /** | 50 | /** |
51 | * RPC confirmation/reply | 51 | * RPC confirmation/reply |
52 | */ | 52 | */ |
53 | static GSM_Error DCT3_ReplyRPC(GSM_Protocol_Message msg, GSM_StateMachine *s) | 53 | static GSM_Error DCT3_ReplyRPC(GSM_Protocol_Message msg, GSM_StateMachine *s) |
54 | { | 54 | { |
55 | printf("RPC Reply "); | 55 | printf("RPC Reply "); |
56 | printf("call=%02x rettype=%02x data=", msg.Buffer[2], msg.Buffer[3]); | 56 | printf("call=%02x rettype=%02x data=", msg.Buffer[2], msg.Buffer[3]); |
57 | if(msg.Buffer[3] == 3) { | 57 | if(msg.Buffer[3] == 3) { |
58 | /* string */ | 58 | /* string */ |
59 | printf("%s", &msg.Buffer[4]); | 59 | printf("%s", &msg.Buffer[4]); |
60 | } else { | 60 | } else { |
61 | dumpraw("RPC Reply data", &msg.Buffer[4], msg.Length-4); | 61 | dumpraw("RPC Reply data", &msg.Buffer[4], msg.Length-4); |
62 | } | 62 | } |
63 | printf("\n"); | 63 | printf("\n"); |
64 | return ERR_NONE; | 64 | return ERR_NONE; |
65 | } | 65 | } |
66 | 66 | ||
67 | /* disassemble mdisnd (0x18xx) packet */ | 67 | /* disassemble mdisnd (0x18xx) packet */ |
68 | static void mdisnd_data(unsigned char type, unsigned char *buffer, size_t length) | 68 | static void mdisnd_data(unsigned char type, unsigned char *buffer, size_t length) |
69 | { | 69 | { |
70 | GSMDecoder_l1l2data dat; | 70 | GSMDecoder_l1l2data dat; |
71 | size_t x; | 71 | size_t x; |
72 | int ch; | 72 | int ch; |
73 | 73 | ||
74 | if(type==0x1B && length>2) { | 74 | if(type==0x1B && length>2) { |
75 | /* channel packet */ | 75 | /* channel packet */ |
76 | ch = buffer[1]; | 76 | ch = buffer[1]; |
77 | dat.tx = GSMDECODER_SEND; | 77 | dat.tx = GSMDECODER_SEND; |
78 | dat.ch = ch; | 78 | dat.ch = ch; |
79 | printf("%02X ch=%02X ",buffer[0],ch); | 79 | 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 @@ | |||
1 | /* (c) 2002-2004 by Marcin Wiacek */ | 1 | /* (c) 2002-2004 by Marcin Wiacek */ |
2 | 2 | ||
3 | #include "../../../common/gsmstate.h" | 3 | #include "../../../common/gsmstate.h" |
4 | 4 | ||
5 | #ifdef GSM_ENABLE_NOKIA_DCT4 | 5 | #ifdef GSM_ENABLE_NOKIA_DCT4 |
6 | 6 | ||
7 | #include <string.h> | 7 | #include <string.h> |
8 | 8 | ||
9 | #include "dct4.h" | 9 | #include "dct4.h" |
10 | #include "../../gammu.h" | 10 | #include "../../gammu.h" |
11 | #include "../../../common/phone/pfunc.h" | 11 | #include "../../../common/phone/pfunc.h" |
12 | #include "../../../common/phone/nokia/nfunc.h" | 12 | #include "../../../common/phone/nokia/nfunc.h" |
13 | #include "../../../common/phone/nokia/dct4/dct4func.h" | 13 | #include "../../../common/phone/nokia/dct4/dct4func.h" |
14 | #include "../../../common/misc/coding/coding.h" | 14 | #include "../../../common/misc/coding/coding.h" |
15 | 15 | ||
16 | extern GSM_Reply_Function UserReplyFunctions4[]; | 16 | static GSM_Reply_Function UserReplyFunctions4[]; |
17 | 17 | ||
18 | /* ------- some usefull functions ----------------------------------------- */ | 18 | /* ------- some usefull functions ----------------------------------------- */ |
19 | 19 | ||
20 | GSM_Error CheckDCT4Only() | 20 | GSM_Error CheckDCT4Only() |
21 | { | 21 | { |
22 | bool found = false; | 22 | bool found = false; |
23 | 23 | ||
24 | /* Checking if phone is DCT4 */ | 24 | /* Checking if phone is DCT4 */ |
25 | #ifdef GSM_ENABLE_NOKIA3650 | 25 | #ifdef GSM_ENABLE_NOKIA3650 |
26 | if (strstr(N3650Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; | 26 | if (strstr(N3650Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; |
27 | #endif | 27 | #endif |
28 | #ifdef GSM_ENABLE_NOKIA6510 | 28 | #ifdef GSM_ENABLE_NOKIA6510 |
29 | if (strstr(N6510Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; | 29 | if (strstr(N6510Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; |
30 | #endif | 30 | #endif |
31 | #ifdef GSM_ENABLE_NOKIA3320 | 31 | #ifdef GSM_ENABLE_NOKIA3320 |
32 | if (strstr(N3320Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; | 32 | if (strstr(N3320Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; |
33 | #endif | 33 | #endif |
34 | if (!found) return ERR_NOTSUPPORTED; | 34 | if (!found) return ERR_NOTSUPPORTED; |
35 | 35 | ||
36 | if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 && | 36 | if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 && |
37 | s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_PHONETBLUE && | 37 | s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_PHONETBLUE && |
38 | s.ConnectionType!=GCT_IRDAPHONET && s.ConnectionType!=GCT_BLUEPHONET && | 38 | s.ConnectionType!=GCT_IRDAPHONET && s.ConnectionType!=GCT_BLUEPHONET && |
39 | s.ConnectionType!=GCT_FBUS2DKU5) { | 39 | s.ConnectionType!=GCT_FBUS2DKU5) { |
40 | return ERR_OTHERCONNECTIONREQUIRED; | 40 | return ERR_OTHERCONNECTIONREQUIRED; |
41 | } | 41 | } |
42 | return ERR_NONE; | 42 | return ERR_NONE; |
43 | } | 43 | } |
44 | 44 | ||
45 | static void CheckDCT4() | 45 | static void CheckDCT4() |
46 | { | 46 | { |
47 | GSM_Error error; | 47 | GSM_Error error; |
48 | 48 | ||
49 | error = CheckDCT4Only(); | 49 | error = CheckDCT4Only(); |
50 | switch (error) { | 50 | switch (error) { |
51 | case ERR_NOTSUPPORTED: | 51 | case ERR_NOTSUPPORTED: |
52 | Print_Error(ERR_NOTSUPPORTED); | 52 | Print_Error(ERR_NOTSUPPORTED); |
53 | break; | 53 | break; |
54 | case ERR_OTHERCONNECTIONREQUIRED: | 54 | case ERR_OTHERCONNECTIONREQUIRED: |
55 | printf("Can't do it with current phone protocol\n"); | 55 | printf("Can't do it with current phone protocol\n"); |
56 | GSM_TerminateConnection(&s); | 56 | GSM_TerminateConnection(&s); |
57 | exit(-1); | 57 | exit(-1); |
58 | default: | 58 | default: |
59 | break; | 59 | break; |
60 | } | 60 | } |
61 | } | 61 | } |
62 | 62 | ||
63 | static bool answer_yes2(char *text) | 63 | static bool answer_yes2(char *text) |
64 | { | 64 | { |
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 @@ | |||
1 | /* (c) by Walek */ | 1 | /* (c) by Walek */ |
2 | 2 | ||
3 | #include "../../../common/gsmstate.h" | 3 | #include "../../../common/gsmstate.h" |
4 | 4 | ||
5 | #ifdef GSM_ENABLE_ATGEN | 5 | #ifdef GSM_ENABLE_ATGEN |
6 | 6 | ||
7 | #include <string.h> | 7 | #include <string.h> |
8 | 8 | ||
9 | #include "../../../common/misc/coding/coding.h" | 9 | #include "../../../common/misc/coding/coding.h" |
10 | #include "../../../common/gsmcomon.h" | 10 | #include "../../../common/gsmcomon.h" |
11 | #include "../../../common/service/gsmnet.h" | 11 | #include "../../../common/service/gsmnet.h" |
12 | #include "../../../common/phone/at/atgen.h" | 12 | #include "../../../common/phone/at/atgen.h" |
13 | #include "../../gammu.h" | 13 | #include "../../gammu.h" |
14 | #include "dsiemens.h" | 14 | #include "dsiemens.h" |
15 | #include "chiffre.h" | 15 | #include "chiffre.h" |
16 | 16 | ||
17 | extern GSM_Error ATGEN_GetSIMIMSI (GSM_StateMachine *s, char *IMSI); | 17 | extern GSM_Error ATGEN_GetSIMIMSI (GSM_StateMachine *s, char *IMSI); |
18 | extern GSM_Error ATGEN_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *status); | 18 | extern GSM_Error ATGEN_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *status); |
19 | extern GSM_Error ATGEN_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *pbk); | 19 | extern GSM_Error ATGEN_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *pbk); |
20 | extern GSM_Reply_Function UserReplyFunctionsAtS[]; | 20 | static GSM_Reply_Function UserReplyFunctionsAtS[]; |
21 | 21 | ||
22 | bool new_variable; | 22 | bool new_variable; |
23 | GSM_Error CheckSiemens() | 23 | GSM_Error CheckSiemens() |
24 | { | 24 | { |
25 | if (s.Phone.Data.Priv.ATGEN.Manufacturer != AT_Siemens) return ERR_NOTSUPPORTED; | 25 | if (s.Phone.Data.Priv.ATGEN.Manufacturer != AT_Siemens) return ERR_NOTSUPPORTED; |
26 | return ERR_NONE; | 26 | return ERR_NONE; |
27 | } | 27 | } |
28 | 28 | ||
29 | GSM_Error ATSIEMENS_Reply_GetSAT(GSM_Protocol_Message msg, GSM_StateMachine *s) | 29 | GSM_Error ATSIEMENS_Reply_GetSAT(GSM_Protocol_Message msg, GSM_StateMachine *s) |
30 | { | 30 | { |
31 | GSM_Phone_ATGENData *Priv = &s->Phone.Data.Priv.ATGEN; | 31 | GSM_Phone_ATGENData *Priv = &s->Phone.Data.Priv.ATGEN; |
32 | GSM_SAT_Measure_results MeasureResult; | 32 | GSM_SAT_Measure_results MeasureResult; |
33 | unsigned char buf[256]; | 33 | unsigned char buf[256]; |
34 | int length,i,rep,ChNo=1,j=0,result=0,origARFCN=0; | 34 | int length,i,rep,ChNo=1,j=0,result=0,origARFCN=0; |
35 | int freq_tmp,frequency[24]; | 35 | int freq_tmp,frequency[24]; |
36 | GSM_NetworkInfo Network; | 36 | GSM_NetworkInfo Network; |
37 | 37 | ||
38 | if (Priv->ReplyState!=AT_Reply_OK) return ERR_UNKNOWN; | 38 | if (Priv->ReplyState!=AT_Reply_OK) return ERR_UNKNOWN; |
39 | if (s->Protocol.Data.AT.EditMode) s->Protocol.Data.AT.EditMode = false; | 39 | if (s->Protocol.Data.AT.EditMode) s->Protocol.Data.AT.EditMode = false; |
40 | if (strstr(GetLineString(msg.Buffer,Priv->Lines,2),"SSTK")) { | 40 | if (strstr(GetLineString(msg.Buffer,Priv->Lines,2),"SSTK")) { |
41 | length = strlen(GetLineString(msg.Buffer,Priv->Lines,2))-7; | 41 | length = strlen(GetLineString(msg.Buffer,Priv->Lines,2))-7; |
42 | DecodeHexBin(buf, GetLineString(msg.Buffer,Priv->Lines,2)+7,length); | 42 | DecodeHexBin(buf, GetLineString(msg.Buffer,Priv->Lines,2)+7,length); |
43 | if (buf[0]==0x7f) { | 43 | if (buf[0]==0x7f) { |
44 | new_variable=true; | 44 | new_variable=true; |
45 | return ERR_NONE; | 45 | return ERR_NONE; |
46 | } | 46 | } |
47 | else return ERR_UNKNOWN; | 47 | else return ERR_UNKNOWN; |
48 | } | 48 | } |
49 | if (!strstr(GetLineString(msg.Buffer,Priv->Lines,3),"SSTK")) return ERR_UNKNOWN; | 49 | if (!strstr(GetLineString(msg.Buffer,Priv->Lines,3),"SSTK")) return ERR_UNKNOWN; |
50 | 50 | ||
51 | length = strlen(GetLineString(msg.Buffer,Priv->Lines,3))-7; | 51 | length = strlen(GetLineString(msg.Buffer,Priv->Lines,3))-7; |
52 | DecodeHexBin(buf, GetLineString(msg.Buffer,Priv->Lines,3)+7,length); | 52 | DecodeHexBin(buf, GetLineString(msg.Buffer,Priv->Lines,3)+7,length); |
53 | 53 | ||
54 | if (buf[3]!=0x26) return ERR_UNKNOWN; | 54 | if (buf[3]!=0x26) return ERR_UNKNOWN; |
55 | 55 | ||
56 | #ifdef DEBUG | 56 | #ifdef DEBUG |
57 | dbgprintf ("SAT command: Provide Local Information\nFunction: "); | 57 | dbgprintf ("SAT command: Provide Local Information\nFunction: "); |
58 | switch (buf[4]) { | 58 | switch (buf[4]) { |
59 | case 00: dbgprintf ("Loc Info\n"); break; | 59 | case 00: dbgprintf ("Loc Info\n"); break; |
60 | case 01: dbgprintf ("IMEI\n"); break; | 60 | case 01: dbgprintf ("IMEI\n"); break; |
61 | case 02: dbgprintf ("Network Measure\n"); break; | 61 | case 02: dbgprintf ("Network Measure\n"); break; |
62 | case 03: dbgprintf ("Date time and timezone\n");break; | 62 | case 03: dbgprintf ("Date time and timezone\n");break; |
63 | case 04: dbgprintf ("Language setting\n"); break; | 63 | case 04: dbgprintf ("Language setting\n"); break; |
64 | case 05: dbgprintf ("Timing advance\n"); break; | 64 | case 05: dbgprintf ("Timing advance\n"); break; |
65 | } | 65 | } |
66 | #endif | 66 | #endif |
67 | /* Loc Info (MCC, MNC, LAC, Cell ID) */ | 67 | /* Loc Info (MCC, MNC, LAC, Cell ID) */ |
68 | if (buf[4]==00) { | 68 | 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 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef ADDRESSEEEDITORWIDGET_H | 24 | #ifndef ADDRESSEEEDITORWIDGET_H |
25 | #define ADDRESSEEEDITORWIDGET_H | 25 | #define ADDRESSEEEDITORWIDGET_H |
26 | 26 | ||
27 | #include <qdatetime.h> | 27 | #include <qdatetime.h> |
28 | #include <qpopupmenu.h> | 28 | #include <qpopupmenu.h> |
29 | #include <qcombobox.h> | ||
29 | 30 | ||
30 | #include <kabc/addressee.h> | 31 | #include <kabc/addressee.h> |
31 | #include <kdialogbase.h> | 32 | #include <kdialogbase.h> |
32 | #include <kjanuswidget.h> | 33 | #include <kjanuswidget.h> |
33 | 34 | ||
34 | #include "extensionwidget.h" | 35 | #include "extensionwidget.h" |
35 | 36 | ||
36 | class AddresseeConfig; | 37 | class AddresseeConfig; |
37 | class QCheckBox; | 38 | class QCheckBox; |
38 | class QSpinBox; | 39 | class QSpinBox; |
39 | class QTabWidget; | 40 | class QTabWidget; |
40 | 41 | ||
41 | #ifndef KAB_EMBEDDED | 42 | #ifndef KAB_EMBEDDED |
42 | class QTextEdit; | 43 | class QTextEdit; |
43 | #else //KAB_EMBEDDED | 44 | #else //KAB_EMBEDDED |
44 | class QMultiLineEdit; | 45 | class QMultiLineEdit; |
45 | #endif //KAB_EMBEDDED | 46 | #endif //KAB_EMBEDDED |
46 | 47 | ||
47 | class KComboBox; | 48 | class KComboBox; |
48 | class KDateEdit; | 49 | class KDateEdit; |
49 | class KLineEdit; | 50 | class KLineEdit; |
50 | class KSqueezedTextLabel; | 51 | class KSqueezedTextLabel; |
51 | 52 | ||
52 | class AddressEditWidget; | 53 | class AddressEditWidget; |
53 | class EmailEditWidget; | 54 | class EmailEditWidget; |
54 | class GeoWidget; | 55 | class GeoWidget; |
55 | class ImageWidget; | 56 | class ImageWidget; |
56 | class KABCore; | 57 | class KABCore; |
57 | class KeyWidget; | 58 | class KeyWidget; |
58 | class PhoneEditWidget; | 59 | class PhoneEditWidget; |
59 | class SecrecyWidget; | 60 | class SecrecyWidget; |
60 | class SoundWidget; | 61 | class SoundWidget; |
61 | 62 | ||
62 | namespace KPIM | 63 | namespace KPIM |
63 | { | 64 | { |
64 | class CategorySelectDialog; | 65 | class CategorySelectDialog; |
65 | class CategoryEditDialog; | 66 | class CategoryEditDialog; |
66 | } | 67 | } |
67 | 68 | ||
68 | namespace KABC { class AddressBook; } | 69 | namespace KABC { class AddressBook; } |
69 | 70 | ||
70 | class AddresseeEditorWidget : public ExtensionWidget | 71 | class AddresseeEditorWidget : public ExtensionWidget |
71 | { | 72 | { |
72 | Q_OBJECT | 73 | Q_OBJECT |
73 | 74 | ||
74 | public: | 75 | public: |
75 | AddresseeEditorWidget( KABCore *core, bool isExtension, | 76 | AddresseeEditorWidget( KABCore *core, bool isExtension, |
76 | QWidget *parent, const char *name = 0 ); | 77 | 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) | |||
628 | SBOX (0, w, k, 12); | 628 | SBOX (0, w, k, 12); |
629 | SBOX (7, w, k, 16); | 629 | SBOX (7, w, k, 16); |
630 | SBOX (6, w, k, 20); | 630 | SBOX (6, w, k, 20); |
631 | SBOX (5, w, k, 24); | 631 | SBOX (5, w, k, 24); |
632 | SBOX (4, w, k, 28); | 632 | SBOX (4, w, k, 28); |
633 | SBOX (3, w, k, 32); | 633 | SBOX (3, w, k, 32); |
634 | SBOX (2, w, k, 36); | 634 | SBOX (2, w, k, 36); |
635 | SBOX (1, w, k, 40); | 635 | SBOX (1, w, k, 40); |
636 | SBOX (0, w, k, 44); | 636 | SBOX (0, w, k, 44); |
637 | SBOX (7, w, k, 48); | 637 | SBOX (7, w, k, 48); |
638 | SBOX (6, w, k, 52); | 638 | SBOX (6, w, k, 52); |
639 | SBOX (5, w, k, 56); | 639 | SBOX (5, w, k, 56); |
640 | SBOX (4, w, k, 60); | 640 | SBOX (4, w, k, 60); |
641 | SBOX (3, w, k, 64); | 641 | SBOX (3, w, k, 64); |
642 | SBOX (2, w, k, 68); | 642 | SBOX (2, w, k, 68); |
643 | SBOX (1, w, k, 72); | 643 | SBOX (1, w, k, 72); |
644 | SBOX (0, w, k, 76); | 644 | SBOX (0, w, k, 76); |
645 | SBOX (7, w, k, 80); | 645 | SBOX (7, w, k, 80); |
646 | SBOX (6, w, k, 84); | 646 | SBOX (6, w, k, 84); |
647 | SBOX (5, w, k, 88); | 647 | SBOX (5, w, k, 88); |
648 | SBOX (4, w, k, 92); | 648 | SBOX (4, w, k, 92); |
649 | SBOX (3, w, k, 96); | 649 | SBOX (3, w, k, 96); |
650 | SBOX (2, w, k, 100); | 650 | SBOX (2, w, k, 100); |
651 | SBOX (1, w, k, 104); | 651 | SBOX (1, w, k, 104); |
652 | SBOX (0, w, k, 108); | 652 | SBOX (0, w, k, 108); |
653 | SBOX (7, w, k, 112); | 653 | SBOX (7, w, k, 112); |
654 | SBOX (6, w, k, 116); | 654 | SBOX (6, w, k, 116); |
655 | SBOX (5, w, k, 120); | 655 | SBOX (5, w, k, 120); |
656 | SBOX (4, w, k, 124); | 656 | SBOX (4, w, k, 124); |
657 | SBOX (3, w, k, 128); | 657 | SBOX (3, w, k, 128); |
658 | 658 | ||
659 | /* Renumber subkeys. */ | 659 | /* Renumber subkeys. */ |
660 | for (i = 0; i < ROUNDS + 1; i++) | 660 | for (i = 0; i < ROUNDS + 1; i++) |
661 | for (j = 0; j < 4; j++) | 661 | for (j = 0; j < 4; j++) |
662 | subkeys[i][j] = k[4 * i + j]; | 662 | subkeys[i][j] = k[4 * i + j]; |
663 | } | 663 | } |
664 | 664 | ||
665 | /* Initialize CONTEXT with the key KEY of KEY_LENGTH bits. */ | 665 | /* Initialize CONTEXT with the key KEY of KEY_LENGTH bits. */ |
666 | static void | 666 | static void |
667 | serpent_setkey_internal (serpent_context_t *context, | 667 | serpent_setkey_internal (serpent_context_t *context, |
668 | const byte_t *key, unsigned int key_length) | 668 | const byte_t *key, unsigned int key_length) |
669 | { | 669 | { |
670 | serpent_key_t key_prepared; | 670 | serpent_key_t key_prepared; |
671 | 671 | ||
672 | serpent_key_prepare (key, key_length, key_prepared); | 672 | serpent_key_prepare (key, key_length, key_prepared); |
673 | serpent_subkeys_generate (key_prepared, context->keys); | 673 | serpent_subkeys_generate (key_prepared, context->keys); |
674 | _gcry_burn_stack (272 * sizeof (u32_t)); | 674 | _gcry_burn_stack (272 * sizeof (u32_t)); |
675 | } | 675 | } |
676 | 676 | static const char *serpent_test (void); | |
677 | /* Initialize CTX with the key KEY of KEY_LENGTH bytes. */ | 677 | /* Initialize CTX with the key KEY of KEY_LENGTH bytes. */ |
678 | static gcry_err_code_t | 678 | static gcry_err_code_t |
679 | serpent_setkey (void *ctx, | 679 | serpent_setkey (void *ctx, |
680 | const byte_t *key, unsigned int key_length) | 680 | const byte_t *key, unsigned int key_length) |
681 | { | 681 | { |
682 | serpent_context_t *context = ctx; | 682 | serpent_context_t *context = ctx; |
683 | static const char *serpent_test_ret; | 683 | static const char *serpent_test_ret; |
684 | static int serpent_init_done; | 684 | static int serpent_init_done; |
685 | gcry_err_code_t ret = GPG_ERR_NO_ERROR; | 685 | gcry_err_code_t ret = GPG_ERR_NO_ERROR; |
686 | 686 | ||
687 | if (! serpent_init_done) | 687 | if (! serpent_init_done) |
688 | { | 688 | { |
689 | /* Execute a self-test the first time, Serpent is used. */ | 689 | /* Execute a self-test the first time, Serpent is used. */ |
690 | static const char *serpent_test (void); | 690 | |
691 | 691 | ||
692 | serpent_test_ret = serpent_test (); | 692 | serpent_test_ret = serpent_test (); |
693 | if (serpent_test_ret) | 693 | if (serpent_test_ret) |
694 | log_error ("Serpent test failure: %s\n", serpent_test_ret); | 694 | log_error ("Serpent test failure: %s\n", serpent_test_ret); |
695 | serpent_init_done = 1; | 695 | serpent_init_done = 1; |
696 | } | 696 | } |
697 | 697 | ||
698 | if (serpent_test_ret) | 698 | if (serpent_test_ret) |
699 | ret = GPG_ERR_SELFTEST_FAILED; | 699 | ret = GPG_ERR_SELFTEST_FAILED; |
700 | else | 700 | else |
701 | { | 701 | { |
702 | serpent_setkey_internal (context, key, key_length); | 702 | serpent_setkey_internal (context, key, key_length); |
703 | _gcry_burn_stack (sizeof (serpent_key_t)); | 703 | _gcry_burn_stack (sizeof (serpent_key_t)); |
704 | } | 704 | } |
705 | 705 | ||
706 | return ret; | 706 | return ret; |
707 | } | 707 | } |
708 | 708 | ||
709 | static void | 709 | static void |
710 | serpent_encrypt_internal (serpent_context_t *context, | 710 | serpent_encrypt_internal (serpent_context_t *context, |
711 | const serpent_block_t input, serpent_block_t output) | 711 | const serpent_block_t input, serpent_block_t output) |
712 | { | 712 | { |
713 | serpent_block_t b, b_next; | 713 | serpent_block_t b, b_next; |
714 | int round = 0; | 714 | int round = 0; |
715 | 715 | ||
716 | #ifdef WORDS_BIGENDIAN | 716 | #ifdef WORDS_BIGENDIAN |
717 | b[0] = byte_swap_32 (input[0]); | 717 | b[0] = byte_swap_32 (input[0]); |
718 | b[1] = byte_swap_32 (input[1]); | 718 | b[1] = byte_swap_32 (input[1]); |
719 | b[2] = byte_swap_32 (input[2]); | 719 | b[2] = byte_swap_32 (input[2]); |
720 | b[3] = byte_swap_32 (input[3]); | 720 | b[3] = byte_swap_32 (input[3]); |
721 | #else | 721 | #else |
722 | b[0] = input[0]; | 722 | b[0] = input[0]; |
723 | b[1] = input[1]; | 723 | b[1] = input[1]; |
724 | b[2] = input[2]; | 724 | b[2] = input[2]; |
725 | b[3] = input[3]; | 725 | b[3] = input[3]; |
726 | #endif | 726 | #endif |
727 | 727 | ||
728 | ROUND (0, context->keys, b, b_next); | 728 | ROUND (0, context->keys, b, b_next); |
729 | ROUND (1, context->keys, b, b_next); | 729 | ROUND (1, context->keys, b, b_next); |
730 | ROUND (2, context->keys, b, b_next); | 730 | ROUND (2, context->keys, b, b_next); |
731 | ROUND (3, context->keys, b, b_next); | 731 | ROUND (3, context->keys, b, b_next); |
732 | ROUND (4, context->keys, b, b_next); | 732 | ROUND (4, context->keys, b, b_next); |
733 | ROUND (5, context->keys, b, b_next); | 733 | ROUND (5, context->keys, b, b_next); |
734 | ROUND (6, context->keys, b, b_next); | 734 | ROUND (6, context->keys, b, b_next); |
735 | ROUND (7, context->keys, b, b_next); | 735 | ROUND (7, context->keys, b, b_next); |
736 | ROUND (0, context->keys, b, b_next); | 736 | ROUND (0, context->keys, b, b_next); |
737 | ROUND (1, context->keys, b, b_next); | 737 | ROUND (1, context->keys, b, b_next); |
738 | ROUND (2, context->keys, b, b_next); | 738 | 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 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2004 by Michael Buesch * | 3 | * copyright (C) 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | /*************************************************************************** | 12 | /*************************************************************************** |
13 | * copyright (C) 2004 by Ulf Schenk | 13 | * copyright (C) 2004 by Ulf Schenk |
14 | * This file is originaly based on version 1.0.1 of pwmanager | 14 | * This file is originaly based on version 1.0.1 of pwmanager |
15 | * and was modified to run on embedded devices that run microkde | 15 | * and was modified to run on embedded devices that run microkde |
16 | * | 16 | * |
17 | * $Id$ | 17 | * $Id$ |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | 19 | ||
20 | |||
21 | #include "binentrygen.h" | 20 | #include "binentrygen.h" |
22 | #include "base64.h" | 21 | #include "base64.h" |
23 | #include "pwmexception.h" | ||
24 | 22 | ||
23 | #include "pwmexception.h" | ||
24 | #include "globalstuff.h" | ||
25 | 25 | ||
26 | void BinEntryGen::encode(const QByteArray &data, | 26 | void BinEntryGen::encode(const QByteArray &data, |
27 | PwMDataItem *ret, | 27 | PwMDataItem *ret, |
28 | DataType type) | 28 | DataType type) |
29 | { | 29 | { |
30 | ret->clear(); | 30 | ret->clear(); |
31 | ret->name = tostr(static_cast<int>(type)); | 31 | ret->name = tostr(static_cast<int>(type)); |
32 | ret->binary = true; | 32 | ret->binary = true; |
33 | if (data.size() == 0) | 33 | if (data.size() == 0) |
34 | return; | 34 | return; |
35 | Base64 b64; | 35 | Base64 b64; |
36 | string d(data.data(), data.size()); | 36 | string d(data.data(), data.size()); |
37 | ret->pw = b64.encode(d); | 37 | ret->pw = b64.encode(d); |
38 | } | 38 | } |
39 | 39 | ||
40 | void BinEntryGen::decode(const PwMDataItem &data, | 40 | void BinEntryGen::decode(const PwMDataItem &data, |
41 | QByteArray *ret, | 41 | QByteArray *ret, |
42 | DataType *type) | 42 | DataType *type) |
43 | { | 43 | { |
44 | BUG_ON(!data.binary); | 44 | BUG_ON(!data.binary); |
45 | int t = strtol(data.name.c_str(), 0, 10); | 45 | int t = strtol(data.name.c_str(), 0, 10); |
46 | *type = static_cast<DataType>(t); | 46 | *type = static_cast<DataType>(t); |
47 | switch (*type) { | 47 | switch (*type) { |
48 | case None: | 48 | case None: |
49 | case KWalletMap: | 49 | case KWalletMap: |
50 | case KWalletStream: | 50 | case KWalletStream: |
51 | break; | 51 | break; |
52 | default: | 52 | default: |
53 | *type = None; | 53 | *type = None; |
54 | } | 54 | } |
55 | if (data.pw == "") { | 55 | if (data.pw == "") { |
56 | ret->fill(0); | 56 | ret->fill(0); |
57 | ret->resize(0); | 57 | ret->resize(0); |
58 | return; | 58 | return; |
59 | } | 59 | } |
60 | Base64 b64; | 60 | Base64 b64; |
61 | string d(b64.decode(data.pw)); | 61 | string d(b64.decode(data.pw)); |
62 | ret->duplicate(d.c_str(), d.length()); | 62 | ret->duplicate(d.c_str(), d.length()); |
63 | } | 63 | } |
64 | 64 | ||
65 | BinEntryGen::DataType BinEntryGen::binType(const PwMDataItem &data) | 65 | BinEntryGen::DataType BinEntryGen::binType(const PwMDataItem &data) |
66 | { | 66 | { |
67 | if (!data.binary) | 67 | if (!data.binary) |
68 | return None; | 68 | return None; |
69 | int type = strtol(data.name.c_str(), 0, 10); | 69 | int type = strtol(data.name.c_str(), 0, 10); |
70 | return (static_cast<DataType>(type)); | 70 | return (static_cast<DataType>(type)); |
71 | } | 71 | } |
72 | |||
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 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2004 by Michael Buesch * | 3 | * copyright (C) 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | /*************************************************************************** | 12 | /*************************************************************************** |
13 | * copyright (C) 2004 by Ulf Schenk | 13 | * copyright (C) 2004 by Ulf Schenk |
14 | * This file is originaly based on version 1.0.1 of pwmanager | 14 | * This file is originaly based on version 1.0.1 of pwmanager |
15 | * and was modified to run on embedded devices that run microkde | 15 | * and was modified to run on embedded devices that run microkde |
16 | * | 16 | * |
17 | * $Id$ | 17 | * $Id$ |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | 19 | ||
20 | #ifndef __BINENTRYGEN_H | 20 | #ifndef __BINENTRYGEN_H |
21 | #define __BINENTRYGEN_H | 21 | #define __BINENTRYGEN_H |
22 | 22 | ||
23 | #include "pwmdoc.h" | ||
24 | 23 | ||
25 | #include <qcstring.h> | 24 | #include <qcstring.h> |
26 | 25 | ||
26 | #include "pwmdoc.h" | ||
27 | 27 | ||
28 | /** Binary entry generator. | 28 | /** Binary entry generator. |
29 | * This generator generates a normal struct PwMDataItem | 29 | * This generator generates a normal struct PwMDataItem |
30 | * from binary data (using base64 encoding). | 30 | * from binary data (using base64 encoding). |
31 | * This mechanism is used to support the binary interface functions | 31 | * This mechanism is used to support the binary interface functions |
32 | * of the KWallet emulation, for example. | 32 | * of the KWallet emulation, for example. |
33 | * | 33 | * |
34 | * The format of the encoded binary data as a PwMDataItem is as follows: | 34 | * The format of the encoded binary data as a PwMDataItem is as follows: |
35 | * | 35 | * |
36 | * PwMDataItem::desc contains the normal description string for | 36 | * PwMDataItem::desc contains the normal description string for |
37 | * this entry. Nothing surprising. | 37 | * this entry. Nothing surprising. |
38 | * PwMDataItem::name contains the "DataType" number in ascii format. | 38 | * PwMDataItem::name contains the "DataType" number in ascii format. |
39 | * PwMDataItem::pw contains the base64 encoded data stream. | 39 | * PwMDataItem::pw contains the base64 encoded data stream. |
40 | * PwMDataItem::binary is always true for binary entries. | 40 | * PwMDataItem::binary is always true for binary entries. |
41 | * All other PwMDataItems are currently unused by BinEntryGen. | 41 | * All other PwMDataItems are currently unused by BinEntryGen. |
42 | */ | 42 | */ |
43 | class BinEntryGen | 43 | class BinEntryGen |
44 | { | 44 | { |
45 | public: | 45 | public: |
46 | enum DataType | 46 | enum DataType |
47 | { | 47 | { |
48 | None = 0, | 48 | None = 0, |
49 | KWalletMap, | 49 | KWalletMap, |
50 | KWalletStream | 50 | KWalletStream |
51 | }; | 51 | }; |
52 | 52 | ||
53 | public: | 53 | public: |
54 | BinEntryGen() { } | 54 | BinEntryGen() { } |
55 | 55 | ||
56 | /** Encode the binary "data" and return it in "ret" */ | 56 | /** Encode the binary "data" and return it in "ret" */ |
57 | void encode(const QByteArray &data, PwMDataItem *ret, DataType type); | 57 | void encode(const QByteArray &data, PwMDataItem *ret, DataType type); |
58 | /** Decode the "data" and return it as binary "ret" */ | 58 | /** Decode the "data" and return it as binary "ret" */ |
59 | void decode(const PwMDataItem &data, QByteArray *ret, DataType *type); | 59 | void decode(const PwMDataItem &data, QByteArray *ret, DataType *type); |
60 | 60 | ||
61 | /** Return the data type for this binary data item */ | 61 | /** Return the data type for this binary data item */ |
62 | DataType binType(const PwMDataItem &data); | 62 | DataType binType(const PwMDataItem &data); |
63 | }; | 63 | }; |
64 | 64 | ||
65 | #endif // __BINENTRYGEN_H | 65 | #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 @@ | |||
1 | /* 2003.05.02: Derived from libgcrypt-1.1.12 by Michael Buesch */ | 1 | /* 2003.05.02: Derived from libgcrypt-1.1.12 by Michael Buesch */ |
2 | 2 | ||
3 | /* blowfish.c - Blowfish encryption | 3 | /* blowfish.c - Blowfish encryption |
4 | *Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. | 4 | *Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. |
5 | * | 5 | * |
6 | * This file is part of Libgcrypt. | 6 | * This file is part of Libgcrypt. |
7 | * | 7 | * |
8 | * Libgcrypt is free software; you can redistribute it and/or modify | 8 | * Libgcrypt is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU Lesser general Public License as | 9 | * it under the terms of the GNU Lesser general Public License as |
10 | * published by the Free Software Foundation; either version 2.1 of | 10 | * published by the Free Software Foundation; either version 2.1 of |
11 | * the License, or (at your option) any later version. | 11 | * the License, or (at your option) any later version. |
12 | * | 12 | * |
13 | * Libgcrypt is distributed in the hope that it will be useful, | 13 | * Libgcrypt is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU Lesser General Public License for more details. | 16 | * GNU Lesser General Public License for more details. |
17 | * | 17 | * |
18 | * You should have received a copy of the GNU Lesser General Public | 18 | * You should have received a copy of the GNU Lesser General Public |
19 | * License along with this program; if not, write to the Free Software | 19 | * License along with this program; if not, write to the Free Software |
20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
21 | * | 21 | * |
22 | * For a description of the algorithm, see: | 22 | * For a description of the algorithm, see: |
23 | * Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996. | 23 | * Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996. |
24 | * ISBN 0-471-11709-9. Pages 336 ff. | 24 | * ISBN 0-471-11709-9. Pages 336 ff. |
25 | */ | 25 | */ |
26 | 26 | ||
27 | /* Test values: | 27 | /* Test values: |
28 | * key "abcdefghijklmnopqrstuvwxyz"; | 28 | * key "abcdefghijklmnopqrstuvwxyz"; |
29 | * plain "BLOWFISH" | 29 | * plain "BLOWFISH" |
30 | * cipher 32 4E D0 FE F4 13 A2 03 | 30 | * cipher 32 4E D0 FE F4 13 A2 03 |
31 | * | 31 | * |
32 | */ | 32 | */ |
33 | 33 | ||
34 | /*************************************************************************** | 34 | /*************************************************************************** |
35 | * copyright (C) 2004 by Ulf Schenk | 35 | * copyright (C) 2004 by Ulf Schenk |
36 | * This file is originaly based on version 1.0.1 of pwmanager | 36 | * This file is originaly based on version 1.0.1 of pwmanager |
37 | * and was modified to run on embedded devices that run microkde | 37 | * and was modified to run on embedded devices that run microkde |
38 | * | 38 | * |
39 | * $Id$ | 39 | * $Id$ |
40 | **************************************************************************/ | 40 | **************************************************************************/ |
41 | 41 | ||
42 | 42 | ||
43 | #include <string.h> | 43 | #include <string.h> |
44 | #include <stdlib.h> | 44 | #include <stdlib.h> |
45 | 45 | ||
46 | #include "blowfish.h" | ||
47 | #include "globalstuff.h" | 46 | #include "globalstuff.h" |
48 | 47 | ||
48 | #include "blowfish.h" | ||
49 | 49 | ||
50 | /* precomputed S boxes */ | 50 | /* precomputed S boxes */ |
51 | static const uint32_t ks0[256] = { | 51 | static const uint32_t ks0[256] = { |
52 | 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, 0xB8E1AFED, 0x6A267E96, | 52 | 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, 0xB8E1AFED, 0x6A267E96, |
53 | 0xBA7C9045, 0xF12C7F99, 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16, | 53 | 0xBA7C9045, 0xF12C7F99, 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16, |
54 | 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, 0x0D95748F, 0x728EB658, | 54 | 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, 0x0D95748F, 0x728EB658, |
55 | 0x718BCD58, 0x82154AEE, 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, | 55 | 0x718BCD58, 0x82154AEE, 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, |
56 | 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, 0x8E79DCB0, 0x603A180E, | 56 | 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, 0x8E79DCB0, 0x603A180E, |
57 | 0x6C9E0E8B, 0xB01E8A3E, 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60, | 57 | 0x6C9E0E8B, 0xB01E8A3E, 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60, |
58 | 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, 0x55CA396A, 0x2AAB10B6, | 58 | 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, 0x55CA396A, 0x2AAB10B6, |
59 | 0xB4CC5C34, 0x1141E8CE, 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A, | 59 | 0xB4CC5C34, 0x1141E8CE, 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A, |
60 | 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, 0xAFD6BA33, 0x6C24CF5C, | 60 | 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, 0xAFD6BA33, 0x6C24CF5C, |
61 | 0x7A325381, 0x28958677, 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193, | 61 | 0x7A325381, 0x28958677, 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193, |
62 | 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, 0xEF845D5D, 0xE98575B1, | 62 | 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, 0xEF845D5D, 0xE98575B1, |
63 | 0xDC262302, 0xEB651B88, 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239, | 63 | 0xDC262302, 0xEB651B88, 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239, |
64 | 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, 0x21C66842, 0xF6E96C9A, | 64 | 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, 0x21C66842, 0xF6E96C9A, |
65 | 0x670C9C61, 0xABD388F0, 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, | 65 | 0x670C9C61, 0xABD388F0, 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, |
66 | 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, 0xA1F1651D, 0x39AF0176, | 66 | 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, 0xA1F1651D, 0x39AF0176, |
67 | 0x66CA593E, 0x82430E88, 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE, | 67 | 0x66CA593E, 0x82430E88, 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE, |
68 | 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, 0x4ED3AA62, 0x363F7706, | 68 | 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, 0x4ED3AA62, 0x363F7706, |
69 | 0x1BFEDF72, 0x429B023D, 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, | 69 | 0x1BFEDF72, 0x429B023D, 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, |
70 | 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, 0xE3FE501A, 0xB6794C3B, | 70 | 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, 0xE3FE501A, 0xB6794C3B, |
71 | 0x976CE0BD, 0x04C006BA, 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463, | 71 | 0x976CE0BD, 0x04C006BA, 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463, |
72 | 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, 0x6DFC511F, 0x9B30952C, | 72 | 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, 0x6DFC511F, 0x9B30952C, |
73 | 0xCC814544, 0xAF5EBD09, 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3, | 73 | 0xCC814544, 0xAF5EBD09, 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3, |
74 | 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, 0x5579C0BD, 0x1A60320A, | 74 | 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, 0x5579C0BD, 0x1A60320A, |
75 | 0xD6A100C6, 0x402C7279, 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, | 75 | 0xD6A100C6, 0x402C7279, 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, |
76 | 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, 0x323DB5FA, 0xFD238760, | 76 | 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, 0x323DB5FA, 0xFD238760, |
77 | 0x53317B48, 0x3E00DF82, 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB, | 77 | 0x53317B48, 0x3E00DF82, 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB, |
78 | 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, 0x695B27B0, 0xBBCA58C8, | 78 | 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, 0x695B27B0, 0xBBCA58C8, |
79 | 0xE1FFA35D, 0xB8F011A0, 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, | 79 | 0xE1FFA35D, 0xB8F011A0, 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, |
80 | 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, 0xE1DDF2DA, 0xA4CB7E33, | 80 | 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, 0xE1DDF2DA, 0xA4CB7E33, |
81 | 0x62FB1341, 0xCEE4C6E8, 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4, | 81 | 0x62FB1341, 0xCEE4C6E8, 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4, |
82 | 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, 0xD08ED1D0, 0xAFC725E0, | 82 | 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, 0xD08ED1D0, 0xAFC725E0, |
83 | 0x8E3C5B2F, 0x8E7594B7, 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C, | 83 | 0x8E3C5B2F, 0x8E7594B7, 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C, |
84 | 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, 0x2F2F2218, 0xBE0E1777, | 84 | 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, 0x2F2F2218, 0xBE0E1777, |
85 | 0xEA752DFE, 0x8B021FA1, 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, | 85 | 0xEA752DFE, 0x8B021FA1, 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, |
86 | 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, 0x165FA266, 0x80957705, | 86 | 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, 0x165FA266, 0x80957705, |
87 | 0x93CC7314, 0x211A1477, 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF, | 87 | 0x93CC7314, 0x211A1477, 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF, |
88 | 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, 0x00250E2D, 0x2071B35E, | 88 | 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, 0x00250E2D, 0x2071B35E, |
89 | 0x226800BB, 0x57B8E0AF, 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA, | 89 | 0x226800BB, 0x57B8E0AF, 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA, |
90 | 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, 0x83260376, 0x6295CFA9, | 90 | 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, 0x83260376, 0x6295CFA9, |
91 | 0x11C81968, 0x4E734A41, 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915, | 91 | 0x11C81968, 0x4E734A41, 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915, |
92 | 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, 0x08BA6FB5, 0x571BE91F, | 92 | 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, 0x08BA6FB5, 0x571BE91F, |
93 | 0xF296EC6B, 0x2A0DD915, 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664, | 93 | 0xF296EC6B, 0x2A0DD915, 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664, |
94 | 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A | 94 | 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A |
95 | }; | 95 | }; |
96 | 96 | ||
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 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2003, 2004 by Michael Buesch * | 3 | * copyright (C) 2003, 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * blowfish.c - Blowfish encryption * | 6 | * blowfish.c - Blowfish encryption * |
7 | * Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. * | 7 | * Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. * |
8 | * * | 8 | * * |
9 | * This program is free software; you can redistribute it and/or modify * | 9 | * This program is free software; you can redistribute it and/or modify * |
10 | * it under the terms of the GNU General Public License version 2 * | 10 | * it under the terms of the GNU General Public License version 2 * |
11 | * as published by the Free Software Foundation. * | 11 | * as published by the Free Software Foundation. * |
12 | * * | 12 | * * |
13 | ***************************************************************************/ | 13 | ***************************************************************************/ |
14 | 14 | ||
15 | /*************************************************************************** | 15 | /*************************************************************************** |
16 | * copyright (C) 2004 by Ulf Schenk | 16 | * copyright (C) 2004 by Ulf Schenk |
17 | * This file is originaly based on version 1.0.1 of pwmanager | 17 | * This file is originaly based on version 1.0.1 of pwmanager |
18 | * and was modified to run on embedded devices that run microkde | 18 | * and was modified to run on embedded devices that run microkde |
19 | * | 19 | * |
20 | * $Id$ | 20 | * $Id$ |
21 | **************************************************************************/ | 21 | **************************************************************************/ |
22 | 22 | ||
23 | #ifndef BLOWFISH_H | 23 | #ifndef BLOWFISH_H |
24 | #define BLOWFISH_H | 24 | #define BLOWFISH_H |
25 | 25 | ||
26 | #include "pwmexception.h" | 26 | //#include "pwmexception.h" |
27 | #ifndef _WIN32_ | 27 | #ifndef _WIN32_ |
28 | #include <stdint.h> | 28 | #include <stdint.h> |
29 | #else | 29 | #else |
30 | 30 | ||
31 | #endif | 31 | #endif |
32 | #include <string> | 32 | #include <string> |
33 | using std::string; | 33 | using std::string; |
34 | 34 | ||
35 | #define BLOWFISH_BLOCKSIZE8 | 35 | #define BLOWFISH_BLOCKSIZE8 |
36 | #define BLOWFISH_ROUNDS 16 | 36 | #define BLOWFISH_ROUNDS 16 |
37 | #define CIPHER_ALGO_BLOWFISH 4/* blowfish 128 bit key */ | 37 | #define CIPHER_ALGO_BLOWFISH 4/* blowfish 128 bit key */ |
38 | 38 | ||
39 | #ifndef _WIN32_ | 39 | #ifndef _WIN32_ |
40 | typedef uint8_t byte; | 40 | typedef uint8_t byte; |
41 | #else | 41 | #else |
42 | #define uint8_t Q_UINT8 | 42 | #define uint8_t Q_UINT8 |
43 | #define byte Q_UINT8 | 43 | #define byte Q_UINT8 |
44 | #define uint32_t Q_UINT32 | 44 | #define uint32_t Q_UINT32 |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | //#include "pwmexception.h" | ||
48 | |||
47 | /** blowfish encryption algorithm. | 49 | /** blowfish encryption algorithm. |
48 | * Derived from libgcrypt-1.1.12 | 50 | * Derived from libgcrypt-1.1.12 |
49 | */ | 51 | */ |
50 | class Blowfish | 52 | class Blowfish |
51 | { | 53 | { |
52 | struct BLOWFISH_context | 54 | struct BLOWFISH_context |
53 | { | 55 | { |
54 | uint32_t s0[256]; | 56 | uint32_t s0[256]; |
55 | uint32_t s1[256]; | 57 | uint32_t s1[256]; |
56 | uint32_t s2[256]; | 58 | uint32_t s2[256]; |
57 | uint32_t s3[256]; | 59 | uint32_t s3[256]; |
58 | uint32_t p[BLOWFISH_ROUNDS+2]; | 60 | uint32_t p[BLOWFISH_ROUNDS+2]; |
59 | }; | 61 | }; |
60 | 62 | ||
61 | public: | 63 | public: |
62 | Blowfish() {} | 64 | Blowfish() {} |
63 | static bool selfTest(); | 65 | static bool selfTest(); |
64 | 66 | ||
65 | /** set key to encrypt. if return == 1, it is a weak key. */ | 67 | /** set key to encrypt. if return == 1, it is a weak key. */ |
66 | int bf_setkey( byte *key, unsigned int keylen ); | 68 | int bf_setkey( byte *key, unsigned int keylen ); |
67 | /** encrypt inbuf and return it in outbuf. | 69 | /** encrypt inbuf and return it in outbuf. |
68 | * inbuf and outbuf have to be: buf % 8 == 0 | 70 | * inbuf and outbuf have to be: buf % 8 == 0 |
69 | * You may check this with getPaddedLen() and pad with NULL. | 71 | * You may check this with getPaddedLen() and pad with NULL. |
70 | */ | 72 | */ |
71 | int bf_encrypt( byte *outbuf, byte *inbuf, unsigned int inbuf_len ); | 73 | int bf_encrypt( byte *outbuf, byte *inbuf, unsigned int inbuf_len ); |
72 | /** decrypt inbuf and return it in outbuf. | 74 | /** decrypt inbuf and return it in outbuf. |
73 | * inbuf and outbuf have to be: buf % 8 == 0 | 75 | * inbuf and outbuf have to be: buf % 8 == 0 |
74 | * You may check this with getPaddedLen() and pad with NULL. | 76 | * You may check this with getPaddedLen() and pad with NULL. |
75 | */ | 77 | */ |
76 | int bf_decrypt( byte *outbuf, byte *inbuf, unsigned int inbuf_len ); | 78 | int bf_decrypt( byte *outbuf, byte *inbuf, unsigned int inbuf_len ); |
77 | /** returns the length, the sting has to be padded to */ | 79 | /** returns the length, the sting has to be padded to */ |
78 | static unsigned int getPaddedLen(unsigned int inLen) | 80 | static unsigned int getPaddedLen(unsigned int inLen) |
79 | { return ((8 - (inLen % 8)) + inLen); } | 81 | { return ((8 - (inLen % 8)) + inLen); } |
80 | /** pad up to 8 bytes. */ | 82 | /** pad up to 8 bytes. */ |
81 | static void padNull(string *buf); | 83 | static void padNull(string *buf); |
82 | /** remove padded data */ | 84 | /** remove padded data */ |
83 | static bool unpadNull(string *buf); | 85 | static bool unpadNull(string *buf); |
84 | 86 | ||
85 | protected: | 87 | protected: |
86 | #if BLOWFISH_ROUNDS != 16 | 88 | #if BLOWFISH_ROUNDS != 16 |
87 | uint32_t function_F( uint32_t x) | 89 | uint32_t function_F( uint32_t x) |
88 | { | 90 | { |
89 | uint16_t a, b, c, d; | 91 | uint16_t a, b, c, d; |
90 | #ifdef BIG_ENDIAN_HOST | 92 | #ifdef BIG_ENDIAN_HOST |
91 | a = ((byte *) & x)[0]; | 93 | a = ((byte *) & x)[0]; |
92 | b = ((byte *) & x)[1]; | 94 | b = ((byte *) & x)[1]; |
93 | c = ((byte *) & x)[2]; | 95 | c = ((byte *) & x)[2]; |
94 | d = ((byte *) & x)[3]; | 96 | 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 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2004 by Michael Buesch * | 3 | * copyright (C) 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | /*************************************************************************** | 12 | /*************************************************************************** |
13 | * copyright (C) 2004 by Ulf Schenk | 13 | * copyright (C) 2004 by Ulf Schenk |
14 | * This file is originaly based on version 1.0.1 of pwmanager | 14 | * This file is originaly based on version 1.0.1 of pwmanager |
15 | * and was modified to run on embedded devices that run microkde | 15 | * and was modified to run on embedded devices that run microkde |
16 | * | 16 | * |
17 | * $Id$ | 17 | * $Id$ |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | 19 | ||
20 | #include "genpasswd.h" | 20 | #include "genpasswd.h" |
21 | #include "pwmexception.h" | 21 | #include "pwmexception.h" |
22 | #include "randomizer.h" | 22 | #include "randomizer.h" |
23 | #include "globalstuff.h" | ||
23 | 24 | ||
24 | 25 | ||
25 | /* how often can a char of the same charset be reused in order */ | 26 | /* how often can a char of the same charset be reused in order */ |
26 | #define FILTER_MAX_CHARSET_REUSE3 | 27 | #define FILTER_MAX_CHARSET_REUSE3 |
27 | /* re-randomize all charsets on every iteration (0/1) */ | 28 | /* re-randomize all charsets on every iteration (0/1) */ |
28 | #define RERAND_CHARSET 0 | 29 | #define RERAND_CHARSET 0 |
29 | 30 | ||
30 | 31 | ||
31 | struct staticCharsetStruct | 32 | struct staticCharsetStruct |
32 | { | 33 | { |
33 | const char *lower; | 34 | const char *lower; |
34 | const char *upper; | 35 | const char *upper; |
35 | const char *num; | 36 | const char *num; |
36 | const char *special; | 37 | const char *special; |
37 | const char *blank; | 38 | const char *blank; |
38 | }; | 39 | }; |
39 | 40 | ||
40 | static struct staticCharsetStruct staticCharset = { | 41 | static struct staticCharsetStruct staticCharset = { |
41 | "abcdefghijklmnopqrstuvwxyz", | 42 | "abcdefghijklmnopqrstuvwxyz", |
42 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ", | 43 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ", |
43 | "0123456789", | 44 | "0123456789", |
44 | "!\"§$%&/()=?,.-;:_+", | 45 | "!\"§$%&/()=?,.-;:_+", |
45 | " " | 46 | " " |
46 | }; | 47 | }; |
47 | 48 | ||
48 | 49 | ||
49 | GenPasswd::GenPasswd() | 50 | GenPasswd::GenPasswd() |
50 | : length (8) | 51 | : length (8) |
51 | , useFilter (true) | 52 | , useFilter (true) |
52 | { | 53 | { |
53 | dynCharset.setAutoDelete(true); | 54 | dynCharset.setAutoDelete(true); |
54 | } | 55 | } |
55 | 56 | ||
56 | void GenPasswd::setCharset(bool lower, | 57 | void GenPasswd::setCharset(bool lower, |
57 | bool upper, | 58 | bool upper, |
58 | bool num, | 59 | bool num, |
59 | bool special, | 60 | bool special, |
60 | bool blank, | 61 | bool blank, |
61 | QString user) | 62 | QString user) |
62 | { | 63 | { |
63 | unsigned int sanityCheck = 0; | 64 | unsigned int sanityCheck = 0; |
64 | dynCharset_element *tmpElement; | 65 | dynCharset_element *tmpElement; |
65 | dynCharset.clear(); | 66 | dynCharset.clear(); |
66 | if (lower) { | 67 | if (lower) { |
67 | tmpElement = new dynCharset_element; | 68 | tmpElement = new dynCharset_element; |
68 | tmpElement->refCnt = 0; | 69 | tmpElement->refCnt = 0; |
69 | tmpElement->data = staticCharset.lower; | 70 | tmpElement->data = staticCharset.lower; |
70 | dynCharset.append(tmpElement); | 71 | 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 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2004 by Michael Buesch * | 3 | * copyright (C) 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * hashPassphrase() is derived from GnuPG and is * | 6 | * hashPassphrase() is derived from GnuPG and is * |
7 | * Copyright (C) 1998, 1999, 2000, 2001, 2003 * | 7 | * Copyright (C) 1998, 1999, 2000, 2001, 2003 * |
8 | * Free Software Foundation, Inc. * | 8 | * Free Software Foundation, Inc. * |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * |
11 | * it under the terms of the GNU General Public License version 2 * | 11 | * it under the terms of the GNU General Public License version 2 * |
12 | * as published by the Free Software Foundation. * | 12 | * as published by the Free Software Foundation. * |
13 | * * | 13 | * * |
14 | ***************************************************************************/ | 14 | ***************************************************************************/ |
15 | 15 | ||
16 | /*************************************************************************** | 16 | /*************************************************************************** |
17 | * copyright (C) 2004 by Ulf Schenk | 17 | * copyright (C) 2004 by Ulf Schenk |
18 | * This file is originaly based on version 1.1 of pwmanager | 18 | * This file is originaly based on version 1.1 of pwmanager |
19 | * and was modified to run on embedded devices that run microkde | 19 | * and was modified to run on embedded devices that run microkde |
20 | * | 20 | * |
21 | * $Id$ | 21 | * $Id$ |
22 | **************************************************************************/ | 22 | **************************************************************************/ |
23 | 23 | ||
24 | #ifndef __LIBGCRYPTIF_H | 24 | #ifndef __LIBGCRYPTIF_H |
25 | #define __LIBGCRYPTIF_H | 25 | #define __LIBGCRYPTIF_H |
26 | 26 | ||
27 | #include "pwmexception.h" | ||
28 | 27 | ||
29 | //#undef CONFIG_PWMANAGER_GCRY // for debugging only. | 28 | //#undef CONFIG_PWMANAGER_GCRY // for debugging only. |
30 | #ifdef CONFIG_PWMANAGER_GCRY | 29 | #ifdef CONFIG_PWMANAGER_GCRY |
31 | 30 | ||
32 | #include <stddef.h> | 31 | #include <stddef.h> |
33 | #include <sys/types.h> | 32 | #include <sys/types.h> |
34 | #ifndef _WIN32_ | 33 | #ifndef _WIN32_ |
35 | #include <stdint.h> | 34 | #include <stdint.h> |
36 | #else | 35 | #else |
37 | #define uint8_t Q_UINT8 | 36 | #define uint8_t Q_UINT8 |
38 | #define byte Q_UINT8 | 37 | #define byte Q_UINT8 |
39 | #define uint32_t Q_UINT32 | 38 | #define uint32_t Q_UINT32 |
40 | #endif | 39 | #endif |
41 | #define STRING2KEY_SALTLEN8 | 40 | #define STRING2KEY_SALTLEN8 |
42 | 41 | ||
42 | #include "pwmexception.h" | ||
43 | |||
44 | |||
43 | /** interface class for the libgcrypt cipher and hash algorithms | 45 | /** interface class for the libgcrypt cipher and hash algorithms |
44 | * NOTE: Always allocate 1024 extra bytes for the inBuf (for padding) | 46 | * NOTE: Always allocate 1024 extra bytes for the inBuf (for padding) |
45 | */ | 47 | */ |
46 | class LibGCryptIf | 48 | class LibGCryptIf |
47 | { | 49 | { |
48 | protected: | 50 | protected: |
49 | struct STRING2KEY | 51 | struct STRING2KEY |
50 | { | 52 | { |
51 | int mode; | 53 | int mode; |
52 | int hash_algo; | 54 | int hash_algo; |
53 | uint8_t salt[STRING2KEY_SALTLEN]; | 55 | uint8_t salt[STRING2KEY_SALTLEN]; |
54 | uint32_t count; | 56 | uint32_t count; |
55 | }; | 57 | }; |
56 | struct DEK | 58 | struct DEK |
57 | { | 59 | { |
58 | size_t keylen; | 60 | size_t keylen; |
59 | uint8_t key[32]; // this is the largest used keylen (256 bit) | 61 | uint8_t key[32]; // this is the largest used keylen (256 bit) |
60 | }; | 62 | }; |
61 | 63 | ||
62 | public: | 64 | public: |
63 | LibGCryptIf() { } | 65 | LibGCryptIf() { } |
64 | /** is libgcrypt available? */ | 66 | /** is libgcrypt available? */ |
65 | static bool available() | 67 | static bool available() |
66 | { return true; } | 68 | { return true; } |
67 | /** encrypt data. _algo is the PWM_CRYPT_* ID | 69 | /** encrypt data. _algo is the PWM_CRYPT_* ID |
68 | * of the algorithm. | 70 | * of the algorithm. |
69 | */ | 71 | */ |
70 | PwMerror encrypt(unsigned char **outBuf, | 72 | PwMerror encrypt(unsigned char **outBuf, |
71 | size_t *outBufLen, | 73 | size_t *outBufLen, |
72 | unsigned char *inBuf, | 74 | unsigned char *inBuf, |
73 | size_t inBufLen, | 75 | size_t inBufLen, |
74 | const unsigned char *key, | 76 | const unsigned char *key, |
75 | size_t keylen, | 77 | size_t keylen, |
76 | char _algo, | 78 | char _algo, |
77 | char _hashalgo //US BUG: pass _hashalgo because we need it in hashPassphrase | 79 | char _hashalgo //US BUG: pass _hashalgo because we need it in hashPassphrase |
78 | ); | 80 | ); |
79 | /** decrypt data. _algo is the PWM_CRYPT_* ID | 81 | /** decrypt data. _algo is the PWM_CRYPT_* ID |
80 | * of the algorithm. | 82 | * of the algorithm. |
81 | */ | 83 | */ |
82 | PwMerror decrypt(unsigned char **outBuf, | 84 | PwMerror decrypt(unsigned char **outBuf, |
83 | size_t *outBufLen, | 85 | size_t *outBufLen, |
84 | const unsigned char *inBuf, | 86 | const unsigned char *inBuf, |
85 | size_t inBufLen, | 87 | size_t inBufLen, |
86 | const unsigned char *key, | 88 | const unsigned char *key, |
87 | size_t keylen, | 89 | size_t keylen, |
88 | char _algo, | 90 | char _algo, |
89 | char _hashalgo //US BUG: pass _hashalgo because we need it in hashPassphrase | 91 | char _hashalgo //US BUG: pass _hashalgo because we need it in hashPassphrase |
90 | ); | 92 | ); |
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 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2003, 2004 by Michael Buesch * | 3 | * copyright (C) 2003, 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | /*************************************************************************** | 12 | /*************************************************************************** |
13 | * copyright (C) 2004 by Ulf Schenk | 13 | * copyright (C) 2004 by Ulf Schenk |
14 | * This file is originaly based on version 1.0.1 of pwmanager | 14 | * This file is originaly based on version 1.0.1 of pwmanager |
15 | * and was modified to run on embedded devices that run microkde | 15 | * and was modified to run on embedded devices that run microkde |
16 | * | 16 | * |
17 | * $Id$ | 17 | * $Id$ |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | 19 | ||
20 | #ifndef __PWMEXCEPTION_H | 20 | #ifndef __PWMEXCEPTION_H |
21 | #define __PWMEXCEPTION_H | 21 | #define __PWMEXCEPTION_H |
22 | 22 | ||
23 | #include "globalstuff.h" | 23 | //#include "globalstuff.h" |
24 | 24 | ||
25 | #include <iostream> | 25 | #include <iostream> |
26 | #include <string> | 26 | #include <string> |
27 | using std::string; | 27 | using std::string; |
28 | using std::cerr; | 28 | using std::cerr; |
29 | using std::cout; | 29 | using std::cout; |
30 | using std::endl; | 30 | using std::endl; |
31 | 31 | ||
32 | /* This is an internal function to reduce code-overhead | 32 | /* This is an internal function to reduce code-overhead |
33 | * of the BUG(), WARN(), TOD0() and FiXME() macros. Please use | 33 | * of the BUG(), WARN(), TOD0() and FiXME() macros. Please use |
34 | * these macros instead of calling this function directly. | 34 | * these macros instead of calling this function directly. |
35 | */ | 35 | */ |
36 | void pwmFatal(const char *id, | 36 | void pwmFatal(const char *id, |
37 | const char *file, | 37 | const char *file, |
38 | int line); | 38 | int line); |
39 | 39 | ||
40 | /** Use PWM_ASSERT(condition) for debugging assertions. | 40 | /** Use PWM_ASSERT(condition) for debugging assertions. |
41 | * "condition" is eaten up and replaced with a NOP | 41 | * "condition" is eaten up and replaced with a NOP |
42 | * when debugging is disabled. | 42 | * when debugging is disabled. |
43 | * | 43 | * |
44 | * PWM_ASSERT_NOEAT(condition) is the same as PWM_ASSERT(condition), | 44 | * PWM_ASSERT_NOEAT(condition) is the same as PWM_ASSERT(condition), |
45 | * but it does _not_ eat up "condition" and ensures that | 45 | * but it does _not_ eat up "condition" and ensures that |
46 | * condition is always evaluated. | 46 | * condition is always evaluated. |
47 | */ | 47 | */ |
48 | #ifdef PWM_ASSERT | 48 | #ifdef PWM_ASSERT |
49 | # undef PWM_ASSERT | 49 | # undef PWM_ASSERT |
50 | #endif | 50 | #endif |
51 | #ifdef PWM_ASSERT_NOEAT | 51 | #ifdef PWM_ASSERT_NOEAT |
52 | # undef PWM_ASSERT_NOEAT | 52 | # undef PWM_ASSERT_NOEAT |
53 | #endif | 53 | #endif |
54 | #ifdef PWM_DEBUG | 54 | #ifdef PWM_DEBUG |
55 | # define PWM_ASSERT(x) do { \ | 55 | # define PWM_ASSERT(x) do { \ |
56 | if (unlikely(!(x))) { \ | 56 | if (unlikely(!(x))) { \ |
57 | cerr << "PWM_ASSERT failed: (" << #x\ | 57 | cerr << "PWM_ASSERT failed: (" << #x\ |
58 | << ") in " << __FILE__ \ | 58 | << ") in " << __FILE__ \ |
59 | << ":" << __LINE__ \ | 59 | << ":" << __LINE__ \ |
60 | << endl; \ | 60 | << endl; \ |
61 | } \ | 61 | } \ |
62 | } while (0) | 62 | } while (0) |
63 | # define PWM_ASSERT_NOEAT(x)do { PWM_ASSERT(x); } while (0) | 63 | # define PWM_ASSERT_NOEAT(x)do { PWM_ASSERT(x); } while (0) |
64 | #else // PWM_DEBUG | 64 | #else // PWM_DEBUG |
65 | # define PWM_ASSERT(x) do { } while (0) | 65 | # define PWM_ASSERT(x) do { } while (0) |
66 | # define PWM_ASSERT_NOEAT(x)do { if (x) ; } while (0) | 66 | # define PWM_ASSERT_NOEAT(x)do { if (x) ; } while (0) |
67 | #endif // PWM_DEBUG | 67 | #endif // PWM_DEBUG |
68 | 68 | ||
69 | /** Insert a BUG() into code paths which clearly show | 69 | /** Insert a BUG() into code paths which clearly show |
70 | * a bug in the code and which should, under normal | 70 | * a bug in the code and which should, under normal |
71 | * circumstances, never execute. | 71 | * circumstances, never execute. |
@@ -169,49 +169,50 @@ class PwMException | |||
169 | { | 169 | { |
170 | public: | 170 | public: |
171 | enum exceptionId | 171 | enum exceptionId |
172 | { | 172 | { |
173 | EX_GENERIC = 0, | 173 | EX_GENERIC = 0, |
174 | EX_OPEN, | 174 | EX_OPEN, |
175 | EX_CLOSE, | 175 | EX_CLOSE, |
176 | EX_READ, | 176 | EX_READ, |
177 | EX_WRITE, | 177 | EX_WRITE, |
178 | EX_LOAD_MODULE, | 178 | EX_LOAD_MODULE, |
179 | EX_PARSE | 179 | EX_PARSE |
180 | }; | 180 | }; |
181 | 181 | ||
182 | public: | 182 | public: |
183 | PwMException(exceptionId id = EX_GENERIC, | 183 | PwMException(exceptionId id = EX_GENERIC, |
184 | const char *message = "") | 184 | const char *message = "") |
185 | { | 185 | { |
186 | exId = id; | 186 | exId = id; |
187 | exMsg = message; | 187 | exMsg = message; |
188 | } | 188 | } |
189 | 189 | ||
190 | exceptionId getId() | 190 | exceptionId getId() |
191 | { return exId; } | 191 | { return exId; } |
192 | const char* getMessage() | 192 | const char* getMessage() |
193 | { return exMsg; } | 193 | { return exMsg; } |
194 | 194 | ||
195 | protected: | 195 | protected: |
196 | /** ID of this exception */ | 196 | /** ID of this exception */ |
197 | exceptionId exId; | 197 | exceptionId exId; |
198 | /** additional error-message for this exception */ | 198 | /** additional error-message for this exception */ |
199 | const char *exMsg; | 199 | const char *exMsg; |
200 | }; | 200 | }; |
201 | 201 | ||
202 | void __printInfo(const string &msg); | 202 | void __printInfo(const string &msg); |
203 | void __printWarn(const string &msg); | 203 | void __printWarn(const string &msg); |
204 | void __printError(const string &msg); | 204 | void __printError(const string &msg); |
205 | 205 | ||
206 | #ifdef PWM_DEBUG | 206 | #ifdef PWM_DEBUG |
207 | void __printDebug(const string &msg); | 207 | void __printDebug(const string &msg); |
208 | # define printDebug(x)__printDebug(x) | 208 | # define printDebug(x)__printDebug(x) |
209 | #else | 209 | #else |
210 | # define printDebug(x)do { } while (0) | 210 | # define printDebug(x)do { } while (0) |
211 | #endif | 211 | #endif |
212 | 212 | ||
213 | #define printInfo(x)__printInfo(x) | 213 | #define printInfo(x)__printInfo(x) |
214 | #define printWarn(x)__printWarn(x) | 214 | #define printWarn(x)__printWarn(x) |
215 | #define printError(x)__printError(x) | 215 | #define printError(x)__printError(x) |
216 | 216 | ||
217 | #include "globalstuff.h" | ||
217 | #endif // __PWMEXCEPTION_H | 218 | #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 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2003, 2004 by Michael Buesch * | 3 | * copyright (C) 2003, 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | /*************************************************************************** | 12 | /*************************************************************************** |
13 | * copyright (C) 2004 by Ulf Schenk | 13 | * copyright (C) 2004 by Ulf Schenk |
14 | * This file is originaly based on version 1.1 of pwmanager | 14 | * This file is originaly based on version 1.1 of pwmanager |
15 | * and was modified to run on embedded devices that run microkde | 15 | * and was modified to run on embedded devices that run microkde |
16 | * | 16 | * |
17 | * $Id$ | 17 | * $Id$ |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | 19 | ||
20 | #ifndef __RANDOMIZER_H | 20 | #ifndef __RANDOMIZER_H |
21 | #define __RANDOMIZER_H | 21 | #define __RANDOMIZER_H |
22 | 22 | ||
23 | #include "pwmexception.h" | 23 | #include "pwmexception.h" |
24 | #include "globalstuff.h" | ||
24 | 25 | ||
25 | #ifndef PWM_EMBEDDED | 26 | #ifndef PWM_EMBEDDED |
26 | #include <qmutex.h> | 27 | #include <qmutex.h> |
27 | #endif | 28 | #endif |
28 | 29 | ||
29 | #include <string> | 30 | #include <string> |
30 | 31 | ||
31 | using std::string; | 32 | using std::string; |
32 | 33 | ||
33 | class QFile; | 34 | class QFile; |
34 | 35 | ||
35 | /** Randomizer to get random values. | 36 | /** Randomizer to get random values. |
36 | * This class is thread-safe. | 37 | * This class is thread-safe. |
37 | * You should always use the instance returned by | 38 | * You should always use the instance returned by |
38 | * obj() to use it. | 39 | * obj() to use it. |
39 | */ | 40 | */ |
40 | class Randomizer | 41 | class Randomizer |
41 | { | 42 | { |
42 | public: | 43 | public: |
43 | Randomizer(); | 44 | Randomizer(); |
44 | ~Randomizer(); | 45 | ~Randomizer(); |
45 | 46 | ||
46 | static Randomizer * obj() | 47 | static Randomizer * obj() |
47 | { | 48 | { |
48 | PWM_ASSERT(rndObj); | 49 | PWM_ASSERT(rndObj); |
49 | return rndObj; | 50 | return rndObj; |
50 | } | 51 | } |
51 | static void init() | 52 | static void init() |
52 | { | 53 | { |
53 | PWM_ASSERT(!rndObj); | 54 | PWM_ASSERT(!rndObj); |
54 | rndObj = new Randomizer; | 55 | rndObj = new Randomizer; |
55 | } | 56 | } |
56 | static void cleanup() | 57 | static void cleanup() |
57 | { | 58 | { |
58 | delete_ifnot_null(rndObj); | 59 | delete_ifnot_null(rndObj); |
59 | } | 60 | } |
60 | 61 | ||
61 | /** generate random char */ | 62 | /** generate random char */ |
62 | char genRndChar(); | 63 | char genRndChar(); |
63 | /** generate random int */ | 64 | /** generate random int */ |
64 | int genRndInt(); | 65 | int genRndInt(); |
65 | /** generate a random unsigned int */ | 66 | /** generate a random unsigned int */ |
66 | unsigned int genRndUInt(); | 67 | unsigned int genRndUInt(); |
67 | 68 | ||
68 | /** returns a buffer with random data */ | 69 | /** returns a buffer with random data */ |
69 | string genRndBuf(size_t len); | 70 | string genRndBuf(size_t len); |
70 | /** returns a buffer with random data */ | 71 | /** returns a buffer with random data */ |
71 | void genRndBuf(unsigned char *buf, size_t len); | 72 | void genRndBuf(unsigned char *buf, size_t len); |