Feature/ssl cert management (#442)

* Adds core logic API for SSL Certificate Management

* Update appmgr/src/net/ssl.rs

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>
This commit is contained in:
Keagan McClelland
2021-09-13 11:24:45 -06:00
committed by Aiden McClelland
parent ab728424a8
commit c91790d1eb
6 changed files with 505 additions and 185 deletions

View File

@@ -54,7 +54,8 @@ pub enum ErrorKind {
Wifi = 46,
Journald = 47,
Zfs = 48,
PasswordHashGeneration = 49,
OpenSsl = 49,
PasswordHashGeneration = 50,
}
impl ErrorKind {
pub fn as_str(&self) -> &'static str {
@@ -108,6 +109,7 @@ impl ErrorKind {
Wifi => "WiFi Internal Error",
Journald => "Journald Error",
Zfs => "ZFS Error",
OpenSsl => "OpenSSL Internal Error",
PasswordHashGeneration => "Password Hash Generation Error",
}
}
@@ -203,6 +205,11 @@ impl From<std::net::AddrParseError> for Error {
Error::new(e, ErrorKind::ParseNetAddress)
}
}
impl From<openssl::error::ErrorStack> for Error {
fn from(e: openssl::error::ErrorStack) -> Self {
Error::new(anyhow!("OpenSSL ERROR:\n{}", e), ErrorKind::OpenSsl)
}
}
impl From<Error> for RpcError {
fn from(e: Error) -> Self {
let mut data_object = serde_json::Map::with_capacity(2);