Skip to content

Split fsverity-utils into a shared library

Jes Sorensen linux-fscrypt 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest20 patches 2 repliesIn review
  2. v39 patches 13 repliesSuperseded
  3. v26 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v17 patches10 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20Build basic shared library frameworkMakefile libverity.c+25 -30 replies
2/20Change compute_file_measurement() to take a file descriptor as argumentcmd_sign.c fsverity.c libfsverity.h+79 -110 replies
3/20Move fsverity_descriptor definition to libfsverity.hcmd_sign.c libfsverity.h+26 -190 replies
4/20Move hash algorithm code to shared libraryMakefile cmd_enable.c cmd_measure.c +6 more+70 -610 replies
5/20Create libfsverity_compute_digest() and adapt cmd_sign to use itcmd_sign.c libfsverity.h libfsverity_private.h +1 more+250 -2010 replies
6/20Introduce libfsverity_sign_digest()cmd_sign.c libfsverity.h libverity.c+329 -3090 replies
7/20Validate input arguments to libfsverity_compute_digest()libverity.c+23 -80 replies
8/20Validate input parameters for libfsverity_sign_digest()libverity.c+26 -80 replies
9/20Document API of libfsveritylibfsverity.h+45 -00 replies
10/20Change libfsverity_compute_digest() to take a read functioncmd_sign.c libfsverity.h libverity.c+28 -340 replies
11/20Make full_{read,write}() return proper error codes instead of boolcmd_enable.c cmd_sign.c util.c +1 more+17 -180 replies
12/20libfsverity: Remove dependencies on util.cfsverity.c hash_algs.c hash_algs.h +4 more+184 -1380 replies
13/20Update Makefile to install libfsverity and fsverity.hMakefile+26 -80 replies
14/20Change libfsverity_find_hash_alg_by_name() to return the alg numbercmd_enable.c cmd_sign.c hash_algs.c +1 more+71 -230 replies
15/20Make libfsverity_find_hash_alg_by_name() private to the shared librarycmd_enable.c cmd_measure.c cmd_sign.c +4 more+37 -390 replies
16/20libfsverity_sign_digest() use ARRAY_SIZE()libverity.c+1 -20 replies
17/20fsverity_cmd_sign() use sizeof() input argument instead of structcmd_sign.c+2 -20 replies
18/20fsverity_cmd_sign() don't exit on error without closing file descriptorcmd_sign.c+6 -50 replies
19/20Improve documentation of libfsverity.h APIlibfsverity.h+19 -80 replies
20/20Fixup MakefileMakefile+17 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 00/20] Split fsverity-utils into a shared library

From: Jes Sorensen <[email protected]>

Hi

This is an update to the libfsverity patches I posted about a month ago, which I believe address all the issues in the feedback I received.

I have a version of rpm that requires this library which is able to sign files and a plugin which will install fsverity signatures when the rpm is installed. The code for rpm can be found on github - note that I do rebase the repo as I fix bugs:
https://github.com/jessorensen/rpm/tree/rpm-fsverity

A git tree with these patches can also be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/jes/fsverity-utils.git

This update changes a number of issues:
- Change the API for libfsverity_compute_digest() to take a callback read function, which is needed to deal with the internal cpio processing of rpm.
- Provides the option to build fsverity linked statically against libfsverity
- Makefile support to install libfsverity.so, libfsverity.h and sets the soname
- Make struct fsverity_descriptor and struct fsverity_hash_alg internal to the library
- Improved documentation of the API in libfsverity.h

I have a .spec file for it that packages this into an rpm for Fedora, as well as a packaged version of rpm with fsverity support in it, which I am happy to share.

Let me know what you think!

Thanks,
Jes

Jes Sorensen (20):
Build basic shared library framework
Change compute_file_measurement() to take a file descriptor as
argument
Move fsverity_descriptor definition to libfsverity.h
Move hash algorithm code to shared library
Create libfsverity_compute_digest() and adapt cmd_sign to use it Introduce libfsverity_sign_digest()
Validate input arguments to libfsverity_compute_digest() Validate input parameters for libfsverity_sign_digest() Document API of libfsverity
Change libfsverity_compute_digest() to take a read function Make full_{read,write}() return proper error codes instead of bool
libfsverity: Remove dependencies on util.c
Update Makefile to install libfsverity and fsverity.h Change libfsverity_find_hash_alg_by_name() to return the alg number Make libfsverity_find_hash_alg_by_name() private to the shared library libfsverity_sign_digest() use ARRAY_SIZE() fsverity_cmd_sign() use sizeof() input argument instead of struct fsverity_cmd_sign() don't exit on error without closing file
descriptor
Improve documentation of libfsverity.h API
Fixup Makefile

 Makefile              |  49 +++-
 cmd_enable.c          |  19 +-
 cmd_measure.c         |  19 +-
 cmd_sign.c            | 565 +++++------------------------------------
 fsverity.c            |  17 +-
 hash_algs.c           |  95 ++++---
 hash_algs.h           |  36 +--
 helpers.h             |  43 ++++
 libfsverity.h         | 138 ++++++++++
 libfsverity_private.h |  52 ++++
 libverity.c           | 572 ++++++++++++++++++++++++++++++++++++++++++
 util.c                |  15 +-
 util.h                |  62 +----
 13 files changed, 1029 insertions(+), 653 deletions(-)
 create mode 100644 helpers.h
 create mode 100644 libfsverity.h
 create mode 100644 libfsverity_private.h
 create mode 100644 libverity.c
Signature · 1 line
2.25.3