Hardware authentication for Linux using ordinary USB Flash Drives.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.9 KiB

  1. /*
  2. * Copyright (c) 2003-2007 Andrea Luzzardi <scox@sig11.org>
  3. *
  4. * This file is part of the pam_usb project. pam_usb is free software;
  5. * you can redistribute it and/or modify it under the terms of the GNU General
  6. * Public License version 2, as published by the Free Software Foundation.
  7. *
  8. * pam_usb is distributed in the hope that it will be useful, but WITHOUT ANY
  9. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  10. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  11. * details.
  12. *
  13. * You should have received a copy of the GNU General Public License along with
  14. * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
  15. * Street, Fifth Floor, Boston, MA 02110-1301 USA
  16. */
  17. #ifndef PUSB_CONF_H_
  18. # define PUSB_CONF_H_
  19. # define PUSB_CONF_FILE "/etc/pamusb.conf"
  20. # define CONF_DEVICE_XPATH "//configuration/devices/device[@id='%s']/%s"
  21. # define CONF_USER_XPATH "//configuration/users/user[@id='%s']/%s"
  22. # define CONF_SERVICE_XPATH "//configuration/services/service[@id='%s']/%s"
  23. # define CONF_USER_MAXLEN 32
  24. # include <limits.h>
  25. #ifdef __linux__
  26. # include <linux/limits.h>
  27. #endif
  28. # include <sys/time.h>
  29. # ifndef PATH_MAX
  30. # define PATH_MAX 4096
  31. # endif
  32. typedef struct pusb_device
  33. {
  34. char name[128];
  35. char vendor[128];
  36. char model[128];
  37. char serial[128];
  38. char volume_uuid[128];
  39. } t_pusb_device;
  40. typedef struct pusb_options
  41. {
  42. time_t probe_timeout;
  43. int enable;
  44. int debug;
  45. int quiet;
  46. int color_log;
  47. int one_time_pad;
  48. time_t pad_expiration;
  49. int deny_remote;
  50. char hostname[64];
  51. char system_pad_directory[PATH_MAX];
  52. char device_pad_directory[PATH_MAX];
  53. t_pusb_device device;
  54. } t_pusb_options;
  55. struct s_opt_list
  56. {
  57. char *name;
  58. char *value;
  59. };
  60. int pusb_conf_init(t_pusb_options *opts);
  61. int pusb_conf_parse(const char *file, t_pusb_options *opts, const char *user, const char *service);
  62. #endif /* !PUSB_CONF_H_ */