git-svn: trunk@2220
Nigel Horne authored on 2006/08/29 16:44:12... | ... |
@@ -36,7 +36,7 @@ |
36 | 36 |
* TODO: Remove the vcard handling |
37 | 37 |
* FIXME: The code does little error checking of OOM scenarios |
38 | 38 |
*/ |
39 |
-static char const rcsid[] = "$Id: pst.c,v 1.30 2006/07/31 19:45:17 njh Exp $"; |
|
39 |
+static char const rcsid[] = "$Id: pst.c,v 1.31 2006/08/29 07:44:12 njh Exp $"; |
|
40 | 40 |
|
41 | 41 |
#if HAVE_CONFIG_H |
42 | 42 |
#include "clamav-config.h" /* must come first */ |
... | ... |
@@ -438,7 +438,7 @@ pst_index_ll * _pst_getID(pst_file* pf, u_int32_t id); |
438 | 438 |
static pst_index_ll *_pst_getID2(pst_index2_ll * ptr, u_int32_t id); |
439 | 439 |
pst_desc_ll * _pst_getDptr(pst_file *pf, u_int32_t id); |
440 | 440 |
static size_t _pst_read_block_size(pst_file *pf, int32_t offset, size_t size, char ** buf, int32_t do_enc, unsigned char is_index); |
441 |
-int32_t _pst_decrypt(unsigned char *buf, size_t size, int32_t type); |
|
441 |
+static int32_t _pst_decrypt(unsigned char *buf, size_t size, int32_t type); |
|
442 | 442 |
static int32_t _pst_getAtPos(FILE* fp, int32_t pos, void *buf, u_int32_t size); |
443 | 443 |
int32_t _pst_get (FILE *fp, void *buf, u_int32_t size); |
444 | 444 |
size_t _pst_ff_getIDblock_dec(pst_file *pf, u_int32_t id, unsigned char **b); |
... | ... |
@@ -4274,26 +4274,26 @@ _pst_read_block_size(pst_file *pf, int32_t offset, size_t size, char ** buf, int |
4274 | 4274 |
return size; |
4275 | 4275 |
} |
4276 | 4276 |
|
4277 |
-int32_t _pst_decrypt(unsigned char *buf, size_t size, int32_t type) { |
|
4278 |
- size_t x = 0; |
|
4279 |
- unsigned char y; |
|
4280 |
- if (buf == NULL) { |
|
4281 |
- return -1; |
|
4282 |
- } |
|
4277 |
+static int32_t |
|
4278 |
+_pst_decrypt(unsigned char *buf, size_t size, int32_t type) |
|
4279 |
+{ |
|
4280 |
+ if (buf == NULL) |
|
4281 |
+ return -1; |
|
4283 | 4282 |
|
4284 |
- if (type == PST_COMP_ENCRYPT) { |
|
4285 |
- x = 0; |
|
4286 |
- while (x < size) { |
|
4287 |
- y = buf[x]; |
|
4288 |
- /*cli_dbgmsg("Transposing %#hhx to %#hhx [%#x]\n", buf[x], comp_enc[y], y);*/ |
|
4289 |
- buf[x] = comp_enc[y]; // transpose from encrypt array |
|
4290 |
- x++; |
|
4291 |
- } |
|
4292 |
- } else { |
|
4293 |
- cli_warnmsg("Unknown encryption: %i. Cannot decrypt\n", type); |
|
4294 |
- return -1; |
|
4295 |
- } |
|
4296 |
- return 0; |
|
4283 |
+ if (type == PST_COMP_ENCRYPT) { |
|
4284 |
+ size_t x = 0; |
|
4285 |
+ |
|
4286 |
+ while (x < size) { |
|
4287 |
+ unsigned char y = buf[x]; |
|
4288 |
+ /*cli_dbgmsg("Transposing %#hhx to %#hhx [%#x]\n", buf[x], comp_enc[y], y);*/ |
|
4289 |
+ buf[x] = comp_enc[y]; // transpose from encrypt array |
|
4290 |
+ x++; |
|
4291 |
+ } |
|
4292 |
+ } else { |
|
4293 |
+ cli_warnmsg("Unknown encryption: %i. Cannot decrypt\n", type); |
|
4294 |
+ return -1; |
|
4295 |
+ } |
|
4296 |
+ return 0; |
|
4297 | 4297 |
} |
4298 | 4298 |
|
4299 | 4299 |
static int32_t |