Commit Graph

1842 Commits

Author SHA1 Message Date
Vineeth Vijayan
f1f80a8a20 zdev: implement option to identify files created by zdev
Enhance the 'chzdev' tool by introducing a new option to discern
files created by 'zdev-tools.' The command usage is as follows:

$ chzdev --is-owner <file-name>

When executed, the command will return an exit code of 0 for all
files generated by zdev-tools. In the case of an unknown file, the
tool will return the exit code 'EXIT_UNKNOWN_FILE i.e 33.'

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-04-26 14:37:52 +02:00
Vineeth Vijayan
4c2bfb1d47 zdev: rename site.h to zdev.h
Add zdev-specific definitions into a lightweight header file. Rather
than creating a new one, transform the existing "site.h" into "zdev.h"
to house all generic zdev-specific definitions that needs to be shared
between chzdev, lszdev and zdev_id going forward.

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-04-26 14:37:51 +02:00
Finn Callies
c0fc21efb3 cpacfstats: dynamically load PAI and CPUMF counter
Up until now cpacfstats assumes that on the running hardware either all
PAI and CPUMF are available or non at all.  Which counters are supported
may be hardware dependent and can vary in the future. With
this commit cpacfstats dynamically loads the counters from sysfs entries
in (/sys/devices/pai_crypto/events/) and (/sys/devices/cpum_cf/events/)
respectively.

Additionally cpacfstats has a new way of determining which PAI counters
are meant for kernel usage.

Signed-off-by: Finn Callies <fcallies@linux.ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-04-26 14:37:51 +02:00
Steffen Eiden
93d3c44a1a Prepare for next release
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-04-03 16:18:09 +02:00
Steffen Eiden
9eea78b3ad New release s390-tools-2.32.0
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
v2.32.0
2024-04-03 16:18:09 +02:00
Steffen Eiden
0a3a556879 rust/Cargo.lock: Update curl-sys crate
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-04-03 16:18:09 +02:00
Steffen Eiden
aba8900074 rust/pv_core: Remove mockito dependency
With f6c6f0cc71 ("rust/pv/test: Code + Certificate refactoring")
no code uses mockito anymore, but it's dependency was not removed.

Remove the mockito dependency from the rust workspace.

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-04-03 16:18:09 +02:00
Dan Horák
f5744b95db genprotimg: Fix build with OpenSSL 1.1
OpenSSL 1.1 seems to use a non-const parameter to X509_name_dup(), but
x509_armonk_locality_fixup() is passing a const there. The compile then
fails on "discards 'const' qualifier", when -Werror is used. Thus
resolve with a type-cast like in c2b_name().

Fixes: https://github.com/ibm-s390-linux/s390-tools/pull/167
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Dan Horák <dan@danny.cz>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-04-02 17:37:53 +02:00
Dan Horák
13d721afd3 libpv: Fix build with OpenSSL 1.1
OpenSSL 1.1 seems to use a non-const parameter to X509_name_dup(), but
x509_armonk_locality_fixup() is passing a const there. The compile then
fails on "discards 'const' qualifier", when -Werror is used. Thus
resolve with a type-cast like in pv_c2b_name().

GitHub-ID: https://github.com/ibm-s390-linux/s390-tools/pull/167
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Dan Horák <dan@danny.cz>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-04-02 17:37:53 +02:00
Eduard Shishkin
90a2e6d70e zipl/src: Fix leak of files
Fix leak of temporary files: if prepare_build_program_table_file()
is called in no dry-run mode and there was an error then the file
@filename will not be deleted in free_bootloader()).

Fix leak of renamed files as well as corruption of previously
created bootmap files with the same name in case of unsuccessful
IPL installation.

Add a special flag to keep a track of file's "temporary" state;
Base the cleanup decision on this flag instead of checking dry-run;
Release resources captured by prepare_bootloader() in the error path;
Move the final rename to be called only after successful installation.

                    Original logic:

prepare_bootloader_ipl():
prepare_bootloader_ngdump():

  always create temporary @filename
  if (!dry-run) rename @filename;
  install;
  cleanup: if (dry_run) drop @filename (*** LEAK ***)

prepare_bootloader_device():

  if (dry_run) create temporary @filename
  install, don't rename;
  cleanup: if (dry_run) drop @filename

                    New logic:

