1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:52:44 +01:00

makefiles/suit: don't allow non-owner to read private key

This commit is contained in:
Benjamin Valentin 2022-06-02 00:15:22 +02:00
parent 5e52d15409
commit b518b0ef6b

View File

@ -11,6 +11,7 @@
# directory for more details.
#
import os
import sys
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
@ -37,7 +38,7 @@ def main():
encryption_algorithm=crypt,
)
with open(sys.argv[1], "wb") as f:
with open(os.open(sys.argv[1], os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600), "wb") as f:
f.write(pem)