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. |
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); |