File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,17 @@ impl fmt::Display for CryptError {
4444 }
4545}
4646
47+ /// Errors which occur when verifying passwords.
4748#[ cfg( feature = "simple" ) ]
4849#[ derive( Debug ) ]
4950pub enum CheckError {
51+ /// Format is invalid.
5052 InvalidFormat ( String ) ,
53+
54+ /// Cryptographic error.
5155 Crypt ( CryptError ) ,
56+
57+ /// Password hash doesn't match (invalid password).
5258 HashMismatch ,
5359}
5460
Original file line number Diff line number Diff line change @@ -54,9 +54,12 @@ pub use crate::{
5454use alloc:: { string:: String , vec:: Vec } ;
5555use sha2:: { Digest , Sha256 , Sha512 } ;
5656
57+ #[ cfg( feature = "simple" ) ]
58+ pub use crate :: errors:: { CheckError , DecodeError } ;
59+
5760#[ cfg( feature = "simple" ) ]
5861use {
59- crate :: { defs:: SALT_MAX_LEN , errors :: CheckError } ,
62+ crate :: defs:: SALT_MAX_LEN ,
6063 alloc:: string:: ToString ,
6164 base64ct:: { Base64ShaCrypt , Encoding } ,
6265 rand_core:: { OsRng , RngCore , TryRngCore } ,
You can’t perform that action at this time.
0 commit comments