summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/gpasmanfile.h
Unidiff
Diffstat (limited to 'pwmanager/pwmanager/gpasmanfile.h') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/gpasmanfile.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/gpasmanfile.h b/pwmanager/pwmanager/gpasmanfile.h
new file mode 100644
index 0000000..d2b7dc5
--- a/dev/null
+++ b/pwmanager/pwmanager/gpasmanfile.h
@@ -0,0 +1,67 @@
1/***************************************************************************
2 * *
3 * copyright (C) 2003 by Michael Buesch *
4 * email: mbuesch@freenet.de *
5 * *
6 * Gpasman, a password manager *
7 * Copyright (C) 1998-1999 Olivier Sessink, olivier@lx.student.wau.nl *
8 * *
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 *
11 * as published by the Free Software Foundation. *
12 * *
13 ***************************************************************************/
14
15/***************************************************************************
16 * copyright (C) 2004 by Ulf Schenk
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
19 *
20 * $Id$
21 **************************************************************************/
22
23#ifndef GPASMANFILE_H
24#define GPASMANFILE_H
25
26#include "rc2.h"
27
28#include <stdio.h>
29
30/** gpasman / kpasman file read/write module */
31class GpasmanFile
32{
33public:
34 GpasmanFile();
35 ~GpasmanFile();
36
37 /*
38 * one entry is a char *entry[4]
39 * this means we have 4 pointers to a char -->
40 * 0 = server
41 * 1 = username
42 * 2 = password
43 * 3 = comment
44 */
45
46 int save_init(const char *filename, const char *password);
47 int save_entry(char *entry[4]);
48 int save_finalize(void);
49 int load_init(const char *filename, const char *password);
50 int load_entry(char *entry[4]);
51 void load_finalize(void);
52
53protected:
54 int check_file(const char *filename);
55 int file_exists(const char *tfile);
56
57protected:
58 FILE *fd;
59 unsigned short iv[4];
60 char *buffer;
61 int bufferIndex;
62 unsigned short plaintext[4];
63 int lastcount, size;
64 Rc2 rc2;
65};
66
67#endif