fixed keysig saving (forgot the id), enhancements on cmdline

This commit is contained in:
TLINDEN
2014-03-02 18:05:45 +01:00
parent 0767e55e55
commit b640fe6743
16 changed files with 84 additions and 69 deletions

View File

@@ -120,7 +120,7 @@ int _check_hash_keysig(Buffer *blob, pcp_pubkey_t *p, pcp_keysig_t *sk) {
/* everything minus version, ctime and cipher, 1st 3 fields */
sk->size = blobstop - 6;
memcpy(sk->belongs, p->id, 17);
memcpy(sk->id, p->id, 17);
/* put the whole signature blob into our keysig */
blob->offset = 6; /* woah, hack :) */
@@ -359,7 +359,7 @@ pcp_ks_bundle_t *pcp_import_pub_pbp(Buffer *blob) {
pcp_keysig_t *sk = ucmalloc(sizeof(pcp_keysig_t));
sk->type = PCP_KEYSIG_PBP;
sk->size = buffer_size(blob);
memcpy(sk->belongs, pub->id, 17);
memcpy(sk->id, pub->id, 17);
sk->blob = ucmalloc(sk->size);
memcpy(sk->blob, buffer_get(blob), sk->size);
crypto_hash_sha256(sk->checksum, sk->blob, sk->size);