CCCID/CHUID: add basic tests and do some cleanups

- Adds tests for CCCID/CHUID, allowing not found (is that ok?)
- Move constants under their respective modules and remove `YKPIV_`
This commit is contained in:
Tony Arcieri
2019-12-07 13:08:30 -08:00
parent 2587a4ac1e
commit 9482ae62ab
9 changed files with 142 additions and 59 deletions
+5
View File
@@ -88,6 +88,9 @@ pub enum Error {
/// Not supported
NotSupported,
/// Not found
NotFound,
}
impl Error {
@@ -113,6 +116,7 @@ impl Error {
Error::ArgumentError => "YKPIV_ARGUMENT_ERROR",
Error::RangeError => "YKPIV_RANGE_ERROR",
Error::NotSupported => "YKPIV_NOT_SUPPORTED",
Error::NotFound => "<not found>",
}
}
@@ -135,6 +139,7 @@ impl Error {
Error::ArgumentError => "argument error",
Error::RangeError => "range error",
Error::NotSupported => "not supported",
Error::NotFound => "not found",
}
}
}