diff options
Diffstat (limited to 'meta/classes/uboot-sign.bbclass')
-rw-r--r-- | meta/classes/uboot-sign.bbclass | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/meta/classes/uboot-sign.bbclass b/meta/classes/uboot-sign.bbclass index d11882f90f..29b2edc833 100644 --- a/meta/classes/uboot-sign.bbclass +++ b/meta/classes/uboot-sign.bbclass | |||
@@ -255,32 +255,7 @@ do_install_append() { | |||
255 | fi | 255 | fi |
256 | } | 256 | } |
257 | 257 | ||
258 | do_generate_rsa_keys() { | 258 | do_uboot_generate_rsa_keys() { |
259 | if [ "${UBOOT_SIGN_ENABLE}" = "0" ] && [ "${FIT_GENERATE_KEYS}" = "1" ]; then | ||
260 | bbwarn "FIT_GENERATE_KEYS is set to 1 even though UBOOT_SIGN_ENABLE is set to 0. The keys will not be generated as they won't be used." | ||
261 | fi | ||
262 | |||
263 | if [ "${UBOOT_SIGN_ENABLE}" = "1" ] && [ "${FIT_GENERATE_KEYS}" = "1" ]; then | ||
264 | |||
265 | # Generate keys only if they don't already exist | ||
266 | if [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".key ] || \ | ||
267 | [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".crt ]; then | ||
268 | |||
269 | # make directory if it does not already exist | ||
270 | mkdir -p "${UBOOT_SIGN_KEYDIR}" | ||
271 | |||
272 | echo "Generating RSA private key for signing fitImage" | ||
273 | openssl genrsa ${FIT_KEY_GENRSA_ARGS} -out \ | ||
274 | "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".key \ | ||
275 | "${FIT_SIGN_NUMBITS}" | ||
276 | |||
277 | echo "Generating certificate for signing fitImage" | ||
278 | openssl req ${FIT_KEY_REQ_ARGS} "${FIT_KEY_SIGN_PKCS}" \ | ||
279 | -key "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".key \ | ||
280 | -out "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".crt | ||
281 | fi | ||
282 | fi | ||
283 | |||
284 | if [ "${SPL_SIGN_ENABLE}" = "0" ] && [ "${UBOOT_FIT_GENERATE_KEYS}" = "1" ]; then | 259 | if [ "${SPL_SIGN_ENABLE}" = "0" ] && [ "${UBOOT_FIT_GENERATE_KEYS}" = "1" ]; then |
285 | bbwarn "UBOOT_FIT_GENERATE_KEYS is set to 1 eventhough SPL_SIGN_ENABLE is set to 0. The keys will not be generated as they won't be used." | 260 | bbwarn "UBOOT_FIT_GENERATE_KEYS is set to 1 eventhough SPL_SIGN_ENABLE is set to 0. The keys will not be generated as they won't be used." |
286 | fi | 261 | fi |
@@ -308,7 +283,7 @@ do_generate_rsa_keys() { | |||
308 | 283 | ||
309 | } | 284 | } |
310 | 285 | ||
311 | addtask generate_rsa_keys before do_uboot_assemble_fitimage after do_compile | 286 | addtask uboot_generate_rsa_keys before do_uboot_assemble_fitimage after do_compile |
312 | 287 | ||
313 | # Create a ITS file for the U-boot FIT, for use when | 288 | # Create a ITS file for the U-boot FIT, for use when |
314 | # we want to sign it so that the SPL can verify it | 289 | # we want to sign it so that the SPL can verify it |