host/lib: Decouple openssl headers from HOSTLIB

Coreboot's cbfstool (under GPLv2 license) links HOSTLIB libvboot_host.a
(under 3-Clause BSD license), which was fine, until CL:4798534 included
openssl headers (under Apache 2.0 license) in HOSTLIB
(host/lib/crypto.c), because GPLv2-only license is not compatible with
Apache 2.0.

Since openssl is needed by futility (which links UTILLIB
libvboot_util.a), solve the problem by decoupling openssl headers from
HOSTLIB. vb2_get_sig_alg(), which caused the problem, is moved from
HOSTLIB to UTILLIB (host/lib/util_misc.c).

Ideally source files for UTILLIB should be placed separately from those
for HOSTLIB. However in this patch we simply move vb2_get_sig_alg() to
an existing UTILLIB file that seems suitable for the function.

BUG=b:303171166
TEST=make hostlib
TEST=make utillib
TEST=make runtests -j
BRANCH=none

Change-Id: Ia16d1f8e30a9645f49ac518fda3d302a36e19fd8
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4918917
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Julius Werner <jwerner@chromium.org>
6 files changed