From db47cbd95a267ae019a37f2079adf9e72e8fe1b3 Mon Sep 17 00:00:00 2001 From: TLINDEN Date: Thu, 13 Feb 2014 20:21:32 +0100 Subject: [PATCH] fixed pbp encryption fix, no more size field in reclist --- libpcp/crypto.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/libpcp/crypto.c b/libpcp/crypto.c index 044094c..1cbd7a7 100644 --- a/libpcp/crypto.c +++ b/libpcp/crypto.c @@ -171,7 +171,7 @@ size_t pcp_decrypt_file(FILE *in, FILE* out, pcp_key_t *s, unsigned char *symkey byte head[1]; size_t cur_bufsize, rec_size; - unsigned char rec_buf[PCP_ASYM_RECIPIENT_RSIZE]; + unsigned char rec_buf[PCP_ASYM_RECIPIENT_SIZE]; #ifdef PCP_ASYM_ADD_SENDER_PUB unsigned char *senderpub; @@ -224,27 +224,23 @@ size_t pcp_decrypt_file(FILE *in, FILE* out, pcp_key_t *s, unsigned char *symkey lenrec = be32toh(lenrec); if(verify) { - reccipher = ucmalloc(lenrec * PCP_ASYM_RECIPIENT_RSIZE); + reccipher = ucmalloc(lenrec * PCP_ASYM_RECIPIENT_SIZE); } /* step 4, fetch recipient list and try to decrypt it for us */ - unsigned char *recip = ucmalloc(PCP_ASYM_RECIPIENT_SIZE); for(nrec=0; nrec