Extra Systems

CYPHERNET

procedure get_fingerprint_items


The get_fingerprint_items procedure is called from check_finger_print to extract the information (caller identifier client_id, called subscriber identifier server_id, requested connection type client_mode, and prolog length prolog_size) from the fingerprint object received by the Extra Systems Cypher Net central server from its subscriber. The prolog is a message sent from one subscriber to another in the get_common_key procedure to agree on a session key. The prolog size is equal to PACKED_VALUE_LENTH + HASH_SIZE, but since different hashing algorithms can be used in different deliveries, this information is included in the fingerprint so that the server knows what size of this service packet it should send (during the execution of the connect_server procedure).

#define FINGERPRINT_CLIENT_MODE_BYTE	2

typedef struct finger_print
{
	unsigned char mixed_item[ITEM_SIZE * 2 * 3];
	unsigned char mixed_hash[HARD_HASH_SIZE];
} FINGERPRINT;

void get_fingerprint_items(PEERID *client_id, PEERID *server_id, char *client_mode, int *prolog_size, FINGERPRINT * fingerprint) {
	int i,j;
	unsigned char *client;
	unsigned char *server;
	unsigned char *prolog;
	client = (unsigned char *) client_id;
	server = (unsigned char *) server_id;
	prolog = (unsigned char *) prolog_size;
	*client_mode = fingerprint->mixed_item[FINGERPRINT_CLIENT_MODE_BYTE];
	for (i = 0; i < ITEM_SIZE; i++) client[i] = fingerprint->mixed_item[i * 2 + 1];
	for (j = 0; j < ITEM_SIZE; i++, j++) server[j] = fingerprint->mixed_item[i * 2 + 1];
	for (j = 0; j < ITEM_SIZE; i++, j++) prolog[j] = fingerprint->mixed_item[i * 2 + 1];
}

The content of this page is also available in French, German, Ukrainian and Russian.


© Extra Systems, 2024 Extra Web Top