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:
parent
5e52d15409
commit
b518b0ef6b
3
dist/tools/suit/gen_key.py
vendored
3
dist/tools/suit/gen_key.py
vendored
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user