summaryrefslogtreecommitdiff
path: root/external/bsd/pam-u2f/dist/tests/basic.c
blob: 81ebd8079e0f9e8f1efba59b6a8228463bba37a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 *  Copyright (C) 2014-2018 Yubico AB - See COPYING
 */

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

/* These #defines must be present according to PAM documentation. */
#define PAM_SM_AUTH

#ifdef HAVE_SECURITY_PAM_APPL_H
#include <security/pam_appl.h>
#endif
#ifdef HAVE_SECURITY_PAM_MODULES_H
#include <security/pam_modules.h>
#endif

int main(int argc, const char **argv) {
  pam_handle_t *pamh = NULL;
  int rc;

  rc = pam_sm_authenticate(pamh, 0, 1, argv);

  printf("rc %d\n", rc);

  return 0;
}