summaryrefslogtreecommitdiffstats
path: root/meta-oe/classes
diff options
context:
space:
mode:
authorJohannes Schneider <johannes.schneider@leica-geosystems.com>2024-11-01 13:05:14 +0100
committerKhem Raj <raj.khem@gmail.com>2024-11-01 06:43:15 -0700
commit4a05d9a185df41e3b84f4d821db831836fa77e8d (patch)
treec77ba4b35c5522a3493dd9dbf44c00ce7f3476c2 /meta-oe/classes
parenta825b853634714bfad5ecee0acdc2942209828c2 (diff)
downloadmeta-openembedded-4a05d9a185df41e3b84f4d821db831836fa77e8d.tar.gz
signing.bbclass: add label length check
Add a (more helpful) error message in case the Package-Name exceeds a certain length which would have the softhsm tools error out. The $PN is used as 'label' in the softhsm, which is a "CK_UTF8CHAR paddedLabel[32]" in softhsm2-util.cpp, so it must not be longer. Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/classes')
-rw-r--r--meta-oe/classes/signing.bbclass5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta-oe/classes/signing.bbclass b/meta-oe/classes/signing.bbclass
index 7fd167d937..8af7bbf8e0 100644
--- a/meta-oe/classes/signing.bbclass
+++ b/meta-oe/classes/signing.bbclass
@@ -92,6 +92,11 @@ signing_pkcs11_tool() {
92} 92}
93 93
94signing_import_prepare() { 94signing_import_prepare() {
95 # the $PN is used as 'label' in the softhsm, which is a "CK_UTF8CHAR
96 # paddedLabel[32]" in softhsm2-util.cpp, so it must not be longer.
97 LEN=$(echo -n ${PN} | wc -c)
98 test $LEN -le 32 || bbfatal "PN must not have a length greater than 32 chars."
99
95 export _SIGNING_ENV_FILE_="${B}/meta-signing.env" 100 export _SIGNING_ENV_FILE_="${B}/meta-signing.env"
96 rm -f "$_SIGNING_ENV_FILE_" 101 rm -f "$_SIGNING_ENV_FILE_"
97 102