Skip to content

Commit

Permalink
as400-ssha1 Unicode test was made too early. No need to complain
Browse files Browse the repository at this point in the history
if we're not seeing "this" format. See #2252.
  • Loading branch information
magnumripper committed Sep 11, 2016
1 parent c05776c commit d381d58
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/as400_ssha1_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ static int our_valid(char *ciphertext, struct fmt_main *self)
if (!strncmp(ciphertext, "$dynamic_1590$", 14))
return pDynamic->methods.valid(ciphertext, pDynamic);

if (strncmp(ciphertext, FORMAT_TAG, FORMAT_TAG_LEN))
return 0;
if (hexlenu(&ciphertext[FORMAT_TAG_LEN], 0) != BINARY_SIZE*2)
return 0;
if (strlen(&ciphertext[FORMAT_TAG_LEN+2*BINARY_SIZE]) > 10)
return 0;
if (options.input_enc == UTF_8 && !valid_utf8((UTF8*)ciphertext)) {
static int error_shown = 0;
#ifdef HAVE_FUZZ
Expand All @@ -163,12 +169,6 @@ static int our_valid(char *ciphertext, struct fmt_main *self)
error_shown = 1;
return 0;
}
if (strncmp(ciphertext, FORMAT_TAG, FORMAT_TAG_LEN) != 0)
return 0;
if (hexlenu(&ciphertext[FORMAT_TAG_LEN], 0) != BINARY_SIZE*2)
return 0;
if (strlen(&ciphertext[FORMAT_TAG_LEN+2*BINARY_SIZE]) > 10)
return 0;
return pDynamic->methods.valid(Convert(Conv_Buf, ciphertext), pDynamic);
}

Expand Down

0 comments on commit d381d58

Please sign in to comment.