mm201 / pkmn-classic-framework

Pokémon application logic for Generation IV and V, including servers
http://pkmnclassic.net/
Other
219 stars 43 forks source link

Research/Implement Pokémon validation signatures (required for Random Matchup) #116

Open InternalLoss opened 1 year ago

InternalLoss commented 1 year ago

It seems Random Matchup fails currently after Wiimmfi fixed the matchmaking error, which @mm201 and I theorised is likely due to the signature not being valid (and confirmed the signature is shared to the other peer). As such, this is likely to be a blocking issue for Random Matchup Free mode (and presumably Rating Mode? @zurgeg may now be able to check since Wiimmfi's side of the communication works without issue).

Hopefully it's not an asymmetric key we don't have, or if it is we can make the DS accept our own signatures..

mm201 commented 1 year ago

For reference, shutter/Jon's Gen6 server can be found here: https://github.com/PretendoNetwork/PKHaX (they're also sending a zeroed out signature)

Apparently Gen6 is using an RSA-256 signature whose public key gets downloaded once from the server and saved. I don't think Gen5 downloads a key, or, at least, I've never seen any failed requests for it in my logs, but it's something we should test for. (test with a virgin savefile and see if it hits any unique endpoints)

InternalLoss commented 1 year ago

I don't think Gen5 downloads a key,

I'd hope not, since there'd likely be no way to blank (and re-download) that key, but then that might mean its static..

zurgeg commented 1 year ago

It seems Random Matchup fails currently after Wiimmfi fixed the matchmaking error, which @mm201 and I theorised is likely due to the signature not being valid (and confirmed the signature is shared to the other peer). As such, this is likely to be a blocking issue for Random Matchup Free mode (and presumably Rating Mode? @zurgeg may now be able to check since Wiimmfi's side of the communication works without issue).

Hopefully it's not an asymmetric key we don't have, or if it is we can make the DS accept our own signatures..

I'll try it in a minute.

zurgeg commented 1 year ago

Just tried. Looks like A) NoSSL is banned on Wiimmfi or B) I was autobanned for some reason or C) I was banned by a mod or D) melonDS is banned. Whatever it is, I can't connect to NAS with 23917. Which is also what happens when you're banned so...

InternalLoss commented 1 year ago

melonDS is banned

you've not been banned, its probably just denied for some reason. Can you DM me your FC on Discord, and I'll ask someone?

zurgeg commented 1 year ago

melonDS is banned

you've not been banned, its probably just denied for some reason. Can you DM me your FC on Discord, and I'll ask someone?

Turns out I was using the wrong melonDS install.

InternalLoss commented 1 year ago

Oops ;)

Let us know how it goes!

zurgeg commented 1 year ago

@InternalLoss @mm201 Can confirm. PGL side is working. So yes, this does affect rating mode

InternalLoss commented 1 year ago

Can confirm. PGL side is working. So yes, this does affect rating mode So even rating mode is affected by this? Ok, time to really figure out if it is truly the signature that's the issue..

zurgeg commented 1 year ago

Can confirm. PGL side is working. So yes, this does affect rating mode So even rating mode is affected by this? Ok, time to really figure out if it is truly the signature that's the issue..

@InternalLoss You could always try the "nop everything relating to whatever isn't working and hope it works" strategy

(Sadly melonDS has no support for debugging)

kuroppoi commented 1 year ago

What we know about this:

Priestyle commented 1 month ago

It's been a year since last comment. Any updates on this?