#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <errno.h>
#include <openssl/rsa.h>
#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <mysql.h>
#include "WFU.h"
Go to the source code of this file.
Data Structures | |
struct | user_information |
Structure that stores the user information. More... | |
struct | key_information |
Structure that stores the information about a key. More... | |
Functions | |
int | WFU_server_dispatch (SSL *ssl, char *client_ip) |
The core server component. | |
int | WFU_server_verify_uvid (SSL *ssl, MYSQL *mysql) |
Server component of verify_uvid. | |
char * | WFU_server_authenticate (SSL *ssl) |
Server authentication component. | |
int | WFU_server_public_key (SSL *ssl) |
Server public key component. | |
int | WFU_server_store_keys (SSL *ssl, MYSQL *mysql, struct user_information *user_info) |
Server key storage component. | |
int | WFU_server_reclaim_keys (SSL *ssl, MYSQL *mysql) |
Server key retrieval component. | |
int | WFU_server_query_salt (SSL *ssl, MYSQL *mysql) |
Server salt query component. | |
int | WFU_server_query_user (SSL *ssl, MYSQL *mysql) |
Server user query component. | |
int | WFU_server_test_ssl (SSL *ssl) |
An SSL testing function for development only. | |
MYSQL * | WFU_mysql_connect () |
Create a connection to the MySQL database. | |
void | WFU_mysql_close (MYSQL *mysql) |
Closes the connection to the MySQL database. | |
int | WFU_select_last_insert_id (MYSQL *mysql) |
Returns the value of the last autoincrement value. | |
user_information * | WFU_user_exists (MYSQL *mysql, char *user_name) |
Test to see whether a user exists with the given username. | |
user_information * | WFU_create_user (MYSQL *mysql, char *user_name) |
Create a user account with the given user_name. | |
void | WFU_free_user_information (struct user_information *user_info) |
Releases the memory used by the user_information structure. | |
int | WFU_insert_key (MYSQL *mysql, struct user_information *user_info, struct wfu_uvid *uvid, struct wfu_data *keys) |
Store the escrow information in the MySQL database. | |
wfu_data * | WFU_get_key (MYSQL *mysql, int key_pk) |
Retrieve the key data given a key escrow number. | |
wfu_data * | WFU_uvid2salt (struct wfu_uvid *uvid) |
Extract the salt from a uvid structure. | |
wfu_data * | WFU_uvid2time (struct wfu_uvid *uvid) |
Extract the time from a uvid structure. | |
key_information * | WFU_verify_uvid (MYSQL *mysql, struct user_information *user_info, struct wfu_uvid *uvid) |
Verify whether the uvid is indexed. | |
wfu_line_array * | WFU_query_salt (MYSQL *mysql, struct wfu_data *salt_data) |
Will return a list of key information for the volumes having the specified salt. | |
wfu_line_array * | WFU_query_user (MYSQL *mysql, struct user_information *user_info) |
Will return a list of key information for the volumes associated with the given user information. |
|
Create a user account with the given user_name. The user informaiton for the account will be returned. If the user_name already belongs to an account, the function returns the user_information just as the function WFU_user_exists().
|
|
Releases the memory used by the user_information structure.
|
|
Retrieve the key data given a key escrow number. This will query the USER_KEY table for a row with the specified primary key value. It will return the escrow data from that row. A NULL will be returned if the row is not found.
|
|
Store the escrow information in the MySQL database. A row will be added to the USER_KEY table with a foreign key referencing the user_id. The uvid will be split into the salt and timestamp. The salt, timestamp and encrypted key information will be stored in this row. Additionally, the current time will be stored.
|
|
Closes the connection to the MySQL database.
|
|
Create a connection to the MySQL database.
|
|
Will return a list of key information for the volumes having the specified salt. The function will constructs a list of possible escrow entries associated with this salt. Each entry of the list includes the escrow date, key escrow number and username. This function will return a pointer to a wfu_line_array structure containing this list.
|
|
Will return a list of key information for the volumes associated with the given user information. The function will constructs a list of possible escrow entries associated with this user. Each entry of the list includes the escrow date, key escrow number and username. This function will return a pointer to a wfu_line_array structure containing this list.
|
|
Returns the value of the last autoincrement value.
|
|
Server authentication component. This is the server function that handles the request from WFU_client_authenticate(). The parameters for the request are read from the SSL connection and check against the LDAP server. An answer is send to the client. If successful, the return value contains information about the user.
|
|
The core server component. This function manages the server actions. Commands are read from the network and this function determins which routine, if any, should handle the request.
|
|
Server public key component. This is the server function that handles the request from WFU_client_public_key(). The user must be authenticated.
|
|
Server salt query component. This is the server function that handles the WFU_restore_query_salt() request. The function reads the salt data from the network and constructs a list of possible escrow entries associated with this salt. Each entry of the list includes the escrow date, key escrow number and username associated with the salt.
|
|
Server user query component. This is the server function that handles the WFU_restore_query_user() request. The function reads the username from the network and constructs a list of possible escrow entries associated with this user. Each entry of the list includes the escrow date, key escrow number and username.
|
|
Server key retrieval component. This is the server function that handles the WFU_restore_reclaim_keys() request. The key escrow number is read from the SSL connection, the data is retrieved from the database and returned to the client. The server cannot decrypt the key information. The client must perform the decryption.
|
|
Server key storage component. This is the server function that handles the WFU_client_store_keys() request. This function accepts the user's information as a parameter, therefore the user must be authenticated prior to this call. The uvid and encrypted data will be read from the SSL connection. The data will be stored under the user_id using the mysql connection. (The username in the uvid structure is ignored.)
|
|
Server component of verify_uvid. This is the server function that handles the request from WFU_client_verify_uvid(). The parameters for the request are read from the SSL connection and check against MYSQL database connection. An answer is send to the client.
|
|
Test to see whether a user exists with the given username. If the username does exists, then the user information will be returned. NULL will be returned if the user is not found.
|
|
Extract the salt from a uvid structure. The salt will be packaged in a wfu_data structure and returned.
|
|
Extract the time from a uvid structure. The time will be packaged in a wfu_data structure and returned.
|
|
Verify whether the uvid is indexed. The time and salt will be extracted from the uvid structure. The the user_id will be extracted from the user_info structure. The function will query the USER_KEY table for a row with this time, salt and user_id. If a row is found, the key_information structure for this row will be returned.
|