pv: Limit CRL download size

Add a dedicated HKD verification error for CRL downloads that exceed the
maximum file size of 10 MiB and cover the max_filesize behavior in the
helper tests and add tests for it.

This commit adds a new development/test dependency as it verifies that
the correct messages are being logged.

Fixes: c6f621d0dc ("rust: Add library for pv tools")
Assisted-by: IBM Bob:1.0.5
Signed-off-by: Marc Hartmayer <marc@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2026-07-03 14:36:21 +02:00
committed by Jan Höppner
parent cf70a27d76
commit 5feee12827
4 changed files with 109 additions and 6 deletions
+2
View File
@@ -179,6 +179,8 @@ pub enum HkdVerifyErrorType {
IbmSignInvalid(#[source] openssl::x509::X509VerifyResult, u32),
#[error("Too many redirections during CRL download")]
TooManyRedirectionsCrlDownload,
#[error("CRL download exceeds maximum file size of {} MiB", .0 / (1024 * 1024))]
CrlDownloadTooLarge(u64),
#[error("CRL download failed")]
CrlDownloadFailed,
}