prepare_bootloader_ipl():
prepare_bootloader_ngdump():

  always create temporary @filename and set @tmp_filename_created;
  install;
  if (!dry_run) rename @filename and clear @tmp_filename_created;
  cleanup: if (@tmp_filename_created is set), drop @filename

prepare_bootloader_device():

  if (dry_run) create @filename and set @tmp_filename_created;
  install, don't rename;
  cleanup: if (@tmp_filename_created is set) drop @filename.

Fixes: https://github.com/ibm-s390-tools/s390-tools/issues/165
Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Acked-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-04-02 17:37:53 +02:00
Marc Hartmayer
bc9f8a8100 genprotimg: Fix out-of-disk space handling
Convert the assertion to a GError since an out-of-disk-space situation
is a valid situation that should be handled.

ERROR:utils/crypto.c:1843:__encrypt_decrypt_bio: assertion failed: (num_bytes_written == out_len)
Bail out! ERROR:utils/crypto.c:1843:__encrypt_decrypt_bio: assertion failed: (num_bytes_written == out_len)

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-04-02 17:37:53 +02:00
Steffen Eiden
2b5e7b0491 pvattest: Fix root-ca parsing
The parser setup falsely set the argument type as filename array, but
code expected a single filename. Fixed by setting up the parser
correctly to expect a single file name.

Fixes: 3ab06d77fb ("pvattest: Create, perform, and verify attestation measurements")
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Steffen Eiden
d7c95265cd libpv: Support Armonk in IBM signing key subject
New IBM signing keys will have Armonk as locality in the subject.
Ensure that CRLs with Poughkeepsie as issuer locality are still
discovered if they are signed with the signing keys private key.
Also, drop the check for issuer/subject comparison and only rely on
validity period and cryptographic signatures.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Marc Hartmayer
8751cfc409 genprotimg/samples/check_hostkeydoc: code formatting
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Marc Hartmayer
01f96d30f6 genprotimg/samples/check_hostkeydoc: fix ShellCheck findings
Fix ShellCheck findings and two typos. White spaces in filenames are now
supported properly.

Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Marc Hartmayer
fffbd93f12 genprotimg/samples/check_hostkeydoc: improve argument parsing
+ use `getopts` POSIX builtin instead of external program
+ improve error reporting
+ support white spaces in the script name

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Marc Hartmayer
ddcfbdc8d2 genprotimg/samples/check_hostkeydoc: support Armonk in IBM signing key subject
Newer IBM signing keys use `Armonk` in their subject therefore add
support for it.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Marc Hartmayer
173fd7cdca genprotimg/samples/check_hostkeydoc: set LC_ALL=C for the sort command
Set `LC_ALL=C` for the `sort` command to get a stable sort order. See
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sort.html for
details on the effect of LC_* on `sort`. Adapt the default issuer
accordingly.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Marc Hartmayer
d14e7593cc genprotimg: support Armonk in IBM signing key subject
New IBM signing certificates will have 'Armonk' as locality in the
subject. Make sure that certificate revocations lists (CRL) with
'Poughkeepsie' as issuer locality are still considered as valid as long
as they are signed with the IBM signing keys private key. In addition,
drop the check for 'issuer(HKD) == subject(HKSK)' as it doesn't improve
security. While at it, remove now unused functions and fix a memory leak
of @akid in `check_crl_issuer`.

Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Steffen Eiden
1a3d0b74f7 rust/pv: Support Armonk in IBM signing key subject
New IBM signing keys will have Armonk as locality in the subject.
Ensure that CRLs with Poughkeepsie as issuer locality are still
discovered if they are signed with the signing keys private key.
Also, drop the check for issuer/subject comparison and only rely on
validity period and cryptographic signatures.

Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Marc Hartmayer
f6c6f0cc71 rust/pv/test: Code + Certificate refactoring
* Get rid of Mockito
* create certs with AKID
* simplify things in the `create_certs.py` script

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Thomas Richter
966e67a252 cpumf/lscpumf: add support for machine type 3932
Add support for machine type 3932 and list the
CPU Measurement facility counter sets.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Joern Siglen
1c128c0d11 dbginfo.sh: dash compatible copy sequence
rewrite the copy of dbginfo.sh for dash compatibility

Reviewed-by: Mike Storzer <MSTORZER@de.ibm.com>
Reviewed-by: Mario Held <mario.held@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
VasiliyS
a3199d58db rust/pv_core: Fix UvDeviceInfo::get() method.
`ATTESTATION_NR` flag was not set properly in case the device
didn't support `Info` IOCTL call.

