blob: bce98536039716c5395decb9bd31011431b88bcf [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"
Patrick Venture4036d632018-11-03 16:32:47 -07004LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
Eddie James1a623ef2018-02-09 11:59:18 -06006
7inherit allarch
Eddie James1a623ef2018-02-09 11:59:18 -06008
9INSECURE_KEY = "${@'${SIGNING_KEY}' == '${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv'}"
10
11DEPENDS += "openssl-native"
12DEPENDS += "${@oe.utils.conditional('INSECURE_KEY', 'True', 'phosphor-insecure-signing-key-native', '', d)}"
13
14FILES_${PN} += "${sysconfdir}/activationdata/"
15
16SIGNING_KEY ?= "${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv"
17SIGNING_KEY_TYPE = "${@os.path.splitext(os.path.basename('${SIGNING_KEY}'))[0]}"
18
19do_install() {
20 openssl pkey -in "${SIGNING_KEY}" -pubout -out ${WORKDIR}/publickey
21 echo HashType=RSA-SHA256 > "${WORKDIR}/hashfunc"
22
23 idir="${D}${sysconfdir}/activationdata/${SIGNING_KEY_TYPE}"
24
25 install -d ${idir}
26 install -m 644 ${WORKDIR}/publickey ${idir}
27 install -m 644 ${WORKDIR}/hashfunc ${idir}
28}
29
30SYSROOT_DIRS_append = " ${sysconfdir}"