From 875d6eb516bbf64237cec9505aa49192fcd06c17 Mon Sep 17 00:00:00 2001 From: "R. Yushaev" <44146334+Naufragous@users.noreply.github.com> Date: Fri, 14 Dec 2018 13:09:54 +0100 Subject: [PATCH] Fix selftest for hash-mode 18400 --- src/interface.c | 10 +++++----- tools/test.pl | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/interface.c b/src/interface.c index e2961ea80..dcee741f9 100644 --- a/src/interface.c +++ b/src/interface.c @@ -11081,10 +11081,10 @@ int odf12_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUS if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - u8 *checksum = token.buf[5]; - u8 *iv = token.buf[7]; - u8 *salt = token.buf[9]; - u8 *encrypted_data = token.buf[11]; + const u8 *checksum = token.buf[5]; + const u8 *iv = token.buf[7]; + const u8 *salt = token.buf[9]; + const u8 *encrypted_data = token.buf[11]; const u32 cipher_type = strtol ((const char *) token.buf[1], NULL, 10); const u32 checksum_type = strtol ((const char *) token.buf[2], NULL, 10); @@ -28605,7 +28605,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) hashconfig->dgst_pos2 = 2; hashconfig->dgst_pos3 = 3; hashconfig->st_hash = ST_HASH_18400; - hashconfig->st_pass = ST_HASH_18500; + hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; break; case 18500: hashconfig->hash_type = HASH_TYPE_SHA1; diff --git a/tools/test.pl b/tools/test.pl index f71172688..7a8b32995 100755 --- a/tools/test.pl +++ b/tools/test.pl @@ -3211,13 +3211,13 @@ sub verify ( hash_class => 'HMACSHA1', iterations => $iter, - output_len => 32, + output_len => 32 ); my $pass_hash = sha256 ($word); my $derived_key = $kdf->PBKDF2 ($b_salt, $pass_hash); - my $cbc = Crypt::Mode::CBC->new('AES', 0); - my $b_plaintext = $cbc->decrypt($b_ciphertext, $derived_key, $b_iv); + my $cbc = Crypt::Mode::CBC->new ('AES', 0); + my $b_plaintext = $cbc->decrypt ($b_ciphertext, $derived_key, $b_iv); my $plaintext = unpack ("H*", $b_plaintext); @@ -10716,15 +10716,15 @@ END_CODE ( hash_class => 'HMACSHA1', iterations => $iterations, - output_len => 32, + output_len => 32 ); my $checksum = sha256_hex ($b_plaintext); my $pass_hash = sha256 ($word_buf); my $derived_key = $kdf->PBKDF2 ($b_salt, $pass_hash); - my $cbc = Crypt::Mode::CBC->new('AES', 0); - my $b_ciphertext = $cbc->encrypt($b_plaintext, $derived_key, $b_iv); + my $cbc = Crypt::Mode::CBC->new ('AES', 0); + my $b_ciphertext = $cbc->encrypt ($b_plaintext, $derived_key, $b_iv); my $ciphertext = unpack ("H*", $b_ciphertext);