3#ifndef __AUTHSERVICE_H__
4#define __AUTHSERVICE_H__
11#include "../common/gsSoap.h"
12#include "../common/gsCrypt.h"
13#include "../common/gsLargeInt.h"
15#if defined(__cplusplus)
24#define WS_LOGIN_MAX_URL_LEN (128)
25extern char wsAuthServiceURL[WS_LOGIN_MAX_URL_LEN];
30#define WSLogin_PARTNERCODE_GAMESPY 0
31#define WSLogin_NAMESPACE_SHARED_NONUNIQUE 0
32#define WSLogin_NAMESPACE_SHARED_UNIQUE 1
34typedef enum WSLoginValue
39 WSLogin_ServerInitFailed,
42 WSLogin_InvalidPassword,
43 WSLogin_InvalidProfile,
44 WSLogin_UniqueNickExpired,
51 WSLogin_HttpError = 100,
53 WSLogin_InvalidCertificate,
56 WSLogin_InvalidParameters,
57 WSLogin_NoAvailabilityCheck,
66#define WS_LOGIN_SIGKEY_LEN_BITS (GS_CRYPT_RSA_BINARY_SIZE)
67#define WS_LOGIN_PEERKEY_LEN_BITS (GS_CRYPT_RSA_BINARY_SIZE)
69#define WS_LOGIN_NICK_LEN (30+1)
70#define WS_LOGIN_EMAIL_LEN (50+1)
71#define WS_LOGIN_PASSWORD_LEN (30+1)
72#define WS_LOGIN_UNIQUENICK_LEN (20+1)
73#define WS_LOGIN_CDKEY_LEN (64+1)
74#define WS_LOGIN_PEERKEYMOD_LEN (WS_LOGIN_PEERKEY_LEN_BITS/8)
75#define WS_LOGIN_PEERKEYEXP_LEN (WS_LOGIN_PEERKEY_LEN_BITS/8)
76#define WS_LOGIN_PEERKEYPRV_LEN (WS_LOGIN_PEERKEY_LEN_BITS/8)
77#define WS_LOGIN_KEYHASH_LEN (33)
78#define WS_LOGIN_SIGNATURE_LEN (WS_LOGIN_SIGKEY_LEN_BITS/8)
79#define WS_LOGIN_SERVERDATA_LEN (WS_LOGIN_PEERKEY_LEN_BITS/8)
80#define WS_LOGIN_AUTHTOKEN_LEN (256)
81#define WS_LOGIN_PARTNERCHALLENGE_LEN (256)
97 gsi_char mProfileNick[WS_LOGIN_NICK_LEN];
98 gsi_char mUniqueNick[WS_LOGIN_UNIQUENICK_LEN];
99 gsi_char mCdKeyHash[WS_LOGIN_KEYHASH_LEN];
101 gsi_u8 mSignature[GS_CRYPT_RSA_BYTE_SIZE];
102 gsi_u8 mServerData[WS_LOGIN_SERVERDATA_LEN];
110 char mKeyHash[GS_CRYPT_MD5_HASHSIZE];
119 wsLoginType_UNIQUENICK,
120 wsLoginType_GPTICKET,
121 wsLoginType_REMOTEAUTH
150 WSLoginValue mLoginResult;
151 WSLoginValue mResponseCode;
153 GSLoginPrivateData mPrivateData;
157typedef void (*WSLoginCallback)(GHTTPResult httpResult,
WSLoginResponse * response,
void * userData);
165 WSLoginValue mLoginResult;
166 WSLoginValue mResponseCode;
167 char mRemoteAuthToken[WS_LOGIN_AUTHTOKEN_LEN];
168 char mPartnerChallenge[WS_LOGIN_PARTNERCHALLENGE_LEN];
172typedef void (*WSLoginPs3CertCallback)(GHTTPResult httpResult,
WSLoginPs3CertResponse * response,
void * userData);
178gsi_u32 wsLoginProfile(
int partnerCode,
int namespaceId,
const gsi_char * profileNick,
const gsi_char * email,
const gsi_char * password,
const gsi_char * cdkeyhash, WSLoginCallback callback,
void * userData);
179gsi_u32 wsLoginUnique (
int partnerCode,
int namespaceId,
const gsi_char * uniqueNick,
const gsi_char * password,
const gsi_char * cdkeyhash, WSLoginCallback callback,
void * userData);
180gsi_u32 wsLoginRemoteAuth(
int partnerCode,
int namespaceId,
const gsi_char authtoken[WS_LOGIN_AUTHTOKEN_LEN],
const gsi_char partnerChallenge[WS_LOGIN_PARTNERCHALLENGE_LEN], WSLoginCallback callback,
void * userData);
183gsi_u32 wsLoginPs3Cert(
int gameId,
int partnerCode,
int namespaceId,
const gsi_u8 * ps3cert,
int certLen, WSLoginPs3CertCallback callback,
void * userData);
187gsi_bool wsLoginCertWriteXML (
const GSLoginCertificate * cert,
const char * anamespace, GSXmlStreamWriter writer);
188gsi_bool wsLoginCertWriteBinary(
const GSLoginCertificate * cert,
char * bufout,
unsigned int maxlen,
unsigned int * lenout);
189gsi_bool wsLoginCertReadBinary (
GSLoginCertificate * certOut,
char * bufin,
unsigned int maxlen);
195#if defined(__cplusplus)
Definition AuthService.h:108
Definition AuthService.h:87
Definition AuthService.h:164
Definition AuthService.h:149