-
Clemens Lang via Gcrypt-devel authored
* src/fips.c [ENABLE_HMAC_BINARY_CHECK] (hmac256_check): Use ELF headers to locate the file offset for the HMAC in addition to information from the loader -- The previous method of locating the offset of the .rodata1 section in the ELF file on disk used information obtained from the loader. This computed the address of the value in memory at runtime, but the offset in the file can be different. Specifically, the old code computed a value relative to ElfW(Phdr).p_vaddr, but the offset in the file is relative to ElfW(Phdr).p_offset. These values can differ, so the computed address at runtime must be translated into a file offset relative to p_offset. This is largely cosmetic, since the text section that should contain the HMAC usually has both p_vaddr and p_offset set to 0. Signed-off-by: Clemens Lang <cllang@redhat.com>
beb5d6df