#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "pam_misc.h"
#include "pam_bt_misc.h"
#include "pam_bt_pair.h"
#include "pam_sec.h"
Go to the source code of this file.
|
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) |
|
◆ bluetooth_login()
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
- Parameters
-
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 |
- Returns
- : return 1 if the trusted bluetooth device is detected
Definition at line 148 of file pam_bt_trust.c.
◆ find_trusted_devices()
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
- Parameters
-
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 |
- Returns
- the list of trusted devices
Definition at line 109 of file pam_bt_trust.c.
◆ find_trusted_paired_device()
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
- Parameters
-
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 |
- Returns
- : 1 iff a trusted device for the user is detected
Definition at line 3 of file pam_bt_trust.c.
◆ get_trusted_dev_file()
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
- Parameters
-
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 |
- Returns
- : the file handle of the user's trusted device file
Definition at line 26 of file pam_bt_trust.c.
◆ set_trusted_devices()
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.
- Parameters
-
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.
◆ trusted_dir_path
const char* trusted_dir_path |
|
extern |