changed secret key export format, now we encrypt the whole thing, and we use an extra passphrase to do so. import wrapper in src/ not implemented yet.

This commit is contained in:
git@daemon.de
2014-02-12 16:47:24 +01:00
parent a78dd9c6eb
commit 621cece568
12 changed files with 294 additions and 148 deletions

View File

@@ -168,22 +168,13 @@ int pcpvault_addkey(vault_t *vault, void *item, uint8_t type) {
else if(type == PCP_KEYSIG_NATIVE || type == PCP_KEYSIG_NATIVE) {
pcp_keysig_t *sk = (pcp_keysig_t *)item;
itemsize = PCP_RAW_KEYSIGSIZE + sk->size;
size_t blobsize = sk->size;
Buffer *b = pcp_keysig2blob(sk);
itemsize = buffer_size(b);
blob = ucmalloc(itemsize);
sk = keysig2be(sk);
memcpy(blob, buffer_get(b), buffer_size(b));
buffer_free(b);
/* FIXME: use Buffer or function */
uint8_t t = sk->type;
uint32_t s = sk->size;
memcpy(blob, &t, 1);
memcpy(blob+1, &s, 4);
memcpy(blob+5, sk->belongs, 17);
memcpy(blob+5+17, sk->checksum, 32);
memcpy(blob+5+17+32, sk->blob, blobsize);
sk = keysig2native(sk);
saveitem = (void *)sk;
}
else {