ProxyAuth
Linux PAM to authenticate device via Bluetooth device
Functions
pam_bt_pair.c File Reference
#include "pam_bt_pair.h"
Include dependency graph for pam_bt_pair.c:

Go to the source code of this file.

Functions

char * check_is_paired (GVariant *properties)
 
char ** process_dbus_bt_list (GVariant *result, int *num_of_paired)
 
char ** get_paired_devices (int *num_of_paired)
 

Function Documentation

◆ check_is_paired()

char* check_is_paired ( GVariant *  properties)

Return Bluetooth address if the device is paired. Else return NULL

Parameters
propertiesAn 'object' that holds a specific bluetooth device's metadata
Returns
: Return Bluetooth address if the device is paired. Else return NULL

Definition at line 3 of file pam_bt_pair.c.

◆ get_paired_devices()

char** get_paired_devices ( int *  num_of_paired)

Return a list of Bluetooth addresses that is currently paired (connected) to the host

Approach: Use dbus to list all the bluetooth devices and see the connected property The paired property only indicates if the device has been paired with the host before and not if it is currently paired

Parameters
num_of_pairedthe number of devices paired to the host NOTE: the value is set within the helper function that the function will call
Returns
: return a list of bluetooth addresses connected to the host

Definition at line 86 of file pam_bt_pair.c.

Here is the call graph for this function:

◆ process_dbus_bt_list()

char** process_dbus_bt_list ( GVariant *  result,
int *  num_of_paired 
)

Return a list of paired devices

Parameters
num_of_pairedthe number of devices that are paired NOTE: The number is set in this function
resultThe object returned by request to DBUS for all managed bluetooth object
Returns
: returns a list of paired devices. Need to free

Definition at line 43 of file pam_bt_pair.c.

Here is the call graph for this function: