We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e610496 commit 116ea8bCopy full SHA for 116ea8b
openssl/src/kdf.rs
@@ -1,4 +1,5 @@
1
use cfg_if::cfg_if;
2
+use std::error;
3
use std::ffi::{CStr, CString, NulError};
4
use std::fmt;
5
use std::io;
@@ -41,6 +42,20 @@ impl From<ErrorStack> for KDFError {
41
42
}
43
44
45
+impl fmt::Display for KDFError {
46
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
47
+ use KDFError::*;
48
+ match self {
49
+ Utf8Error(ref e) => e.fmt(f),
50
+ NulError(ref e) => e.fmt(f),
51
+ NoSuchKDF => write!(f, "No such KDF"),
52
+ SSL(ref e) => e.fmt(f),
53
+ }
54
55
+}
56
+
57
+impl error::Error for KDFError {}
58
59
pub trait KDFParams {
60
fn kdf_name(&self) -> String;
61
fn to_params(&self) -> Result<Params, KDFError>;
0 commit comments