dav/pwd.h

changeset 489
fb69eae42ef0
parent 474
017a4f09e6fa
child 653
f503c272bd70
equal deleted inserted replaced
488:29b979ca8750 489:fb69eae42ef0
51 * version = 1 byte 51 * version = 1 byte
52 * enc = 1 byte 52 * enc = 1 byte
53 * pwfunc = 1 byte 53 * pwfunc = 1 byte
54 * salt = 16 bytes 54 * salt = 16 bytes
55 * indexlen = uint32 55 * indexlen = uint32
56 * index = { length id length location } 56 * index = { length id locations zero }
57 * content = { entry } 57 * content = { entry }
58 * entry = length id length username length password 58 * entry = length id length username length password
59 * length = uint32 59 * length = uint32
60 * zero = 4 zero bytes
60 * id = string 61 * id = string
61 * location = string 62 * locations = { length string }
62 * username = string 63 * username = string
63 * password = string 64 * password = string
64 * 65 *
65 * The content is AES encrypted with a key derived from a password 66 * The content is AES encrypted with a key derived from a password
66 * and the salt. The first 16 bytes are the aes iv. 67 * and the salt. The first 16 bytes are the aes iv.
134 char *password; 135 char *password;
135 }; 136 };
136 137
137 struct PwdIndexEntry { 138 struct PwdIndexEntry {
138 char *id; 139 char *id;
139 char *location; 140 UcxList *locations;
140 }; 141 };
141 142
142 /* 143 /*
143 * opens the password store 144 * opens the password store
144 * the content is still encrypted and must be decrypted using pwdstore_decrypt 145 * the content is still encrypted and must be decrypted using pwdstore_decrypt
163 int pwdstore_has_location(PwdStore *s, const char *location); 164 int pwdstore_has_location(PwdStore *s, const char *location);
164 165
165 PwdEntry* pwdstore_get(PwdStore *p, const char *id); 166 PwdEntry* pwdstore_get(PwdStore *p, const char *id);
166 167
167 void pwdstore_put(PwdStore *p, const char *id, const char *username, const char *password); 168 void pwdstore_put(PwdStore *p, const char *id, const char *username, const char *password);
168 void pwdstore_put_index(PwdStore *p, const char *id, const char *location); 169 void pwdstore_put_index(PwdStore *p, char *id, UcxList *locations);
169 170
170 int pwdstore_store(PwdStore *p, const char *file); 171 int pwdstore_store(PwdStore *p, const char *file);
171 172
172 /* private */ 173 /* private */
173 int pwdstore_getindex(PwdStore *s); 174 int pwdstore_getindex(PwdStore *s);

mercurial