blob: 16e1d999f483a5aaaa112b971533ce4eb9f72528 [file] [log] [blame]
Eddie Jamesb2b7ff62018-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"
Brad Bishop75f03872018-11-03 09:41:57 -07004LICENSE = "Apache-2.0"
Brad Bishop6f3f0aa2019-09-13 12:14:05 -04005LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
Eddie Jamesb2b7ff62018-02-09 11:59:18 -06006
7inherit allarch
Eddie Jamesb2b7ff62018-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}"