Various whitespace changes.
Make some functions static.
This commit is contained in:
parent
46c20a0ec0
commit
9b9967924b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=67912
@ -179,7 +179,8 @@ arp_SetProxy(struct bundle *bundle, struct in_addr addr, int s)
|
||||
* address.
|
||||
*/
|
||||
if (!get_ether_addr(s, addr, &dls.sdl)) {
|
||||
log_Printf(LOG_PHASE_BIT, "Cannot determine ethernet address for proxy ARP\n");
|
||||
log_Printf(LOG_PHASE_BIT, "Cannot determine ethernet address for "
|
||||
"proxy ARP\n");
|
||||
return 0;
|
||||
}
|
||||
arpreq.arp_ha.sa_len = sizeof(struct sockaddr);
|
||||
|
@ -500,8 +500,8 @@ CcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
|
||||
if (o->val.id == cp[0])
|
||||
break;
|
||||
if (o == NULL)
|
||||
log_Printf(LogCCP, "%s: Warning: Ignoring peer NAK of unsent option\n",
|
||||
fp->link->name);
|
||||
log_Printf(LogCCP, "%s: Warning: Ignoring peer NAK of unsent"
|
||||
" option\n", fp->link->name);
|
||||
else {
|
||||
memcpy(&o->val, cp, length);
|
||||
if ((*algorithm[f]->o.Set)(&o->val) == MODE_ACK)
|
||||
|
@ -509,7 +509,8 @@ chap_Challenge(struct authinfo *authp)
|
||||
struct chap *chap = auth2chap(authp);
|
||||
int len;
|
||||
|
||||
log_Printf(LogDEBUG, "CHAP%02X: Challenge\n", authp->physical->link.lcp.want_authtype);
|
||||
log_Printf(LogDEBUG, "CHAP%02X: Challenge\n",
|
||||
authp->physical->link.lcp.want_authtype);
|
||||
|
||||
len = strlen(authp->physical->dl->bundle->cfg.auth.name);
|
||||
|
||||
@ -530,7 +531,7 @@ chap_Challenge(struct authinfo *authp)
|
||||
static void
|
||||
chap_Success(struct authinfo *authp)
|
||||
{
|
||||
char *msg;
|
||||
const char *msg;
|
||||
datalink_GotAuthname(authp->physical->dl, authp->in.name);
|
||||
#ifdef HAVE_DES
|
||||
if (authp->physical->link.lcp.want_authtype == 0x81) {
|
||||
@ -561,18 +562,19 @@ chap_Failure(struct authinfo *authp)
|
||||
#ifdef HAVE_DES
|
||||
char buf[1024];
|
||||
#endif
|
||||
char *msg;
|
||||
const char *msg;
|
||||
|
||||
#ifdef HAVE_DES
|
||||
if (authp->physical->link.lcp.want_authtype == 0x81) {
|
||||
char *ptr;
|
||||
int i;
|
||||
|
||||
msg = buf;
|
||||
msg += sprintf(buf, "E=691 R=0 C=");
|
||||
ptr = buf;
|
||||
ptr += sprintf(buf, "E=691 R=0 C=");
|
||||
for (i=0; i<16; i++)
|
||||
msg += sprintf(msg, "%02X", *(auth2chap(authp)->challenge.local+1+i));
|
||||
ptr += sprintf(ptr, "%02X", *(auth2chap(authp)->challenge.local+1+i));
|
||||
|
||||
sprintf(msg, " V=3 M=Invalid!");
|
||||
sprintf(ptr, " V=3 M=Invalid!");
|
||||
msg = buf;
|
||||
} else
|
||||
#endif
|
||||
@ -889,7 +891,8 @@ chap_Input(struct bundle *bundle, struct link *l, struct mbuf *bp)
|
||||
if (p->link.lcp.his_authtype == 0x81) {
|
||||
if (strncmp(ans, chap->authresponse, 42)) {
|
||||
datalink_AuthNotOk(p->dl);
|
||||
log_Printf(LogDEBUG, "CHAP81: AuthenticatorResponse: (%s) != ans: (%s)\n", chap->authresponse, ans);
|
||||
log_Printf(LogDEBUG, "CHAP81: AuthenticatorResponse: (%s)"
|
||||
" != ans: (%s)\n", chap->authresponse, ans);
|
||||
|
||||
} else {
|
||||
/* Successful login */
|
||||
|
@ -65,7 +65,8 @@ struct MS_ChapResponse {
|
||||
u_char UseNT; /* If 1, ignore the LANMan response field */
|
||||
};
|
||||
|
||||
static u_char Get7Bits(u_char *input, int startBit)
|
||||
static u_char
|
||||
Get7Bits(u_char *input, int startBit)
|
||||
{
|
||||
register unsigned int word;
|
||||
|
||||
@ -79,7 +80,8 @@ static u_char Get7Bits(u_char *input, int startBit)
|
||||
|
||||
/* IN 56 bit DES key missing parity bits
|
||||
OUT 64 bit DES key with parity bits added */
|
||||
static void MakeKey(u_char *key, u_char *des_key)
|
||||
static void
|
||||
MakeKey(u_char *key, u_char *des_key)
|
||||
{
|
||||
des_key[0] = Get7Bits(key, 0);
|
||||
des_key[1] = Get7Bits(key, 7);
|
||||
@ -118,7 +120,8 @@ ChallengeResponse(u_char *challenge, u_char *pwHash, u_char *response)
|
||||
}
|
||||
|
||||
void
|
||||
NtPasswordHash(char *key, int keylen, char *hash) {
|
||||
NtPasswordHash(char *key, int keylen, char *hash)
|
||||
{
|
||||
MD4_CTX MD4context;
|
||||
|
||||
MD4Init(&MD4context);
|
||||
@ -127,7 +130,8 @@ NtPasswordHash(char *key, int keylen, char *hash) {
|
||||
}
|
||||
|
||||
void
|
||||
HashNtPasswordHash(char *hash, char *hashhash) {
|
||||
HashNtPasswordHash(char *hash, char *hashhash)
|
||||
{
|
||||
MD4_CTX MD4context;
|
||||
|
||||
MD4Init(&MD4context);
|
||||
@ -136,7 +140,9 @@ HashNtPasswordHash(char *hash, char *hashhash) {
|
||||
}
|
||||
|
||||
void
|
||||
ChallengeHash(char *PeerChallenge, char *AuthenticatorChallenge, char *UserName, int UserNameLen, char *Challenge) {
|
||||
ChallengeHash(char *PeerChallenge, char *AuthenticatorChallenge,
|
||||
char *UserName, int UserNameLen, char *Challenge)
|
||||
{
|
||||
SHA_CTX Context;
|
||||
char Digest[SHA_DIGEST_LENGTH];
|
||||
char *Name;
|
||||
@ -158,7 +164,10 @@ ChallengeHash(char *PeerChallenge, char *AuthenticatorChallenge, char *UserName,
|
||||
}
|
||||
|
||||
void
|
||||
GenerateNTResponse(char *AuthenticatorChallenge, char *PeerChallenge, char *UserName, int UserNameLen, char *Password, int PasswordLen, char *Response) {
|
||||
GenerateNTResponse(char *AuthenticatorChallenge, char *PeerChallenge,
|
||||
char *UserName, int UserNameLen, char *Password,
|
||||
int PasswordLen, char *Response)
|
||||
{
|
||||
char Challenge[8];
|
||||
char PasswordHash[16];
|
||||
|
||||
@ -169,7 +178,11 @@ GenerateNTResponse(char *AuthenticatorChallenge, char *PeerChallenge, char *User
|
||||
}
|
||||
|
||||
void
|
||||
GenerateAuthenticatorResponse(char *Password, int PasswordLen, char *NTResponse, char *PeerChallenge, char *AuthenticatorChallenge, char *UserName, int UserNameLen, char *AuthenticatorResponse) {
|
||||
GenerateAuthenticatorResponse(char *Password, int PasswordLen,
|
||||
char *NTResponse, char *PeerChallenge,
|
||||
char *AuthenticatorChallenge, char *UserName,
|
||||
int UserNameLen, char *AuthenticatorResponse)
|
||||
{
|
||||
SHA_CTX Context;
|
||||
char PasswordHash[16];
|
||||
char PasswordHashHash[16];
|
||||
@ -230,7 +243,8 @@ GenerateAuthenticatorResponse(char *Password, int PasswordLen, char *NTResponse,
|
||||
}
|
||||
|
||||
void
|
||||
GetMasterKey(char *PasswordHashHash, char *NTResponse, char *MasterKey) {
|
||||
GetMasterKey(char *PasswordHashHash, char *NTResponse, char *MasterKey)
|
||||
{
|
||||
char Digest[SHA_DIGEST_LENGTH];
|
||||
SHA_CTX Context;
|
||||
static char Magic1[27] =
|
||||
@ -247,7 +261,9 @@ GetMasterKey(char *PasswordHashHash, char *NTResponse, char *MasterKey) {
|
||||
}
|
||||
|
||||
void
|
||||
GetAsymetricStartKey(char *MasterKey, char *SessionKey, int SessionKeyLength, int IsSend, int IsServer) {
|
||||
GetAsymetricStartKey(char *MasterKey, char *SessionKey, int SessionKeyLength,
|
||||
int IsSend, int IsServer)
|
||||
{
|
||||
char Digest[SHA_DIGEST_LENGTH];
|
||||
SHA_CTX Context;
|
||||
char *s;
|
||||
@ -299,7 +315,9 @@ GetAsymetricStartKey(char *MasterKey, char *SessionKey, int SessionKeyLength, in
|
||||
}
|
||||
|
||||
void
|
||||
GetNewKeyFromSHA(char *StartKey, char *SessionKey, long SessionKeyLength, char *InterimKey) {
|
||||
GetNewKeyFromSHA(char *StartKey, char *SessionKey, long SessionKeyLength,
|
||||
char *InterimKey)
|
||||
{
|
||||
SHA_CTX Context;
|
||||
char Digest[SHA_DIGEST_LENGTH];
|
||||
|
||||
@ -313,8 +331,11 @@ GetNewKeyFromSHA(char *StartKey, char *SessionKey, long SessionKeyLength, char *
|
||||
memcpy(InterimKey, Digest, SessionKeyLength);
|
||||
}
|
||||
|
||||
void
|
||||
Get_Key(char *InitialSessionKey, char *CurrentSessionKey, int LengthOfDesiredKey) {
|
||||
#if 0
|
||||
static void
|
||||
Get_Key(char *InitialSessionKey, char *CurrentSessionKey,
|
||||
int LengthOfDesiredKey)
|
||||
{
|
||||
SHA_CTX Context;
|
||||
char Digest[SHA_DIGEST_LENGTH];
|
||||
|
||||
@ -327,6 +348,7 @@ Get_Key(char *InitialSessionKey, char *CurrentSessionKey, int LengthOfDesiredKey
|
||||
|
||||
memcpy(CurrentSessionKey, Digest, LengthOfDesiredKey);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* passwordHash 16-bytes MD4 hashed password
|
||||
challenge 8-bytes peer CHAP challenge
|
||||
|
@ -474,7 +474,8 @@ datalink_Read(struct fdescriptor *d, struct bundle *bundle, const fd_set *fdset)
|
||||
}
|
||||
|
||||
static int
|
||||
datalink_Write(struct fdescriptor *d, struct bundle *bundle, const fd_set *fdset)
|
||||
datalink_Write(struct fdescriptor *d, struct bundle *bundle,
|
||||
const fd_set *fdset)
|
||||
{
|
||||
struct datalink *dl = descriptor2datalink(d);
|
||||
int result = 0;
|
||||
|
@ -502,9 +502,11 @@ Parse(struct ipcp *ipcp, int argc, char const *const *argv,
|
||||
}
|
||||
|
||||
log_Printf(LogDEBUG, "Parse: Src: %s\n", inet_ntoa(filterdata.f_src.ipaddr));
|
||||
log_Printf(LogDEBUG, "Parse: Src mask: %s\n", inet_ntoa(filterdata.f_src.mask));
|
||||
log_Printf(LogDEBUG, "Parse: Src mask: %s\n",
|
||||
inet_ntoa(filterdata.f_src.mask));
|
||||
log_Printf(LogDEBUG, "Parse: Dst: %s\n", inet_ntoa(filterdata.f_dst.ipaddr));
|
||||
log_Printf(LogDEBUG, "Parse: Dst mask: %s\n", inet_ntoa(filterdata.f_dst.mask));
|
||||
log_Printf(LogDEBUG, "Parse: Dst mask: %s\n",
|
||||
inet_ntoa(filterdata.f_dst.mask));
|
||||
log_Printf(LogDEBUG, "Parse: Proto = %d\n", proto);
|
||||
|
||||
log_Printf(LogDEBUG, "Parse: src: %s (%d)\n",
|
||||
|
@ -308,7 +308,8 @@ lcp_Setup(struct lcp *lcp, int openmode)
|
||||
}
|
||||
|
||||
if (p->type != PHYS_DIRECT)
|
||||
memcpy(&lcp->want_callback, &p->dl->cfg.callback, sizeof(struct callback));
|
||||
memcpy(&lcp->want_callback, &p->dl->cfg.callback,
|
||||
sizeof(struct callback));
|
||||
else
|
||||
lcp->want_callback.opmask = 0;
|
||||
lcp->want_lqrperiod = IsEnabled(lcp->cfg.lqr) ?
|
||||
|
@ -435,7 +435,8 @@ log_SetLevel(struct cmdargs const *arg)
|
||||
local = 0;
|
||||
else {
|
||||
if (arg->prompt == NULL) {
|
||||
log_Printf(LogWARN, "set log local: Only available on the command line\n");
|
||||
log_Printf(LogWARN, "set log local: Only available on the"
|
||||
" command line\n");
|
||||
return 1;
|
||||
}
|
||||
argc--;
|
||||
|
@ -168,8 +168,8 @@ BringDownServer(int signo)
|
||||
static void
|
||||
Usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Usage: ppp [-auto | -foreground | -background | -direct | -dedicated | -ddial | -interactive]"
|
||||
fprintf(stderr, "Usage: ppp [-auto | -foreground | -background | -direct |"
|
||||
" -dedicated | -ddial | -interactive]"
|
||||
#ifndef NOALIAS
|
||||
" [-nat]"
|
||||
#endif
|
||||
|
@ -1076,7 +1076,8 @@ mpserver_Read(struct fdescriptor *d, struct bundle *bundle, const fd_set *fdset)
|
||||
}
|
||||
|
||||
static int
|
||||
mpserver_Write(struct fdescriptor *d, struct bundle *bundle, const fd_set *fdset)
|
||||
mpserver_Write(struct fdescriptor *d, struct bundle *bundle,
|
||||
const fd_set *fdset)
|
||||
{
|
||||
/* We never want to write here ! */
|
||||
log_Printf(LogALERT, "mpserver_Write: Internal error: Bad call !\n");
|
||||
|
@ -71,8 +71,9 @@ MPPEResetOutput(void *v)
|
||||
log_Printf(LogCCP, "MPPE: Output channel reset\n");
|
||||
}
|
||||
|
||||
void
|
||||
MPPEReduceSessionKey(struct mppe_state *mp) {
|
||||
static void
|
||||
MPPEReduceSessionKey(struct mppe_state *mp)
|
||||
{
|
||||
switch(mp->keybits) {
|
||||
case 40:
|
||||
mp->sesskey[2] = 0x9e;
|
||||
@ -83,8 +84,9 @@ MPPEReduceSessionKey(struct mppe_state *mp) {
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MPPEKeyChange(struct mppe_state *mp) {
|
||||
static void
|
||||
MPPEKeyChange(struct mppe_state *mp)
|
||||
{
|
||||
char InterimKey[MPPE_KEY_LEN];
|
||||
RC4_KEY RC4Key;
|
||||
|
||||
@ -143,7 +145,8 @@ MPPEOutput(void *v, struct ccp *ccp, struct link *l, int pri, u_short *proto,
|
||||
/* Chage protocol number */
|
||||
*proto = ccp_Proto(ccp);
|
||||
|
||||
log_Printf(LogDEBUG, "MPPE: Output: Encrypted: Proto %02x (%d bytes)\n", *proto, m_length(mo));
|
||||
log_Printf(LogDEBUG, "MPPE: Output: Encrypted: Proto %02x (%d bytes)\n",
|
||||
*proto, m_length(mo));
|
||||
|
||||
return mo;
|
||||
}
|
||||
@ -193,7 +196,8 @@ MPPEInput(void *v, struct ccp *ccp, u_short *proto, struct mbuf *mp)
|
||||
rp = MBUF_CTOP(mp);
|
||||
RC4(&mip->rc4key, m_length(mp), rp, rp);
|
||||
|
||||
log_Printf(LogDEBUG, "MPPE: Input: Decrypted: Proto %02x (%d bytes)\n", *proto, m_length(mp));
|
||||
log_Printf(LogDEBUG, "MPPE: Input: Decrypted: Proto %02x (%d bytes)\n",
|
||||
*proto, m_length(mp));
|
||||
|
||||
log_DumpBp(LogDEBUG, "MPPE: Input: Decrypted: Packet:", mp);
|
||||
|
||||
@ -224,7 +228,8 @@ MPPEInitOptsOutput(struct lcp_opt *o, const struct ccp_config *cfg)
|
||||
log_Printf(LogCCP, "MPPE: InitOptsOutput\n");
|
||||
|
||||
if (!MPPE_MasterKeyValid) {
|
||||
log_Printf(LogWARN, "MPPE: MasterKey is invalid, MPPE is capable only with CHAP81 authentication\n");
|
||||
log_Printf(LogWARN, "MPPE: MasterKey is invalid,"
|
||||
" MPPE is capable only with CHAP81 authentication\n");
|
||||
*(u_int32_t *)o->data = htonl(0x0);
|
||||
return;
|
||||
}
|
||||
@ -419,4 +424,3 @@ const struct ccp_algorithm MPPEAlgorithm = {
|
||||
MPPEOutput
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -218,7 +218,8 @@ server_LocalOpen(struct bundle *bundle, const char *name, mode_t mask)
|
||||
if (mask != (mode_t)-1)
|
||||
umask(mask);
|
||||
if (listen(s, 5) != 0) {
|
||||
log_Printf(LogERROR, "Local: Unable to listen to socket - BUNDLE overload?\n");
|
||||
log_Printf(LogERROR, "Local: Unable to listen to socket -"
|
||||
" BUNDLE overload?\n");
|
||||
close(s);
|
||||
ID0unlink(name);
|
||||
return 5;
|
||||
|
Loading…
Reference in New Issue
Block a user