summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/compiler.h10
-rw-r--r--pwmanager/pwmanager/pwm.h3
-rw-r--r--pwmanager/pwmanager/pwmanager.pro4
-rw-r--r--pwmanager/pwmanager/pwmdoc.h4
-rw-r--r--pwmanager/pwmanager/randomizer.cpp8
-rw-r--r--pwmanager/pwmanager/setmasterpwwndimpl.h4
-rw-r--r--pwmanager/pwmanager/sha1.h9
7 files changed, 32 insertions, 10 deletions
diff --git a/pwmanager/pwmanager/compiler.h b/pwmanager/pwmanager/compiler.h
index be08c6d..a942246 100644
--- a/pwmanager/pwmanager/compiler.h
+++ b/pwmanager/pwmanager/compiler.h
@@ -6,16 +6,24 @@
6 * it under the terms of the GNU General Public License version 2 * 6 * it under the terms of the GNU General Public License version 2 *
7 * as published by the Free Software Foundation. * 7 * as published by the Free Software Foundation. *
8 * * 8 * *
9 ***************************************************************************/ 9 ***************************************************************************/
10 10
11#ifndef __PWMANAGER_COMPILER_H 11#ifndef __PWMANAGER_COMPILER_H
12#define __PWMANAGER_COMPILER_H 12#define __PWMANAGER_COMPILER_H
13 13
14#ifdef _WIN32_
15# define __builtin_expect(x, expected_value) (x)
16 #define NOREGPARM__attribute__((regparm(0)))
17 #define REGPARM __attribute__((regparm(3)))
18 #define likely(x)__builtin_expect(!!(x), 1)
19 #define unlikely(x)__builtin_expect(!!(x), 0)
20
21#else
14#ifdef __deprecated 22#ifdef __deprecated
15# undef __deprecated 23# undef __deprecated
16#endif 24#endif
17#if __GNUC__ >= 3 25#if __GNUC__ >= 3
18# if __GNUC_MINOR__ > 0 26# if __GNUC_MINOR__ > 0
19 # define __deprecated__attribute__((deprecated)) 27 # define __deprecated__attribute__((deprecated))
20# endif 28# endif
21#elif __GNUC__ == 2 29#elif __GNUC__ == 2
@@ -52,10 +60,10 @@
52#ifdef NOREGPARM 60#ifdef NOREGPARM
53# undef NOREGPARM 61# undef NOREGPARM
54#endif 62#endif
55 #define NOREGPARM__attribute__((regparm(0))) 63 #define NOREGPARM__attribute__((regparm(0)))
56#ifdef REGPARM 64#ifdef REGPARM
57# undef REGPARM 65# undef REGPARM
58#endif 66#endif
59 #define REGPARM __attribute__((regparm(3))) 67 #define REGPARM __attribute__((regparm(3)))
60 68#endif
61#endif // __PWMANAGER_COMPILER_H 69#endif // __PWMANAGER_COMPILER_H
diff --git a/pwmanager/pwmanager/pwm.h b/pwmanager/pwmanager/pwm.h
index 116bc66..6ab9d6b 100644
--- a/pwmanager/pwmanager/pwm.h
+++ b/pwmanager/pwmanager/pwm.h
@@ -136,18 +136,17 @@ public slots:
136 //US ENH : changed code to run with older MOC 136 //US ENH : changed code to run with older MOC
137 137
138 void addPwd_slot(); 138 void addPwd_slot();
139 void addPwd_slot1(QString *pw, PwMDoc *_doc); 139 void addPwd_slot1(QString *pw, PwMDoc *_doc);
140 /** manage/edit triggered */ 140 /** manage/edit triggered */
141 //US ENH : changed code to run with older MOC 141 //US ENH : changed code to run with older MOC
142 void editPwd_slot(); 142 void editPwd_slot();
143 void editPwd_slot1(const QString *category); 143 void editPwd_slot1(const QString *category);
144 void editPwd_slot3(const QString *category = 0, const int *index = 0, 144 void editPwd_slot3(const QString *category, const int *index ,PwMDoc *_doc );
145 PwMDoc *_doc = 0);
146 145
147 /** manage/delete triggered */ 146 /** manage/delete triggered */
148 void deletePwd_slot(); 147 void deletePwd_slot();
149 /** execute the "Launcher" entry */ 148 /** execute the "Launcher" entry */
150 void execLauncher_slot(); 149 void execLauncher_slot();
151 /** open browser with URL entry */ 150 /** open browser with URL entry */
152 void goToURL_slot(); 151 void goToURL_slot();
153 /** manage/changeMasterPwd triggered */ 152 /** manage/changeMasterPwd triggered */
diff --git a/pwmanager/pwmanager/pwmanager.pro b/pwmanager/pwmanager/pwmanager.pro
index 7f39c76..49c1f46 100644
--- a/pwmanager/pwmanager/pwmanager.pro
+++ b/pwmanager/pwmanager/pwmanager.pro
@@ -1,10 +1,10 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG += qt warn_on 2 CONFIG += qt warn_off
3DESTDIR= ../../bin 3DESTDIR= ../../bin
4 TARGET = pwmpi 4 TARGET = pwmpi
5include( ../../variables.pri ) 5include( ../../variables.pri )
6 6
7INCLUDEPATH += . ../../ ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils 7INCLUDEPATH += . ../../ ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils
8DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION 8DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION
9 9
10#enable this setting if you want debugoutput for pwmanager 10#enable this setting if you want debugoutput for pwmanager
@@ -25,17 +25,17 @@ MOC_DIR = moc/unix
25 25
26} 26}
27win32:{ 27win32:{
28 28
29DEFINES += _WIN32_ 29DEFINES += _WIN32_
30OBJECTS_DIR = obj/win 30OBJECTS_DIR = obj/win
31MOC_DIR = moc/win 31MOC_DIR = moc/win
32QMAKE_LINK += /NODEFAULTLIB:LIBC 32QMAKE_LINK += /NODEFAULTLIB:LIBC
33 33QMAKE_CXXFLAGS += /TP /GX /GR /Ehsc
34} 34}
35 35
36#INTERFACES = \ 36#INTERFACES = \
37#addentrywnd.ui \ 37#addentrywnd.ui \
38#configwnd.ui \ 38#configwnd.ui \
39#findwnd.ui \ 39#findwnd.ui \
40#getmasterpwwnd.ui \ 40#getmasterpwwnd.ui \
41#pwgenwnd.ui \ 41#pwgenwnd.ui \
diff --git a/pwmanager/pwmanager/pwmdoc.h b/pwmanager/pwmanager/pwmdoc.h
index 635361a..55e3231 100644
--- a/pwmanager/pwmanager/pwmdoc.h
+++ b/pwmanager/pwmanager/pwmdoc.h
@@ -14,17 +14,19 @@
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 __PWMDOC_H 20#ifndef __PWMDOC_H
21#define __PWMDOC_H 21#define __PWMDOC_H
22 22#ifdef _WIN32_
23#define ssize_t unsigned int
24#endif
23 #define PWM_FILE_VER (static_cast<char>(0x05)) 25 #define PWM_FILE_VER (static_cast<char>(0x05))
24 26
25 #define PWM_HASH_SHA1 (static_cast<char>(0x01)) 27 #define PWM_HASH_SHA1 (static_cast<char>(0x01))
26 #define PWM_HASH_SHA256 (static_cast<char>(0x02)) 28 #define PWM_HASH_SHA256 (static_cast<char>(0x02))
27 #define PWM_HASH_SHA384 (static_cast<char>(0x03)) 29 #define PWM_HASH_SHA384 (static_cast<char>(0x03))
28 #define PWM_HASH_SHA512 (static_cast<char>(0x04)) 30 #define PWM_HASH_SHA512 (static_cast<char>(0x04))
29 #define PWM_HASH_MD5 (static_cast<char>(0x05)) 31 #define PWM_HASH_MD5 (static_cast<char>(0x05))
30 #define PWM_HASH_RMD160 (static_cast<char>(0x06)) 32 #define PWM_HASH_RMD160 (static_cast<char>(0x06))
diff --git a/pwmanager/pwmanager/randomizer.cpp b/pwmanager/pwmanager/randomizer.cpp
index e1085ff..da4df78 100644
--- a/pwmanager/pwmanager/randomizer.cpp
+++ b/pwmanager/pwmanager/randomizer.cpp
@@ -30,18 +30,22 @@
30 30
31#ifdef PWM_EMBEDDED 31#ifdef PWM_EMBEDDED
32 32
33#ifndef Q_LONG 33#ifndef Q_LONG
34#define Q_LONG long 34#define Q_LONG long
35#endif 35#endif
36 36
37#endif //PWM_EMBEDDED 37#endif //PWM_EMBEDDED
38 38#ifdef _WIN32_
39 39int rand_r( uint * seed ) {
40 srand(*seed);
41 return rand();
42}
43#endif
40Randomizer * Randomizer::rndObj (0); 44Randomizer * Randomizer::rndObj (0);
41 45
42Randomizer::Randomizer() 46Randomizer::Randomizer()
43{ 47{
44 rndDev = new QFile; 48 rndDev = new QFile;
45 seed = time(0); 49 seed = time(0);
46 50
47#if 1 // set to 0 to test rand_r() fallback 51#if 1 // set to 0 to test rand_r() fallback
diff --git a/pwmanager/pwmanager/setmasterpwwndimpl.h b/pwmanager/pwmanager/setmasterpwwndimpl.h
index 3203d4d..08f3654 100644
--- a/pwmanager/pwmanager/setmasterpwwndimpl.h
+++ b/pwmanager/pwmanager/setmasterpwwndimpl.h
@@ -24,17 +24,21 @@
24#ifndef PWM_EMBEDDED 24#ifndef PWM_EMBEDDED
25#include "setmasterpwwnd.h" 25#include "setmasterpwwnd.h"
26#else 26#else
27#include "setmasterpwwnd_emb.h" 27#include "setmasterpwwnd_emb.h"
28#endif 28#endif
29 29
30#include <klocale.h> 30#include <klocale.h>
31 31
32#ifdef _WIN32_
33#define uint32_t Q_UINT32
34#else
32#include <stdint.h> 35#include <stdint.h>
36#endif
33#include <string> 37#include <string>
34using std::string; 38using std::string;
35 39
36class PwMKeyCard; 40class PwMKeyCard;
37 41
38/** set master pw wnd */ 42/** set master pw wnd */
39class SetMasterPwWndImpl : public setMasterPwWnd 43class SetMasterPwWndImpl : public setMasterPwWnd
40{ 44{
diff --git a/pwmanager/pwmanager/sha1.h b/pwmanager/pwmanager/sha1.h
index 29442a7..c649bae 100644
--- a/pwmanager/pwmanager/sha1.h
+++ b/pwmanager/pwmanager/sha1.h
@@ -14,22 +14,27 @@
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 SHA1_H 20#ifndef SHA1_H
21#define SHA1_H 21#define SHA1_H
22 22#ifdef _WIN32_
23#define uint32_t unsigned int
24 #define uint8_tunsigned char
25 #define byteunsigned char
26#else
23#include <stdint.h> 27#include <stdint.h>
28 typedef uint8_t byte;
29#endif
24#include <string> 30#include <string>
25using std::string; 31using std::string;
26 32
27 typedef uint8_t byte;
28 33
29 #define SHA1_HASH_LEN_BIT160 34 #define SHA1_HASH_LEN_BIT160
30 #define SHA1_HASH_LEN_BYTE(SHA1_HASH_LEN_BIT / 8) 35 #define SHA1_HASH_LEN_BYTE(SHA1_HASH_LEN_BIT / 8)
31 36
32/** sha1 hash algorithm. 37/** sha1 hash algorithm.
33 * Derived from libgcrypt-1.1.12 38 * Derived from libgcrypt-1.1.12
34 */ 39 */
35class Sha1 40class Sha1