Closes: https://github.com/ibm-s390-linux/s390-tools/pull/163
Signed-off-by: Vasiliy Suvorov <vsuvorov@gmail.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-22 12:07:29 +01:00
Vineeth Vijayan
659483031e zdev: Rearrange the options alphabetically in man page
re-arrange options in zdev manpages in the alphabetical order.

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:43 +01:00
Ingo Franzki
7dc2513205 zkey: Detect FIPS mode and generate PBKDF for luksFormat according to it
For LUKS2 volumes, zkey generates 'cryptsetup luksFormat' commands with
options '--pbkdf argon2i --pbkdf-memory 32 --pbkdf-force-iterations 4'
for low memory and time requirements. Using the default Argon2i options
might cause out-of-memory errors when multiple encrypted volumes are
unlocked automatically at boot through /etc/crypttab.

When the system runs in FIPS mode, which is indicated by file
/proc/sys/crypto/fips_enabled containing '1', the Argon2i password based
key derivation function might be disabled by a policy, and such
'cryptsetup luksFormat' commands might fail.

Generate '--pbkdf pbkdf2' instead if the system runs in FIPS mode.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:43 +01:00
Marc Hartmayer
0748d365a6 genprotimg/**/Makefile: Fix staged installs
Fix the support for staged installs. The Makefile variable `PKGDATADIR`
uses `DESTDIR` for all Makefile target, but actually it should only be
used for the `install*` and `uninstall*` targets. [1] Fix this by using
`DESTDIR` only for `install*` targets - uninstall* targets are not
supported by s390-tools.

Before this change, if `DESTDIR` was set for staged installs,
`genprotimg` has tried to find the bootloader binaries at the temporary
installation path `$DESTDIR$(TOOLS_DATADIR)/genprotimg/` instead of
`$(TOOLS_DATADIR)/genprotimg`.

[1] https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Fixes: 65b9fc442c ("genprotimg: introduce new tool for the creation of PV images")
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:38 +01:00
Marc Hartmayer
94a404ed10 pvattest: Makefile: Remove unused variable and CFLAGS
Remove unused variables and unused compiler flags.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:34 +01:00
Thomas Richter
ef1799f31f s390-tools/libutil: Add machine type 3932
Add support for machine type 3932.
Print identical product name for machine types 8561 and 8562.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Suggested-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:34 +01:00
Mikhail Zaslonko
47b0960cc7 zdump: Make ngdump_get_part_path() public
Make ngdump_get_part_path() public in order for unit-tests to access it.

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:34 +01:00
Mikhail Zaslonko
2288331a6f zipl: Clear CCW-type DASD dumper upon ldipl-dump tool installation
Clear CCW-type DASD standalone dumper (if installed on the DASD) upon
successful installation of the List-Directed ECKD dump tool on the same
device. This helps to avoid 'zgetdump -d' confusion and have only one
'active' dump tool per disk.

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Acked-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:34 +01:00
Mikhail Zaslonko
23e9156f43 s390_dump.h: Add DF_S390_DUMPER_MAGIC_SIZE constant
Add DF_S390_DUMPER_MAGIC_SIZE constant to s390_dump.h.
Use it instead of hardcoded length when processing dumper magics
in zgetdump code.

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Acked-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:34 +01:00
Mikhail Zaslonko
8f99e7c4ea zdump: Move DUMPER_MAGIC constants to include/dump/s390_dump.h
Move DUMPER_MAGIC constants from df_s390.h to the global header
include/dump/s390_dump.h in order to reuse it in zipl code.

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:34 +01:00
Mikhail Zaslonko
f3bcd94524 zdump: Add zgetdump -d support for ECKD ldipl-dump
Make 'zgetdump -d' to identify ldipl-dump tool (ngdump) installed on DASD
volume just like it does for NVMe ngdump.

Output sample:
-------------
Dump device info:
  Dump tool.........: Next Generation (NGDump) dump tool
  Version...........: 1
  Architecture......: s390x (64 bit)

