ProxyAuth
Linux PAM to authenticate device via Bluetooth device
|
#include "pam_bt_trust.h"
Go to the source code of this file.
Functions | |
int | find_trusted_paired_device (FILE *log_fp, char **trusted_devices, int num_of_devices, char **paired_devices, int num_of_paired, char **detected_dev) |
FILE * | get_trusted_dev_file (const char *trusted_dir_path, const char *username, FILE *log_fp) |
void | set_trusted_devices (FILE *trusted_dev_fp, char **trusted_devices, int num_trusted_devices) |
char ** | find_trusted_devices (FILE *log_fp, const char *trusted_dir_path, const char *username, int *num_of_devices) |
int | bluetooth_login (FILE *log_fp, const char *trusted_dir_path, const char *username, char **detected_dev) |
int bluetooth_login | ( | FILE * | log_fp, |
const char * | trusted_dir_path, | ||
const char * | username, | ||
char ** | detected_dev | ||
) |
Deals whether or not the device is able to login via bluetooth
log_fp | the file handle for the log file |
trusted_dir_path | the path of where all the user's trusted devices are located |
username | the username of the user who wants to login |
detected_dev | The bluetooth address of the device that authenticates PAM NOTE: find_trusted_paired_device(...) will allocate and set the bluetooth address. Developer must free the memory themselves |
Definition at line 148 of file pam_bt_trust.c.
char** find_trusted_devices | ( | FILE * | log_fp, |
const char * | trusted_dir_path, | ||
const char * | username, | ||
int * | num_of_devices | ||
) |
Populate the array with trusted devices
log_fp | the file handle for the log file |
trusted_dir_path | the path where the trusted bluetooth device files for all users are located |
username | the username of the user that wants to log in |
num_of_devices | the number of devices the users trust to authenticate their system Note: the number is set in this function |
Definition at line 109 of file pam_bt_trust.c.
int find_trusted_paired_device | ( | FILE * | log_fp, |
char ** | trusted_devices, | ||
int | num_of_devices, | ||
char ** | paired_devices, | ||
int | num_of_paired, | ||
char ** | detected_dev | ||
) |
Return 1 iff a trusted device for the user is connected
log_fp | the handle of the log file |
trusted_devices | the array of trusted bluetooth MAC addresses of the user |
num_of_devices | the number of devices the user trusts |
detected_dev | the address of the detected device NOTE: detected_dev will be set in this function if a device was detected |
Definition at line 3 of file pam_bt_trust.c.
FILE* get_trusted_dev_file | ( | const char * | trusted_dir_path, |
const char * | username, | ||
FILE * | log_fp | ||
) |
Return file pointer for the user's trusted bluetooth device
trusted_dir_path | the path to where all the user's trusted device file is located |
username | the username |
log_fp | the handle for the log file |
Definition at line 26 of file pam_bt_trust.c.
void set_trusted_devices | ( | FILE * | trusted_dev_fp, |
char ** | trusted_devices, | ||
int | num_trusted_devices | ||
) |
Write to the array all the trusted bluetooth MAC addresses.
trusted_dev_fp | the file handle of the user's trusted device file |
trusted_devices | an array that will contain all the user's trusted bluetooth MAC addresses to authenticate from |
Definition at line 81 of file pam_bt_trust.c.