summaryrefslogtreecommitdiff
path: root/usr.sbin/pppd/chap.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pppd/chap.c')
-rw-r--r--usr.sbin/pppd/chap.c81
1 files changed, 20 insertions, 61 deletions
diff --git a/usr.sbin/pppd/chap.c b/usr.sbin/pppd/chap.c
index b98e7fc57e4..5dc66600024 100644
--- a/usr.sbin/pppd/chap.c
+++ b/usr.sbin/pppd/chap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chap.c,v 1.20 2023/03/08 04:43:14 guenther Exp $ */
+/* $OpenBSD: chap.c,v 1.21 2024/08/09 05:16:13 deraadt Exp $ */
/*
* chap.c - Challenge Handshake Authentication Protocol.
@@ -112,8 +112,7 @@ static void ChapGenChallenge(chap_state *);
* ChapInit - Initialize a CHAP unit.
*/
static void
-ChapInit(unit)
- int unit;
+ChapInit(int unit)
{
chap_state *cstate = &chap[unit];
@@ -132,10 +131,7 @@ ChapInit(unit)
*
*/
void
-ChapAuthWithPeer(unit, our_name, digest)
- int unit;
- char *our_name;
- int digest;
+ChapAuthWithPeer(int unit, char *our_name, int digest)
{
chap_state *cstate = &chap[unit];
@@ -162,10 +158,7 @@ ChapAuthWithPeer(unit, our_name, digest)
* ChapAuthPeer - Authenticate our peer (start server).
*/
void
-ChapAuthPeer(unit, our_name, digest)
- int unit;
- char *our_name;
- int digest;
+ChapAuthPeer(int unit, char *our_name, int digest)
{
chap_state *cstate = &chap[unit];
@@ -189,8 +182,7 @@ ChapAuthPeer(unit, our_name, digest)
* ChapChallengeTimeout - Timeout expired on sending challenge.
*/
static void
-ChapChallengeTimeout(arg)
- void *arg;
+ChapChallengeTimeout(void *arg)
{
chap_state *cstate = (chap_state *) arg;
@@ -216,8 +208,7 @@ ChapChallengeTimeout(arg)
* ChapResponseTimeout - Timeout expired on sending response.
*/
static void
-ChapResponseTimeout(arg)
- void *arg;
+ChapResponseTimeout(void *arg)
{
chap_state *cstate = (chap_state *) arg;
@@ -233,8 +224,7 @@ ChapResponseTimeout(arg)
* ChapRechallenge - Time to challenge the peer again.
*/
static void
-ChapRechallenge(arg)
- void *arg;
+ChapRechallenge(void *arg)
{
chap_state *cstate = (chap_state *) arg;
@@ -254,8 +244,7 @@ ChapRechallenge(arg)
* Start up if we have pending requests.
*/
static void
-ChapLowerUp(unit)
- int unit;
+ChapLowerUp(int unit)
{
chap_state *cstate = &chap[unit];
@@ -280,8 +269,7 @@ ChapLowerUp(unit)
* Cancel all timeouts.
*/
static void
-ChapLowerDown(unit)
- int unit;
+ChapLowerDown(int unit)
{
chap_state *cstate = &chap[unit];
@@ -304,8 +292,7 @@ ChapLowerDown(unit)
* ChapProtocolReject - Peer doesn't grok CHAP.
*/
static void
-ChapProtocolReject(unit)
- int unit;
+ChapProtocolReject(int unit)
{
chap_state *cstate = &chap[unit];
@@ -323,10 +310,7 @@ ChapProtocolReject(unit)
* ChapInput - Input CHAP packet.
*/
static void
-ChapInput(unit, inpacket, packet_len)
- int unit;
- u_char *inpacket;
- int packet_len;
+ChapInput(int unit, u_char *inpacket, int packet_len)
{
chap_state *cstate = &chap[unit];
u_char *inp;
@@ -386,11 +370,7 @@ ChapInput(unit, inpacket, packet_len)
* ChapReceiveChallenge - Receive Challenge and send Response.
*/
static void
-ChapReceiveChallenge(cstate, inp, id, len)
- chap_state *cstate;
- u_char *inp;
- int id;
- int len;
+ChapReceiveChallenge(chap_state *cstate, u_char *inp, int id, int len)
{
int rchallenge_len;
u_char *rchallenge;
@@ -479,11 +459,7 @@ ChapReceiveChallenge(cstate, inp, id, len)
* ChapReceiveResponse - Receive and process response.
*/
static void
-ChapReceiveResponse(cstate, inp, id, len)
- chap_state *cstate;
- u_char *inp;
- int id;
- int len;
+ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len)
{
u_char *remmd, remmd_len;
int secret_len, old_state;
@@ -602,11 +578,7 @@ ChapReceiveResponse(cstate, inp, id, len)
* ChapReceiveSuccess - Receive Success
*/
static void
-ChapReceiveSuccess(cstate, inp, id, len)
- chap_state *cstate;
- u_char *inp;
- u_char id;
- int len;
+ChapReceiveSuccess(chap_state *cstate, u_char *inp, int id, int len)
{
CHAPDEBUG((LOG_INFO, "ChapReceiveSuccess: Rcvd id %d.", id));
@@ -640,11 +612,7 @@ ChapReceiveSuccess(cstate, inp, id, len)
* ChapReceiveFailure - Receive failure.
*/
static void
-ChapReceiveFailure(cstate, inp, id, len)
- chap_state *cstate;
- u_char *inp;
- u_char id;
- int len;
+ChapReceiveFailure(chap_state *cstate, u_char *inp, int id, int len)
{
CHAPDEBUG((LOG_INFO, "ChapReceiveFailure: Rcvd id %d.", id));
@@ -672,8 +640,7 @@ ChapReceiveFailure(cstate, inp, id, len)
* ChapSendChallenge - Send an Authenticate challenge.
*/
static void
-ChapSendChallenge(cstate)
- chap_state *cstate;
+ChapSendChallenge(chap_state *cstate)
{
u_char *outp;
int chal_len, name_len;
@@ -709,9 +676,7 @@ ChapSendChallenge(cstate)
* ChapSendStatus - Send a status response (ack or nak).
*/
static void
-ChapSendStatus(cstate, code)
- chap_state *cstate;
- int code;
+ChapSendStatus(chap_state *cstate, int code)
{
u_char *outp;
int outlen, msglen;
@@ -746,8 +711,7 @@ ChapSendStatus(cstate, code)
*/
static void
-ChapGenChallenge(cstate)
- chap_state *cstate;
+ChapGenChallenge(chap_state *cstate)
{
int chal_len;
@@ -769,8 +733,7 @@ ChapGenChallenge(cstate)
* in *cstate.
*/
static void
-ChapSendResponse(cstate)
- chap_state *cstate;
+ChapSendResponse(chap_state *cstate)
{
u_char *outp;
int outlen, md_len, name_len;
@@ -808,11 +771,7 @@ static char *ChapCodenames[] = {
};
static int
-ChapPrintPkt(p, plen, printer, arg)
- u_char *p;
- int plen;
- void (*printer)(void *, char *, ...);
- void *arg;
+ChapPrintPkt(u_char *p, int plen, void (*printer)(void *, char *, ...), void *arg)
{
int code, id, len;
int clen, nlen;