diff --git a/src/hashes.c b/src/hashes.c index 1681a585e..11676630d 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -254,6 +254,7 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl debugfile_ctx_t *debugfile_ctx = hashcat_ctx->debugfile_ctx; loopback_ctx_t *loopback_ctx = hashcat_ctx->loopback_ctx; hashes_t *hashes = hashcat_ctx->hashes; + hashconfig_t *hashconfig = hashcat_ctx->hashconfig; const u32 salt_pos = plain->salt_pos; const u32 digest_pos = plain->digest_pos; // relative @@ -276,7 +277,7 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl build_plain (hashcat_ctx, device_param, plain, plain_buf, &plain_len); // TOTP should be base32 encoded - if (hashcat_ctx->hashconfig->hash_mode == KERN_TYPE_TOTP_HMACSHA1) + if (hashconfig->hash_mode == KERN_TYPE_TOTP_HMACSHA1) { // we need a temp buffer for the base32 encoding u32 temp_buf[64] = { 0 }; diff --git a/src/interface.c b/src/interface.c index e7574a3d7..18a043b66 100644 --- a/src/interface.c +++ b/src/interface.c @@ -5189,11 +5189,11 @@ int totp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); + if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); + // now we need to reduce our hash into a token int otp_code = hc_strtoul ((const char *) input_buf, NULL, 10); - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - digest[1] = otp_code; u8 *salt_pos = token.buf[1];