File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ pub enum Error {
3939 /// Invalid password.
4040 PasswordInvalid ,
4141
42+ /// Random number generator failure.
43+ RngFailure ,
44+
4245 /// Invalid salt.
4346 SaltInvalid ,
4447
@@ -58,6 +61,7 @@ impl fmt::Display for Error {
5861 Self :: ParamInvalid { name } => write ! ( f, "invalid parameter: {name:?}" ) ,
5962 Self :: ParamsInvalid => write ! ( f, "invalid parameters" ) ,
6063 Self :: PasswordInvalid => write ! ( f, "invalid password" ) ,
64+ Self :: RngFailure => write ! ( f, "rng failure" ) ,
6165 Self :: SaltInvalid => write ! ( f, "invalid salt" ) ,
6266 Self :: Version => write ! ( f, "invalid algorithm version" ) ,
6367 }
@@ -69,8 +73,7 @@ impl core::error::Error for Error {}
6973#[ cfg( feature = "getrandom" ) ]
7074impl From < getrandom:: Error > for Error {
7175 fn from ( _: getrandom:: Error ) -> Self {
72- // TODO(tarcieri): should we have a specific variant for RNGs errors?
73- Error :: Crypto
76+ Error :: RngFailure
7477 }
7578}
7679
You can’t perform that action at this time.
0 commit comments