summaryrefslogtreecommitdiff
path: root/lib/attr.c
blob: bf5e1057acc20508db34a47ea2b32966e5ae817d (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
#include <freeradius/libradius.h>
#include "libradsec.h"
#include "libradsec-impl.h"

fixme
attr_create(fixme)
{

  printf ("creating value pairs\n");
  /* User-Name.  */
  vp = pairmake ("User-Name", USER_NAME, 0);
  if (!vp) {
    fr_perror ("pairmake");
    return -1;
  }

  /* User-Password.  */
  {
    size_t pwlen =  sizeof(USER_PW);
    strncpy (user_pw, USER_PW, sizeof(user_pw));
    rad_pwencode(user_pw, &pwlen, SECRET, reqauth);
  }
  pairadd (&vp, pairmake ("User-Password", user_pw, 0));
  pkt->vps = vp;

  printf ("attributes:\n");
  vp_printlist (stdout, vp);
}