pv: Require matching versions of request and HKD

Enforce that a v{1,2} request also has a v{1,2} hostkey.
This requires to change the signature of Request::add_hostkey to return
a Result.

Co-Developed-by: Timo Keller <tkeller@linux.ibm.com>
Signed-off-by: Timo Keller <tkeller@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <marc@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Steffen Eiden
2026-07-22 14:24:28 +02:00
parent 73c227fa9a
commit 9a5c9cd7f9
8 changed files with 60 additions and 17 deletions
+3
View File
@@ -144,6 +144,9 @@ pub enum Error {
#[error("{}", .0)]
InvalidHkd(String),
#[error("All host keys must use the same version (all hybrid or all non-hybrid)")]
MixedHostkeyVersions,
}
// used in macros