File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,30 @@ SUIT_PUB_HDR_DIR = $(dir $(SUIT_PUB_HDR))
3535CFLAGS += -I$(SUIT_PUB_HDR_DIR )
3636BUILDDEPS += $(SUIT_PUB_HDR )
3737
38+ # OpenSSL leaves an empty file if key generation fails - remove it manually
39+ # see https://github.com/openssl/openssl/issues/25440
3840$(SUIT_SEC ) : | $(CLEAN )
3941 $(Q ) echo suit: generating key in $(SUIT_KEY_DIR )
4042 $(Q ) mkdir -p $(SUIT_KEY_DIR )
41- $(Q )$(RIOTBASE ) /dist/tools/suit/gen_key.py $@ $(SUIT_SEC_PASSWORD )
43+ $(Q ) ( \
44+ printf " 0) none\n" ; \
45+ printf " 1) aes-256-cbc\n" ; \
46+ printf " Choose encryption for key file $@ : " ; \
47+ if [ -z " $( RIOT_CI_BUILD) " ]; then read encryption; else encryption=0; fi ; \
48+ case $$ encryption in \
49+ 0) \
50+ openssl genpkey -algorithm ed25519 -out $@ ; \
51+ ;; \
52+ 1) \
53+ openssl genpkey -algorithm ed25519 -aes-256-cbc -out $@ || : ; \
54+ ;; \
55+ * ) \
56+ echo " Invalid choice" ; \
57+ exit 1; \
58+ ;; \
59+ esac ; \
60+ )
61+ $(Q ) if [ ! -s $@ ]; then rm $@ ; fi
4262
4363% .pem.pub : % .pem
4464 $(Q ) openssl ec -inform pem -in $< -outform pem -pubout -out $@
You can’t perform that action at this time.
0 commit comments