Eddie James | b2b7ff6 | 2018-02-09 11:59:18 -0600 | [diff] [blame] | 1 | SUMMARY = "OpenBMC image signing public key" |
| 2 | DESCRIPTION = "Public key information to be included in images for image verification." |
| 3 | PR = "r1" |
Brad Bishop | 75f0387 | 2018-11-03 09:41:57 -0700 | [diff] [blame] | 4 | LICENSE = "Apache-2.0" |
Brad Bishop | 6f3f0aa | 2019-09-13 12:14:05 -0400 | [diff] [blame] | 5 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" |
Eddie James | b2b7ff6 | 2018-02-09 11:59:18 -0600 | [diff] [blame] | 6 | |
| 7 | inherit allarch |
Eddie James | b2b7ff6 | 2018-02-09 11:59:18 -0600 | [diff] [blame] | 8 | |
| 9 | INSECURE_KEY = "${@'${SIGNING_KEY}' == '${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv'}" |
| 10 | |
| 11 | DEPENDS += "openssl-native" |
| 12 | DEPENDS += "${@oe.utils.conditional('INSECURE_KEY', 'True', 'phosphor-insecure-signing-key-native', '', d)}" |
| 13 | |
| 14 | FILES_${PN} += "${sysconfdir}/activationdata/" |
| 15 | |
| 16 | SIGNING_KEY ?= "${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv" |
| 17 | SIGNING_KEY_TYPE = "${@os.path.splitext(os.path.basename('${SIGNING_KEY}'))[0]}" |
| 18 | |
| 19 | do_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 | |
| 30 | SYSROOT_DIRS_append = " ${sysconfdir}" |