build-ca: Remove new key if moving new certificate fails

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2023-05-08 22:51:38 +01:00
parent 93d4f73140
commit 3d14095384
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -1754,6 +1754,7 @@ build_ca: CA certificate password created via temp-files"
die "Failed to move key temp-file"
}
mv "$out_file_tmp" "$out_file" || {
rm -f "$out_key" # Also remove the key
die "Failed to move cert temp-file"
}