msnp-wiki/docs/commands/qry.md

70 lines
1.8 KiB
Markdown

# Introduction
`QRY` is a command introduced with [MSNP6](../versions/msnp6.md).
It is a Notification Server command, WITH a request payload but without a response payload.
Responds to a challenge request ([CHL](chl.md) command).
# Client/Request
```
QRY TrID public-key length
payload
```
Where `public-key` is your client's Public Key.
For a list of valid Public Keys, read the [Challenge Key Pairs](../files/challenge_keypairs.md) article.
Where `length` is the size (in bytes) of the `payload`.
Where `payload` is the challenge response.
## Challenge responses
Calculating the challenge response depends on the version of the protocol you are using.
For a list of valid Private Keys, read the [Challenge Key Pairs](../files/challenge_keypairs.md) article.
### Basic responses
*Only in [MSNP6](../versions/msnp10.md) to [MSNP10](../versions/msnp10.md).*
Simply MD5 hash the challenge and your client's Private Key concatenated together as a string.
The output should be 32 bytes and lowercase hexadecimal.
### Advanced responses
*Since [MSNP11](../versions/msnp11.md).*
Since this is more advanced of an algorithm,
it will be avaliable as annotated source code in the Miscellaneous Files sectiom.
TODO: Write said annotated source code.
The output should be 32 bytes and lowercase hexadecimal.
# Server/Response
`QRY TrID`
# Examples
## Successful response
```
S: CHL 12345678901234567890
C: QRY 1 msmsgs@msnmsgr.com 32
8ba1bb9d6dbf624fee31a2053af5fdd0
S: QRY 1
```
## Failed challenge
*NOTE: This happens as-is in [MSNP11](../versions/msnp11.md),
since it isn't using the new method.*
```
S: CHL 12345678901234567890
C: QRY 2 msmsgs@msnmsgr.com 32
8ba1bb9d6dbf624fee31a2053af5fdd0
S: 540 2
```
Server disconnects client.
# Known changes
* [MSNP11](../versions/msnp11.md): Changed challenge response generation algorithm drastically.