updates from 2021-04-21

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2023-02-17 11:06:30 -05:00
parent d5812860fc
commit 823fe02331
Signed by: vbatts
GPG key ID: 10937E57733F1362
7 changed files with 114 additions and 58 deletions

20
conf/filewriter.go Normal file
View file

@ -0,0 +1,20 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (C) 2019-2021 WireGuard LLC. All Rights Reserved.
*/
package conf
import (
"crypto/rand"
"encoding/hex"
)
func randomFileName() string {
var randBytes [32]byte
_, err := rand.Read(randBytes[:])
if err != nil {
panic(err)
}
return hex.EncodeToString(randBytes[:]) + ".tmp"
}