Eddie James | 1a623ef | 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" |
Patrick Venture | 4036d63 | 2018-11-03 16:32:47 -0700 | [diff] [blame] | 4 | LICENSE = "Apache-2.0" |
| 5 | LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" |
Eddie James | 1a623ef | 2018-02-09 11:59:18 -0600 | [diff] [blame] | 6 | |
| 7 | inherit allarch |
Eddie James | 1a623ef | 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}" |