• R
    evm: Propagate choice of HMAC algorithm in evm_crypto.c · 1bc1a8be
    Roberto Sassu 提交于
    hulk inclusion
    category: bugfix
    bugzilla: 3007
    CVE: NA
    
    ---------------------------
    
    Commit 5feeb611 ("evm: Allow non-SHA1 digital signatures") introduced
    the possibility to use different hash algorithm for signatures, but kept
    the algorithm for the HMAC hard-coded (SHA1). Switching to a different
    algorithm for HMAC would require to change the code in different places.
    
    This patch introduces a new global variable called evm_hash_algo, and
    consistently uses it whenever EVM perform HMAC-related operations. It also
    introduces a new kernel configuration option called CONFIG_EVM_DEFAULT_HASH
    so that evm_hash_algo can be defined at kernel compilation time.
    Signed-off-by: NRoberto Sassu <roberto.sassu@huawei.com>
    Acked-by: NHanjun Guo <guohanjun@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    1bc1a8be
evm_main.c 21.8 KB