Skip to content

Commit

Permalink
zip2john: Fix some clang-tidy errors
Browse files Browse the repository at this point in the history
Reported by Lucian Popescu
  • Loading branch information
solardiz committed May 2, 2024
1 parent ccdcf21 commit 1c97519
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/zip2john.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,23 +482,15 @@ static int process_aes(zip_file *zip, zip_ptr *p)
// continue;
unsigned char iv[16];
unsigned char Erd[256];
uint32_t Size;
uint32_t Format;
uint16_t AlgId;
uint16_t Bitlen;
uint16_t Flags;
uint16_t ErdSize;
uint32_t Reserved1;
uint16_t VSize;
uint16_t IVSize;
char *bname;

// unused
(void) Flags;
(void) Bitlen;
(void) Reserved1;
(void) Size;

fprintf(stderr, "Poking at %s in %s to see if it's indeed strong encryption...\n", p->file_name, zip->fname);
bname = jtr_basename(zip->fname);
IVSize = fget16LE(fp);
Expand All @@ -510,7 +502,7 @@ static int process_aes(zip_file *zip, zip_ptr *p)
fprintf(stderr, "No (Error reading IV)\n");
return 0;
}
Size = fget32LE(fp);
(void) fget32LE(fp); /* Size */
Format = fget16LE(fp);
if (Format != 3) {
fprintf(stderr, "No (Format == %"PRIu32")\n", Format);
Expand Down Expand Up @@ -542,7 +534,7 @@ static int process_aes(zip_file *zip, zip_ptr *p)
IVSize = 12;
}
Bitlen = fget16LE(fp);
Flags = fget16LE(fp);
(void) fget16LE(fp); /* Flags */
ErdSize = fget16LE(fp);
if (ErdSize > sizeof(Erd)) {
fprintf(stderr, "No (ErdSize too large: %"PRIu16")\n", ErdSize);
Expand Down

0 comments on commit 1c97519

Please sign in to comment.