mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 60c687238d | |||
| 57b992ffa1 | |||
| 1f07a41d5a | |||
| 512b47c004 | |||
| 818ffbc4b0 | |||
| 5e65df7375 | |||
| 4eb80d14a0 | |||
| 7247a61e0b | |||
| c856f28e11 | |||
| ca30cfd341 | |||
| 58ecf1f363 | |||
| d36ff82999 | |||
| d4398aea89 | |||
| 672548ce30 | |||
| 344965bd29 | |||
| d6a96f07c1 | |||
| 6a99d95d4f |
@@ -16,6 +16,7 @@ List of all individuals having contributed content to s390-tools
|
|||||||
- Clemens von Mann
|
- Clemens von Mann
|
||||||
- Dan Horak
|
- Dan Horak
|
||||||
- Despina Papadopoulou
|
- Despina Papadopoulou
|
||||||
|
- Dimitri John Ledkov
|
||||||
- Eberhard Pasch
|
- Eberhard Pasch
|
||||||
- Einar Lueck
|
- Einar Lueck
|
||||||
- Erwin Vicari
|
- Erwin Vicari
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
Release history for s390-tools (MIT version)
|
Release history for s390-tools (MIT version)
|
||||||
--------------------------------------------
|
--------------------------------------------
|
||||||
|
* __v2.6.0 (2018-08-10)__
|
||||||
|
|
||||||
|
For Linux kernel version: 4.18
|
||||||
|
|
||||||
|
Add new tool:
|
||||||
|
- zkey: Add zkey-cryptsetup tool
|
||||||
|
Changes of existing tools:
|
||||||
|
- netboot: add BOOTIF support
|
||||||
|
|
||||||
|
Bug Fixes:
|
||||||
|
- mon_procd: fix parsing of /proc/<pid>/stat
|
||||||
|
- netboot: Include compressed kernel modules in initramfs
|
||||||
|
- netboot: Send client architecture and handle path prefix
|
||||||
|
|
||||||
* __v2.5.0 (2018-06-08)__
|
* __v2.5.0 (2018-06-08)__
|
||||||
|
|
||||||
For Linux kernel version: 4.17
|
For Linux kernel version: 4.17
|
||||||
|
|||||||
@@ -265,6 +265,8 @@ build options:
|
|||||||
| net-snmp | `HAVE_SNMP` | osasnmpd |
|
| net-snmp | `HAVE_SNMP` | osasnmpd |
|
||||||
| glibc-static | `HAVE_LIBC_STATIC` | zfcpdump |
|
| glibc-static | `HAVE_LIBC_STATIC` | zfcpdump |
|
||||||
| openssl | `HAVE_OPENSSL` | zkey |
|
| openssl | `HAVE_OPENSSL` | zkey |
|
||||||
|
| cryptsetup | `HAVE_CRYPTSETUP2` | zkey-cryptsetup |
|
||||||
|
| json-c | `HAVE_JSONC` | zkey-cryptsetup |
|
||||||
|
|
||||||
This table lists additional build or install options:
|
This table lists additional build or install options:
|
||||||
|
|
||||||
@@ -371,8 +373,11 @@ the different tools are provided:
|
|||||||
|
|
||||||
* zkey:
|
* zkey:
|
||||||
For building the zkey tools you need openssl version 0.9.7 or newer installed
|
For building the zkey tools you need openssl version 0.9.7 or newer installed
|
||||||
(openssl-devel.rpm). Tip: you may skip the zkey build by adding
|
(openssl-devel.rpm). Also required are cryptsetup version 2.0.3 or newer
|
||||||
`HAVE_OPENSSL=0` to the make invocation.
|
(cryptsetup-devel.rpm), and json-c version 0.12 or newer (json-c-devel.rpm).
|
||||||
|
Tip: you may skip the zkey build by adding `HAVE_OPENSSL=0`, and you may
|
||||||
|
may skip the zkey-cryptsetup build by adding `HAVE_CRYPTSETUP2=0`, or
|
||||||
|
`HAVE_JSONC=0` to the make invocation.
|
||||||
A new group 'zkeyadm' needs to be created and all users intending to use the
|
A new group 'zkeyadm' needs to be created and all users intending to use the
|
||||||
tool must be added to this group. The owner of the default key repository
|
tool must be added to this group. The owner of the default key repository
|
||||||
'/etc/zkey/repository' must be set to group 'zkeyadm' with write permission
|
'/etc/zkey/repository' must be set to group 'zkeyadm' with write permission
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ COMMON_INCLUDED = true
|
|||||||
# The variable "DISTRELEASE" should be overwritten in rpm spec files with:
|
# The variable "DISTRELEASE" should be overwritten in rpm spec files with:
|
||||||
# "make DISTRELEASE=%{release}" and "make install DISTRELEASE=%{release}"
|
# "make DISTRELEASE=%{release}" and "make install DISTRELEASE=%{release}"
|
||||||
VERSION = 2
|
VERSION = 2
|
||||||
RELEASE = 5
|
RELEASE = 6
|
||||||
PATCHLEVEL = 0
|
PATCHLEVEL = 0
|
||||||
DISTRELEASE = build-$(shell date +%Y%m%d)
|
DISTRELEASE = build-$(shell date +%Y%m%d)
|
||||||
S390_TOOLS_RELEASE = $(VERSION).$(RELEASE).$(PATCHLEVEL)-$(DISTRELEASE)
|
S390_TOOLS_RELEASE = $(VERSION).$(RELEASE).$(PATCHLEVEL)-$(DISTRELEASE)
|
||||||
|
|||||||
@@ -594,17 +594,18 @@ static void cal_task_pcpu(struct task_t *task, const unsigned long long tics)
|
|||||||
*/
|
*/
|
||||||
static int read_stat(struct task_t *task)
|
static int read_stat(struct task_t *task)
|
||||||
{
|
{
|
||||||
int ppid, tty, proc;
|
unsigned long long maj_flt = 0, utime = 0, stime = 0, cutime = 0,
|
||||||
unsigned long flags, pri, nice;
|
cstime = 0;
|
||||||
unsigned long long maj_flt, utime, stime, cutime, cstime;
|
unsigned long flags = 0, pri = 0, nice = 0;
|
||||||
char *cmd_start, *cmd_end, *cmdlenp, *cmdp;
|
char *cmd_start, *cmd_end, *cmdlenp, *cmdp;
|
||||||
|
int ppid = 0, tty = 0, proc = 0, rc;
|
||||||
|
|
||||||
snprintf(fname, sizeof(fname), "/proc/%u/stat", task->pid);
|
snprintf(fname, sizeof(fname), "/proc/%u/stat", task->pid);
|
||||||
if (read_file(fname, buf, sizeof(buf) - 1) == -1)
|
if (read_file(fname, buf, sizeof(buf) - 1) == -1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
cmd_start = strchr(buf, '(') + 1;
|
cmd_start = strchr(buf, '(') + 1;
|
||||||
cmd_end = strchr(cmd_start, ')');
|
cmd_end = strrchr(cmd_start, ')');
|
||||||
name_lens.cmd_len = cmd_end - cmd_start;
|
name_lens.cmd_len = cmd_end - cmd_start;
|
||||||
cmdlenp = mon_record + sizeof(struct monwrite_hdr);
|
cmdlenp = mon_record + sizeof(struct monwrite_hdr);
|
||||||
cmdlenp += sizeof(struct procd_hdr);
|
cmdlenp += sizeof(struct procd_hdr);
|
||||||
@@ -625,7 +626,7 @@ static int read_stat(struct task_t *task)
|
|||||||
memcpy(cmdlenp, &name_lens.cmd_len, sizeof(__u16));
|
memcpy(cmdlenp, &name_lens.cmd_len, sizeof(__u16));
|
||||||
|
|
||||||
cmd_end += 2;
|
cmd_end += 2;
|
||||||
sscanf(cmd_end,
|
rc = sscanf(cmd_end,
|
||||||
"%c %d %*d %*d %d %*d "
|
"%c %d %*d %*d %d %*d "
|
||||||
"%lu %*s %*s %Lu %*s "
|
"%lu %*s %*s %Lu %*s "
|
||||||
"%Lu %Lu %Lu %Lu "
|
"%Lu %Lu %Lu %Lu "
|
||||||
@@ -642,6 +643,8 @@ static int read_stat(struct task_t *task)
|
|||||||
&utime, &stime, &cutime, &cstime,
|
&utime, &stime, &cutime, &cstime,
|
||||||
&pri, &nice,
|
&pri, &nice,
|
||||||
&proc);
|
&proc);
|
||||||
|
if (rc != 12)
|
||||||
|
syslog(LOG_ERR, "bad data in %s \n", fname);
|
||||||
task->ppid = (__u32)ppid;
|
task->ppid = (__u32)ppid;
|
||||||
task->tty = (__u16)tty;
|
task->tty = (__u16)tty;
|
||||||
task->flags = (__u32)flags;
|
task->flags = (__u32)flags;
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ echo "$cmd: Copying virtio modules"
|
|||||||
mkdir -p $builddir/$netdir
|
mkdir -p $builddir/$netdir
|
||||||
mkdir -p $builddir/$blkdir
|
mkdir -p $builddir/$blkdir
|
||||||
set +e
|
set +e
|
||||||
cp $netdir/virtio_net.ko $builddir/$netdir 2> /dev/null
|
cp $netdir/virtio_net.ko* $builddir/$netdir 2> /dev/null
|
||||||
cp $blkdir/virtio_blk.ko $builddir/$blkdir 2> /dev/null
|
cp $blkdir/virtio_blk.ko* $builddir/$blkdir 2> /dev/null
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Busybox (+ dependencies)
|
# Busybox (+ dependencies)
|
||||||
@@ -170,7 +170,7 @@ cat <<'EOF' > $builddir/init
|
|||||||
/bin/mount -t tmpfs none /run
|
/bin/mount -t tmpfs none /run
|
||||||
|
|
||||||
/sbin/modprobe virtio_net
|
/sbin/modprobe virtio_net
|
||||||
/sbin/udhcpc -O pxeconffile -O pxepathprefix &
|
/sbin/udhcpc -O pxeconffile -O pxepathprefix -x 93:001F &
|
||||||
|
|
||||||
/sbin/pxeboot.script
|
/sbin/pxeboot.script
|
||||||
EOF
|
EOF
|
||||||
@@ -237,6 +237,7 @@ case "$1" in
|
|||||||
echo " router: $router"
|
echo " router: $router"
|
||||||
echo " domain: $domain $dns"
|
echo " domain: $domain $dns"
|
||||||
echo " tftp: $siaddr"
|
echo " tftp: $siaddr"
|
||||||
|
echo " pxepathprefix: $pxepathprefix"
|
||||||
# flush routes
|
# flush routes
|
||||||
/sbin/ip route flush table all
|
/sbin/ip route flush table all
|
||||||
# setup if link
|
# setup if link
|
||||||
@@ -272,6 +273,7 @@ case "$1" in
|
|||||||
echo "siaddr=$siaddr" > $PXECONF
|
echo "siaddr=$siaddr" > $PXECONF
|
||||||
echo "interface=$interface" >> $PXECONF
|
echo "interface=$interface" >> $PXECONF
|
||||||
echo "ip=$ip" >> $PXECONF
|
echo "ip=$ip" >> $PXECONF
|
||||||
|
echo "pxepathprefix=$pxepathprefix" >> $PXECONF
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -354,7 +356,7 @@ then
|
|||||||
for c in $CONFIGS
|
for c in $CONFIGS
|
||||||
do
|
do
|
||||||
echo "fetching config pxelinux.cfg/$c from $siaddr"
|
echo "fetching config pxelinux.cfg/$c from $siaddr"
|
||||||
if /usr/bin/tftp -g -l /tmp/config -r pxelinux.cfg/$c $siaddr
|
if /usr/bin/tftp -g -l /tmp/config -r ${pxepathprefix}pxelinux.cfg/$c $siaddr
|
||||||
then
|
then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@@ -371,6 +373,7 @@ fi
|
|||||||
kernel=$(/bin/grep -i "^[[:space:]]*kernel" /tmp/config | sed "s/^[[:space:]]*kernel[[:space:]]*//I")
|
kernel=$(/bin/grep -i "^[[:space:]]*kernel" /tmp/config | sed "s/^[[:space:]]*kernel[[:space:]]*//I")
|
||||||
initrd=$(/bin/grep -i "^[[:space:]]*initrd" /tmp/config | sed "s/^[[:space:]]*initrd[[:space:]]*//I")
|
initrd=$(/bin/grep -i "^[[:space:]]*initrd" /tmp/config | sed "s/^[[:space:]]*initrd[[:space:]]*//I")
|
||||||
append=$(/bin/grep -i "^[[:space:]]*append" /tmp/config | sed "s/^[[:space:]]*append[[:space:]]*//I")
|
append=$(/bin/grep -i "^[[:space:]]*append" /tmp/config | sed "s/^[[:space:]]*append[[:space:]]*//I")
|
||||||
|
ipappend=$(/bin/grep -i "^[[:space:]]*ipappend" /tmp/config | sed "s/^[[:space:]]*ipappend[[:space:]]*//I")
|
||||||
|
|
||||||
if [ -z "$kernel" ]
|
if [ -z "$kernel" ]
|
||||||
then
|
then
|
||||||
@@ -378,13 +381,13 @@ then
|
|||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
echo fetch kernel $kernel from $siaddr
|
echo fetch kernel $kernel from $siaddr
|
||||||
/usr/bin/tftp -g -l /tmp/kernel -r $kernel $siaddr
|
/usr/bin/tftp -g -l /tmp/kernel -r $pxepathprefix$kernel $siaddr
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$initrd" ]
|
if [ -n "$initrd" ]
|
||||||
then
|
then
|
||||||
echo fetch initrd $initrd from $siaddr
|
echo fetch initrd $initrd from $siaddr
|
||||||
/usr/bin/tftp -g -l /tmp/initrd -r $initrd $siaddr
|
/usr/bin/tftp -g -l /tmp/initrd -r $pxepathprefix$initrd $siaddr
|
||||||
INITRD="--initrd=/tmp/initrd"
|
INITRD="--initrd=/tmp/initrd"
|
||||||
else
|
else
|
||||||
INITRD=""
|
INITRD=""
|
||||||
@@ -394,6 +397,9 @@ if [ -z "$append" ]; then
|
|||||||
echo "Kexec load: kexec -l /tmp/kernel $INITRD"
|
echo "Kexec load: kexec -l /tmp/kernel $INITRD"
|
||||||
kexec -l /tmp/kernel $INITRD
|
kexec -l /tmp/kernel $INITRD
|
||||||
else
|
else
|
||||||
|
if [ "$ipappend" = "2" ]; then
|
||||||
|
$append="$append BOOTIF=01-$ifaddr"
|
||||||
|
fi
|
||||||
echo "Kexec load: kexec -l /tmp/kernel $INITRD --append=\"$append\""
|
echo "Kexec load: kexec -l /tmp/kernel $INITRD --append=\"$append\""
|
||||||
kexec -l /tmp/kernel $INITRD --append="$append"
|
kexec -l /tmp/kernel $INITRD --append="$append"
|
||||||
fi
|
fi
|
||||||
|
|||||||
+23
-16
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# dbginfo.sh - Tool to collect runtime, configuration, and trace information
|
# dbginfo.sh - Tool to collect runtime, configuration, and trace information
|
||||||
#
|
#
|
||||||
# Copyright IBM Corp. 2002, 2017
|
# Copyright IBM Corp. 2002, 2018
|
||||||
#
|
#
|
||||||
# s390-tools is free software; you can redistribute it and/or modify
|
# s390-tools is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the MIT license. See LICENSE for details.
|
# it under the terms of the MIT license. See LICENSE for details.
|
||||||
@@ -21,7 +21,7 @@ readonly SCRIPTNAME="${0##*/}"
|
|||||||
print_version() {
|
print_version() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
${SCRIPTNAME}: Debug information script version %S390_TOOLS_VERSION%
|
${SCRIPTNAME}: Debug information script version %S390_TOOLS_VERSION%
|
||||||
Copyright IBM Corp. 2002, 2017
|
Copyright IBM Corp. 2002, 2018
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -480,6 +480,7 @@ VM_CMDS="q userid\
|
|||||||
:q cpus\
|
:q cpus\
|
||||||
:q srm\
|
:q srm\
|
||||||
:q vtod\
|
:q vtod\
|
||||||
|
:q time full\
|
||||||
:q timezone\
|
:q timezone\
|
||||||
:q loaddev\
|
:q loaddev\
|
||||||
:q v osa\
|
:q v osa\
|
||||||
@@ -1016,25 +1017,31 @@ environment_setup()
|
|||||||
# create gzip-ped tar file
|
# create gzip-ped tar file
|
||||||
create_package()
|
create_package()
|
||||||
{
|
{
|
||||||
|
local rc_tar
|
||||||
pr_stdout "Finalizing: Creating archive with collected data"
|
pr_stdout "Finalizing: Creating archive with collected data"
|
||||||
cd "${WORKDIR_BASE}"
|
cd "${WORKDIR_BASE}"
|
||||||
|
|
||||||
if ! tar -czf "${WORKARCHIVE}" "${WORKDIR_CURRENT}"; then
|
tar -czf "${WORKARCHIVE}" "${WORKDIR_CURRENT}"
|
||||||
pr_stdout " "
|
rc_tar=$?
|
||||||
pr_stdout "${SCRIPTNAME}: Error: Collection of data failed!"
|
if [ $rc_tar -eq 0 ]; then
|
||||||
pr_stdout " The creation of \"${WORKARCHIVE}\" was not successful."
|
chmod 0600 "${WORKARCHIVE}"
|
||||||
pr_stdout " Please check the directory \"${WORKDIR_BASE}\""
|
pr_stdout " "
|
||||||
pr_stdout " to provide enough free available space."
|
pr_stdout "Collected data was saved to:"
|
||||||
|
pr_stdout " >> ${WORKARCHIVE} <<"
|
||||||
|
pr_stdout " "
|
||||||
|
pr_stdout "Review the collected data before sending to your service organization. "
|
||||||
|
pr_stdout " "
|
||||||
|
elif [ $rc_tar -eq 127 ]; then
|
||||||
|
pr_stdout " "
|
||||||
|
pr_stdout "${SCRIPTNAME}: Error: tar command is not available!"
|
||||||
|
pr_stdout " Please install the corresponding package!"
|
||||||
else
|
else
|
||||||
chmod 0600 "${WORKARCHIVE}"
|
pr_stdout " "
|
||||||
pr_stdout " "
|
pr_stdout "${SCRIPTNAME}: Error: Collection of data failed!"
|
||||||
pr_stdout "Collected data was saved to:"
|
pr_stdout " The creation of \"${WORKARCHIVE}\" was not successful."
|
||||||
pr_stdout " >> ${WORKARCHIVE} <<"
|
pr_stdout " Please check the directory \"${WORKDIR_BASE}\""
|
||||||
|
pr_stdout " to provide enough free available space."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pr_stdout " "
|
|
||||||
pr_stdout "Review the collected data before sending to your service organization. "
|
|
||||||
pr_stdout " "
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,10 @@ In rare situations a device might temporarily not be accessible to
|
|||||||
the subchannel. Then "none" is displayed as the device identifier and the
|
the subchannel. Then "none" is displayed as the device identifier and the
|
||||||
other device attributes are empty.
|
other device attributes are empty.
|
||||||
|
|
||||||
|
For subchannels bound to an alternate driver (most notably vfio_ccw) the
|
||||||
|
device identifier may also be displayed as "none". In this case use the
|
||||||
|
\fB--vfio\fR option to show VFIO specific subchannel information.
|
||||||
|
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
.nf
|
.nf
|
||||||
This man-page was written by Stefan Bader <shbader@de.ibm.com>.
|
This man-page was written by Stefan Bader <shbader@de.ibm.com>.
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
#define UDEV_SUFFIX ".rules"
|
#define UDEV_SUFFIX ".rules"
|
||||||
|
|
||||||
#define PATH_MODPROBE_CONF "/etc/modprobe.d"
|
#define PATH_MODPROBE_CONF "/etc/modprobe.d"
|
||||||
#define PATH_MODPROBE "/usr/sbin/modprobe"
|
#define PATH_MODPROBE "/sbin/modprobe"
|
||||||
#define PATH_CCW_BUS "/sys/bus/ccw"
|
#define PATH_CCW_BUS "/sys/bus/ccw"
|
||||||
#define PATH_CCWGROUP_BUS "/sys/bus/ccwgroup"
|
#define PATH_CCWGROUP_BUS "/sys/bus/ccwgroup"
|
||||||
#define PATH_UDEV_RULES "/etc/udev/rules.d"
|
#define PATH_UDEV_RULES "/etc/udev/rules.d"
|
||||||
|
|||||||
+69
-19
@@ -1,47 +1,97 @@
|
|||||||
include ../common.mak
|
include ../common.mak
|
||||||
|
|
||||||
ifeq (${HAVE_OPENSSL},0)
|
ifneq (${HAVE_OPENSSL},0)
|
||||||
|
BUILD_TARGETS += zkey
|
||||||
all:
|
INSTALL_TARGETS += install-zkey
|
||||||
$(SKIP) HAVE_OPENSSL=0
|
|
||||||
|
|
||||||
install:
|
|
||||||
$(SKIP) HAVE_OPENSSL=0
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
BUILD_TARGETS += zkey-skip
|
||||||
|
INSTALL_TARGETS += zkey-skip
|
||||||
|
endif
|
||||||
|
|
||||||
check_dep:
|
ifneq (${HAVE_CRYPTSETUP2},0)
|
||||||
|
ifneq (${HAVE_JSONC},0)
|
||||||
|
BUILD_TARGETS += zkey-cryptsetup
|
||||||
|
INSTALL_TARGETS += install-zkey-cryptsetup
|
||||||
|
CPPFLAGS += -DHAVE_LUKS2_SUPPORT
|
||||||
|
else
|
||||||
|
BUILD_TARGETS += zkey-cryptsetup-skip-jsonc
|
||||||
|
INSTALL_TARGETS += zkey-cryptsetup-skip-jsonc
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
BUILD_TARGETS += zkey-cryptsetup-skip-cryptsetup2
|
||||||
|
INSTALL_TARGETS += zkey-cryptsetup-skip-cryptsetup2
|
||||||
|
endif
|
||||||
|
|
||||||
|
CPPFLAGS += -I../include
|
||||||
|
LIBS = $(rootdir)/libutil/libutil.a
|
||||||
|
|
||||||
|
detect-libcryptsetup.h:
|
||||||
|
echo "#include <libcryptsetup.h>" > detect-libcryptsetup.h
|
||||||
|
echo "#ifndef CRYPT_LUKS2" >> detect-libcryptsetup.h
|
||||||
|
echo " #error libcryptsetup version 2.0.3 is required" >> detect-libcryptsetup.h
|
||||||
|
echo "#endif" >> detect-libcryptsetup.h
|
||||||
|
echo "int i = CRYPT_SLOT_UNBOUND;" >> detect-libcryptsetup.h
|
||||||
|
|
||||||
|
check-dep-zkey:
|
||||||
$(call check_dep, \
|
$(call check_dep, \
|
||||||
"zkey", \
|
"zkey", \
|
||||||
"openssl/evp.h", \
|
"openssl/evp.h", \
|
||||||
"openssl-devel", \
|
"openssl-devel", \
|
||||||
"HAVE_OPENSSL=0")
|
"HAVE_OPENSSL=0")
|
||||||
|
|
||||||
CPPFLAGS += -I../include
|
check-dep-zkey-cryptsetup: detect-libcryptsetup.h
|
||||||
LDLIBS += -ldl -lcrypto
|
$(call check_dep, \
|
||||||
|
"zkey-cryptsetup", \
|
||||||
|
"detect-libcryptsetup.h", \
|
||||||
|
"cryptsetup-devel version 2.0.3", \
|
||||||
|
"HAVE_CRYPTSETUP2=0", \
|
||||||
|
"-I.")
|
||||||
|
$(call check_dep, \
|
||||||
|
"zkey-cryptsetup", \
|
||||||
|
"json-c/json.h", \
|
||||||
|
"json-c-devel", \
|
||||||
|
"HAVE_JSONC=0")
|
||||||
|
|
||||||
all: check_dep zkey
|
zkey-skip:
|
||||||
|
echo " SKIP zkey due to HAVE_OPENSSL=0"
|
||||||
|
|
||||||
libs = $(rootdir)/libutil/libutil.a
|
zkey-cryptsetup-skip-cryptsetup2:
|
||||||
|
echo " SKIP zkey-cryptsetup due to HAVE_CRYPTSETUP2=0"
|
||||||
|
|
||||||
|
zkey-cryptsetup-skip-jsonc:
|
||||||
|
echo " SKIP zkey-cryptsetup due to HAVE_JSONC=0"
|
||||||
|
|
||||||
|
all: $(BUILD_TARGETS)
|
||||||
|
|
||||||
zkey.o: zkey.c pkey.h misc.h
|
zkey.o: zkey.c pkey.h misc.h
|
||||||
pkey.o: pkey.c pkey.h
|
pkey.o: pkey.c pkey.h
|
||||||
properties.o: properties.c properties.h
|
properties.o: check-dep-zkey properties.c properties.h
|
||||||
keystore.o: keystore.c keystore.h properties.h
|
keystore.o: keystore.c keystore.h properties.h
|
||||||
|
zkey-cryptsetup.o: check-dep-zkey-cryptsetup zkey-cryptsetup.c pkey.h misc.h
|
||||||
|
|
||||||
zkey: zkey.o pkey.o properties.o keystore.o $(libs)
|
zkey: LDLIBS = -ldl -lcrypto
|
||||||
|
zkey: zkey.o pkey.o properties.o keystore.o $(LIBS)
|
||||||
|
|
||||||
install: all
|
zkey-cryptsetup: LDLIBS = -ldl -lcryptsetup -ljson-c
|
||||||
|
zkey-cryptsetup: zkey-cryptsetup.o pkey.o $(LIBS)
|
||||||
|
|
||||||
|
install-common:
|
||||||
$(INSTALL) -d -m 755 $(DESTDIR)$(USRBINDIR)
|
$(INSTALL) -d -m 755 $(DESTDIR)$(USRBINDIR)
|
||||||
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 zkey $(DESTDIR)$(USRBINDIR)
|
|
||||||
$(INSTALL) -d -m 755 $(DESTDIR)$(MANDIR)/man1
|
$(INSTALL) -d -m 755 $(DESTDIR)$(MANDIR)/man1
|
||||||
|
|
||||||
|
install-zkey:
|
||||||
|
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 zkey $(DESTDIR)$(USRBINDIR)
|
||||||
$(INSTALL) -m 644 -c zkey.1 $(DESTDIR)$(MANDIR)/man1
|
$(INSTALL) -m 644 -c zkey.1 $(DESTDIR)$(MANDIR)/man1
|
||||||
$(INSTALL) -d -m 770 $(DESTDIR)$(SYSCONFDIR)/zkey
|
$(INSTALL) -d -m 770 $(DESTDIR)$(SYSCONFDIR)/zkey
|
||||||
$(INSTALL) -d -m 770 $(DESTDIR)$(SYSCONFDIR)/zkey/repository
|
$(INSTALL) -d -m 770 $(DESTDIR)$(SYSCONFDIR)/zkey/repository
|
||||||
|
|
||||||
endif
|
install-zkey-cryptsetup:
|
||||||
|
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 zkey-cryptsetup $(DESTDIR)$(USRBINDIR)
|
||||||
|
$(INSTALL) -m 644 -c zkey-cryptsetup.1 $(DESTDIR)$(MANDIR)/man1
|
||||||
|
|
||||||
|
install: all install-common $(INSTALL_TARGETS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o zkey
|
rm -f *.o zkey zkey-cryptsetup detect-libcryptsetup.h
|
||||||
|
|
||||||
.PHONY: all install clean
|
.PHONY: all install clean
|
||||||
|
|||||||
+487
-97
File diff suppressed because it is too large
Load Diff
+9
-6
@@ -30,16 +30,17 @@ int keystore_generate_key(struct keystore *keystore, const char *name,
|
|||||||
const char *description, const char *volumes,
|
const char *description, const char *volumes,
|
||||||
const char *apqns, size_t sector_size,
|
const char *apqns, size_t sector_size,
|
||||||
size_t keybits, bool xts, const char *clear_key_file,
|
size_t keybits, bool xts, const char *clear_key_file,
|
||||||
int pkey_fd);
|
const char *volume_type, int pkey_fd);
|
||||||
|
|
||||||
int keystore_import_key(struct keystore *keystore, const char *name,
|
int keystore_import_key(struct keystore *keystore, const char *name,
|
||||||
const char *description, const char *volumes,
|
const char *description, const char *volumes,
|
||||||
const char *apqns, size_t sector_size,
|
const char *apqns, size_t sector_size,
|
||||||
const char *import_file);
|
const char *import_file, const char *volume_type);
|
||||||
|
|
||||||
int keystore_change_key(struct keystore *keystore, const char *name,
|
int keystore_change_key(struct keystore *keystore, const char *name,
|
||||||
const char *description, const char *volumes,
|
const char *description, const char *volumes,
|
||||||
const char *apqns, long int sector_size);
|
const char *apqns, long int sector_size,
|
||||||
|
const char *volume_type);
|
||||||
|
|
||||||
int keystore_rename_key(struct keystore *keystore, const char *name,
|
int keystore_rename_key(struct keystore *keystore, const char *name,
|
||||||
const char *newname);
|
const char *newname);
|
||||||
@@ -63,12 +64,14 @@ int keystore_remove_key(struct keystore *keystore, const char *name,
|
|||||||
bool quiet);
|
bool quiet);
|
||||||
|
|
||||||
int keystore_list_keys(struct keystore *keystore, const char *name_filter,
|
int keystore_list_keys(struct keystore *keystore, const char *name_filter,
|
||||||
const char *volume_filter, const char *apqn_filter);
|
const char *volume_filter, const char *apqn_filter,
|
||||||
|
const char *volume_type);
|
||||||
|
|
||||||
int keystore_cryptsetup(struct keystore *keystore, const char *volume_filter,
|
int keystore_cryptsetup(struct keystore *keystore, const char *volume_filter,
|
||||||
bool execute);
|
bool execute, const char *volume_type);
|
||||||
|
|
||||||
int keystore_crypttab(struct keystore *keystore, const char *volume_filter);
|
int keystore_crypttab(struct keystore *keystore, const char *volume_filter,
|
||||||
|
const char *volume_type);
|
||||||
|
|
||||||
void keystore_free(struct keystore *keystore);
|
void keystore_free(struct keystore *keystore);
|
||||||
|
|
||||||
|
|||||||
+158
@@ -11,11 +11,13 @@
|
|||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <linux/if_alg.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
@@ -25,6 +27,12 @@
|
|||||||
|
|
||||||
#include "pkey.h"
|
#include "pkey.h"
|
||||||
|
|
||||||
|
#ifndef AF_ALG
|
||||||
|
#define AF_ALG 38
|
||||||
|
#endif
|
||||||
|
#ifndef SOL_ALG
|
||||||
|
#define SOL_ALG 279
|
||||||
|
#endif
|
||||||
|
|
||||||
#define pr_verbose(verbose, fmt...) do { \
|
#define pr_verbose(verbose, fmt...) do { \
|
||||||
if (verbose) \
|
if (verbose) \
|
||||||
@@ -34,6 +42,8 @@
|
|||||||
#define DOUBLE_KEYSIZE_FOR_XTS(keysize, xts) ((xts) ? 2 * (keysize) : (keysize))
|
#define DOUBLE_KEYSIZE_FOR_XTS(keysize, xts) ((xts) ? 2 * (keysize) : (keysize))
|
||||||
#define HALF_KEYSIZE_FOR_XTS(keysize, xts) ((xts) ? (keysize) / 2 : (keysize))
|
#define HALF_KEYSIZE_FOR_XTS(keysize, xts) ((xts) ? (keysize) / 2 : (keysize))
|
||||||
|
|
||||||
|
#define MAX_CIPHER_LEN 32
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definitions for the CCA library
|
* Definitions for the CCA library
|
||||||
*/
|
*/
|
||||||
@@ -367,6 +377,8 @@ int generate_secure_key_random(int pkey_fd, const char *keyfile,
|
|||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
rc = -errno;
|
rc = -errno;
|
||||||
warnx("Failed to generate a secure key: %s", strerror(errno));
|
warnx("Failed to generate a secure key: %s", strerror(errno));
|
||||||
|
warnx("Make sure that all available CCA crypto adapters are "
|
||||||
|
"setup with the same master key");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,6 +390,8 @@ int generate_secure_key_random(int pkey_fd, const char *keyfile,
|
|||||||
rc = -errno;
|
rc = -errno;
|
||||||
warnx("Failed to generate a secure key: %s",
|
warnx("Failed to generate a secure key: %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
warnx("Make sure that all available CCA crypto "
|
||||||
|
"adapters are setup with the same master key");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,6 +479,8 @@ int generate_secure_key_clear(int pkey_fd, const char *keyfile,
|
|||||||
rc = -errno;
|
rc = -errno;
|
||||||
warnx("Failed to generate a secure key from a "
|
warnx("Failed to generate a secure key from a "
|
||||||
"clear key: %s", strerror(errno));
|
"clear key: %s", strerror(errno));
|
||||||
|
warnx("Make sure that all available CCA crypto adapters are "
|
||||||
|
"setup with the same master key");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -479,6 +495,8 @@ int generate_secure_key_clear(int pkey_fd, const char *keyfile,
|
|||||||
rc = -errno;
|
rc = -errno;
|
||||||
warnx("Failed to generate a secure key from "
|
warnx("Failed to generate a secure key from "
|
||||||
"a clear key: %s", strerror(errno));
|
"a clear key: %s", strerror(errno));
|
||||||
|
warnx("Make sure that all available CCA crypto "
|
||||||
|
"adapters are setup with the same master key");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -746,3 +764,143 @@ int validate_secure_key(int pkey_fd,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a key verification pattern of a secure key by encrypting the all
|
||||||
|
* zero message with the secure key using the AF_ALG interface
|
||||||
|
*
|
||||||
|
* @param[in] key the secure key token
|
||||||
|
* @param[in] key_size the size of the secure key
|
||||||
|
* @param[in] vp buffer where the verification pattern is returned
|
||||||
|
* @param[in] vp_len the size of the buffer
|
||||||
|
* @param[in] verbose if true, verbose messages are printed
|
||||||
|
*
|
||||||
|
* @returns 0 on success, a negative errno in case of an error
|
||||||
|
*/
|
||||||
|
int generate_key_verification_pattern(const char *key, size_t key_size,
|
||||||
|
char *vp, size_t vp_len, bool verbose)
|
||||||
|
{
|
||||||
|
int tfmfd = -1, opfd = -1, rc = 0;
|
||||||
|
char null_msg[ENC_ZERO_LEN];
|
||||||
|
char enc_zero[ENC_ZERO_LEN];
|
||||||
|
struct af_alg_iv *alg_iv;
|
||||||
|
struct cmsghdr *header;
|
||||||
|
uint32_t *type;
|
||||||
|
ssize_t len;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
struct sockaddr_alg sa = {
|
||||||
|
.salg_family = AF_ALG,
|
||||||
|
.salg_type = "skcipher",
|
||||||
|
};
|
||||||
|
struct iovec iov = {
|
||||||
|
.iov_base = (void *)null_msg,
|
||||||
|
.iov_len = sizeof(null_msg),
|
||||||
|
};
|
||||||
|
int iv_msg_size = CMSG_SPACE(sizeof(*alg_iv) + PAES_BLOCK_SIZE);
|
||||||
|
char buffer[CMSG_SPACE(sizeof(*type)) + iv_msg_size];
|
||||||
|
struct msghdr msg = {
|
||||||
|
.msg_control = buffer,
|
||||||
|
.msg_controllen = sizeof(buffer),
|
||||||
|
.msg_iov = &iov,
|
||||||
|
.msg_iovlen = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (vp_len < VERIFICATION_PATTERN_LEN) {
|
||||||
|
rc = -EMSGSIZE;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
snprintf((char *)sa.salg_name, sizeof(sa.salg_name), "%s(paes)",
|
||||||
|
key_size > SECURE_KEY_SIZE ? "xts" : "cbc");
|
||||||
|
|
||||||
|
tfmfd = socket(AF_ALG, SOCK_SEQPACKET, 0);
|
||||||
|
if (tfmfd < 0) {
|
||||||
|
rc = -errno;
|
||||||
|
pr_verbose(verbose, "Failed to open an AF_ALG socket");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bind(tfmfd, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
|
||||||
|
rc = -errno;
|
||||||
|
pr_verbose(verbose, "Failed to bind the AF_ALG socket, "
|
||||||
|
"salg_name='%s' ", sa.salg_name);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (setsockopt(tfmfd, SOL_ALG, ALG_SET_KEY, key,
|
||||||
|
key_size) < 0) {
|
||||||
|
rc = -errno;
|
||||||
|
pr_verbose(verbose, "Failed to set the key");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
opfd = accept(tfmfd, NULL, 0);
|
||||||
|
if (opfd < 0) {
|
||||||
|
rc = -errno;
|
||||||
|
pr_verbose(verbose, "Failed to accept on the AF_ALG socket");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(null_msg, 0, sizeof(null_msg));
|
||||||
|
memset(buffer, 0, sizeof(buffer));
|
||||||
|
|
||||||
|
header = CMSG_FIRSTHDR(&msg);
|
||||||
|
if (header == NULL) {
|
||||||
|
pr_verbose(verbose, "Failed to obtain control message header");
|
||||||
|
rc = -EINVAL;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
header->cmsg_level = SOL_ALG;
|
||||||
|
header->cmsg_type = ALG_SET_OP;
|
||||||
|
header->cmsg_len = CMSG_LEN(sizeof(*type));
|
||||||
|
type = (void *)CMSG_DATA(header);
|
||||||
|
*type = ALG_OP_ENCRYPT;
|
||||||
|
|
||||||
|
header = CMSG_NXTHDR(&msg, header);
|
||||||
|
if (header == NULL) {
|
||||||
|
pr_verbose(verbose, "Failed to obtain control message "
|
||||||
|
"header");
|
||||||
|
rc = -EINVAL;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
header->cmsg_level = SOL_ALG;
|
||||||
|
header->cmsg_type = ALG_SET_IV;
|
||||||
|
header->cmsg_len = iv_msg_size;
|
||||||
|
alg_iv = (void *)CMSG_DATA(header);
|
||||||
|
alg_iv->ivlen = PAES_BLOCK_SIZE;
|
||||||
|
memcpy(alg_iv->iv, null_msg, PAES_BLOCK_SIZE);
|
||||||
|
|
||||||
|
len = sendmsg(opfd, &msg, 0);
|
||||||
|
if (len != ENC_ZERO_LEN) {
|
||||||
|
pr_verbose(verbose, "Failed to send to the AF_ALG socket");
|
||||||
|
rc = -errno;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
len = read(opfd, enc_zero, sizeof(enc_zero));
|
||||||
|
if (len != ENC_ZERO_LEN) {
|
||||||
|
pr_verbose(verbose, "Failed to receive from the AF_ALG socket");
|
||||||
|
rc = -errno;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(vp, 0, vp_len);
|
||||||
|
for (i = 0; i < sizeof(enc_zero); i++)
|
||||||
|
sprintf(&vp[i * 2], "%02x", enc_zero[i]);
|
||||||
|
|
||||||
|
pr_verbose(verbose, "Key verification pattern: %s", vp);
|
||||||
|
|
||||||
|
out:
|
||||||
|
if (opfd != -1)
|
||||||
|
close(opfd);
|
||||||
|
if (tfmfd != -1)
|
||||||
|
close(tfmfd);
|
||||||
|
|
||||||
|
if (rc != 0)
|
||||||
|
pr_verbose(verbose, "Failed to generate the key verification "
|
||||||
|
"pattern: %s", strerror(-rc));
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|||||||
@@ -93,6 +93,10 @@ typedef void (*t_CSNBKTC)(long *return_code,
|
|||||||
unsigned char *rule_array,
|
unsigned char *rule_array,
|
||||||
unsigned char *key_identifier);
|
unsigned char *key_identifier);
|
||||||
|
|
||||||
|
#define PAES_BLOCK_SIZE 16
|
||||||
|
#define ENC_ZERO_LEN (2 * PAES_BLOCK_SIZE)
|
||||||
|
#define VERIFICATION_PATTERN_LEN (2 * ENC_ZERO_LEN + 1)
|
||||||
|
|
||||||
int load_cca_library(void **lib_csulcca, t_CSNBKTC *dll_CSNBKTC, bool verbose);
|
int load_cca_library(void **lib_csulcca, t_CSNBKTC *dll_CSNBKTC, bool verbose);
|
||||||
|
|
||||||
int open_pkey_device(bool verbose);
|
int open_pkey_device(bool verbose);
|
||||||
@@ -122,4 +126,7 @@ int key_token_change(t_CSNBKTC dll_CSNBKTC,
|
|||||||
u8 *secure_key, unsigned int secure_key_size,
|
u8 *secure_key, unsigned int secure_key_size,
|
||||||
char *method, bool verbose);
|
char *method, bool verbose);
|
||||||
|
|
||||||
|
int generate_key_verification_pattern(const char *key, size_t key_size,
|
||||||
|
char *vp, size_t vp_len, bool verbose);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ void properties_free(struct properties *properties)
|
|||||||
free(property->name);
|
free(property->name);
|
||||||
free(property->value);
|
free(property->value);
|
||||||
util_list_remove(&properties->list, property);
|
util_list_remove(&properties->list, property);
|
||||||
|
free(property);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(properties);
|
free(properties);
|
||||||
@@ -259,6 +260,7 @@ int properties_remove(struct properties *properties, const char *name)
|
|||||||
free(property->name);
|
free(property->name);
|
||||||
free(property->value);
|
free(property->value);
|
||||||
util_list_remove(&properties->list, property);
|
util_list_remove(&properties->list, property);
|
||||||
|
free(property);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,10 +616,13 @@ char *str_list_remove(const char *str_list, const char *str)
|
|||||||
*/
|
*/
|
||||||
void str_list_free_string_array(char **strings)
|
void str_list_free_string_array(char **strings)
|
||||||
{
|
{
|
||||||
|
char **list = strings;
|
||||||
|
|
||||||
util_assert(strings != NULL, "Internal error: strings is NULL");
|
util_assert(strings != NULL, "Internal error: strings is NULL");
|
||||||
|
|
||||||
while (*strings != NULL) {
|
while (*strings != NULL) {
|
||||||
free((void *)*strings);
|
free((void *)*strings);
|
||||||
strings++;
|
strings++;
|
||||||
}
|
}
|
||||||
|
free(list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,403 @@
|
|||||||
|
.\" Copyright IBM Corp. 2018
|
||||||
|
.\" s390-tools is free software; you can redistribute it and/or modify
|
||||||
|
.\" it under the terms of the MIT license. See LICENSE for details.
|
||||||
|
.\"
|
||||||
|
.TH ZKEY\-CRYPTSETUP 1 "May 2018" "s390-tools"
|
||||||
|
.SH NAME
|
||||||
|
zkey\-cryptsetup \- Manage secure AES volume keys of volumes encrypted with
|
||||||
|
\fBLUKS2\fP and the \fBpaes\fP cipher
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B zkey\-cryptsetup
|
||||||
|
.I command
|
||||||
|
.I device
|
||||||
|
.RI [ OPTIONS ]
|
||||||
|
.
|
||||||
|
.PP
|
||||||
|
.B zkey\-cryptsetup
|
||||||
|
.RI [ command ]
|
||||||
|
.BR \-\-help | \-h
|
||||||
|
.br
|
||||||
|
.B zkey\-cryptsetup
|
||||||
|
.BR \-\-version | \-v
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Use \fBzkey\-cryptsetup\fP to validate and re-encipher secure AES
|
||||||
|
volume keys of volumes encrypted with \fBLUKS2\fP and the \fBpaes\fP cipher.
|
||||||
|
These secure AES volume keys are enciphered with a master key of an IBM
|
||||||
|
cryptographic adapter in CCA coprocessor mode.
|
||||||
|
.PP
|
||||||
|
To encrypt a volume using \fBLUKS2\fP and the \fBpaes\fP cipher, generate a
|
||||||
|
secure AES key using \fBzkey\fP: \fB'zkey generate luks.key --xts'\fP.
|
||||||
|
Then format the device with \fBcryptsetup\fP using the just generated secure
|
||||||
|
AES key from file luks.key: \fB'cryptsetup luksFormat <device> --type luks2
|
||||||
|
--cipher paes-xts-plain64 --master-key-file luks.key --key-size 1024'\fP. For
|
||||||
|
more details about \fBzkey\fP or \fBcryptsetup\fP see the
|
||||||
|
corresponding man pages.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.SH COMMANDS
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.SS "Validate secure AES volume keys"
|
||||||
|
.
|
||||||
|
.B zkey\-cryptsetup
|
||||||
|
.BR validate | val
|
||||||
|
.I device
|
||||||
|
.RB [ \-\-key\-file | \-d
|
||||||
|
.IR file-name ]
|
||||||
|
.RB [ \-\-keyfile\-offset | \-o
|
||||||
|
.IR bytes ]
|
||||||
|
.RB [ \-\-keyfile\-size | \-l
|
||||||
|
.IR bytes ]
|
||||||
|
.RB [ \-\-tries | \-T
|
||||||
|
.IR number ]
|
||||||
|
.RB [ \-\-verbose | \-V ]
|
||||||
|
.RB [ \-\-debug | \-D ]
|
||||||
|
.PP
|
||||||
|
Use the
|
||||||
|
.B validate
|
||||||
|
command to validate a secure AES volume key of a volume encrypted with
|
||||||
|
\fBLUKS2\fP and the \fBpaes\fP cipher.
|
||||||
|
It checks if the LUKS2 header of the volume contains a valid secure key.
|
||||||
|
It also displays the attributes of the secure key, such as key size, whether
|
||||||
|
it is a secure key that can be used for the XTS cipher mode, and the master key
|
||||||
|
register (CURRENT or OLD) with which the secure key is enciphered.
|
||||||
|
For further information about master key registers, see the
|
||||||
|
\fBreencipher\fP command.
|
||||||
|
.PP
|
||||||
|
To open a key slot contained in the LUKS2 header of the volume, a passphrase is
|
||||||
|
required. You are prompted for the passphrase, unless option
|
||||||
|
.B \-\-key\-file
|
||||||
|
is specified. Option
|
||||||
|
.B \-\-tries
|
||||||
|
specifies how often a passphrase can be re-entered. When option
|
||||||
|
.B \-\-key\-file
|
||||||
|
is specified, the passphrase is read from the specified file. You can specify
|
||||||
|
options
|
||||||
|
.B \-\-keyfile\-offset
|
||||||
|
and
|
||||||
|
.B \-\-keyfile\-size
|
||||||
|
to control which part of the key file is used as passphrase. These options
|
||||||
|
behave in the same way as with \fBcryptsetup\fP.
|
||||||
|
.
|
||||||
|
.SS "Re-encipher secure AES volume keys"
|
||||||
|
.
|
||||||
|
.PP
|
||||||
|
.B zkey\-cryptsetup
|
||||||
|
.BR reencipher | re
|
||||||
|
.I device
|
||||||
|
.RB [ \-\-staged | \-s ]
|
||||||
|
.RB [ \-\-in\-place | \-i ]
|
||||||
|
.RB [ \-\-complete | \-c ]
|
||||||
|
.RB [ \-\-key\-file | \-d
|
||||||
|
.IR file-name ]
|
||||||
|
.RB [ \-\-keyfile\-offset | \-o
|
||||||
|
.IR bytes ]
|
||||||
|
.RB [ \-\-keyfile\-size | \-l
|
||||||
|
.IR bytes ]
|
||||||
|
.RB [ \-\-tries | \-T
|
||||||
|
.IR number ]
|
||||||
|
.RB [ \-\-verbose | \-V ]
|
||||||
|
.RB [ \-\-debug | \-D ]
|
||||||
|
.PP
|
||||||
|
Use the
|
||||||
|
.B reencipher
|
||||||
|
command to re-encipher a secure AES volume key of a volume encrypted with
|
||||||
|
\fBLUKS2\fP and the \fBpaes\fP cipher. A secure AES volume key must be
|
||||||
|
re-enciphered when the master key of the cryptographic adapter in CCA
|
||||||
|
coprocessor mode changes.
|
||||||
|
.PP
|
||||||
|
The cryptographic adapter in CCA coprocessor mode has three different registers
|
||||||
|
to store master keys:
|
||||||
|
.RS 2
|
||||||
|
.IP "\(bu" 2
|
||||||
|
The \fBCURRENT\fP register contains the current master key.
|
||||||
|
.
|
||||||
|
.IP "\(bu" 2
|
||||||
|
The \fBOLD\fP register contains the previously used master key.
|
||||||
|
Secure keys enciphered with the master key contained in the \fBOLD\fP
|
||||||
|
register can still be used until the master key is changed again.
|
||||||
|
.
|
||||||
|
.IP "\(bu" 2
|
||||||
|
The \fBNEW\fP register contains the new master key to be set.
|
||||||
|
The master key in the \fBNEW\fP register cannot be used until it is made
|
||||||
|
the current master key. You can pro-actively re-encipher a secure key with the
|
||||||
|
\fBNEW\fP master key before this key is made the \fBCURRENT\fP key.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\fBzkey\-cryptsetup\fP automatically detects whether the secure volume key
|
||||||
|
is currently enciphered with the master key in the \fBOLD\fP register or with
|
||||||
|
the master key in the \fBCURRENT\fP register. If currently enciphered with the
|
||||||
|
master key in the \fBOLD\fP register, it is re-enciphered with the master key
|
||||||
|
in the \fBCURRENT\fP register. If it is currently enciphered with the master
|
||||||
|
key in the \fBCURRENT\fP register, it is re-enciphered with the master key in
|
||||||
|
the \fBNEW\fP register. If for this case the \fBNEW\fP register does not
|
||||||
|
contain a valid master key, then the re-encipher operation fails.
|
||||||
|
.PP
|
||||||
|
Re-enciphering a secure volume key of a volume encrypted with
|
||||||
|
\fBLUKS2\fP and the \fBpaes\fP cipher can be performed \fBin-place\fP, or in
|
||||||
|
\fBstaged\fP mode.
|
||||||
|
.PP
|
||||||
|
\fB"In-place"\fP immediately replaces the secure volume key in the LUKS2
|
||||||
|
header of the encrypted volume with the re-enciphered secure volume key.
|
||||||
|
Re-enciphering from \fBOLD\fP to \fBCURRENT\fP is performed in-place per
|
||||||
|
default. You can use option \fB--in-place\fP to force an in-place
|
||||||
|
re-enciphering for the \fBCURRENT\fP to \fBNEW\fP case. Be aware that
|
||||||
|
an encrypted volume with a secure volume key that was re-enciphered in-place
|
||||||
|
from \fBCURRENT\fP to \fBNEW\fP is no longer usable, until the new CCA master
|
||||||
|
key has been made the current one.
|
||||||
|
.PP
|
||||||
|
\fBStaged\fP mode means that the re-enciphered secure volume key is stored in a
|
||||||
|
separate (unbound) key slot in the LUKS2 header of the encrypted volume. Thus
|
||||||
|
all key slots containing the current secure volume key are still valid at this
|
||||||
|
point. Once the new CCA master key has been set (made active), you must rerun
|
||||||
|
the reencipher command with option \fB--complete\fP to complete the staged
|
||||||
|
re-enciphering. When completing the staged re-enciphering, the (unbound) key
|
||||||
|
slot containing the re-enciphered secure volume key becomes the active
|
||||||
|
key slot and, optionally, all key slots containing the old secure volume key
|
||||||
|
are removed.
|
||||||
|
Re-enciphering from \fBCURRENT\fP to \fBNEW\fP is performed in staged mode per
|
||||||
|
default. You can use option \fB--staged\fP to force a staged re-enciphering for
|
||||||
|
the \fBOLD\fP to \fBCURRENT\fP case.
|
||||||
|
.PP
|
||||||
|
To open a key slot contained in the LUKS2 header of the volume, a passphrase is
|
||||||
|
required. You are prompted for the passphrase, unless option
|
||||||
|
.B \-\-key\-file
|
||||||
|
is specified. Option
|
||||||
|
.B \-\-tries
|
||||||
|
specifies how often a passphrase can be re-entered. When option
|
||||||
|
.B \-\-key\-file
|
||||||
|
is specified, the passphrase is read from the specified file. You can specify
|
||||||
|
options
|
||||||
|
.B \-\-keyfile\-offset
|
||||||
|
and
|
||||||
|
.B \-\-keyfile\-size
|
||||||
|
to control which part of the key file is used as passphrase. These options
|
||||||
|
behave in the same way as with \fBcryptsetup\fP.
|
||||||
|
.PP
|
||||||
|
.B Note:
|
||||||
|
The \fBreencipher\fP command requires the CCA host library (libcsulcca.so)
|
||||||
|
to be installed.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.SS "Set a verification pattern of the secure AES volume key"
|
||||||
|
.
|
||||||
|
.B zkey\-cryptsetup
|
||||||
|
.BR setvp | setv
|
||||||
|
.I device
|
||||||
|
.RB [ \-\-key\-file | \-d
|
||||||
|
.IR file-name ]
|
||||||
|
.RB [ \-\-keyfile\-offset | \-o
|
||||||
|
.IR bytes ]
|
||||||
|
.RB [ \-\-keyfile\-size | \-l
|
||||||
|
.IR bytes ]
|
||||||
|
.RB [ \-\-tries | \-T
|
||||||
|
.IR number ]
|
||||||
|
.RB [ \-\-verbose | \-V ]
|
||||||
|
.RB [ \-\-debug | \-D ]
|
||||||
|
.PP
|
||||||
|
Use the
|
||||||
|
.B setvp
|
||||||
|
command to set a verification pattern of the secure AES volume key of a volume
|
||||||
|
encrypted with \fBLUKS2\fP and the \fBpaes\fP cipher. The verification pattern
|
||||||
|
identifies the effective key used to encrypt the volume's data.
|
||||||
|
The verification pattern is stored in a token named
|
||||||
|
\fBpaes-verification-pattern\fP in the LUKS2 header.
|
||||||
|
.PP
|
||||||
|
.B Note:
|
||||||
|
Set the verification pattern right after formatting the volume using
|
||||||
|
\fB'cryptsetup luksFormat'\fP.
|
||||||
|
.PP
|
||||||
|
To open a key slot contained in the LUKS2 header of the volume, a passphrase is
|
||||||
|
required. You are prompted for the passphrase, unless option
|
||||||
|
.B \-\-key\-file
|
||||||
|
is specified. Option
|
||||||
|
.B \-\-tries
|
||||||
|
specifies how often a passphrase can be re-entered. When option
|
||||||
|
.B \-\-key\-file
|
||||||
|
is specified, the passphrase is read from the specified file. You can specify
|
||||||
|
options
|
||||||
|
.B \-\-keyfile\-offset
|
||||||
|
and
|
||||||
|
.B \-\-keyfile\-size
|
||||||
|
to control which part of the key file is used as passphrase. These options
|
||||||
|
behave in the same way as with \fBcryptsetup\fP.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.SS "Set a new secure AES volume key for a volume"
|
||||||
|
.
|
||||||
|
.B zkey\-cryptsetup
|
||||||
|
.BR setkey | setk
|
||||||
|
.I device
|
||||||
|
.BR \-\-master\-key\-file | \-m
|
||||||
|
.IR file-name
|
||||||
|
.RB [ \-\-key\-file | \-d
|
||||||
|
.IR file-name ]
|
||||||
|
.RB [ \-\-keyfile\-offset | \-o
|
||||||
|
.IR bytes ]
|
||||||
|
.RB [ \-\-keyfile\-size | \-l
|
||||||
|
.IR bytes ]
|
||||||
|
.RB [ \-\-tries | \-T
|
||||||
|
.IR number ]
|
||||||
|
.RB [ \-\-verbose | \-V ]
|
||||||
|
.RB [ \-\-debug | \-D ]
|
||||||
|
.PP
|
||||||
|
Use the
|
||||||
|
.B setkey
|
||||||
|
command to set a new secure AES volume key for a volume encrypted with
|
||||||
|
\fBLUKS2\fP and the \fBpaes\fP cipher. Use this command to recover from an
|
||||||
|
invalid secure AES volume key contained in the LUKS2 header.
|
||||||
|
A secure AES volume key contained in the LUKS2 header can become invalid when
|
||||||
|
the CCA master key is changed without re-enciphering the secure volume key.
|
||||||
|
.PP
|
||||||
|
You can recover the secure volume key only if you have a copy of the secure key
|
||||||
|
in a file, and this copy was re-enciphered when the CCA master key has been
|
||||||
|
changed. Thus, the copy of the secure key must be currently enciphered with the
|
||||||
|
CCA master key in the CURRENT or OLD master key register.
|
||||||
|
Specify the secure key file with option
|
||||||
|
.B \-\-master\-key\-file
|
||||||
|
to set this secure key as the new volume key.
|
||||||
|
.PP
|
||||||
|
In case the LUKS2 header of the volume contains a verification pattern token,
|
||||||
|
it is used to ensure that the new volume key contains the same effective key.
|
||||||
|
If no verification pattern token is available, then you are prompted to confirm
|
||||||
|
that the specified secure key is the correct one.
|
||||||
|
.B ATTENTION:
|
||||||
|
If you set a wrong secure key you will loose all the data on the encrypted
|
||||||
|
volume!
|
||||||
|
.PP
|
||||||
|
To open a key slot contained in the LUKS2 header of the volume, a passphrase is
|
||||||
|
required. You are prompted for the passphrase, unless option
|
||||||
|
.B \-\-key\-file
|
||||||
|
is specified. Option
|
||||||
|
.B \-\-tries
|
||||||
|
specifies how often a passphrase can be re-entered. When option
|
||||||
|
.B \-\-key\-file
|
||||||
|
is specified, the passphrase is read from the specified file. You can specify
|
||||||
|
options
|
||||||
|
.B \-\-keyfile\-offset
|
||||||
|
and
|
||||||
|
.B \-\-keyfile\-size
|
||||||
|
to control which part of the key file is used as passphrase. These options
|
||||||
|
behave in the same way the same as with \fBcryptsetup\fP.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.SH OPTIONS
|
||||||
|
.
|
||||||
|
.SS "Options for the reencipher command"
|
||||||
|
.TP
|
||||||
|
.BR \-i ", " \-\-in-place
|
||||||
|
Forces an in-place re-enciphering of a secure volume key in the LUKS2
|
||||||
|
header. This option immediately replaces the secure volume key in the LUKS2
|
||||||
|
header of the encrypted volume with the re-enciphered secure volume key.
|
||||||
|
Re-enciphering from \fBOLD\fP to \fBCURRENT\fP is performed in-place per
|
||||||
|
default.
|
||||||
|
.TP
|
||||||
|
.BR \-s ", " \-\-staged
|
||||||
|
Forces that the re-enciphering of a secure volume key in the LUKS2
|
||||||
|
header is performed in staged mode. Staged mode means that the re-enciphered
|
||||||
|
secure volume key is stored in a separate (unbound) key slot in the LUKS2
|
||||||
|
header of the encrypted volume. Thus all key slots containing the current
|
||||||
|
secure volume key are still valid at this point. Once the new CCA master key
|
||||||
|
has been set (made active), you must rerun the reencipher command with option
|
||||||
|
\fB--complete\fP to complete the staged re-enciphering. Re-enciphering from
|
||||||
|
\fBCURRENT\fP to \fBNEW\fP is performed in staged mode per default.
|
||||||
|
.TP
|
||||||
|
.BR \-p ", " \-\-complete
|
||||||
|
Completes a staged re-enciphering. Use this option after the new CCA master key
|
||||||
|
has been set (made active). When completing the staged re-enciphering, the
|
||||||
|
(unbound) key slot containing the re-enciphered secure volume key becomes
|
||||||
|
the active key slot and, optionally, all key slots containing the old secure
|
||||||
|
volume key are removed.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.SS "Options for the setkey command"
|
||||||
|
.TP
|
||||||
|
.BR \-m ", " \-\-master\-key\-file\~\fIfile\-name\fP
|
||||||
|
Specifies the name of a file containing the secure AES key that is set as the
|
||||||
|
new volume key.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.SS "Options for supplying the passphrase"
|
||||||
|
.TP
|
||||||
|
.BR \-d ", " \-\-key\-file\~\fIfile\-name\fP
|
||||||
|
Reads the passphrase from the specified file. If this option is omitted,
|
||||||
|
or if the file\-name is \fI-\fP (a dash), then you are prompted to enter the
|
||||||
|
passphrase interactively.
|
||||||
|
.TP
|
||||||
|
.BR \-o ", " \-\-keyfile\-offset\~\fIbytes\fP
|
||||||
|
Specifies the number of bytes to skip before starting to read in the file
|
||||||
|
specified with option \fB\-\-key\-file\fP. If omitted, the file is read
|
||||||
|
from the beginning. When option \fB\-\-key\-file\fP is not specified, this
|
||||||
|
option is ignored.
|
||||||
|
.TP
|
||||||
|
.BR \-l ", " \-\-keyfile\-size\~\fIbytes\fP
|
||||||
|
Specifies the number of bytes to be read from the beginning of the file
|
||||||
|
specified with option \fB\-\-key\-file\fP. If omitted, the file is read
|
||||||
|
until the end. When \fB\-\-keyfile\-offset\fP is also specified, reading starts
|
||||||
|
at the offset. When option \fB\-\-key\-file\fP is not specified, this option is
|
||||||
|
ignored.
|
||||||
|
.TP
|
||||||
|
.BR \-T ", " \-\-tries\~\fInumber\fP
|
||||||
|
Specifies how often the interactive input of the passphrase can be re-entered.
|
||||||
|
The default is 3 times. When option \fB\-\-key\-file\fP is specified, this
|
||||||
|
option is ignored, and the passphrase is read only once from the file.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.SS "General options"
|
||||||
|
.TP
|
||||||
|
.BR \-V ", " \-\-verbose
|
||||||
|
Displays additional information messages during processing.
|
||||||
|
.TP
|
||||||
|
.BR \-D ", " \-\-debug
|
||||||
|
Displays additional debugging messages during processing. This option also
|
||||||
|
implies \fB\-\-verbose\fP.
|
||||||
|
.TP
|
||||||
|
.BR \-h ", " \-\-help
|
||||||
|
Displays help text and exits.
|
||||||
|
.TP
|
||||||
|
.BR \-v ", " \-\-version
|
||||||
|
Displays version information and exits.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.SH EXAMPLES
|
||||||
|
.TP
|
||||||
|
.B zkey-cryptsetup reencipher /dev/dasdd1
|
||||||
|
Re-enciphers the secure volume key of the encrypted volume /dev/dasdd1.
|
||||||
|
.TP
|
||||||
|
.B zkey-cryptsetup reencipher /dev/dasdd1 \-\-staged
|
||||||
|
Re-enciphers the secure volume key of the encrypted volume /dev/dasdd1 in
|
||||||
|
staged mode.
|
||||||
|
.TP
|
||||||
|
.B zkey-cryptsetup reencipher /dev/dasdd1 \-\-complete
|
||||||
|
Completes re-enciphers the secure volume key of the encrypted
|
||||||
|
volume /dev/dasdd1.
|
||||||
|
.TP
|
||||||
|
.B zkey-cryptsetup reencipher /dev/dasdd1 \-\-in\-place
|
||||||
|
Re-enciphers the secure volume key of the encrypted volume /dev/dasdd1 in
|
||||||
|
in-place mode.
|
||||||
|
.TP
|
||||||
|
.B zkey-cryptsetup validate /dev/dasdd1
|
||||||
|
Validates the secure volume key of the encrypted volume /dev/dasdd1 and
|
||||||
|
displays its attributes.
|
||||||
|
.TP
|
||||||
|
.B zkey-cryptsetup setvp /dev/dasdd1
|
||||||
|
Sets the verification pattern of the secure volume key of the encrypted
|
||||||
|
volume /dev/dasdd1.
|
||||||
|
.TP
|
||||||
|
.B zkey-cryptsetup setkey /dev/dasdd1 --master-key-file seckey.key
|
||||||
|
Sets the secure key contained in file seckey.key as the new volume key
|
||||||
|
for the encrypted volume /dev/dasdd1.
|
||||||
File diff suppressed because it is too large
Load Diff
+187
-109
@@ -75,30 +75,32 @@ key repository.
|
|||||||
.BR generate | gen
|
.BR generate | gen
|
||||||
.I secure\-key\-file
|
.I secure\-key\-file
|
||||||
.RB [ \-\-keybits | \-k
|
.RB [ \-\-keybits | \-k
|
||||||
.IB size ]
|
.IR size ]
|
||||||
.RB [ \-\-xts | \-x ]
|
.RB [ \-\-xts | \-x ]
|
||||||
.RB [ \-\-clearkey | \-c
|
.RB [ \-\-clearkey | \-c
|
||||||
.IB clear\-key\-file ]
|
.IR clear\-key\-file ]
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.
|
.
|
||||||
.PP
|
.PP
|
||||||
.B zkey
|
.B zkey
|
||||||
.BR generate | gen
|
.BR generate | gen
|
||||||
.B \-\-name | \-N
|
.B \-\-name | \-N
|
||||||
.IB key-name
|
.IR key-name
|
||||||
.RB [ \-\-description | \-d
|
.RB [ \-\-description | \-d
|
||||||
.IB description ]
|
.IR description ]
|
||||||
.RB [ \-\-volumes | \-l
|
.RB [ \-\-volumes | \-l
|
||||||
.IB volume1:dmname1[,volume2:dmname2[,...]] ]
|
.IR volume1:dmname1[,volume2:dmname2[,...]] ]
|
||||||
.RB [ \-\-apqns | \-a
|
.RB [ \-\-apqns | \-a
|
||||||
.IB card1.domain1[,card2.domain2[,...]] ]
|
.IR card1.domain1[,card2.domain2[,...]] ]
|
||||||
.RB [ \-\-sector-size | \-S
|
.RB [ \-\-sector-size | \-S
|
||||||
.IB bytes ]
|
.IR bytes ]
|
||||||
|
.RB [ \-\-volume-type | \-t
|
||||||
|
.IR type ]
|
||||||
.RB [ \-\-keybits | \-k
|
.RB [ \-\-keybits | \-k
|
||||||
.IB size ]
|
.IR size ]
|
||||||
.RB [ \-\-xts | \-x ]
|
.RB [ \-\-xts | \-x ]
|
||||||
.RB [ \-\-clearkey | \-c
|
.RB [ \-\-clearkey | \-c
|
||||||
.IB clear\-key\-file ]
|
.IR clear\-key\-file ]
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.PP
|
.PP
|
||||||
Use the
|
Use the
|
||||||
@@ -115,16 +117,16 @@ The generated secure key can either be stored in a file in the file system,
|
|||||||
or in the secure key repository. To store the generated secure key in a
|
or in the secure key repository. To store the generated secure key in a
|
||||||
file, specify the file name with option \fIsecure\-key\-file\fP. To store the
|
file, specify the file name with option \fIsecure\-key\-file\fP. To store the
|
||||||
secure key in the secure key repository, specify the name of the key using the
|
secure key in the secure key repository, specify the name of the key using the
|
||||||
.B --name
|
.B \-\-name
|
||||||
option. When storing the secure key in a key repository,
|
option. When storing the secure key in a key repository,
|
||||||
additional information can be associated with a secure key using the
|
additional information can be associated with a secure key using the
|
||||||
.B --description
|
.B \-\-description
|
||||||
,
|
,
|
||||||
.B --volumes
|
.B \-\-volumes
|
||||||
,
|
,
|
||||||
.B --apqns
|
.B \-\-apqns
|
||||||
, or the
|
, or the
|
||||||
.B --sector-size
|
.B \-\-sector-size
|
||||||
options.
|
options.
|
||||||
.
|
.
|
||||||
.SS "Validating secure AES keys"
|
.SS "Validating secure AES keys"
|
||||||
@@ -138,7 +140,7 @@ options.
|
|||||||
.B zkey
|
.B zkey
|
||||||
.BR validate | val
|
.BR validate | val
|
||||||
.RB [ \-\-name | \-N
|
.RB [ \-\-name | \-N
|
||||||
.IB key-name ]
|
.IR key-name ]
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.PP
|
.PP
|
||||||
Use the
|
Use the
|
||||||
@@ -156,10 +158,10 @@ secure key repository. To validate a secure key contained in a file, specify
|
|||||||
the file name with option \fIsecure\-key\-file\fP. To validate secure keys
|
the file name with option \fIsecure\-key\-file\fP. To validate secure keys
|
||||||
contained in the secure key repository, specify the name of the key
|
contained in the secure key repository, specify the name of the key
|
||||||
or a pattern containing wildcards using the
|
or a pattern containing wildcards using the
|
||||||
.B --name
|
.B \-\-name
|
||||||
option. When wildcards are used you must quote the value.
|
option. When wildcards are used you must quote the value.
|
||||||
If neither option \fIsecure\-key\-file\fP nor option
|
If neither option \fIsecure\-key\-file\fP nor option
|
||||||
.B --name
|
.B \-\-name
|
||||||
are specified, then all secure keys contained in the key repository
|
are specified, then all secure keys contained in the key repository
|
||||||
are validated.
|
are validated.
|
||||||
.
|
.
|
||||||
@@ -171,15 +173,15 @@ are validated.
|
|||||||
.RB [ \-\-to\-new | \-n ]
|
.RB [ \-\-to\-new | \-n ]
|
||||||
.RB [ \-\-from\-old | \-o ]
|
.RB [ \-\-from\-old | \-o ]
|
||||||
.RB [ \-\-output | \-f
|
.RB [ \-\-output | \-f
|
||||||
.IB output\-file ]
|
.IR output\-file ]
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.PP
|
.PP
|
||||||
.B zkey
|
.B zkey
|
||||||
.BR reencipher | re
|
.BR reencipher | re
|
||||||
.RB [ \-\-name | \-N
|
.RB [ \-\-name | \-N
|
||||||
.IB key-name ]
|
.IR key-name ]
|
||||||
.RB [ \-\-apqns | \-a
|
.RB [ \-\-apqns | \-a
|
||||||
.IB card1.domain1[,card2.domain2[,...]] ]
|
.IR card1.domain1[,card2.domain2[,...]] ]
|
||||||
.RB [ \-\-to\-new | \-n ]
|
.RB [ \-\-to\-new | \-n ]
|
||||||
.RB [ \-\-from\-old | \-o ]
|
.RB [ \-\-from\-old | \-o ]
|
||||||
.RB [ \-\-in-place | \-i ]
|
.RB [ \-\-in-place | \-i ]
|
||||||
@@ -190,7 +192,7 @@ are validated.
|
|||||||
Use the
|
Use the
|
||||||
.B reencipher
|
.B reencipher
|
||||||
command to re-encipher an existing secure key with a new master key.
|
command to re-encipher an existing secure key with a new master key.
|
||||||
A secure key bust be re-enciphered when the master key of the CCA
|
A secure key must be re-enciphered when the master key of the CCA
|
||||||
cryptographic adapter changes.
|
cryptographic adapter changes.
|
||||||
.PP
|
.PP
|
||||||
The CCA cryptographic adapter has three different registers to store
|
The CCA cryptographic adapter has three different registers to store
|
||||||
@@ -243,18 +245,18 @@ secure key repository. To re-encipher a secure key contained in a file,
|
|||||||
specify the file name with option \fIsecure\-key\-file\fP. To re-encipher
|
specify the file name with option \fIsecure\-key\-file\fP. To re-encipher
|
||||||
secure keys contained in the secure key repository, specify the name of the key
|
secure keys contained in the secure key repository, specify the name of the key
|
||||||
or a pattern containing wildcards using the
|
or a pattern containing wildcards using the
|
||||||
.B --name
|
.B \-\-name
|
||||||
option. When wildcards are used you must quote the value.
|
option. When wildcards are used you must quote the value.
|
||||||
You can also specify the
|
You can also specify the
|
||||||
.B --apqns
|
.B \-\-apqns
|
||||||
option to re-encipher those secure
|
option to re-encipher those secure
|
||||||
keys which are associated with the specified cryptographic adapters (APQNs).
|
keys which are associated with the specified cryptographic adapters (APQNs).
|
||||||
You can use wildcards for the APQN specification.
|
You can use wildcards for the APQN specification.
|
||||||
When wildcards are used you must quote the value.
|
When wildcards are used you must quote the value.
|
||||||
If both option
|
If both option
|
||||||
.B --name
|
.B \-\-name
|
||||||
and option
|
and option
|
||||||
.B --apqns
|
.B \-\-apqns
|
||||||
are specified then all secure keys
|
are specified then all secure keys
|
||||||
contained in the key repository that match both patterns are re-enciphered.
|
contained in the key repository that match both patterns are re-enciphered.
|
||||||
If all both options are omitted, then all secure keys contained in the key
|
If all both options are omitted, then all secure keys contained in the key
|
||||||
@@ -265,7 +267,7 @@ performed \fBin-place\fP, or in \fBstaged\fP mode.
|
|||||||
.PP
|
.PP
|
||||||
\fB"In-place"\fP immediately replaces the secure key in the repository with
|
\fB"In-place"\fP immediately replaces the secure key in the repository with
|
||||||
the re-enciphered secure key. Re-enciphering from \fBOLD\fP to \fBCURRENT\fP is
|
the re-enciphered secure key. Re-enciphering from \fBOLD\fP to \fBCURRENT\fP is
|
||||||
performed in-place per default. You can use option \fB--in-place\fP to force an
|
performed in-place per default. You can use option \fB\-\-in-place\fP to force an
|
||||||
in-place re-enciphering for the \fBCURRENT\fP to \fBNEW\fP case. Be aware that
|
in-place re-enciphering for the \fBCURRENT\fP to \fBNEW\fP case. Be aware that
|
||||||
a secure key that was re-enciphered in-place from \fBCURRENT\fP to \fBNEW\fP
|
a secure key that was re-enciphered in-place from \fBCURRENT\fP to \fBNEW\fP
|
||||||
is no longer valid, until the new CCA master key has been made the current one.
|
is no longer valid, until the new CCA master key has been made the current one.
|
||||||
@@ -273,9 +275,9 @@ is no longer valid, until the new CCA master key has been made the current one.
|
|||||||
\fBStaged\fP mode means that the re-enciphered secure key is stored in a
|
\fBStaged\fP mode means that the re-enciphered secure key is stored in a
|
||||||
separate file in the secure key repository. Thus the current secure key is still
|
separate file in the secure key repository. Thus the current secure key is still
|
||||||
valid at this point. Once the new CCA master key has been set (made active), you
|
valid at this point. Once the new CCA master key has been set (made active), you
|
||||||
must rerun the reencipher command with option \fB--complete\fP to complete the
|
must rerun the reencipher command with option \fB\-\-complete\fP to complete the
|
||||||
staged re-enciphering. Re-enciphering from \fBCURRENT\fP to \fBNEW\fP is
|
staged re-enciphering. Re-enciphering from \fBCURRENT\fP to \fBNEW\fP is
|
||||||
performed in staged mode per default. You can use option \fB--staged\fP to force
|
performed in staged mode per default. You can use option \fB\-\-staged\fP to force
|
||||||
a staged re-enciphering for the \fBOLD\fP to \fBCURRENT\fP case.
|
a staged re-enciphering for the \fBOLD\fP to \fBCURRENT\fP case.
|
||||||
.PP
|
.PP
|
||||||
.B Note:
|
.B Note:
|
||||||
@@ -288,15 +290,17 @@ to be installed.
|
|||||||
.BR import | im
|
.BR import | im
|
||||||
.I secure\-key\-file
|
.I secure\-key\-file
|
||||||
.B \-\-name | \-N
|
.B \-\-name | \-N
|
||||||
.IB key-name
|
.IR key-name
|
||||||
.RB [ \-\-description | \-d
|
.RB [ \-\-description | \-d
|
||||||
.IB description ]
|
.IR description ]
|
||||||
.RB [ \-\-volumes | \-l
|
.RB [ \-\-volumes | \-l
|
||||||
.IB volume1:dmname1[,volume2:dmname2[,...]] ]
|
.IR volume1:dmname1[,volume2:dmname2[,...]] ]
|
||||||
.RB [ \-\-apqns | \-a
|
.RB [ \-\-apqns | \-a
|
||||||
.IB card1.domain1[,card2.domain2[,...]] ]
|
.IR card1.domain1[,card2.domain2[,...]] ]
|
||||||
.RB [ \-\-sector-size | \-S
|
.RB [ \-\-sector-size | \-S
|
||||||
.IB bytes ]
|
.IR bytes ]
|
||||||
|
.RB [ \-\-volume-type | \-t
|
||||||
|
.IR type ]
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.
|
.
|
||||||
.PP
|
.PP
|
||||||
@@ -305,13 +309,13 @@ Use the
|
|||||||
command to import an existing secure key contained in a file into the the
|
command to import an existing secure key contained in a file into the the
|
||||||
secure key repository. When importing a secure key in a key repository,
|
secure key repository. When importing a secure key in a key repository,
|
||||||
additional information can be associated with a secure key using the
|
additional information can be associated with a secure key using the
|
||||||
.B --description
|
.B \-\-description
|
||||||
,
|
,
|
||||||
.B --volumes
|
.B \-\-volumes
|
||||||
,
|
,
|
||||||
.B --apqns
|
.B \-\-apqns
|
||||||
, or the
|
, or the
|
||||||
.B --sector-size
|
.B \-\-sector-size
|
||||||
options.
|
options.
|
||||||
.
|
.
|
||||||
.SS "Export AES secure keys from the secure key repository"
|
.SS "Export AES secure keys from the secure key repository"
|
||||||
@@ -320,7 +324,7 @@ options.
|
|||||||
.BR export | ex
|
.BR export | ex
|
||||||
.I secure\-key\-file
|
.I secure\-key\-file
|
||||||
.B \-\-name | \-N
|
.B \-\-name | \-N
|
||||||
.IB key-name
|
.IR key-name
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.
|
.
|
||||||
.PP
|
.PP
|
||||||
@@ -329,7 +333,7 @@ Use the
|
|||||||
command to export an existing secure key contained in the secure key repository
|
command to export an existing secure key contained in the secure key repository
|
||||||
to a file in the file system. Specify the name of the key that is to be exported
|
to a file in the file system. Specify the name of the key that is to be exported
|
||||||
using the
|
using the
|
||||||
.B --name
|
.B \-\-name
|
||||||
option. You cannot use wildcards.
|
option. You cannot use wildcards.
|
||||||
When wildcards are used you must quote the value.
|
When wildcards are used you must quote the value.
|
||||||
The exported secure key also remains in the secure key repository.
|
The exported secure key also remains in the secure key repository.
|
||||||
@@ -339,20 +343,22 @@ The exported secure key also remains in the secure key repository.
|
|||||||
.B zkey
|
.B zkey
|
||||||
.BR list | li
|
.BR list | li
|
||||||
.RB [ \-\-name | \-N
|
.RB [ \-\-name | \-N
|
||||||
.IB key-name ]
|
.IR key-name ]
|
||||||
.RB [ \-\-volumes | \-l
|
.RB [ \-\-volumes | \-l
|
||||||
.IB volume1[:dmname1][,volume2[:dmname2][,...]] ]
|
.IR volume1[:dmname1][,volume2[:dmname2][,...]] ]
|
||||||
.RB [ \-\-apqns | \-a
|
.RB [ \-\-apqns | \-a
|
||||||
.IB card1.domain1[,card2.domain2[,...]] ]
|
.IR card1.domain1[,card2.domain2[,...]] ]
|
||||||
|
.RB [ \-\-volume-type | \-t
|
||||||
|
.IR type ]
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.
|
.
|
||||||
.PP
|
.PP
|
||||||
Use the
|
Use the
|
||||||
.B list
|
.B list
|
||||||
command to display a list of secure keys contained in the secure key repository.
|
command to display a list of secure keys contained in the secure key repository.
|
||||||
You can filter the displayed list by key name, associated volumes, and
|
You can filter the displayed list by key name, associated volumes, associated
|
||||||
associated cryptographic adapters (APQNs). You can use wildcards for the key
|
cryptographic adapters (APQNs), and volume type. You can use wildcards for the
|
||||||
name, associated APQNs, and associated volumes. The device-mapper name of an
|
key name, associated APQNs, and associated volumes. The device-mapper name of an
|
||||||
associated volume can be omitted; if it is specified then only those keys are
|
associated volume can be omitted; if it is specified then only those keys are
|
||||||
listed that are associated with the specified volume and device-mapper name.
|
listed that are associated with the specified volume and device-mapper name.
|
||||||
.PP
|
.PP
|
||||||
@@ -361,15 +367,15 @@ The
|
|||||||
command displays the attributes of the secure keys, such as key sizes,
|
command displays the attributes of the secure keys, such as key sizes,
|
||||||
whether it is a secure key that can be used for the XTS cipher mode, the textual
|
whether it is a secure key that can be used for the XTS cipher mode, the textual
|
||||||
description, associated cryptographic adapters (APQNs) and volumes, the
|
description, associated cryptographic adapters (APQNs) and volumes, the
|
||||||
sector size, and timestamps for key creation, last modification and last
|
sector size, the key verification pattern, and timestamps for key creation, last
|
||||||
re-encipherment.
|
modification and last re-encipherment.
|
||||||
.
|
.
|
||||||
.SS "Remove existing AES secure keys from the secure key repository"
|
.SS "Remove existing AES secure keys from the secure key repository"
|
||||||
.
|
.
|
||||||
.B zkey
|
.B zkey
|
||||||
.BR remove | rem
|
.BR remove | rem
|
||||||
.B \-\-name | \-N
|
.B \-\-name | \-N
|
||||||
.IB key-name
|
.IR key-name
|
||||||
.RB [ \-\-force | \-F ]
|
.RB [ \-\-force | \-F ]
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.
|
.
|
||||||
@@ -378,10 +384,10 @@ Use the
|
|||||||
.B remove
|
.B remove
|
||||||
command to remove an existing secure key from the secure key repository.
|
command to remove an existing secure key from the secure key repository.
|
||||||
Specify the name of the key that is to be removed using the
|
Specify the name of the key that is to be removed using the
|
||||||
.B --name
|
.B \-\-name
|
||||||
option. You cannot use wildcards. The remove command prompts for
|
option. You cannot use wildcards. The remove command prompts for
|
||||||
a confirmation, unless you specify the
|
a confirmation, unless you specify the
|
||||||
.B --force
|
.B \-\-force
|
||||||
option.
|
option.
|
||||||
.PP
|
.PP
|
||||||
.B Note:
|
.B Note:
|
||||||
@@ -395,43 +401,45 @@ secure key.
|
|||||||
.B zkey
|
.B zkey
|
||||||
.BR change | ch
|
.BR change | ch
|
||||||
.B \-\-name | \-N
|
.B \-\-name | \-N
|
||||||
.IB key-name
|
.IR key-name
|
||||||
.RB [ \-\-description | \-d
|
.RB [ \-\-description | \-d
|
||||||
.IB description ]
|
.IR description ]
|
||||||
.RB [ \-\-volumes | \-l
|
.RB [ \-\-volumes | \-l
|
||||||
.IB [+|-]volume1:dmname1[,volume2:dmname2[,...]] ]
|
.IR [+|-]volume1:dmname1[,volume2:dmname2[,...]] ]
|
||||||
.RB [ \-\-apqns | \-a
|
.RB [ \-\-apqns | \-a
|
||||||
.IB [+|-]card1.domain1[,card2.domain2[,...]] ]
|
.IR [+|-]card1.domain1[,card2.domain2[,...]] ]
|
||||||
.RB [ \-\-sector-size | \-S
|
.RB [ \-\-sector-size | \-S
|
||||||
.IB bytes ]
|
.IR bytes ]
|
||||||
|
.RB [ \-\-volume-type | \-t
|
||||||
|
.IR type ]
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.
|
.
|
||||||
.PP
|
.PP
|
||||||
Use the
|
Use the
|
||||||
.B change
|
.B change
|
||||||
command to change the description, the associated volumes, the associated
|
command to change the description, the associated volumes, the associated
|
||||||
cryptographic adapters (APQNs), and the sector size of a secure key contained
|
cryptographic adapters (APQNs), the sector size, and the volume type of a secure
|
||||||
in the secure key repository. Specify the name of the key that is to be changed
|
key contained in the secure key repository. Specify the name of the key that is
|
||||||
using the
|
to be changed using the
|
||||||
.B --name
|
.B \-\-name
|
||||||
option. You cannot use wildcards.
|
option. You cannot use wildcards.
|
||||||
.PP
|
.PP
|
||||||
You can set (replace), add, or
|
You can set (replace), add, or
|
||||||
remove volume and cryptographic adapters (APQN) associations. To set
|
remove volume and cryptographic adapters (APQN) associations. To set
|
||||||
(replace) an association, specify the association with the
|
(replace) an association, specify the association with the
|
||||||
.B --volumes
|
.B \-\-volumes
|
||||||
or the
|
or the
|
||||||
.B --apqns
|
.B \-\-apqns
|
||||||
options. To add an association,
|
options. To add an association,
|
||||||
specify the new association prefixed with a \fI+\fP with the
|
specify the new association prefixed with a \fI+\fP with the
|
||||||
.B --volumes
|
.B \-\-volumes
|
||||||
or the
|
or the
|
||||||
.B --apqns
|
.B \-\-apqns
|
||||||
options. To remove an association,
|
options. To remove an association,
|
||||||
specify the association to remove prefixed with a \fI-\fP with the
|
specify the association to remove prefixed with a \fI-\fP with the
|
||||||
.B --volumes
|
.B \-\-volumes
|
||||||
or the
|
or the
|
||||||
.B --apqns
|
.B \-\-apqns
|
||||||
options. You cannot mix \fI+\fP and
|
options. You cannot mix \fI+\fP and
|
||||||
\fI-\fP in one specification. You can either add or remove (or set) the
|
\fI-\fP in one specification. You can either add or remove (or set) the
|
||||||
associations with one command.
|
associations with one command.
|
||||||
@@ -447,9 +455,9 @@ command.
|
|||||||
.B zkey
|
.B zkey
|
||||||
.BR rename | ren
|
.BR rename | ren
|
||||||
.B \-\-name | \-N
|
.B \-\-name | \-N
|
||||||
.IB key-name
|
.IR key-name
|
||||||
.B \-\-new-name | \-w
|
.B \-\-new-name | \-w
|
||||||
.IB new-key-name
|
.IR new-key-name
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.
|
.
|
||||||
.PP
|
.PP
|
||||||
@@ -457,9 +465,9 @@ Use the
|
|||||||
.B rename
|
.B rename
|
||||||
command to rename an existing secure key in the secure key repository.
|
command to rename an existing secure key in the secure key repository.
|
||||||
Specify the name of the key that is to be renamed using the
|
Specify the name of the key that is to be renamed using the
|
||||||
.B --name
|
.B \-\-name
|
||||||
option and the new name using the
|
option and the new name using the
|
||||||
.B --new-name
|
.B \-\-new-name
|
||||||
option. You cannot use wildcards.
|
option. You cannot use wildcards.
|
||||||
.
|
.
|
||||||
.SS "Copy (duplicate) existing AES secure keys in the secure key repository"
|
.SS "Copy (duplicate) existing AES secure keys in the secure key repository"
|
||||||
@@ -467,11 +475,11 @@ option. You cannot use wildcards.
|
|||||||
.B zkey
|
.B zkey
|
||||||
.B copy | co
|
.B copy | co
|
||||||
.RB \-\-name | \-N
|
.RB \-\-name | \-N
|
||||||
.IB key-name
|
.IR key-name
|
||||||
.B \-\-new-key-name | \-w
|
.B \-\-new-key-name | \-w
|
||||||
.IB new-name
|
.IR new-name
|
||||||
.RB [ \-\-volumes | \-l
|
.RB [ \-\-volumes | \-l
|
||||||
.IB volume1:dmname1[,volume2:dmname2[,...]] ]
|
.IR volume1:dmname1[,volume2:dmname2[,...]] ]
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.
|
.
|
||||||
.PP
|
.PP
|
||||||
@@ -479,15 +487,15 @@ Use the
|
|||||||
.B copy
|
.B copy
|
||||||
command to copy (duplicate) an existing secure key in the secure key repository.
|
command to copy (duplicate) an existing secure key in the secure key repository.
|
||||||
Specify the name of the key that is to be copied using the
|
Specify the name of the key that is to be copied using the
|
||||||
.B --name
|
.B \-\-name
|
||||||
option and the name of the copied key using the
|
option and the name of the copied key using the
|
||||||
.B --new-name
|
.B \-\-new-name
|
||||||
option. You cannot use wildcards.
|
option. You cannot use wildcards.
|
||||||
.PP
|
.PP
|
||||||
.B Note:
|
.B Note:
|
||||||
When copying a secure key, the volume associations are not copied, because
|
When copying a secure key, the volume associations are not copied, because
|
||||||
a specific volume can only be associated with a single secure key. Specify the
|
a specific volume can only be associated with a single secure key. Specify the
|
||||||
.B --volumes
|
.B \-\-volumes
|
||||||
option to associate different
|
option to associate different
|
||||||
volumes with the copied secure key, or use the \fBchange\fP command to associate
|
volumes with the copied secure key, or use the \fBchange\fP command to associate
|
||||||
volumes afterwards.
|
volumes afterwards.
|
||||||
@@ -497,45 +505,56 @@ volumes afterwards.
|
|||||||
.B zkey
|
.B zkey
|
||||||
.BR crypttab | cryptt
|
.BR crypttab | cryptt
|
||||||
.RB [ \-\-volumes | \-l
|
.RB [ \-\-volumes | \-l
|
||||||
.IB volume1[:dmname1][,volume2[:dmname2][,...]] ]
|
.IR volume1[:dmname1][,volume2[:dmname2][,...]] ]
|
||||||
|
.RB [ \-\-volume-type | \-t
|
||||||
|
.IR type ]
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.
|
.
|
||||||
.PP
|
.PP
|
||||||
Use the
|
Use the
|
||||||
.B crypttab
|
.B crypttab
|
||||||
command to generate crypttab entries using the \fBplain\fP dm-crypt mode
|
command to generate crypttab entries using the \fBplain\fP or \fBLUKS2\fP
|
||||||
for volumes that are associated with secure keys contained in the secure key
|
dm-crypt mode for volumes that are associated with secure keys contained in the
|
||||||
repository. Specify the
|
secure key repository. Specify the
|
||||||
.B --volumes
|
.B \-\-volumes
|
||||||
option to limit the list
|
option to limit the list
|
||||||
of volumes where crypttab entries are generated for. You can use wildcards.
|
of volumes where crypttab entries are generated for. You can use wildcards.
|
||||||
When wildcards are used you must quote the value.
|
When wildcards are used you must quote the value.
|
||||||
The device-mapper name of an associated volume can be omitted; if it is
|
The device-mapper name of an associated volume can be omitted; if it is
|
||||||
specified then only those volumes with the specified volume and device-mapper
|
specified then only those volumes with the specified volume and device-mapper
|
||||||
name are selected.
|
name are selected.
|
||||||
|
Specify the
|
||||||
|
.B \-\-volume-type
|
||||||
|
option to generate crypttab entries for the specified volume type only.
|
||||||
.
|
.
|
||||||
.SS "Generate cryptsetup commands for volumes associated with secure AES keys"
|
.SS "Generate cryptsetup commands for volumes associated with secure AES keys"
|
||||||
.
|
.
|
||||||
.B zkey
|
.B zkey
|
||||||
.BR cryptsetup | crypts
|
.BR cryptsetup | crypts
|
||||||
.RB [ \-\-volumes | \-l
|
.RB [ \-\-volumes | \-l
|
||||||
.IB volume1[:dmname1][,volume2[:dmname2][,...]] ]
|
.IR volume1[:dmname1][,volume2[:dmname2][,...]] ]
|
||||||
|
.RB [ \-\-volume-type | \-t
|
||||||
|
.IR type ]
|
||||||
.RB [ \-\-run | \-r ]
|
.RB [ \-\-run | \-r ]
|
||||||
.RB [ \-\-verbose | \-V ]
|
.RB [ \-\-verbose | \-V ]
|
||||||
.
|
.
|
||||||
.PP
|
.PP
|
||||||
Use the
|
Use the
|
||||||
.B cryptsetup
|
.B cryptsetup
|
||||||
command to generate \fBcryptsetup plainOpen\fP commands for volumes that are
|
command to generate \fBcryptsetup plainOpen\fP or \fBcryptsetup luksFormat\fP
|
||||||
associated with secure keys contained in the secure key repository. Specify the
|
commands for volumes that are associated with secure keys contained in the
|
||||||
.B --volumes
|
secure key repository. Specify the
|
||||||
|
.B \-\-volumes
|
||||||
option to limit the list
|
option to limit the list
|
||||||
of volumes where cryptsetup commands are generated for. You can use wildcards.
|
of volumes where cryptsetup commands are generated for. You can use wildcards.
|
||||||
When wildcards are used you must quote the value.
|
When wildcards are used you must quote the value.
|
||||||
The device-mapper name of an associated volume can be omitted; if it is
|
The device-mapper name of an associated volume can be omitted; if it is
|
||||||
specified then only those volumes with the specified volume and device-mapper
|
specified then only those volumes with the specified volume and device-mapper
|
||||||
name are selected. Specify the
|
name are selected. Specify the
|
||||||
.B --run
|
.B \-\-volume-type
|
||||||
|
option to generate cryptsetup commands for the specified volume type only.
|
||||||
|
Specify the
|
||||||
|
.B \-\-run
|
||||||
option to run the generated cryptsetup commands.
|
option to run the generated cryptsetup commands.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
@@ -589,8 +608,17 @@ This option is only used for secure keys contained in the secure key repository.
|
|||||||
.TP
|
.TP
|
||||||
.BR \-S ", " \-\-sector-size\~\fIbytes\fP
|
.BR \-S ", " \-\-sector-size\~\fIbytes\fP
|
||||||
Specifies the sector size in bytes used with dm-crypt. It must be a power of two
|
Specifies the sector size in bytes used with dm-crypt. It must be a power of two
|
||||||
and in the range 512 - 4096 bytes. If omitted, the system default sector size
|
and in the range of 512 to 4096 bytes. If omitted, the system default sector
|
||||||
is used.
|
size is used.
|
||||||
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
|
.TP
|
||||||
|
.BR \-t ", " \-\-volume-type\~\fItype\fP
|
||||||
|
Specifies the volume type of the associated volumes used with dm-crypt. Possible
|
||||||
|
values are \fBplain\fP and \fBluks2\fP. If omitted, \fBluks2\fP is used.
|
||||||
|
This option is only available if
|
||||||
|
.B zkey
|
||||||
|
has been compiled with LUKS2 support enabled. If LUKS2 support is not enabled,
|
||||||
|
the default volume type is \fBplain\fP.
|
||||||
This option is only used for secure keys contained in the secure key repository.
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
@@ -650,7 +678,7 @@ repository is performed in staged mode. Staged mode means that the re-enciphered
|
|||||||
secure key is stored in a separate file in the secure key repository. Thus the
|
secure key is stored in a separate file in the secure key repository. Thus the
|
||||||
current secure key is still valid at this point. Once the new CCA master key has
|
current secure key is still valid at this point. Once the new CCA master key has
|
||||||
been set (made active), you must rerun the reencipher command with option
|
been set (made active), you must rerun the reencipher command with option
|
||||||
\fB--complete\fP to complete the staged re-enciphering.
|
\fB\-\-complete\fP to complete the staged re-enciphering.
|
||||||
Re-enciphering from CURRENT to NEW is performed in staged mode per default.
|
Re-enciphering from CURRENT to NEW is performed in staged mode per default.
|
||||||
This option is only used for secure keys contained in the secure key repository.
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
.TP
|
.TP
|
||||||
@@ -690,8 +718,17 @@ This option is only used for secure keys contained in the secure key repository.
|
|||||||
.TP
|
.TP
|
||||||
.BR \-S ", " \-\-sector-size\~\fIbytes\fP
|
.BR \-S ", " \-\-sector-size\~\fIbytes\fP
|
||||||
Specifies the sector size in bytes used with dm-crypt. It must be a power of two
|
Specifies the sector size in bytes used with dm-crypt. It must be a power of two
|
||||||
and in the range 512 - 4096 bytes. If omitted, the system default sector size
|
and in the range of 512 to 4096 bytes. If omitted, the system default sector
|
||||||
is used.
|
size is used.
|
||||||
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
|
.TP
|
||||||
|
.BR \-t ", " \-\-volume-type\~\fItype\fP
|
||||||
|
Specifies the volume type of the associated volumes used with dm-crypt. Possible
|
||||||
|
values are \fBplain\fP and \fBluks2\fP. If omitted, \fBluks2\fP is used.
|
||||||
|
This option is only available if
|
||||||
|
.B zkey
|
||||||
|
has been compiled with LUKS2 support enabled. If LUKS2 support is not enabled,
|
||||||
|
the default volume type is \fBplain\fP.
|
||||||
This option is only used for secure keys contained in the secure key repository.
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
@@ -734,6 +771,15 @@ APQNs. Each APQN association specifies a card and domain number separated
|
|||||||
by a period (like lszcrypt displays it). You can use wildcards in the APQN
|
by a period (like lszcrypt displays it). You can use wildcards in the APQN
|
||||||
specification.
|
specification.
|
||||||
This option is only used for secure keys contained in the secure key repository.
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
|
.TP
|
||||||
|
.BR \-t ", " \-\-volume-type\~\fItype\fP
|
||||||
|
Specifies the volume type of the associated volumes used with dm-crypt. Possible
|
||||||
|
values are \fBplain\fP and \fBluks2\fP. Only keys with the specified volume
|
||||||
|
type are listed.
|
||||||
|
This option is only available if
|
||||||
|
.B zkey
|
||||||
|
has been compiled with LUKS2 support enabled.
|
||||||
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
@@ -791,9 +837,16 @@ This option is only used for secure keys contained in the secure key repository.
|
|||||||
.TP
|
.TP
|
||||||
.BR \-S ", " \-\-sector-size\~\fIbytes\fP
|
.BR \-S ", " \-\-sector-size\~\fIbytes\fP
|
||||||
Specifies the sector size in bytes used with dm-crypt. It must be a power of two
|
Specifies the sector size in bytes used with dm-crypt. It must be a power of two
|
||||||
and in the range 512 - 4096 bytes. If omitted, the system default sector size
|
and in the range of 512 to 4096 bytes. Specify \fI0\fP to set the sector size
|
||||||
is used. Specify \fI0\fP to un-set the sector size so that the system default
|
to the system default.
|
||||||
is used.
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
|
.TP
|
||||||
|
.BR \-t ", " \-\-volume-type\~\fItype\fP
|
||||||
|
Specifies the volume type of the associated volumes used with dm-crypt. Possible
|
||||||
|
values are \fBplain\fP and \fBluks2\fP.
|
||||||
|
This option is only available if
|
||||||
|
.B zkey
|
||||||
|
has been compiled with LUKS2 support enabled.
|
||||||
This option is only used for secure keys contained in the secure key repository.
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
@@ -845,6 +898,15 @@ specified volume and device-mapper name. You can use wildcards to specify
|
|||||||
the volumes and device-mapper names.
|
the volumes and device-mapper names.
|
||||||
When wildcards are used you must quote the value.
|
When wildcards are used you must quote the value.
|
||||||
This option is only used for secure keys contained in the secure key repository.
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
|
.TP
|
||||||
|
.BR \-t ", " \-\-volume-type\~\fItype\fP
|
||||||
|
Specifies the volume type of the associated volumes used with dm-crypt. Possible
|
||||||
|
values are \fBplain\fP and \fBluks2\fP. Only keys with the specified volume
|
||||||
|
type are selected to generate crypttab entries for.
|
||||||
|
This option is only available if
|
||||||
|
.B zkey
|
||||||
|
has been compiled with LUKS2 support enabled.
|
||||||
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
@@ -861,10 +923,18 @@ the volumes and device-mapper names.
|
|||||||
When wildcards are used you must quote the value.
|
When wildcards are used you must quote the value.
|
||||||
This option is only used for secure keys contained in the secure key repository.
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
.TP
|
.TP
|
||||||
.BR \-r ", " \-\-run\fP
|
.BR \-t ", " \-\-volume-type\~\fItype\fP
|
||||||
Runs the generated cryptsetup commands. When an execution of a cryptsetup
|
Specifies the volume type of the associated volumes used with dm-crypt. Possible
|
||||||
command fails, no further cryptsetup commands are executed, and zkey ends
|
values are \fBplain\fP and \fBluks2\fP. Only keys with the specified volume
|
||||||
with an error.
|
type are selected to generate cryptsetup commands for.
|
||||||
|
This option is only available if
|
||||||
|
.B zkey
|
||||||
|
has been compiled with LUKS2 support enabled.
|
||||||
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
|
.TP
|
||||||
|
.BR \-r ", " \-\-run
|
||||||
|
Runs the generated cryptsetup commands. When one of the cryptsetup command fail,
|
||||||
|
no further cryptsetup commands are run, and zkey ends with an error.
|
||||||
This option is only used for secure keys contained in the secure key repository.
|
This option is only used for secure keys contained in the secure key repository.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
@@ -895,15 +965,20 @@ in file 'seckey.bin'.
|
|||||||
Generates a secure AES key from the clear key in file 'clearkey.bin' and
|
Generates a secure AES key from the clear key in file 'clearkey.bin' and
|
||||||
stores it in file 'seckey.bin'.
|
stores it in file 'seckey.bin'.
|
||||||
.TP
|
.TP
|
||||||
.B zkey generate --name seckey
|
.B zkey generate \-\-name seckey
|
||||||
Generates a random 256-bit secure AES key and stores it in the secure key
|
Generates a random 256-bit secure AES key and stores it in the secure key
|
||||||
repository under the name 'seckey'.
|
repository using the name 'seckey'.
|
||||||
.TP
|
.TP
|
||||||
.B zkey generate --name seckey --volumes /dev/dasdc1:encvol --apqns 03.004c
|
.B zkey generate \-\-name seckey \-\-volumes /dev/dasdc1:encvol \-\-apqns 03.004c
|
||||||
Generates a random 256-bit secure AES key and stores it in the secure key
|
Generates a random 256-bit secure AES key and stores it in the secure key
|
||||||
repository under the name 'seckey' and associates it with block
|
repository using the name 'seckey' and associates it with block
|
||||||
device '/dev/dasdc1' and device-mapper name 'encvol', and APQN '03.004c'.
|
device '/dev/dasdc1' and device-mapper name 'encvol', and APQN '03.004c'.
|
||||||
.TP
|
.TP
|
||||||
|
.B zkey generate \-\-name seckey \-\-volumes /dev/dasdc1:encvol \-\-volume-type luks2
|
||||||
|
Generates a random 256-bit secure AES key and stores it in the secure key
|
||||||
|
repository using the name 'seckey' and associates it with block
|
||||||
|
device '/dev/dasdc1' and device-mapper name 'encvol', and a volume type of luks2.
|
||||||
|
.TP
|
||||||
.B zkey reencipher seckey.bin \-\-from\-old
|
.B zkey reencipher seckey.bin \-\-from\-old
|
||||||
Re-enciphers the secure key in file 'seckey.bin' which is currently enciphered
|
Re-enciphers the secure key in file 'seckey.bin' which is currently enciphered
|
||||||
with the master key in the OLD register with the master key in the CURRENT
|
with the master key in the OLD register with the master key in the CURRENT
|
||||||
@@ -915,17 +990,17 @@ Re-enciphers the secure key in file 'seckey.bin' which is currently enciphered
|
|||||||
with the master key in the CURRENT register with the master key in the NEW
|
with the master key in the CURRENT register with the master key in the NEW
|
||||||
register, and saves the re-enciphered secure key to file 'seckey2.bin'.
|
register, and saves the re-enciphered secure key to file 'seckey2.bin'.
|
||||||
.TP
|
.TP
|
||||||
.B zkey reencipher --name seckey
|
.B zkey reencipher \-\-name seckey
|
||||||
Re-enciphers the secure key 'seckey' in the secure key repository.
|
Re-enciphers the secure key 'seckey' in the secure key repository.
|
||||||
.TP
|
.TP
|
||||||
.B zkey reencipher --apqns 03.004c
|
.B zkey reencipher \-\-apqns 03.004c
|
||||||
Re-enciphers all secure keys contained in the secure key repository that are
|
Re-enciphers all secure keys contained in the secure key repository that are
|
||||||
associated with APQN '03.004c'.
|
associated with APQN '03.004c'.
|
||||||
.TP
|
.TP
|
||||||
.B zkey validate seckey.bin
|
.B zkey validate seckey.bin
|
||||||
Validates the secure key in file 'seckey.bin' and displays its attributes.
|
Validates the secure key in file 'seckey.bin' and displays its attributes.
|
||||||
.TP
|
.TP
|
||||||
.B zkey validate --name seckey
|
.B zkey validate \-\-name seckey
|
||||||
Validates the secure key 'seckey' in the secure key repository and displays its
|
Validates the secure key 'seckey' in the secure key repository and displays its
|
||||||
attributes.
|
attributes.
|
||||||
.TP
|
.TP
|
||||||
@@ -933,25 +1008,28 @@ attributes.
|
|||||||
Lists all secure keys in the secure key repository and displays its
|
Lists all secure keys in the secure key repository and displays its
|
||||||
attributes.
|
attributes.
|
||||||
.TP
|
.TP
|
||||||
.B zkey list --name '*key'
|
.B zkey list \-\-name '*key'
|
||||||
Lists all secure keys in the secure key repository with names ending with 'key'
|
Lists all secure keys in the secure key repository with names ending with 'key'
|
||||||
and displays its attributes.
|
and displays its attributes.
|
||||||
.TP
|
.TP
|
||||||
.B zkey change --name seckey --volumes +/dev/dasdc2:encvol2
|
.B zkey change \-\-name seckey \-\-volumes +/dev/dasdc2:encvol2
|
||||||
Changes the secure key 'seckey' in the secure key repository and adds
|
Changes the secure key 'seckey' in the secure key repository and adds
|
||||||
volume '/dev/dasdc2' with device-mapper name 'encvol2' to the list of associated
|
volume '/dev/dasdc2' with device-mapper name 'encvol2' to the list of associated
|
||||||
volumes of this secure key.
|
volumes of this secure key.
|
||||||
.TP
|
.TP
|
||||||
.B zkey change --name seckey --apqns -03.004c
|
.B zkey change \-\-name seckey \-\-apqns -03.004c
|
||||||
Changes the secure key 'seckey' in the secure key repository and removes
|
Changes the secure key 'seckey' in the secure key repository and removes
|
||||||
APQN '03.004c' from the list of associated APQNs of this secure key.
|
APQN '03.004c' from the list of associated APQNs of this secure key.
|
||||||
.TP
|
.TP
|
||||||
.B zkey crypttab --volumes '/dev/dasdc*'
|
.B zkey crypttab \-\-volumes '/dev/dasdc*'
|
||||||
Generates crypttab entries for all volumes that match the pattern '/dev/dasdc*'.
|
Generates crypttab entries for all volumes that match the pattern '/dev/dasdc*'.
|
||||||
.TP
|
.TP
|
||||||
.B zkey cryptsetup --volumes '*:enc_dasd'
|
.B zkey cryptsetup \-\-volumes '*:enc_dasd'
|
||||||
Generates cryptsetup commands for the volumes that uses the device-mapper
|
Generates cryptsetup commands for the volumes that uses the device-mapper
|
||||||
name 'enc_dasd'.
|
name 'enc_dasd'.
|
||||||
|
.TP
|
||||||
|
.B zkey cryptsetup \-\-volume-type luks2
|
||||||
|
Generates cryptsetup commands for all volumes of type luks2.
|
||||||
.
|
.
|
||||||
.SH ENVIRONMENT
|
.SH ENVIRONMENT
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
+108
-19
@@ -68,6 +68,7 @@ static struct zkey_globals {
|
|||||||
char *volumes;
|
char *volumes;
|
||||||
char *apqns;
|
char *apqns;
|
||||||
long int sector_size;
|
long int sector_size;
|
||||||
|
char *volume_type;
|
||||||
char *newname;
|
char *newname;
|
||||||
bool run;
|
bool run;
|
||||||
bool force;
|
bool force;
|
||||||
@@ -180,6 +181,16 @@ static struct util_opt opt_vec[] = {
|
|||||||
"used",
|
"used",
|
||||||
.command = COMMAND_GENERATE,
|
.command = COMMAND_GENERATE,
|
||||||
},
|
},
|
||||||
|
#ifdef HAVE_LUKS2_SUPPORT
|
||||||
|
{
|
||||||
|
.option = { "volume-type", required_argument, NULL, 't'},
|
||||||
|
.argument = "type",
|
||||||
|
.desc = "The type of the associated volume(s). Possible values "
|
||||||
|
"are 'plain' and 'luks2'. When this option is omitted, "
|
||||||
|
"the default is 'luks2'",
|
||||||
|
.command = COMMAND_GENERATE,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
{
|
{
|
||||||
.flags = UTIL_OPT_FLAG_SECTION,
|
.flags = UTIL_OPT_FLAG_SECTION,
|
||||||
@@ -211,19 +222,23 @@ static struct util_opt opt_vec[] = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
.option = {"complete", 0, NULL, 'p'},
|
.option = {"complete", 0, NULL, 'p'},
|
||||||
.desc = "Completes a pending re-enciphering of a secure AES "
|
.desc = "Completes a staged re-enciphering. Use this option "
|
||||||
"key that was re-enciphered with the master key in the "
|
"after the new CCA master key has been set (made "
|
||||||
"NEW register",
|
"active)",
|
||||||
.command = COMMAND_REENCIPHER,
|
.command = COMMAND_REENCIPHER,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.option = {"in-place", 0, NULL, 'i'},
|
.option = {"in-place", 0, NULL, 'i'},
|
||||||
.desc = "Forces an in-place re-enchipering of a secure AES key",
|
.desc = "Forces an in-place re-enchipering of a secure AES "
|
||||||
|
"key. Re-enciphering from OLD to CURRENT is performed "
|
||||||
|
"in-place per default",
|
||||||
.command = COMMAND_REENCIPHER,
|
.command = COMMAND_REENCIPHER,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.option = {"staged", 0, NULL, 's'},
|
.option = {"staged", 0, NULL, 's'},
|
||||||
.desc = "Forces a staged re-enchipering of a secure AES key",
|
.desc = "Forces that the re-enciphering of a secure AES key is "
|
||||||
|
"performed in staged mode. Re-enciphering from CURRENT "
|
||||||
|
"to NEW is performed in staged mode per default",
|
||||||
.command = COMMAND_REENCIPHER,
|
.command = COMMAND_REENCIPHER,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -310,6 +325,16 @@ static struct util_opt opt_vec[] = {
|
|||||||
"used",
|
"used",
|
||||||
.command = COMMAND_IMPORT,
|
.command = COMMAND_IMPORT,
|
||||||
},
|
},
|
||||||
|
#ifdef HAVE_LUKS2_SUPPORT
|
||||||
|
{
|
||||||
|
.option = { "volume-type", required_argument, NULL, 't'},
|
||||||
|
.argument = "type",
|
||||||
|
.desc = "The type of the associated volume(s). Possible values "
|
||||||
|
"are 'plain' and 'luks2'. When this option is omitted, "
|
||||||
|
"the default is 'luks2'",
|
||||||
|
.command = COMMAND_IMPORT,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
{
|
{
|
||||||
.flags = UTIL_OPT_FLAG_SECTION,
|
.flags = UTIL_OPT_FLAG_SECTION,
|
||||||
@@ -358,6 +383,16 @@ static struct util_opt opt_vec[] = {
|
|||||||
"associated with specific crypto cards",
|
"associated with specific crypto cards",
|
||||||
.command = COMMAND_LIST,
|
.command = COMMAND_LIST,
|
||||||
},
|
},
|
||||||
|
#ifdef HAVE_LUKS2_SUPPORT
|
||||||
|
{
|
||||||
|
.option = { "volume-type", required_argument, NULL, 't'},
|
||||||
|
.argument = "type",
|
||||||
|
.desc = "The type of the associated volume(s). Possible values "
|
||||||
|
"are 'plain' and 'luks2'. Use this option to list all "
|
||||||
|
"keys with the specified volumes type.",
|
||||||
|
.command = COMMAND_LIST,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
{
|
{
|
||||||
.flags = UTIL_OPT_FLAG_SECTION,
|
.flags = UTIL_OPT_FLAG_SECTION,
|
||||||
@@ -422,11 +457,19 @@ static struct util_opt opt_vec[] = {
|
|||||||
.option = { "sector-size", required_argument, NULL, 'S'},
|
.option = { "sector-size", required_argument, NULL, 'S'},
|
||||||
.argument = "0|512|4096",
|
.argument = "0|512|4096",
|
||||||
.desc = "The sector size used with dm-crypt. It must be power "
|
.desc = "The sector size used with dm-crypt. It must be power "
|
||||||
"of two and in range 512 - 4096 bytes. If this option "
|
"of two and in range 512 - 4096 bytes. Specify 0 to "
|
||||||
"is omitted, the system default sector size (512) is "
|
"use the system default sector size (512)",
|
||||||
"used",
|
|
||||||
.command = COMMAND_CHANGE,
|
.command = COMMAND_CHANGE,
|
||||||
},
|
},
|
||||||
|
#ifdef HAVE_LUKS2_SUPPORT
|
||||||
|
{
|
||||||
|
.option = { "volume-type", required_argument, NULL, 't'},
|
||||||
|
.argument = "type",
|
||||||
|
.desc = "The type of the associated volume(s). Possible values "
|
||||||
|
"are 'plain' and 'luks2'",
|
||||||
|
.command = COMMAND_CHANGE,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
{
|
{
|
||||||
.flags = UTIL_OPT_FLAG_SECTION,
|
.flags = UTIL_OPT_FLAG_SECTION,
|
||||||
@@ -494,6 +537,17 @@ static struct util_opt opt_vec[] = {
|
|||||||
"volume and the device-mapper name matches",
|
"volume and the device-mapper name matches",
|
||||||
.command = COMMAND_CRYPTTAB,
|
.command = COMMAND_CRYPTTAB,
|
||||||
},
|
},
|
||||||
|
#ifdef HAVE_LUKS2_SUPPORT
|
||||||
|
{
|
||||||
|
.option = { "volume-type", required_argument, NULL, 't'},
|
||||||
|
.argument = "type",
|
||||||
|
.desc = "The type of the associated volume(s). Possible values "
|
||||||
|
"are 'plain' and 'luks2'. Use this option to select "
|
||||||
|
"the keys by its volume type for which a crypttab "
|
||||||
|
"entry is to be generated",
|
||||||
|
.command = COMMAND_CRYPTTAB,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
{
|
{
|
||||||
.flags = UTIL_OPT_FLAG_SECTION,
|
.flags = UTIL_OPT_FLAG_SECTION,
|
||||||
@@ -512,6 +566,17 @@ static struct util_opt opt_vec[] = {
|
|||||||
"both, the volume and the device-mapper name matches",
|
"both, the volume and the device-mapper name matches",
|
||||||
.command = COMMAND_CRYPTSETUP,
|
.command = COMMAND_CRYPTSETUP,
|
||||||
},
|
},
|
||||||
|
#ifdef HAVE_LUKS2_SUPPORT
|
||||||
|
{
|
||||||
|
.option = { "volume-type", required_argument, NULL, 't'},
|
||||||
|
.argument = "type",
|
||||||
|
.desc = "The type of the associated volume(s). Possible values "
|
||||||
|
"are 'plain' and 'luks2'. Use this option to select "
|
||||||
|
"the keys by its volume type for which a crypttab "
|
||||||
|
"entry is to be generated",
|
||||||
|
.command = COMMAND_CRYPTSETUP,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
.option = {"run", 0, NULL, 'r'},
|
.option = {"run", 0, NULL, 'r'},
|
||||||
.desc = "Runs the generated cryptsetup command",
|
.desc = "Runs the generated cryptsetup command",
|
||||||
@@ -819,7 +884,7 @@ static int command_generate_repository(void)
|
|||||||
|
|
||||||
rc = keystore_generate_key(g.keystore, g.name, g.description, g.volumes,
|
rc = keystore_generate_key(g.keystore, g.name, g.description, g.volumes,
|
||||||
g.apqns, g.sector_size, g.keybits, g.xts,
|
g.apqns, g.sector_size, g.keybits, g.xts,
|
||||||
g.clearkeyfile, g.pkey_fd);
|
g.clearkeyfile, g.volume_type, g.pkey_fd);
|
||||||
|
|
||||||
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -1057,6 +1122,7 @@ static int command_reencipher(void)
|
|||||||
*/
|
*/
|
||||||
static int command_validate_file(void)
|
static int command_validate_file(void)
|
||||||
{
|
{
|
||||||
|
char vp[VERIFICATION_PATTERN_LEN];
|
||||||
size_t secure_key_size;
|
size_t secure_key_size;
|
||||||
size_t clear_key_size;
|
size_t clear_key_size;
|
||||||
u8 *secure_key;
|
u8 *secure_key;
|
||||||
@@ -1089,14 +1155,30 @@ static int command_validate_file(void)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = generate_key_verification_pattern((char *)secure_key,
|
||||||
|
secure_key_size, vp, sizeof(vp),
|
||||||
|
g.verbose);
|
||||||
|
if (rc != 0) {
|
||||||
|
warnx("Failed to generate the verification pattern: %s",
|
||||||
|
strerror(-rc));
|
||||||
|
warnx("Make sure that kernel module 'paes_s390' is loaded and "
|
||||||
|
"that the 'paes' cipher is available");
|
||||||
|
rc = EXIT_FAILURE;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
printf("Validation of secure key in file '%s':\n", g.pos_arg);
|
printf("Validation of secure key in file '%s':\n", g.pos_arg);
|
||||||
printf(" Status: Valid\n");
|
printf(" Status: Valid\n");
|
||||||
printf(" Secure key size: %lu bytes\n", secure_key_size);
|
printf(" Secure key size: %lu bytes\n", secure_key_size);
|
||||||
printf(" Clear key size: %lu bits\n", clear_key_size);
|
printf(" Clear key size: %lu bits\n", clear_key_size);
|
||||||
printf(" XTS type key: %s\n",
|
printf(" XTS type key: %s\n",
|
||||||
secure_key_size > SECURE_KEY_SIZE ? "Yes" : "No");
|
secure_key_size > SECURE_KEY_SIZE ? "Yes" : "No");
|
||||||
printf(" Encrypted with: %s CCA master key\n",
|
printf(" Enciphered with: %s CCA master key\n",
|
||||||
is_old_mk ? "OLD" : "CURRENT");
|
is_old_mk ? "OLD" : "CURRENT");
|
||||||
|
printf(" Verification pattern: %.*s\n", VERIFICATION_PATTERN_LEN / 2,
|
||||||
|
vp);
|
||||||
|
printf(" %.*s\n", VERIFICATION_PATTERN_LEN / 2,
|
||||||
|
&vp[VERIFICATION_PATTERN_LEN / 2]);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
free(secure_key);
|
free(secure_key);
|
||||||
@@ -1150,7 +1232,8 @@ static int command_import(void)
|
|||||||
g.sector_size = 0;
|
g.sector_size = 0;
|
||||||
|
|
||||||
rc = keystore_import_key(g.keystore, g.name, g.description, g.volumes,
|
rc = keystore_import_key(g.keystore, g.name, g.description, g.volumes,
|
||||||
g.apqns, g.sector_size, g.pos_arg);
|
g.apqns, g.sector_size, g.pos_arg,
|
||||||
|
g.volume_type);
|
||||||
|
|
||||||
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -1183,7 +1266,8 @@ static int command_list(void)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rc = keystore_list_keys(g.keystore, g.name, g.volumes, g.apqns);
|
rc = keystore_list_keys(g.keystore, g.name, g.volumes, g.apqns,
|
||||||
|
g.volume_type);
|
||||||
|
|
||||||
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -1222,7 +1306,7 @@ static int command_change(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = keystore_change_key(g.keystore, g.name, g.description, g.volumes,
|
rc = keystore_change_key(g.keystore, g.name, g.description, g.volumes,
|
||||||
g.apqns, g.sector_size);
|
g.apqns, g.sector_size, g.volume_type);
|
||||||
|
|
||||||
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -1282,7 +1366,7 @@ static int command_crypttab(void)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rc = keystore_crypttab(g.keystore, g.volumes);
|
rc = keystore_crypttab(g.keystore, g.volumes, g.volume_type);
|
||||||
|
|
||||||
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -1296,7 +1380,7 @@ static int command_cryptsetup(void)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rc = keystore_cryptsetup(g.keystore, g.volumes, g.run);
|
rc = keystore_cryptsetup(g.keystore, g.volumes, g.run, g.volume_type);
|
||||||
|
|
||||||
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
return rc != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -1473,6 +1557,11 @@ int main(int argc, char *argv[])
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef HAVE_LUKS2_SUPPORT
|
||||||
|
case 't':
|
||||||
|
g.volume_type = optarg;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case 'w':
|
case 'w':
|
||||||
g.newname = optarg;
|
g.newname = optarg;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user