Navigation


Changeset 539:6994e9a3c528 in freeDiameter


Ignore:
Timestamp:
Sep 11, 2010, 8:52:36 AM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

The previous commit provoked an Accounting-Response with empty authenticator... Should be fixed now.

Location:
extensions/app_radgw
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_radgw/radius.c

    r518 r539  
    349349        size_t len[4];
    350350
    351         os_memset(auth, 0, MD5_MAC_LEN);
    352         attr = radius_msg_add_attr(msg, RADIUS_ATTR_MESSAGE_AUTHENTICATOR,
    353                                    auth, MD5_MAC_LEN);
    354         if (attr == NULL) {
    355                 printf("WARNING: Could not add Message-Authenticator\n");
    356                 return -1;
     351        if (msg->hdr->code != RADIUS_CODE_ACCOUNTING_RESPONSE) {
     352            os_memset(auth, 0, MD5_MAC_LEN);
     353            attr = radius_msg_add_attr(msg, RADIUS_ATTR_MESSAGE_AUTHENTICATOR,
     354                                       auth, MD5_MAC_LEN);
     355            if (attr == NULL) {
     356                    printf("WARNING: Could not add Message-Authenticator\n");
     357                    return -1;
     358            }
    357359        }
    358360        msg->hdr->length = htons(msg->buf_used);
  • extensions/app_radgw/rgw_clients.c

    r538 r539  
    841841        }
    842842       
    843         if ((*msg)->hdr->code != RADIUS_CODE_ACCOUNTING_RESPONSE) {
    844             if (radius_msg_finish_srv(*msg, cli->key.data, cli->key.len, req->radius.hdr->authenticator)) {
    845                     TRACE_DEBUG(INFO, "An error occurred while preparing the RADIUS answer");
    846                     radius_msg_free(*msg);
    847                     free(*msg);
    848                     *msg = NULL;
    849                     return EINVAL;
    850             }
     843        if (radius_msg_finish_srv(*msg, cli->key.data, cli->key.len, req->radius.hdr->authenticator)) {
     844                TRACE_DEBUG(INFO, "An error occurred while preparing the RADIUS answer");
     845                radius_msg_free(*msg);
     846                free(*msg);
     847                *msg = NULL;
     848                return EINVAL;
    851849        }
    852850       
Note: See TracChangeset for help on using the changeset viewer.