X-Git-Url: https://git.distorted.org.uk/~mdw/become/blobdiff_plain/0c6c5a979b3da98915ab3ad8064f9dbfdf901e08..bce14ae6dba85f1fbb5dd966c9598115e838e913:/src/daemon.c diff --git a/src/daemon.c b/src/daemon.c index 317a7fb..bb41b4a 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -1,10 +1,10 @@ /* -*-c-*- * - * $Id: daemon.c,v 1.7 1997/09/17 10:23:23 mdw Exp $ + * $Id: daemon.c,v 1.10 1998/04/23 13:23:09 mdw Exp $ * * Running a `become' daemon * - * (c) 1997 EBI + * (c) 1998 EBI */ /*----- Licensing notice --------------------------------------------------* @@ -29,6 +29,20 @@ /*----- Revision history --------------------------------------------------* * * $Log: daemon.c,v $ + * Revision 1.10 1998/04/23 13:23:09 mdw + * Support new interface to configuration file parser. + * + * Revision 1.9 1998/01/12 16:45:59 mdw + * Fix copyright date. + * + * Revision 1.8 1997/09/26 09:14:58 mdw + * Merged blowfish branch into trunk. + * + * Revision 1.7.2.1 1997/09/26 09:08:05 mdw + * Use the Blowfish encryption algorithm instead of IDEA. This is partly + * because I prefer Blowfish (without any particularly strong evidence) but + * mainly because IDEA is patented and Blowfish isn't. + * * Revision 1.7 1997/09/17 10:23:23 mdw * Fix a typo. Port numbers are in network order now, so don't change them. * @@ -79,10 +93,10 @@ /* --- Local headers --- */ #include "become.h" +#include "blowfish.h" #include "config.h" #include "crypt.h" #include "daemon.h" -#include "idea.h" #include "lexer.h" #include "name.h" #include "netg.h" @@ -103,7 +117,7 @@ static int daemon__port = -1; /* No particular port yet */ static volatile sig_atomic_t daemon__rescan = 0; /* Rescan as soon as poss */ #define daemon__signum daemon__rescan /* Alias for readbility */ static int daemon__readKey = 0; /* Have I read a key? */ -static unsigned char daemon__key[IDEA_KEYSIZE]; /* encryption key */ +static unsigned char daemon__key[BLOWFISH_KEYSIZE]; /* Encryption key */ static jmp_buf daemon__dieBuf; /* Jump here to kill the daemon */ /*----- Main code ---------------------------------------------------------*/ @@ -165,7 +179,7 @@ static int daemon__readConfig(const char *cf) if ((fp = fopen(cf, "r")) == 0) return (-1); lexer_scan(fp); - yyparse(); + parse(); fclose(fp); if (!daemon__readKey) daemon_readKey(file_KEY); @@ -219,7 +233,7 @@ void daemon__read(int fd) unsigned char rpl[crp_size]; /* Buffer for outgoing replies */ struct sockaddr_in sin; /* Address of packet sender */ char sender[64]; /* Sender's hostname (resolved) */ - unsigned char sk[IDEA_KEYSIZE]; /* Session key for reply */ + unsigned char sk[BLOWFISH_KEYSIZE]; /* Session key for reply */ request rq; /* Request buffer for verification */ /* --- Read the message --- */ @@ -328,7 +342,7 @@ void daemon_init(const char *cf, int port) if (daemon__port == 0) { struct servent *se = getservbyname(quis(), "udp"); if (!se) - die("no idea which port to use"); + die("no idea which port to listen to"); daemon__port = se->s_port; }