ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
mdl_verify_rabook_internal.h File Reference

Private strict RBKC validator seam for media downloader artifacts. More...

#include <stdint.h>
#include "fw_if_fs.h"
#include "mdl_export.h"
#include "mdl_verify.h"
#include "ra8_attributes.h"
#include "ra8_err.h"
Include dependency graph for mdl_verify_rabook_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ra8_err_t priv_mdl_verify_rabook (fw_fs_file_t *file, uint64_t size_bytes, mdl_export_workspace_t *workspace, mdl_verify_report_t *report)
 Strictly validate one borrowed RBKC .rabook file.

Detailed Description

Private strict RBKC validator seam for media downloader artifacts.

Keeps the caller-workspace RBKC reader behind the downloader's borrowed-file verifier contract. No filesystem path, allocation, or publication policy crosses this seam.

Since
0.1.0

Definition in file mdl_verify_rabook_internal.h.

Function Documentation

◆ priv_mdl_verify_rabook()

ra8_err_t priv_mdl_verify_rabook ( fw_fs_file_t * file,
uint64_t size_bytes,
mdl_export_workspace_t * workspace,
mdl_verify_report_t * report )

Strictly validate one borrowed RBKC .rabook file.

Opens the callback-driven chunk reader, validates every compressed stream and the complete inner RABOOK1 structure/CRC, then reports bounded chapter and image counts.

Parameters
[in,out]fileBorrowed readable and seekable file.
[in]size_bytesImmutable complete file extent.
[in,out]workspaceExclusive caller-owned validation arena.
[out]reportCandidate report populated only on success.
Returns
Strict reader, workspace, or portable-file status.
Return values
k_ra8_okEvery outer and inner byte passed strict validation.
k_ra8_err_invalid_sizeA wire or caller-workspace bound was exceeded.
k_ra8_err_validation_failedA zlib stream or RABOOK1 structure failed.
Precondition
All pointers are non-NULL and file remains open for the call.
workspace was reset by the owning verifier and is exclusively mutable.
Postcondition
Success initializes RABOOK counts in report.
The borrowed file remains open; its final cursor is unspecified.
Note
Not thread-safe for a shared file or workspace.
Since
0.1.0

Definition at line 120 of file mdl_verify_rabook.c.

References book_header_t::author_off, book_chunked_open(), book_chunked_validate_strict(), book_header_t::chapter_count, book_header_t::identifier_off, book_header_t::image_count, internal_rabook_inflate(), internal_rabook_read(), k_ra8_err_invalid_arg, k_ra8_err_invalid_size, k_ra8_ok, k_rabook_chunk_bytes, k_rabook_compressed_bytes, k_rabook_scratch_bytes, k_rabook_table_entries, mdl_export_workspace_take(), RA8_PRIV, and book_header_t::title_off.

Referenced by internal_verify_borrowed().