This is a short post to announce the release of efitools version 1.4. The packages are available here:
Just select your distribution (various versions of Debian, Ubuntu, Fedora and openSUSE).
The main additions over version 1.3 is that there are two new utilities: efi-readvar and efi-updatevar that allow you to read and manipulate the UEFI signatures database from linux userspace. The disadvantage of these tools is that they require the new efivarfs filesystem to be mounted somewhere in the system (efivarfs was added in kernel 3.8, so you either have to be running a very recent distribution, like openSUSE Tumbleweed, or you have to build your own kernels to use it). To mount the efivarfs filesystem, just do
mount -o efivarfs none /mnt (or some other useful mount point)
As long as this is successful, you can now use the efi- tools to read and write the secure variables. In order to write the variables in User Mode, you must have the private part of the Platform and Key Exchange Keys available. So, assuming your private part of the platform key is PK.key, you can add your own KEK with
efi-updatevar -a -c KEK.crt -k PK.key KEK
And then add your own signature database key with
efi-updatevar -a -c DB.crt -k KEK.key db
Where KEK.crt and DB.crt are X509 certificates.
Note that by default, files in the efivarfs filesystem are owned by root and have permission 0644, so efi-readvar can be executed by any user, but efi-updatevar needs to be able to write to the variable files (i.e. would have to run as root).
There’s also extensive man pages documenting all the options for both efi-readvar and efi-updatevar.