blob: 897bfdea4cd90a29d016d1290fcbbc93ac366145 [file] [log] [blame]
Eddie James1a623ef2018-02-09 11:59:18 -06001SUMMARY = "OpenBMC image signing public key"
2DESCRIPTION = "Public key information to be included in images for image verification."
3PR = "r1"
4
5inherit allarch
6inherit obmc-phosphor-license
7
8INSECURE_KEY = "${@'${SIGNING_KEY}' == '${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv'}"
9
10DEPENDS += "openssl-native"
11DEPENDS += "${@oe.utils.conditional('INSECURE_KEY', 'True', 'phosphor-insecure-signing-key-native', '', d)}"
12
13FILES_${PN} += "${sysconfdir}/activationdata/"
14
15SIGNING_KEY ?= "${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv"
16SIGNING_KEY_TYPE = "${@os.path.splitext(os.path.basename('${SIGNING_KEY}'))[0]}"
17
18do_install() {
19 openssl pkey -in "${SIGNING_KEY}" -pubout -out ${WORKDIR}/publickey
20 echo HashType=RSA-SHA256 > "${WORKDIR}/hashfunc"
21
22 idir="${D}${sysconfdir}/activationdata/${SIGNING_KEY_TYPE}"
23
24 install -d ${idir}
25 install -m 644 ${WORKDIR}/publickey ${idir}
26 install -m 644 ${WORKDIR}/hashfunc ${idir}
27}
28
29SYSROOT_DIRS_append = " ${sysconfdir}"