adc6898 SecurityPkg/DxeImageVerificationLib: refactor db/dbx fetching code (CVE-2019-14575)

1 file Authored by Jian J Wang 4 years ago, Committed by mergify[bot] 4 years ago,
    SecurityPkg/DxeImageVerificationLib: refactor db/dbx fetching code (CVE-2019-14575)
    
    REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1608
    
    The dbx fetching code inside the while/for-loop causes code hard to
    understand. Since there's no need to get dbx more than once, this patch
    simplify the code logic by moving related code to be outside the while-
    loop. db fetching code is also refined accordingly to reduce the indent
    level of code.
    
    More comments are also added or refined to explain more details.
    
    Cc: Jiewen Yao <jiewen.yao@intel.com>
    Cc: Chao Zhang <chao.b.zhang@intel.com>
    Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
    Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>