-/* $OpenBSD: parser.c,v 1.3 2024/07/09 17:26:14 yasuoka Exp $ */
+/* $OpenBSD: parser.c,v 1.4 2024/07/24 08:27:20 yasuoka Exp $ */
/*
* Copyright (c) 2010 Reyk Floeter <reyk@vantronix.net>
MAXWAIT,
FLAGS,
SESSION_SEQ,
+ MSGAUTH,
ENDTOKEN
};
.tries = TEST_TRIES_DEFAULT,
.interval = { TEST_INTERVAL_DEFAULT, 0 },
.maxwait = { TEST_MAXWAIT_DEFAULT, 0 },
+ .msgauth = 1
};
static const struct token t_test[];
static const struct token t_tries[];
static const struct token t_interval[];
static const struct token t_maxwait[];
+static const struct token t_yesno[];
static const struct token t_ipcp[];
static const struct token t_ipcp_flags[];
static const struct token t_ipcp_session_seq[];
{ KEYWORD, "interval", NONE, t_interval },
{ KEYWORD, "tries", NONE, t_tries },
{ KEYWORD, "maxwait", NONE, t_maxwait },
+ { KEYWORD, "msgauth", NONE, t_yesno },
{ ENDTOKEN, "", NONE, NULL }
};
{ ENDTOKEN, "", NONE, NULL }
};
+static const struct token t_yesno[] = {
+ { MSGAUTH, "yes", 1, t_test_opts },
+ { MSGAUTH, "no", 0, t_test_opts },
+ { ENDTOKEN, "", NONE, NULL }
+};
+
static const struct token t_ipcp[] = {
{ KEYWORD, "show", IPCP_SHOW, NULL },
{ KEYWORD, "dump", IPCP_DUMP, t_ipcp_flags },
printf("invalid argument: %s is %s for "
"\"session-id\"", word, errstr);
t = &table[i];
+ case MSGAUTH:
+ if (word != NULL &&
+ strcmp(word, table[i].keyword) == 0) {
+ match++;
+ res.msgauth = table[i].value;
+ t = &table[i];
+ }
+ break;
case ENDTOKEN:
break;
}
case SESSION_SEQ:
fprintf(stderr, " <sequence number>\n");
break;
+ case MSGAUTH:
+ fprintf(stderr, " %s\n", table[i].keyword);
+ break;
case ENDTOKEN:
break;
}
-.\" $OpenBSD: radiusctl.8,v 1.8 2024/07/14 03:47:44 jsg Exp $
+.\" $OpenBSD: radiusctl.8,v 1.9 2024/07/24 08:27:20 yasuoka Exp $
.\"
.\" Copyright (c) YASUOKA Masahiko <yasuoka@yasuoka.net>
.\"
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.\"
-.Dd $Mdocdate: July 14 2024 $
+.Dd $Mdocdate: July 24 2024 $
.Dt RADIUSCTL 8
.Os
.Sh NAME
.It Cm tries Ar number
Specifies the number of packets to try sending.
The default is 3.
+.It Cm msgauth Ar yes | no
+Specifies if Message-Authenticator is given for the access request packet.
+The default is yes.
.El
.It Cm ipcp show
Show all ipcp sessions in the database of
-/* $OpenBSD: radiusctl.c,v 1.11 2024/07/22 09:39:23 yasuoka Exp $ */
+/* $OpenBSD: radiusctl.c,v 1.12 2024/07/24 08:27:20 yasuoka Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
*
u32val = htonl(res->nas_port);
radius_put_raw_attr(reqpkt, RADIUS_TYPE_NAS_PORT, &u32val, 4);
- radius_put_message_authenticator(reqpkt, res->secret);
+ if (res->msgauth)
+ radius_put_message_authenticator(reqpkt, res->secret);
event_init();
: (radius_check_message_authenticator(pkt, secret) == 0)
? "Verified" : "NG");
}
+ if (!resp)
+ fprintf(out, " Message-Authenticator = %s\n",
+ (radius_has_attr(pkt, RADIUS_TYPE_MESSAGE_AUTHENTICATOR))
+ ? "(Present)" : "(Not present)");
if (radius_get_string_attr(pkt, RADIUS_TYPE_USER_NAME, buf,
sizeof(buf)) == 0)