mirror of
https://wiilab.wiimart.org/wiimart/WiiSOAP
synced 2025-09-06 05:21:04 +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())
|
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)
|
e.AddKVNode("ETickets", ticketString)
|
||||||
|
// Two cert types must be present.
|
||||||
e.AddKVNode("Certs", b64(wadlib.CertChainTemplate))
|
e.AddKVNode("Certs", b64(wadlib.CertChainTemplate))
|
||||||
e.AddKVNode("Certs", b64(wadlib.CertChainTemplate))
|
e.AddKVNode("Certs", b64(wadlib.CertChainTemplate))
|
||||||
e.AddKVNode("TitleId", titleId)
|
e.AddKVNode("TitleId", titleId)
|
||||||
|
11
main.go
11
main.go
@ -19,11 +19,15 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
crypto "crypto/rand"
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/jackc/pgx/v4/pgxpool"
|
"github.com/jackc/pgx/v4/pgxpool"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
|
"math"
|
||||||
|
"math/big"
|
||||||
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -47,10 +51,15 @@ func checkError(err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
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.
|
// Initial Start.
|
||||||
fmt.Println("WiiSOAP 0.2.6 Kawauso\n[i] Reading the Config...")
|
fmt.Println("WiiSOAP 0.2.6 Kawauso\n[i] Reading the Config...")
|
||||||
|
|
||||||
// Check the Config.
|
// Check the config.
|
||||||
ioconfig, err := ioutil.ReadFile("./config.xml")
|
ioconfig, err := ioutil.ReadFile("./config.xml")
|
||||||
checkError(err)
|
checkError(err)
|
||||||
readConfig := Config{}
|
readConfig := Config{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user