Unrecognized auth message/Using key files with GoW CWE

Discussions About MOSS (Myst Online Server Software)

Moderator: a'moaca'

Nobby deNobbs
Member
Posts: 6
Joined: Thu Apr 07, 2011 11:51 am

Unrecognized auth message/Using key files with GoW CWE

Post by Nobby deNobbs » Mon Dec 21, 2015 5:19 pm

I've set up everything already, I only need to convert/encrypt the keyfiles for my client. I made them using

Code: Select all

make_cyan_dh -g 2 -s auth_key.der -c auth_key.bin
make_cyan_dh -g 2 -s game_key.der -c game_key.bin
make_cyan_dh -g 2 -s gatekeeper_key.der -c gate_key.bin
I tried using this script with the .bin files:

Code: Select all

import base64

fileList = [['game_key.bin', 'Game'], ['gate_key.bin', 'Gate'], ['auth_key.bin', 'Auth']]
iniList = []

for i in fileList:
    file = open(i[0], 'rb')
    n = list(file.read(64))
    x = list(file.read(64))
    file.close()
    #n.reverse()     #I've tried the same .bin files with inverting x & n
    #x.reverse()
    iniList.append(['Server.' + i[1] + '.N "' + base64.b64encode("".join(n)) + '"\n', 'Server.' + i[1] + '.X "' + base64.b64encode("".join(x)) + '"\n'])
iniList[0].append('\n')

#time for user Input

ip = '"' + raw_input('Hostname: ') + '"'
dispName = 'Server.DispName ' + '"' + raw_input('DispName: ') + '"' + '\n'
statusUrl = 'Server.Status ' + '"' + raw_input('Status URL: ') + '"' + '\n'
signupUrl = 'Server.Signup ' + '"' + raw_input('Signup URL: ') + '"' + '\n'

for l in range(1, 3):
    iniList[l].append('Server.' + fileList[l][1] + '.Host ' + ip + '\n\n')
    
for l in [[dispName], [statusUrl], [signupUrl]]:
    iniList.append(l)

outFile = open('server.ini', 'w')

for l in iniList:
    for i in l:
        outFile.write(i)

outFile.close()
The lenght of the files seems to be okay, but not the content. I always get some "unrecognized auth message..." in my log files.
Does anyone know what I did wrong? Actually I'm a newbie to encryption :oops:

Greetings McLayan

Edit: Forgot to mention that I'm trying to set up a MOSS server, the last step would be to synchronize the keys.
Last edited by Nobby deNobbs on Mon Dec 21, 2015 8:29 pm, edited 1 time in total.

User avatar
Mac_Fife
Member
Posts: 1229
Joined: Fri Dec 19, 2008 12:38 am
Location: Scotland
Contact:

Re: Unrecognized auth message/Using key files with GoW CWE

Post by Mac_Fife » Mon Dec 21, 2015 7:51 pm

Your statements for generating the key files look OK to me. I've got no idea about the script to create the server.INI file though - I've no idea what the client is expecting.
Mac_Fife
OpenUru.org wiki wrangler

User avatar
Mac_Fife
Member
Posts: 1229
Joined: Fri Dec 19, 2008 12:38 am
Location: Scotland
Contact:

Re: Unrecognized auth message/Using key files with GoW CWE

Post by Mac_Fife » Mon Dec 21, 2015 8:03 pm

Hmm, just a minute... Are you trying to create a server.INI for an internal client or an external client? External clients must have an encrypted server.INI file while the internal client doesn't. You need to process the file using plFileEncrypt (with the INI file in the same folder) for the external client.
Mac_Fife
OpenUru.org wiki wrangler

Nobby deNobbs
Member
Posts: 6
Joined: Thu Apr 07, 2011 11:51 am

Re: Unrecognized auth message/Using key files with GoW CWE

Post by Nobby deNobbs » Mon Dec 21, 2015 8:27 pm

My script is based on the function Christian Walther wrote in a nother thread:
Christian Walther wrote: It’s been a while since I did this so my memory is hazy, but I think the only moderately involved part about it is to base64-encode the keys. I did that in the interactive Python interpreter using the base64 module. Converting between byte-wise hex text and binary representations is easy in Python too, if needed. To check whether you got the byte order and everything right, it helps to try it with a known example such as the MOULa keys.

I just looked in my MOSS server folder and found this, maybe you find it helpful – I’m not sure where the input files that it takes are from, maybe from make_cyan_dh -c:

Code: Select all

#!/usr/bin/env python

import base64

def printkey(infile, outname):
        with open(infile, "r") as f:
                n = list(f.read(64))
                n.reverse()
                x = list(f.read(64))
                x.reverse()
                print "Server." + outname + '.N "' + base64.b64encode("".join(n)) + '"'
                print "Server." + outname + '.X "' + base64.b64encode("".join(x)) + '"'

