Tiny bits of code beautifying
This commit is contained in:
parent
9267bed9f5
commit
6327f32f43
2 changed files with 17 additions and 14 deletions
12
src/net.c
12
src/net.c
|
@ -17,7 +17,7 @@
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
$Id: net.c,v 1.35.4.86 2000/11/30 23:18:19 zarq Exp $
|
$Id: net.c,v 1.35.4.87 2000/12/05 08:59:29 zarq Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -386,9 +386,9 @@ int setup_tap_fd(void)
|
||||||
const char *tapfname;
|
const char *tapfname;
|
||||||
config_t const *cfg;
|
config_t const *cfg;
|
||||||
#ifdef HAVE_LINUX
|
#ifdef HAVE_LINUX
|
||||||
#ifdef HAVE_TUNTAP
|
# ifdef HAVE_TUNTAP
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
#endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cp
|
cp
|
||||||
|
@ -397,11 +397,11 @@ cp
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LINUX
|
#ifdef HAVE_LINUX
|
||||||
#ifdef HAVE_TUNTAP
|
# ifdef HAVE_TUNTAP
|
||||||
tapfname = "/dev/misc/net/tun";
|
tapfname = "/dev/misc/net/tun";
|
||||||
#else
|
# else
|
||||||
tapfname = "/dev/tap0";
|
tapfname = "/dev/tap0";
|
||||||
#endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_FREEBSD
|
#ifdef HAVE_FREEBSD
|
||||||
tapfname = "/dev/tap0";
|
tapfname = "/dev/tap0";
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
$Id: protocol.c,v 1.28.4.68 2000/11/30 23:18:21 zarq Exp $
|
$Id: protocol.c,v 1.28.4.69 2000/12/05 08:59:30 zarq Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -72,11 +72,12 @@ int check_id(char *id)
|
||||||
for (i = 0; i < strlen(id); i++)
|
for (i = 0; i < strlen(id); i++)
|
||||||
if(!isalnum(id[i]) && id[i] != '_')
|
if(!isalnum(id[i]) && id[i] != '_')
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generic request routines - takes care of logging and error detection as well */
|
/* Generic request routines - takes care of logging and error
|
||||||
|
detection as well */
|
||||||
|
|
||||||
int send_request(connection_t *cl, const char *format, ...)
|
int send_request(connection_t *cl, const char *format, ...)
|
||||||
{
|
{
|
||||||
|
@ -85,8 +86,9 @@ int send_request(connection_t *cl, const char *format, ...)
|
||||||
int len, request;
|
int len, request;
|
||||||
|
|
||||||
cp
|
cp
|
||||||
/* Use vsnprintf instead of vasprintf: faster, no memory fragmentation, cleanup is automatic,
|
/* Use vsnprintf instead of vasprintf: faster, no memory
|
||||||
and there is a limit on the input buffer anyway */
|
fragmentation, cleanup is automatic, and there is a limit on the
|
||||||
|
input buffer anyway */
|
||||||
|
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
len = vsnprintf(buffer, MAXBUFSIZE, format, args);
|
len = vsnprintf(buffer, MAXBUFSIZE, format, args);
|
||||||
|
@ -174,9 +176,10 @@ cp
|
||||||
(H) SHA1,
|
(H) SHA1,
|
||||||
(E) Encrypted with symmetric cipher.
|
(E) Encrypted with symmetric cipher.
|
||||||
|
|
||||||
Part of the challenge is directly used to set the symmetric cipher key and the initial vector.
|
Part of the challenge is directly used to set the symmetric cipher
|
||||||
Since a man-in-the-middle cannot decrypt the RSA challenges, this means that he cannot get or
|
key and the initial vector. Since a man-in-the-middle cannot
|
||||||
forge the key for the symmetric cipher.
|
decrypt the RSA challenges, this means that he cannot get or forge
|
||||||
|
the key for the symmetric cipher.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int send_id(connection_t *cl)
|
int send_id(connection_t *cl)
|
||||||
|
|
Loading…
Reference in a new issue