mirror of
https://wiilab.wiimart.org/wiimart/WiiSOAP
synced 2025-09-03 20:11:14 +02:00
Properly seed randomness
I am not really sure how that went unnoticed.
This commit is contained in:
parent
f27c980c44
commit
cad9816315
7
ecs.go
7
ecs.go
@ -154,13 +154,8 @@ func purchaseTitle(e *Envelope) {
|
||||
})
|
||||
e.AddKVNode("SyncTime", e.Timestamp())
|
||||
|
||||
//// Two cert types must be present.
|
||||
//type Certs struct {
|
||||
// XMLName xml.Name `xml:"Certs"`
|
||||
// Value string `xml:",chardata"`
|
||||
//}
|
||||
|
||||
e.AddKVNode("ETickets", ticketString)
|
||||
// Two cert types must be present.
|
||||
e.AddKVNode("Certs", b64(wadlib.CertChainTemplate))
|
||||
e.AddKVNode("Certs", b64(wadlib.CertChainTemplate))
|
||||
e.AddKVNode("TitleId", titleId)
|
||||
|
11
main.go
11
main.go
@ -19,11 +19,15 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
crypto "crypto/rand"
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"github.com/jackc/pgx/v4/pgxpool"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"math"
|
||||
"math/big"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@ -47,10 +51,15 @@ func checkError(err error) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Seed our random number generator before anything else.
|
||||
seed, err := crypto.Int(crypto.Reader, big.NewInt(math.MaxInt64))
|
||||
checkError(err)
|
||||
rand.Seed(seed.Int64())
|
||||
|
||||
// Initial Start.
|
||||
fmt.Println("WiiSOAP 0.2.6 Kawauso\n[i] Reading the Config...")
|
||||
|
||||
// Check the Config.
|
||||
// Check the config.
|
||||
ioconfig, err := ioutil.ReadFile("./config.xml")
|
||||
checkError(err)
|
||||
readConfig := Config{}
|
||||
|
Loading…
x
Reference in New Issue
Block a user