RADIUS: Redesign Request Authenticator generation
[mech_eap.git] / src / ap / accounting.c
index dfb593a..22684a6 100644 (file)
@@ -50,10 +50,9 @@ static struct radius_msg * accounting_msg(struct hostapd_data *hapd,
                return NULL;
        }
 
-       if (sta) {
-               radius_msg_make_authenticator(msg, (u8 *) sta, sizeof(*sta));
-       } else {
-               radius_msg_make_authenticator(msg, (u8 *) hapd, sizeof(*hapd));
+       if (radius_msg_make_authenticator(msg) < 0) {
+               wpa_printf(MSG_INFO, "Could not make Request Authenticator");
+               goto fail;
        }
 
        if (!radius_msg_add_attr_int32(msg, RADIUS_ATTR_ACCT_STATUS_TYPE,