Partition info:
  Partition number..: 2

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:34 +01:00
Mikhail Zaslonko
a2f8b19c2a dumpconf: Update the man page and etc/sysconfig/dumpconf template
Update dumpconf man page with list-directed ECKD dump information (new
attributes and configuration example for ECKD LDIPL dump).
Update etc/sysconfig/dumpconf with list-directed ECKD dump configuration
example.

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:34 +01:00
Mikhail Zaslonko
588d720517 dumpconf: Process br_chr and bootprog eckd attributes
- Write the following sysfs attributes for list-directed ECKD devices
  introducing setup_eckd_device() function.
    br_chr: location of boot record
    bootprog: boot program selector
- Remove redundant parameters from setup_ccw_device() and setup_fcp_device()
  functioins.

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:34 +01:00
Ingo Franzki
cd822cb770 zkey: Fix convert command to accept only keys of type CCA-AESDATA
Reject conversion of other key types with a proper error message.
Also fix a typo in another error message of the convert command.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:34 +01:00
Ingo Franzki
b27b8e3cd3 zkey: Fix typos in error message
Use a colon instead of a semicolon in the message.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:34 +01:00
Steffen Maier
7a2c5dc980 zdev/dracut: Fix file mode of non-executable shell library zdev-lib.sh
Use similar `install` mode option in Makefile as in commit
9b2fb1d4d2 ("zdev: add helper to convert from dasd_mod.dasd to zdev
config").

Fixes: 73c46a3056 ("zdev/dracut: fix kdump by only activating required devices")
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-03-15 15:11:28 +01:00
Jan Höppner
d9e3763d1c Prepare for next release
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-02-02 17:49:44 +01:00
Jan Höppner
6f15ed3264 New release s390-tools-2.31.0
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
v2.31.0
2024-02-02 17:49:44 +01:00
Joern Siglen
0d2b5af007 dbginfo.sh: check for DPM mode
check if the LPAR is running in DPM mode and reflect this in the summary.

Suggested-by: Mike Storzer <MSTORZER@de.ibm.com>
Acked-by: Eberhard Pasch <epasch@de.ibm.com>
Reviewed-by: Mario Held <mario.held@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-02-02 16:11:22 +01:00
Jan Höppner
9e7a8f48e8 common.mak: Set default C/C++ standard to gnu11/gnu++11
s390-tools doesn't define a common C/C++ standard at the moment.
Set the standard to gnu11/gnu++11, which is also used by the Kernel, and
establish a common baseline for all tools.

The -std flag is added to ALL_CFLAGS and ALL_CXXFLAGS to avoid losing it
in case CFLAGS are set by an outside entity.
It is also added to CLAGS_FOR_BUILD for this one special cross build
case.

The -std flag is removed from all tools that set it manually until now.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-02-02 16:11:22 +01:00
Steffen Eiden
98f7a0569c rust/pvsecret: User defined signatures and verifications
Introduces the ability to `pvsecret` to add a signature (ecdsa or rsa)
to the program-reserved space (user-data) of an add-secret request
during the request creation. Additionally, some arbitrary data may be
inserted.

The new command `verify` checks if add-secret requests are sane (e.g.
start with the correct magic value). If the request contains a
user-signature `verify` will also verify this signature.

Acked-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-02-02 16:11:22 +01:00
Steffen Eiden
551f66282e rust/pvsecret: Streamline man and README
Makes the source for the manfiles&README more readable. Fixes some nits
like double spaces, unnessecary indentations, line breaks, ...
Removes pvsecret-version.1 as this command maps to the --version
option.

Acked-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-02-02 16:11:22 +01:00
Steffen Eiden
3d2ba5aaed rust/pvsecret: Sync man and help
The output of --help and man pages got out of sync.
Apply changes to the help output to fix this.

Acked-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-02-02 16:11:22 +01:00
Steffen Eiden
94942a48ab rust/pv: Add function to read a private key
Add a function to read a private key in PEM or DER format.

While at it, fix some documentation issues in read_{certs, crls}.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-02-02 16:11:22 +01:00
Steffen Eiden
ab8984a7a3 rust/pv: Remove unused functions
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-02-02 16:11:22 +01:00
Marc Hartmayer
4990f643c1 rust/pv: Add-Secret: Add user-data and user-defined signing keys
User-data can be added to add-secret requests. User-data can be unsigned
or containing a signature of the request using a custom private key.

The user-data is placed at offset 0x218 and 0x200 bytes long.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-02-02 16:11:22 +01:00
Steffen Eiden
34bef977e8 rust/pv: User-data signing and verifying
Add the ability to generate signed user-data and to verify the
signature.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-02-02 16:11:22 +01:00