added own file type for crypt+sign, now signing the encrypted result, not the clear message.

using 64bit integers for time vars in key ex/im_ports
This commit is contained in:
TLINDEN
2014-05-06 11:50:28 +02:00
parent 9d2d02221b
commit c66c7ae15c
6 changed files with 55 additions and 21 deletions

View File

@@ -76,7 +76,7 @@ int pcpdecrypt(char *id, int useid, char *infile, char *outfile, char *passwd, i
symkey = pcp_scrypt(ptx, passphrase, strlen(passphrase), salt, 90);
free(salt);
}
else {
else if(head == PCP_ASYM_CIPHER || head == PCP_ASYM_CIPHER_SIG) {
/* asymetric mode */
if(useid) {
secret = pcphash_keyexists(ptx, id);
@@ -108,11 +108,18 @@ int pcpdecrypt(char *id, int useid, char *infile, char *outfile, char *passwd, i
secret = pcpkey_decrypt(ptx, secret, passphrase);
if(secret == NULL)
goto errde3;
if(head == PCP_ASYM_CIPHER_SIG)
verify = 1;
}
}
else {
fatal(ptx, "Could not determine input file type (got: %02x)\n", head);
goto errde3;
}
}
else {
fatal(ptx, "Could not determine input file type\n");
fatal(ptx, "Failed to read from file!\n");
goto errde3;
}