summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile7
-rw-r--r--tools/docker/Dockerfile3
-rwxr-xr-xtools/qconfig.py4
-rw-r--r--tools/sfspl.c5
4 files changed, 15 insertions, 4 deletions
diff --git a/tools/Makefile b/tools/Makefile
index e5f5eea47c7..53b87d22a80 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -76,6 +76,9 @@ FIT_OBJS-y := fit_common.o fit_image.o image-host.o generated/boot/image-fit.o
FIT_SIG_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := image-sig-host.o generated/boot/image-fit-sig.o
FIT_CIPHER_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := generated/boot/image-cipher.o
+HOSTCFLAGS_image-host.o += \
+ $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "")
+
# The following files are synced with upstream DTC.
# Use synced versions from scripts/dtc/libfdt/.
LIBFDT_OBJS := $(addprefix libfdt/, fdt.o fdt_ro.o fdt_wip.o fdt_sw.o fdt_rw.o \
@@ -84,8 +87,12 @@ LIBFDT_OBJS := $(addprefix libfdt/, fdt.o fdt_ro.o fdt_wip.o fdt_sw.o fdt_rw.o \
RSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix generated/lib/rsa/, \
rsa-sign.o rsa-verify.o \
rsa-mod-exp.o)
+HOSTCFLAGS_rsa-sign.o += \
+ $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "")
ECDSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix generated/lib/ecdsa/, ecdsa-libcrypto.o)
+HOSTCFLAGS_ecdsa-libcrypto.o += \
+ $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "")
AES_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix generated/lib/aes/, \
aes-encrypt.o aes-decrypt.o)
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
index 85d67848327..569912303fc 100644
--- a/tools/docker/Dockerfile
+++ b/tools/docker/Dockerfile
@@ -296,7 +296,8 @@ RUN wget -O - https://coreboot.org/releases/coreboot-24.08.tar.xz | tar -C /tmp
make olddefconfig && \
make -j $(nproc) && \
sudo mkdir /opt/coreboot && \
- sudo cp build/coreboot.rom build/cbfstool /opt/coreboot/
+ sudo cp build/coreboot.rom build/cbfstool /opt/coreboot/ && \
+ rm -rf /tmp/coreboot-24.08
# Create our user/group
RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot
diff --git a/tools/qconfig.py b/tools/qconfig.py
index 259adbe1bc9..c96a305a48f 100755
--- a/tools/qconfig.py
+++ b/tools/qconfig.py
@@ -1453,7 +1453,7 @@ def do_scan_source(path, do_update):
print('\nCONFIG options used as Proper in Makefiles but without a non-xPL_ variant:')
not_found = check_not_found(all_uses, MODE_PROPER)
show_uses(not_found)
- proper_not_found |= {not_found.keys()}
+ proper_not_found |= not_found.keys()
# Scan the source code
all_uses, _ = scan_src_files(src_list)
@@ -1471,7 +1471,7 @@ def do_scan_source(path, do_update):
print('\nCONFIG options used as Proper in source but without a non-xPL_ variant:')
not_found = check_not_found(all_uses, MODE_PROPER)
show_uses(not_found)
- proper_not_found |= {not_found.keys()}
+ proper_not_found |= not_found.keys()
print('\nCONFIG options used as SPL but without an xPL_ variant:')
for item in sorted(spl_not_found):
diff --git a/tools/sfspl.c b/tools/sfspl.c
index c76420ce21b..516e96e8dd9 100644
--- a/tools/sfspl.c
+++ b/tools/sfspl.c
@@ -70,11 +70,14 @@ static int sfspl_verify_header(unsigned char *buf, int size,
printf("Truncated file\n");
return EXIT_FAILURE;
}
+ if ((size_t)size > hdr_size + file_size)
+ printf("File too long, expected %u bytes\n",
+ hdr_size + file_size);
if (hdr->version != DEFAULT_VERSION) {
printf("Unknown file format version\n");
return EXIT_FAILURE;
}
- crc_check = crc32(0, &buf[hdr_size], size - hdr_size);
+ crc_check = crc32(0, &buf[hdr_size], file_size);
if (crc_check != crc) {
printf("Incorrect CRC32\n");
return EXIT_FAILURE;