summaryrefslogtreecommitdiff
path: root/src/lib/cbfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/cbfs.c')
-rw-r--r--src/lib/cbfs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 4e25d27cfb..78eeb3bfb2 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -208,6 +208,13 @@ static size_t cbfs_load_and_decompress(const struct region_device *rdev, void *b
DEBUG("Decompressing %zu bytes from '%s' to %p with algo %d\n",
in_size, mdata->h.filename, buffer, compression);
+ if (CONFIG(CBFS_VERIFICATION) && !CONFIG(CBFS_ALLOW_UNVERIFIED_DECOMPRESSION) &&
+ skip_verification && compression != CBFS_COMPRESS_NONE) {
+ ERROR("Refusing to decompress unverified file '%s' with algo %d\n",
+ mdata->h.filename, compression);
+ return 0;
+ }
+
switch (compression) {
case CBFS_COMPRESS_NONE:
if (buffer_size < in_size)