Polish modules/jwtx: key file open mode

There is no reason why we should open a key file being written
read/write, use O_WRONLY
This commit is contained in:
Nils Goroll 2026-02-05 18:15:52 +01:00
parent 20c1f699bd
commit ecae2459c7
No known key found for this signature in database
GPG key ID: 1DCD8F57A3868BD7

View file

@ -338,7 +338,7 @@ func loadOrCreateAsymmetricKey(keyPath, algorithm string) (any, error) {
return err return err
} }
f, err := os.OpenFile(keyPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600) f, err := os.OpenFile(keyPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600)
if err != nil { if err != nil {
return err return err
} }