printkey("game_pub", "Game")
print
printkey("gatekeeper_pub", "Gate")
print 'Server.Gate.Host "10.211.55.2"'
print
printkey("auth_pub", "Auth")
print 'Server.Auth.Host "10.211.55.2"'
print
print 'Server.DispName "Lonqua"'
print 'Server.Status "http://10.211.55.2:14617/serverstatus/urulivelive.php"'
print 'Server.Signup ""'
I would like to make a server.ini for an internal CWE client.

User avatar
Hoikas
Member
Posts: 286
Joined: Fri Jun 03, 2011 8:38 pm

Re: Unrecognized auth message/Using key files with GoW CWE

Post by Hoikas » Mon Dec 21, 2015 9:01 pm

The H-uru codebase no longer supports MOSS servers due to limitations in its design. Please utilize DirtSand. But if you must use MOSS, an invalid message type means you aren't using the right encryption keys somewhere. H-uru wants the keys in big endian, but I don't know what MOSS gives you, sorry.
Image

Nobby deNobbs
Member
Posts: 6
Joined: Thu Apr 07, 2011 11:51 am

Re: Unrecognized auth message/Using key files with GoW CWE

Post by Nobby deNobbs » Thu Dec 31, 2015 3:24 pm

Hoikas wrote:The H-uru codebase no longer supports MOSS servers due to limitations in its design. Please utilize DirtSand.
Okay thanks, I'll try to set up a Dirtsand server next year.
But still I would like to get it working with MOSS, maybe I could test my code by converting the public keys for MOULagain. The problem is just that I don't know how to get them, they are hard coded in the MOULa external clients and encrypted in the server.ini files for the GoW internal client. Could someone tell me where to find them?

wish you all a happy New Year :)
Nobby

EDIT: I found out what the problem was: I used the wrong generator for make_cyan_dh. My little script works fine, just I'm not able to link into AvatarCustomization after choosing a name for my avatar (I'll have a look at the logfiles tomorrow).

User avatar
Mac_Fife
Member
Posts: 1229
Joined: Fri Dec 19, 2008 12:38 am
Location: Scotland
Contact:

Re: Unrecognized auth message/Using key files with GoW CWE

Post by Mac_Fife » Thu Dec 31, 2015 5:56 pm

I think you're missing the point. To make your client work with a MOSS server using the MOULagain keys you'll need the private server keys as well as the public ones for the client. While the latter can be extracted from the client code, the former is, well, "private". So you're probably better to work with freshly generated key pairs of your own.
Mac_Fife
OpenUru.org wiki wrangler

User avatar
Mac_Fife
Member
Posts: 1229
Joined: Fri Dec 19, 2008 12:38 am
Location: Scotland
Contact:

Re: Unrecognized auth message/Using key files with GoW CWE

Post by Mac_Fife » Thu Dec 31, 2015 6:00 pm

Have you copied all the game files from a working MOULa install into your client's folder?
Mac_Fife
OpenUru.org wiki wrangler

Nobby deNobbs
Member
Posts: 6
Joined: Thu Apr 07, 2011 11:51 am

Re: Unrecognized auth message/Using key files with GoW CWE

Post by Nobby deNobbs » Fri Jan 01, 2016 12:33 pm

Mac_Fife wrote:I think you're missing the point. To make your client work with a MOSS server using the MOULagain keys you'll need the private server keys as well as the public ones for the client. While the latter can be extracted from the client code, the former is, well, "private". So you're probably better to work with freshly generated key pairs of your own.
No, I just wanted to see if my script for creating a server.ini file works. I would have taken the public MOULa keys to see if my script produces a server.ini matching the one GoW released with their CWE client for MOULa, but I already got it working with keys I made myself.
Mac_Fife wrote:Have you copied all the game files from a working MOULa install into your client's folder?
Yes, my client is fully functional. It works fine with MOULa but when I'm about to link into AvatarCustomization after typing in an avatar name I get an Network Error 5:
Image

The game server log files look like this:

Code: Select all

1451650595.542953  INFO game: game startup
1451650595.543215  INFO game: I'm a AvatarCustomization server, UUID 23b1e319-65e7-49c6-83e1-b028b9b69c69, internal ID 0100007f,780cebc2
1451650595.543370 DEBUG game: No SDL found for age AvatarCustomization
1451650595.566021 DEBUG game: Shutdown timer was active, cancelling

User avatar
Mac_Fife
Member
Posts: 1229
Joined: Fri Dec 19, 2008 12:38 am
Location: Scotland
Contact:

Re: Unrecognized auth message/Using key files with GoW CWE

Post by Mac_Fife » Fri Jan 01, 2016 2:08 pm

Sounds like you haven't set up game-dir and game-dir/age folders on the server: http://wiki.openuru.org/index.php?title ... erver_Data
Mac_Fife
OpenUru.org wiki wrangler

Post Reply

Return to “MOSS”

Who is online

Users browsing this forum: No registered users and 2 guests