7 Star 0 Fork 9

OpenHarmony / third_party_fsverity-utils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README_zh.md 1.68 KB
一键复制 编辑 原始数据 按行查看 历史
lihehe 提交于 2023-04-24 20:12 . Add README_zh.md

fsverity-utils

简介

fsverity-utils是与内核特性fs-verity配套的一组用户态工具。fs-verity是Linux Kernel提供的保护文件完整性的机制,可以实现以文件为粒度的按需保护可写分区的只读文件。可选地,fs-verity提供对文件签名的验证,以保证文件的真实性。

1. 组件引入背景 为了OpenHarmony上使用内核特性fs-verity而提供的三方库接口。

2. 使用场景 可以通过动态库或者静态库的方式依赖此组件,调用接口计算fs-verity的摘要、签名。

3. 为OpenHarmony带来的价值 满足在OpenHarmony上使能内核特性fs-verity的诉求。

OpenHaromny中如何使用fsverity-utils

  1. 在BUILD.gn中增加编译依赖
include_dirs = [
  "//third_party/fsverity_utils/include",
  "//third_party/fsverity_utils/common"
]

deps = [
  # 动态库依赖(可选)
  "//third_party/fsverity_utils:libfsverity_utils",
  # 静态库依赖(可选)
  "//third_party/fsverity_utils:libfsverity_utils_static" 
]
  1. libfsverity_utils(_static)提供的主要接口
接口名称 功能
libfsverity_enable 对文件使能fs-verity保护
libfsverity_enable_with_sig 对文件使能带fs-verity签名
libfsverity_compute_digest 计算文件的fsverity摘要
libfsverity_sign_digest 对fsverity摘要进行签名

具体使用方法和其他接口见include/libfsverity.h

fsverity-utils使用文档

代码仓库:https://git.kernel.org/pub/scm/fs/fsverity/fsverity-utils.git

fs-verity介绍:https://www.kernel.org/doc/html/latest/filesystems/fsverity.html

1
https://gitee.com/openharmony/third_party_fsverity-utils.git
git@gitee.com:openharmony/third_party_fsverity-utils.git
openharmony
third_party_fsverity-utils
third_party_fsverity-utils
master

搜索帮助