fixed crypt+sign, now the sig contains the encrypted recipient list as well and is encrypted itself

This commit is contained in:
git@daemon.de
2014-02-05 13:09:20 +01:00
parent 5707ecbf9c
commit a89b16a15c
5 changed files with 138 additions and 38 deletions

View File

@@ -160,8 +160,7 @@ int pcpencrypt(char *id, char *infile, char *outfile, char *passwd, plist_t *rec
symkey = pcp_scrypt(passphrase, crypto_secretbox_KEYBYTES, salt, 90);
free(salt);
}
else if(id != NULL) {
// FIXME: mk id a plist_t with loop as well
else if(id != NULL && recipient == NULL) {
// lookup by id
HASH_FIND_STR(pcppubkey_hash, id, tmp);
if(tmp == NULL) {
@@ -193,7 +192,7 @@ int pcpencrypt(char *id, char *infile, char *outfile, char *passwd, plist_t *rec
plist_t *rec;
pcphash_iteratepub(tmp) {
rec = recipient->first;
while (rec->next != NULL) {
while (rec != NULL) {
_lc(rec->value);
if(strnstr(tmp->mail, rec->value, 255) != NULL || strnstr(tmp->owner, rec->value, 255) != NULL) {
pub = ucmalloc(sizeof(pcp_pubkey_t));