diff options
author | yasuoka <yasuoka@openbsd.org> | 2019-04-01 09:51:56 +0000 |
---|---|---|
committer | yasuoka <yasuoka@openbsd.org> | 2019-04-01 09:51:56 +0000 |
commit | b922578661fa5391a0dc7cda669c9780dc98e7b3 (patch) | |
tree | 9da0099a2387aff06ded32c7a4a50a76ee2c1946 | |
parent | aarch64 also uses PIE by default, make ${NOPIE*} flags available (diff) | |
download | wireguard-openbsd-b922578661fa5391a0dc7cda669c9780dc98e7b3.tar.xz wireguard-openbsd-b922578661fa5391a0dc7cda669c9780dc98e7b3.zip |
Show message-authenticator correctly. It had shown the result of
authenticator mistakenly. Original diff from IIJ.
-rw-r--r-- | usr.sbin/radiusctl/radiusctl.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/radiusctl/radiusctl.c b/usr.sbin/radiusctl/radiusctl.c index 49c238f6030..6b1d03e1637 100644 --- a/usr.sbin/radiusctl/radiusctl.c +++ b/usr.sbin/radiusctl/radiusctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radiusctl.c,v 1.6 2015/12/31 16:22:27 millert Exp $ */ +/* $OpenBSD: radiusctl.c,v 1.7 2019/04/01 09:51:56 yasuoka Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net> * @@ -252,10 +252,16 @@ radius_dump(FILE *out, RADIUS_PACKET *pkt, bool resp, const char *secret) " Code = %s(%d)\n", (int)radius_get_id(pkt), radius_code_str((int)radius_get_code(pkt)), (int)radius_get_code(pkt)); - if (resp && secret) - fprintf(out, " Message-Authenticator = %s\n", + if (resp && secret) { + fprintf(out, " Authenticator = %s\n", (radius_check_response_authenticator(pkt, secret) == 0) ? "Verified" : "NG"); + fprintf(out, " Message-Authenticator = %s\n", + (!radius_has_attr(pkt, RADIUS_TYPE_MESSAGE_AUTHENTICATOR)) + ? "(Not present)" + : (radius_check_message_authenticator(pkt, secret) == 0) + ? "Verified" : "NG"); + } if (radius_get_string_attr(pkt, RADIUS_TYPE_USER_NAME, buf, sizeof(buf)) == 0) |