mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-22 16:44:06 +09:00
Some improvements
This commit is contained in:
@ -70,11 +70,5 @@ func NewSecretKey() (string, error) {
|
||||
|
||||
// NewMasterKey generate a new value intended to be used by MASTER_KEY.
|
||||
func NewMasterKey() ([]byte, error) {
|
||||
secretBytes := make([]byte, 32)
|
||||
_, err := io.ReadFull(rand.Reader, secretBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return secretBytes, nil
|
||||
return util.CryptoRandomBytes(32)
|
||||
}
|
||||
|
Reference in New Issue
Block a user