diff --git a/rust/pv/src/req/hostkey.rs b/rust/pv/src/req/hostkey.rs index 9edf673e..d50cb3f3 100644 --- a/rust/pv/src/req/hostkey.rs +++ b/rust/pv/src/req/hostkey.rs @@ -4,7 +4,7 @@ //! Host key types for UV requests -use openssl::pkey::{PKey, Public}; +use openssl::pkey::{PKey, PKeyRef, Public}; /// Versioned host keys container #[non_exhaustive] @@ -16,10 +16,10 @@ pub enum HostKey { impl HostKey { /// Return the ECDH public key - pub fn ec_key(&self) -> &PKey { - match self { + pub fn ec_key(&self) -> Option<&PKeyRef> { + Some(match self { HostKey::V1(ec_key) => ec_key, - } + }) } }