Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] Hashing implementations failing due to uninitialized WorkingKey #7

Open
mrpastewart opened this issue Jan 5, 2025 · 0 comments
Labels
Type: Test A problem or enhancement related to a test.

Comments

@mrpastewart
Copy link
Contributor

mrpastewart commented Jan 5, 2025

Select package

Auth

Which jobs/test(s) are failing

test/hasher_test.dart:BcryptHasher basic bcrypt hashing
test/hasher_test.dart:BcryptHasher bcrypt verification with argon2i hash throws
test/hasher_test.dart:ArgonHasher basic argon2i hashing
test/hasher_test.dart:Argon2IdHasher basic argon2id hashing
test/hash_manager_test.dart:HashManager isHashed returns true for hashed value
test/hash_manager_test.dart:HashManager make delegates to driver
test/hash_manager_test.dart:HashManager check delegates to driver
test/hash_manager_test.dart:HashManager needsRehash delegates to driver
test/hash_manager_test.dart:HashManager info delegates to driver

Reason for failure/description

All failing tests share the same root cause: a LateInitializationError for the '_WorkingKey' field. This error occurs in all three hashing implementations (Bcrypt, Argon2i, and Argon2id) and affects the HashManager tests that depend on these implementations.

Error messages consistently show:

LateInitializationError: Field '_WorkingKey@213300867' has not been initialized.

The error appears in three variants but with the same underlying cause:

"Bcrypt hashing not supported"
"Argon2i hashing not supported"
"Argon2id hashing not supported"

Is this a regression?

No

Media proof

Bad state: Bcrypt hashing not supported: LateInitializationError: Field '_WorkingKey@213300867' has not been initialized.
  package:platform_hashing/src/bcrypt_hasher.dart 41:7  BcryptHasher.make

Bad state: Argon2i hashing not supported: LateInitializationError: Field '_WorkingKey@213300867' has not been initialized.
  package:platform_hashing/src/argon_hasher.dart 57:7  ArgonHasher.make

Bad state: Argon2id hashing not supported: LateInitializationError: Field '_WorkingKey@213300867' has not been initialized.
  package:platform_hashing/src/argon2id_hasher.dart 34:7  Argon2IdHasher.make

Additional context

Additional context:

  • Location: packages/hashing/
  • The issue appears to be in the initialization of the hashing implementations
  • The '_WorkingKey' field is marked as late but never initialized before use
  • This affects all hashing algorithms (Bcrypt, Argon2i, Argon2id)
  • The error propagates up to the HashManager level, causing failures in higher-level tests
  • Key files involved:
    - src/bcrypt_hasher.dart
    - src/argon_hasher.dart
    - src/argon2id_hasher.dart
    - src/hash_manager.dart
@mrpastewart mrpastewart added the Type: Test A problem or enhancement related to a test. label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Test A problem or enhancement related to a test.
Projects
None yet
Development

No branches or pull requests

1 participant