blob: 174a7e3cebbaf9c4eff06125770645079583f1d8 [file] [log] [blame]
#
# Copyright 2021 Google LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
EAPI=7
SRC_URI=""
KEYWORDS="*"
DESCRIPTION="Ephemeral key that can be embedded into EFI shim"
HOMEPAGE=""
LICENSE="Apache-2.0"
SLOT="0"
IUSE=""
BDEPEND="dev-libs/openssl"
src_unpack() {
echo mkdir -p "${S}"
mkdir -p "${S}"
}
src_prepare() {
openssl req -new -nodes -utf8 -days 36500 \
-batch -x509 -config "${FILESDIR}/x509.genkey" \
-outform PEM -out "${S}/signing_key.x509" \
-keyout "${S}/signing_key.pem"
openssl x509 -in "${S}/signing_key.x509" \
-out "${S}/signing_key.cer" -outform DER
default
}
src_install() {
insinto /build/share/platform-key
doins "signing_key.pem"
doins "signing_key.x509"
doins "signing_key.cer"
}