mirror of
https://github.com/openharmony/kernel_linux_common_modules.git
synced 2026-08-27 01:31:36 -04:00
fix: fix logic defects in certificate chain length calculation
1.Avoid infinite loops caused by circular certificate chains. 2.Prevent potential integer overflow issues. Signed-off-by: Guo Yitao <414989582@qq.com>
This commit is contained in:
@@ -195,6 +195,9 @@ void code_sign_verify_certchain(const void *raw_pkcs7, size_t pkcs7_len,
|
||||
break;
|
||||
}
|
||||
cert_chain_depth_without_root++;
|
||||
if (cert_chain_depth_without_root > (source->max_path_depth - 1)) {
|
||||
break;
|
||||
}
|
||||
// search again for current issuer's issuer
|
||||
issuer = cert->issuer;
|
||||
cert = pkcs7->certs;
|
||||
|
||||
Reference in New Issue
Block a user