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" |
| 4 | |
| 5 | inherit allarch |
| 6 | inherit obmc-phosphor-license |
| 7 | |
| 8 | INSECURE_KEY = "${@'${SIGNING_KEY}' == '${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv'}" |
| 9 | |
| 10 | DEPENDS += "openssl-native" |
| 11 | DEPENDS += "${@oe.utils.conditional('INSECURE_KEY', 'True', 'phosphor-insecure-signing-key-native', '', d)}" |
| 12 | |
| 13 | FILES_${PN} += "${sysconfdir}/activationdata/" |
| 14 | |
| 15 | SIGNING_KEY ?= "${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv" |
| 16 | SIGNING_KEY_TYPE = "${@os.path.splitext(os.path.basename('${SIGNING_KEY}'))[0]}" |
| 17 | |
| 18 | do_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 | |
| 29 | SYSROOT_DIRS_append = " ${sysconfdir}" |