Navigation


Changeset 1088:1d1a20a0779d in freeDiameter for extensions/app_radgw/rgwx_auth.c


Ignore:
Timestamp:
May 5, 2013, 4:25:27 AM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Second part of changeset 1083, now the code compiles again. Still missing some functions implementation, though

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_radgw/rgwx_auth.c

    r1027 r1088  
    125125};
    126126
     127struct sess_state {
     128        char req_auth[16];
     129};
     130
     131
    127132/* Initialize the plugin */
    128133static int auth_conf_parse(char * confstr, struct rgwp_config ** state)
     
    137142        memset(new, 0, sizeof(struct rgwp_config));
    138143       
    139         CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, free, NULL ) );
     144        CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, (void *)free, NULL, NULL ) );
    140145        new->confstr = confstr;
    141146       
     
    10571062        /* Store the request identifier in the session (if provided) */
    10581063        {
    1059                 unsigned char * req_auth;
    1060                 CHECK_MALLOC(req_auth = malloc(16));
    1061                 memcpy(req_auth, &rad_req->hdr->authenticator[0], 16);
     1064                struct sess_state  *st;
     1065                CHECK_MALLOC(st = malloc(sizeof(struct sess_state)));
     1066                memcpy(st->req_auth, &rad_req->hdr->authenticator[0], 16);
    10621067               
    1063                 CHECK_FCT( fd_sess_state_store( cs->sess_hdl, sess, &req_auth ) );
     1068                CHECK_FCT( fd_sess_state_store( cs->sess_hdl, sess, &st ) );
    10641069        }
    10651070       
     
    10771082        int no_str = 0; /* indicate if an STR is required for this server */
    10781083        uint8_t tuntag = 0;
    1079         unsigned char * req_auth = NULL;
     1084        struct sess_state  *st;
    10801085        int error_cause = 0;
    10811086        struct session * sess;
     
    10891094        CHECK_FCT( fd_msg_sess_get(fd_g_config->cnf_dict, *diam_ans, &sess, NULL) );
    10901095        if (sess) {
    1091                 CHECK_FCT( fd_sess_state_retrieve( cs->sess_hdl, sess, &req_auth ) );
     1096                CHECK_FCT( fd_sess_state_retrieve( cs->sess_hdl, sess, &st ) );
    10921097                CHECK_FCT( fd_sess_getsid(sess, &sid, &sidlen) );
    10931098        } /* else ? */
     
    17591764                                                                                       
    17601765                                                                                        /* We need the request authenticator */
    1761                                                                                         CHECK_PARAMS(req_auth);
     1766                                                                                        CHECK_PARAMS(st);
    17621767
    17631768                                                                                        /* Retrieve the shared secret */
     
    17781783                                                                                        addr[0] = secret;
    17791784                                                                                        len[0] = secret_len;
    1780                                                                                         addr[1] = req_auth;
     1785                                                                                        addr[1] = st->req_auth;
    17811786                                                                                        len[1] = 16;
    17821787                                                                                        addr[2] = &buf[1];
     
    18531858
    18541859                                                /* We need the request authenticator */
    1855                                                 CHECK_PARAMS(req_auth);
     1860                                                CHECK_PARAMS(st);
    18561861
    18571862                                                /* Retrieve the shared secret */
     
    18661871                                                send_len = ahdr->avp_value->os.len - recv_len;
    18671872                                               
    1868                                                 if ( ! radius_msg_add_mppe_keys(*rad_fw, req_auth, secret, secret_len,
     1873                                                if ( ! radius_msg_add_mppe_keys(*rad_fw, st->req_auth, secret, secret_len,
    18691874                                                                ahdr->avp_value->os.data + recv_len, send_len,
    18701875                                                                ahdr->avp_value->os.data, recv_len) ) {
     
    19251930       
    19261931        CHECK_FCT( fd_msg_free( aoh ) );
    1927         free(req_auth);
     1932        free(st);
    19281933       
    19291934        if (error_cause) {
Note: See TracChangeset for help on using the changeset viewer.