Implement GetChallenge

This commit is contained in:
Spotlight 2020-08-18 16:07:36 -05:00
parent 7c7ac06509
commit a3355a7b69
No known key found for this signature in database
GPG Key ID: 874AA355B3209BDC
2 changed files with 10 additions and 0 deletions

5
ias.go
View File

@ -42,6 +42,11 @@ func iasHandler(e Envelope, doc *xmlquery.Node) (bool, string) {
case "GetChallenge": case "GetChallenge":
fmt.Println("The request is valid! Responding...") fmt.Println("The request is valid! Responding...")
// The official Wii Shop Channel requests a Challenge from the server, and promptly disregards it.
// (Sometimes, it may not request a challenge at all.) No attempt is made to validate the response.
// It then uses another hard-coded value in place of this returned value entirely in any situation.
// For this reason, we consider it irrelevant.
e.AddKVNode("Challenge", SharedChallenge)
break break
case "GetRegistrationInfo": case "GetRegistrationInfo":

View File

@ -28,6 +28,11 @@ import (
"strings" "strings"
) )
const (
// Any given challenge must be 10 characters or less (challenge.length > 0xb)
SharedChallenge = "NintyWhyPls"
)
// checkError makes error handling not as ugly and inefficient. // checkError makes error handling not as ugly and inefficient.
func checkError(err error) { func checkError(err error) {
if err != nil { if err != nil {