[Verse-dev] host_id

Eskil Steenberg eskil at obsession.se
Mon Oct 4 19:52:17 CEST 2004


Thorsten Jordan wrote:

> Hello,
>
> according the port from verse3 to verse4 - what exactly is the host id?
> A signle uint8 or an c-string?!

Ok, This is none thing that is not yet properly, implemented so just 
ignore it or pass in NULL.

But i can tell you how its going to work:

host_id is a pointer to an array of uint8. the length of this should be 
two defines that looks like they have slipped the verse.h file

thees functions are used on the host to create a hist id:

extern uint8    *verse_host_id_create(uint8 *id);

This function creates a new host id. once you have created the id you 
can save it in a file, to be able to shut down the server and re start 
it with the same id.

extern void        verse_host_id_set(uint8 *id);

And this function allows you to set the host id. The array should be 
1536 bytes long. it contains both a private and public key ans should be 
kept a secret.

On the client side only the public key is given so its only 1024 bytes 
long. If the client has the host id of the host its going to connect to 
it can pass it in as "expected_host_id" to verse_send_connect. If you 
pass in an expected id that doesnt match the host id, the connection 
will fail. (this test can not be faked by a host of a man in the middle)

Once you have got an accept you can store the host_id is param of 
verse_send_connect_accept so that you can connect to the same host again 
and make sure its the same host.

E


More information about the Verse-dev mailing list