debug sec key import

This commit is contained in:
TLINDEN
2015-04-17 13:06:01 +02:00
parent c82baa393b
commit 63539612ca

View File

@@ -802,6 +802,7 @@ pcp_key_t *pcp_import_secret(PCPCTX *ptx, byte *raw, size_t rawsize, char *passp
} }
/* now we've got the blob, parse it */ /* now we've got the blob, parse it */
buffer_dump(blob);
pcp_key_t *sk = pcp_import_secret_native(ptx, blob, passphrase); pcp_key_t *sk = pcp_import_secret_native(ptx, blob, passphrase);
buffer_free(blob); buffer_free(blob);
@@ -833,6 +834,9 @@ pcp_key_t *pcp_import_secret_native(PCPCTX *ptx, Buffer *cipher, char *passphras
} }
/* decrypt the blob */ /* decrypt the blob */
buffer_info(cipher);
fprintf(stderr, "cipherpen: %ld\n", cipherlen);
_dump(" symkey", symkey, crypto_secretbox_KEYBYTES);
if(pcp_sodium_verify_mac(&clear, buffer_get_remainder(cipher), if(pcp_sodium_verify_mac(&clear, buffer_get_remainder(cipher),
cipherlen, nonce, symkey) != 0) { cipherlen, nonce, symkey) != 0) {
fatal(ptx, "failed to decrypt the secret key file\n"); fatal(ptx, "failed to decrypt the secret key file\n");