OSDN Git Service

Ver.1.3.15: Fix browser's long waiting after sending accept page. And fix small bugs.
authorwatanaby <>
Mon, 16 Oct 2006 02:56:47 +0000 (02:56 +0000)
committerwatanaby <>
Mon, 16 Oct 2006 02:56:47 +0000 (02:56 +0000)
22 files changed:
opengate/doc/Changes.html
opengate/doc/en/errcheck.html
opengate/doc/en/install.html
opengate/doc/ja/errcheck.html
opengate/doc/ja/install.html
opengate/opengatesrv/Makefile
opengate/opengatesrv/addr-convert.c
opengate/opengatesrv/auth-ftps.c
opengate/opengatesrv/auth-pop3s.c
opengate/opengatesrv/comm-cgi.c
opengate/opengatesrv/comm-ip6fw.c
opengate/opengatesrv/comm-java.c
opengate/opengatesrv/comm-ndp.c
opengate/opengatesrv/ctrl-firewall.c
opengate/opengatesrv/get-param.c
opengate/opengatesrv/htmltemplate.c
opengate/opengatesrv/opengateauth.c
opengate/opengatesrv/opengatesrv.h
opengate/opengatesrv/test-comm-java.c
opengate/opengatesrv/test-get-param.c
opengate/opengatesrv/utilities.c
opengate/opengatesrv/wrapper.c

index 3602e06..9b8e8fe 100644 (file)
@@ -473,6 +473,11 @@ Ver.1.3.14 at 2006.5.23</DT>
 <DD>\r
 Remove close-error message. Modify QA document.\r
 </DD>\r
+<DT>\r
+Ver.1.3.15 at 2006.10.14</DT>\r
+<DD>\r
+Fix browser's long waiting after sending accept page. And other small bugs.\r
+</DD>\r
 </DL>\r
 <b>Please see CVS in SourceForge.net to check the file difference between versions.</b>\r
 </BODY>\r
index 204c9c1..24d3cee 100644 (file)
@@ -14,7 +14,7 @@
 <UL>\r
 <LI>\r
 When error occured, check the stand alone action of each related software.  Especially setting of ipfw is difficult and affects to many sides. At first, debug with ipfw fully open state. Then close it little by little. \r
-</LI><P></P>\r
+</LI>\r
 \r
 <LI>\r
 Opengate uses following files, where the directorys are default. Is these files correctly settled.\r
@@ -27,19 +27,21 @@ Opengate uses following files, where the directorys are default. Is these files
  /var/log/opengate.log<br>\r
 And Opengate creates a lock file [/tmp/opengate.lock] at execution. \r
 It can be removed.\r
-</LI><P></P>\r
+</LI>\r
  \r
 <LI>\r
 Please understand the basic flow of the system by reading <A href="../progflow.html" >the description of system flow</A> and <A href="../protocol.txt">Protocol between applications</A>.\r
-</LI><P></P>\r
+</LI>\r
 \r
 <LI>\r
-Test programs are prepared as opengatesrv/test-*. </LI><P></P>\r
+Test programs are prepared as opengatesrv/test-*. </LI>\r
 \r
 <LI>\r
 Opengate put out info and error log to /var/log/opengate.log.\r
 At error, see the log file. If you set Debug switch to 1 in /etc/opengate/opengatesrv.conf, many debug info is dumped to the log file. See also the Apache log and system log.\r
-</LI><P></P>\r
+</LI>\r
+\r
+<LI>Configuration file is /etc/opengate/opengatesrv.conf. Processing of 'make install' creates /etc/opengate/opengatesrv.conf.sample.  Copy this to opengatesrv.conf.  As the configuration parameters are changed between versions, do not use the file of different version.</LI>\r
 </UL>\r
 <hr>\r
 Following is the list of errors and the descriptions at each execution step in the form as;\r
index 323af33..f19a809 100644 (file)
@@ -778,6 +778,7 @@ want to use IPv6 function, you need to set FQDN corresponding to IPv4 and IPv6 b
 <h4>F.4&nbsp;Setup of ipfw<A class=anchor href="#opengate4" name=opengate4>\81õ</A></h4>\r
 \r
 <p>Write ipfw rules for for Opengate. This is example "rc.firewall".</p>\r
+<p>From FreeBSD6.1, IPFW supports IPv6. The IPFW rule used in Opengate is affected by this change. See <a href="http://www.cc.saga-u.ac.jp/opengate/newipfw-e.html>Setting of IPFW on FreeBSD6.1 or Later</a> for detail.</p>\r
 \r
 <table><tr><td><pre>\r
 ### set these to your outside interface network and netmask and ip\r
@@ -842,8 +843,8 @@ firewall_script="/etc/opengate/rc.firewall"
 <!-- ************ 5 ************** -->\r
 <h4>F.5&nbsp;Setup of ip6fw<A class=anchor href="#opengate5" name=opengate5>\81õ</A></h4>\r
 \r
-<p>Write ipfw rules for for Opengate. This is example "rc.firewall6". \r
-</p>\r
+<p>Write ipfw rules for for Opengate. This is example "rc.firewall6". </p>\r
+<p>From FreeBSD6.1, IPFW supports IPv6. The IPFW rule used in Opengate is affected by this change. See <a href="http://www.cc.saga-u.ac.jp/opengate/newipfw-e.html>Setting of IPFW on FreeBSD6.1 or Later</a> for detail.</p>\r
 \r
 <table><tr><td><pre>\r
 ### set these to your outside interface network and prefixlen and ip\r
index e603b72..82b83bd 100644 (file)
@@ -28,13 +28,16 @@ Opengate
  </LI><P></P>\r
  \r
 <LI>\r
-\95Ê\82É\81A<A href="../progflow.html" >\83v\83\8d\83O\83\89\83\80\83t\83\8d\81[\89ð\90à</A>\82Æ<A href="../protocol.txt" >\8aÖ\98A\83\\83t\83g\8aÔ\82Ì\83v\83\8d\83g\83R\83\8b</A>\82ð\97p\88Ó\82µ\82Ä\82¢\82Ü\82·\81B\83v\83\8d\83O\83\89\83\80\82Ì\8aî\96{\93I\82È\93®\82«\82ð\94c\88¬\82µ\82Ä\82­\82¾\82³\82¢\81B</LI><P></P>\r
+\95Ê\82É\81A<A href="../progflow.html" >\83v\83\8d\83O\83\89\83\80\83t\83\8d\81[\89ð\90à</A>\82Æ<A href="../protocol.txt" >\8aÖ\98A\83\\83t\83g\8aÔ\82Ì\83v\83\8d\83g\83R\83\8b</A>\82ð\97p\88Ó\82µ\82Ä\82¢\82Ü\82·\81B\83v\83\8d\83O\83\89\83\80\82Ì\8aî\96{\93I\82È\93®\82«\82ð\94c\88¬\82µ\82Ä\82­\82¾\82³\82¢\81B</LI>\r
 \r
 <LI>\r
-\82Ü\82½\81A\83e\83X\83g\83v\83\8d\83O\83\89\83\80\82ð\97p\88Ó\82µ\82Ü\82µ\82½\81Bopengatesrv\92\86\82Étest-*\82Æ\82µ\82Ä\92u\82¢\82Ä\82¢\82Ü\82·\82ª\81A\8eg\82¢\95û\82Í\83\\81[\83X\82ð\8c©\82Ä\82­\82¾\82³\82¢\81B</LI><P></P>\r
+\82Ü\82½\81A\83e\83X\83g\83v\83\8d\83O\83\89\83\80\82ð\97p\88Ó\82µ\82Ü\82µ\82½\81Bopengatesrv\92\86\82Étest-*\82Æ\82µ\82Ä\92u\82¢\82Ä\82¢\82Ü\82·\82ª\81A\8eg\82¢\95û\82Í\83\\81[\83X\82ð\8c©\82Ä\82­\82¾\82³\82¢\81B</LI>\r
 \r
 <LI>\r
-/var/log/opengate.log\82É\8aJ\95ú\81A\95Â\8d½\82Ì\83\8d\83O\82¨\82æ\82Ñ\83G\83\89\81[\83\8d\83O\82ð\8fo\97Í\82µ\82Ü\82·\81B\83G\83\89\81[\82Ì\8fê\8d\87\82Í\82±\82Ì\83\8d\83O\82ð\8am\94F\82­\82¾\82³\82¢\81B/etc/opengate/opengatesrv.conf\93à\82ÌDebug\82ð1\82É\82·\82é\82Æ\81A\83f\83o\83b\83O\82Ì\82½\82ß\82Ì\8fî\95ñ\82ð\91å\97Ê\82É\8fo\82·\82æ\82¤\82É\82È\82è\82Ü\82·\81B\82Ü\82½\81AApache\82Ì\83\8d\83O\82â\83V\83X\83e\83\80\83\8d\83O\82ð\8am\94F\82­\82¾\82³\82¢\81B</LI><P></P>\r
+/var/log/opengate.log\82É\8aJ\95ú\81A\95Â\8d½\82Ì\83\8d\83O\82¨\82æ\82Ñ\83G\83\89\81[\83\8d\83O\82ð\8fo\97Í\82µ\82Ü\82·\81B\83G\83\89\81[\82Ì\8fê\8d\87\82Í\82±\82Ì\83\8d\83O\82ð\8am\94F\82­\82¾\82³\82¢\81B/etc/opengate/opengatesrv.conf\93à\82ÌDebug\82ð1\82É\82·\82é\82Æ\81A\83f\83o\83b\83O\82Ì\82½\82ß\82Ì\8fî\95ñ\82ð\91å\97Ê\82É\8fo\82·\82æ\82¤\82É\82È\82è\82Ü\82·\81B\82Ü\82½\81AApache\82Ì\83\8d\83O\82â\83V\83X\83e\83\80\83\8d\83O\82ð\8am\94F\82­\82¾\82³\82¢\81B</LI>\r
+\r
+<LI>/etc/opengate/opengatesrv.conf\82ª\90Ý\92è\83t\83@\83C\83\8b\82Å\82·\81Bmake install\82Å\82Í\81A/etc/opengate/opengatesrv.conf.sample\82ª\8dì\82ç\82ê\82Ü\82·\82Ì\82Å\81A\82±\82ê\82ðopengatesrv.conf\82É\83R\83s\81[\82µ\82Ä\82­\82¾\82³\82¢\81B\90Ý\92è\83t\83@\83C\83\8b\82Í\81A\83o\81[\83W\83\87\83\93\82É\82æ\82Á\82Ä\90Ý\92è\8d\80\96Ú\82Ì\91\9d\8c¸\82ª\82 \82è\82Ü\82·\82Ì\82Å\81A\91Î\89\9e\82·\82é\83o\81[\83W\83\87\83\93\82Ì\82à\82Ì\82ð\8eg\82Á\82Ä\82­\82¾\82³\82¢\81B</LI>\r
+\r
 </UL>\r
 <hr>\r
 \88È\89º\81A\8ae\93®\8dì\82É\82Â\82¢\82Ä\81A\82»\82Ì\8e\9e\82Ì\83G\83\89\81[\8fó\8bµ\82Æ\91Î\89\9e\82ð\97ñ\8b\93\82µ\82Ü\82·\81B\r
@@ -115,7 +118,7 @@ Opengate
 </UL>\r
 \r
 </UL>\r
-<P></P>\r
+\r
 <!-- ******************** -->\r
 \r
 <LI>\8e\9f\82Éopengateauth.cgi\82ª\93®\8dì\82µ\82Ä\81Aindex.html\82Ìkeyword\82ð\92u\82«\8a·\82¦\82½<a href=../pict/auth.jpg>\94F\8fØ\97v\8b\81\83y\81[\83W</a>\82ð\91\97\82è\8fo\82·\81B\82±\82Ì\83y\81[\83W\82Í\94F\8fØ\97v\8b\81\82ð\95\\8e¦\82·\82é\81B</LI>\r
index c1b3db9..7c90679 100644 (file)
@@ -769,6 +769,7 @@ CONFIGPATH = /etc/opengate
 \r
 <p>\r
 Opengate\82Ì\93®\8dì\82Ì\82½\82ß\82É\93K\90Ø\82É\83t\83@\83C\83A\83E\83H\81[\83\8b\82Ì\83\8b\81[\83\8b\82ð\8bL\8fq\82µ\82È\82¯\82ê\82Î\82È\82ç\82È\82¢\81B\88È\89º\82É\8bL\8fq\82·\82é\83\8b\81[\83\8b\82Ì\97á\82ð\8e¦\82·\81B</p>\r
+<p>\92\8d\88Ó\81FFreeBSD6.1\82©\82çipfw\82ªIPv6\82É\91Î\89\9e\82µ\82½\94Å\82É\82È\82Á\82½\82½\82ß\81AOpengate\82Ìipfw\83\8b\81[\83\8b\82à\89e\8b¿\82ð\8eó\82¯\82é\81B<a href="http://www.cc.saga-u.ac.jp/opengate/newipfw.html">FreeBSD6.1\88È\8d~\82Å\82Ìipfw\90Ý\92è</a>\82ð\8eQ\8fÆ\82Ì\82±\82Æ\81B</p>\r
 \r
 <table><tr><td><pre>\r
 ### set these to your outside interface network and netmask and ip\r
@@ -837,6 +838,7 @@ ipfw
 \r
 <p>\r
 \82±\82ê\82ÍIPv6\83p\83P\83b\83g\82Ì\83t\83@\83C\83A\83E\83H\81[\83\8b\90Ý\92è\82Å\82 \82è\81AIPv6\8b@\94\\82ð\97\98\97p\82µ\82È\82¢\8fê\8d\87\82Í\95s\97v\82Å\82 \82é\81BOpengate\82Ì\93®\8dì\82Ì\82½\82ß\82É\93K\90Ø\82É\83t\83@\83C\83A\83E\83H\81[\83\8b\82Ì\83\8b\81[\83\8b\82ð\8bL\8fq\82µ\82È\82¯\82ê\82Î\82È\82ç\82È\82¢\81B\88È\89º\82É\8bL\8fq\82·\82×\82«\83\8b\81[\83\8b\82Ì\97á\81i/etc/rc.firewall6\81j\82ð\8e¦\82·\81B</p>\r
+<p>\92\8d\88Ó\81FFreeBSD6.1\82©\82çipfw\82ªIPv6\82É\91Î\89\9e\82µ\82½\94Å\82É\82È\82Á\82½\82½\82ß\81AOpengate\82Ìipfw\83\8b\81[\83\8b\82à\89e\8b¿\82ð\8eó\82¯\82é\81B<a href="http://www.cc.saga-u.ac.jp/opengate/newipfw.html">FreeBSD6.1\88È\8d~\82Å\82Ìipfw\90Ý\92è</a>\82ð\8eQ\8fÆ\82Ì\82±\82Æ\81B</p>\r
 \r
 <table><tr><td><pre>\r
 ### set these to your outside interface network and prefixlen and ip\r
index dc99874..0c98c07 100644 (file)
@@ -7,7 +7,7 @@ DOCPATH = /usr/local/www/data/opengate
 CGIPATH = /usr/local/www/cgi-bin/opengate
 CONFIGPATH = /etc/opengate
 
-CFLAGS= 
+CFLAGS= -O4 -Wall
 LIBS = -lssl -lcrypto -lradius -lpam -lezxml -L../ezxml
 OBJS = utilities.o comm-auth.o comm-cgi.o comm-java.o comm-ipfw.o comm-ip6fw.c comm-arp.o comm-ndp.o error.o tcp_connect.o sock_ntop_host.o wrapper.o signal.o auth-pam.o auth-rad.o auth-pop3s.o comm-userdb.o get-param.o auth-ftps.o htmltemplate.o addr-convert.o get-mac.o ctrl-firewall.o
 MAINPROGO = main.o
index 064ce91..dd371d7 100644 (file)
@@ -55,9 +55,9 @@ int addrEncode(char encodeAddr[], char dotSepAddr[])
   /* the string has the from as [encodeAddress-checkDigit-TimeNow] */
   if(!illform){
     snprintf(encodeAddr, ADDRMAXLN,
-            "%u-%d-%d", address,checkDigit, time(NULL));
+            "%lu-%d-%d", address,checkDigit, time(NULL));
   }else{
-    snprintf(encodeAddr, ADDRMAXLN, "");
+    encodeAddr[0]='\0';
   }
 
   return illform;
@@ -77,7 +77,7 @@ int addrDecode(char dotSepAddr[], char encodeAddr[])
   time_t encodeTiming, diffTime;
 
   /* convert string to integer */
-  if(sscanf(encodeAddr, "%u-%d-%d", &address, &checkDigit, &encodeTiming)!=3){
+  if(sscanf(encodeAddr, "%lu-%d-%d", &address, &checkDigit, &encodeTiming)!=3){
     illform=1;
   }
 
@@ -102,7 +102,7 @@ int addrDecode(char dotSepAddr[], char encodeAddr[])
   if(!illform){
     snprintf(dotSepAddr, ADDRMAXLN, "%d.%d.%d.%d", ad[3], ad[2], ad[1], ad[0]);
   }else{
-    snprintf(dotSepAddr, ADDRMAXLN, "");
+    dotSepAddr[0]='\0';
   }
 
   return illform;
index e2f560d..0bc7fdb 100644 (file)
@@ -29,12 +29,6 @@ Email: watanaby@is.saga-u.ac.jp
    Apache module mod_auth_pam.c by Ingo Luetkebohle
 */
 
-#include <openssl/crypto.h>
-#include <openssl/x509.h>
-#include <openssl/pem.h>
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-
 #include "opengatesrv.h"
 
 /*****************************************/
index a802678..8d4b9ac 100644 (file)
@@ -28,12 +28,6 @@ Email: watanaby@is.saga-u.ac.jp
    Apache module mod_auth_pam.c by Ingo Luetkebohle
 */
 
-#include <openssl/crypto.h>
-#include <openssl/x509.h>
-#include <openssl/pem.h>
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-
 #include "opengatesrv.h"
 
 /*************************/
index eeafaab..cce43d1 100644 (file)
@@ -56,12 +56,10 @@ int getPostData(char *userid, char *password, char *clientAddr4, int *durationPt
   char *value[1];
   char *next[1];
   char *ptr;
-  int item;
   char durationStr[WORDMAXLN];
   char langList[BUFFMAXLN];
   char encodeAddr4[ADDRMAXLN];
   char accessAddr[ADDRMAXLN];
-  int ret;
 
   /* get content sent from web input */
   if(getenv("CONTENT_LENGTH")==NULL)return FALSE;
@@ -145,7 +143,6 @@ int getPostData(char *userid, char *password, char *clientAddr4, int *durationPt
 /*********************************************/
 void putClientDeny(char *clientAddr4)
 {
-  FILE *fp;
   char denydoc[BUFFMAXLN];
   char authCgiUrl[BUFFMAXLN];
   char encodeAddr[ADDRMAXLN];
@@ -191,7 +188,6 @@ void putClientDeny(char *clientAddr4)
 /*********************************************/
 void putClientRetry(char *lang)
 {
-  FILE *fp;
   char retrydoc[BUFFMAXLN];
   char externalUrl[BUFFMAXLN];
   char authCgiUrl[BUFFMAXLN];
@@ -249,7 +245,6 @@ void putJavaApplet(char *userid, int port, int pid, char *clientAddr4, char *cli
   int markfound=0;
   char acceptdoc[BUFFMAXLN];
   char acceptdoc2url[BUFFMAXLN];
-  char *ptr;
   char terminateurl[BUFFMAXLN];
 
   char *startPageUrl=GetConfValue("StartPage/Url");
@@ -297,7 +292,7 @@ void putJavaApplet(char *userid, int port, int pid, char *clientAddr4, char *cli
         printf("IPv4 address : [%s]\r\n",clientAddr4);
         printf("</td></tr>\r\n");
         printf("</table>\r\n");
-      }else if(ipStatus=IPV46DUAL){
+      }else if(ipStatus==IPV46DUAL){
         printf("<table border=0>\r\n");
         printf("<tr><td>\r\n");
         printf("IPv4 address : [%s]\r\n",clientAddr4);
index 9c128dd..21c53d0 100644 (file)
@@ -39,8 +39,6 @@ int openClientGate6(char *clientAddr6, char *userid, char *macAddr6, char *userP
   int fd;\r
   int ret=0;\r
   int retNum;\r
-  int ruleCount;\r
-  int ruleNumber;\r
 \r
   Sigfunc *defaultSigFunc;\r
 \r
index f715f3d..f4756c1 100644 (file)
@@ -107,10 +107,10 @@ int getListenPort(void)
 int waitAppletConnect(char *userid, char *clientAddr4, char *clientAddr6, int duration, char *macAddr4, int ipStatus, struct clientAddr *pClientAddr)
 {
   socklen_t len;
-  fd_set rfd, rfd0;                 /* fd_set for select */
-  int n,i;                          /* counter */
+  fd_set rfd0;                      /* fd_set for select */
+  int n;                            /* counter */
   int smax;                         /* select max descliptor */
-  int ipType;                         /* using IP type */
+  int ipType=IPV4;                  /* using IP type */
   struct sockaddr_storage cliaddr;  /* client IP adddress */
   char buff[BUFFMAXLN];             /* read in buffer */
   Sigfunc *sigfunc;                 /* signal function save */
index bb18075..3779c74 100644 (file)
@@ -37,7 +37,6 @@ void scanNdpEntry(struct clientAddr *pClientAddr, char *userid, char *macAddr6,
   char *startp;
   char buf[BUFFMAXLN];
   char tmpAddr[ADDRMAXLN]="";
-  int pid;
   struct clientAddr *tmp1, *tmp2, *lastAddr;
 
   /* exec ndp */
@@ -52,7 +51,7 @@ void scanNdpEntry(struct clientAddr *pClientAddr, char *userid, char *macAddr6,
   /* get IPv6 address from above string                    */
 
   /* clear active status for IPv6 address */
-  tmp1=pClientAddr;
+  lastAddr=tmp1=pClientAddr;
   while(tmp1!=NULL){
     if(tmp1->ipType==IPV6) tmp1->activeStatus=FALSE;
     lastAddr=tmp1;
@@ -159,7 +158,6 @@ int getMacAddrFromNdp(char *clientAddr6, char* macAddr6)
   FILE *fpipe;
   char buf[BUFFMAXLN];
   char *startp;
-  char *endp;
 
   macAddr6[0]='?';
   macAddr6[1]='\0';
index b6ae295..9d90119 100644 (file)
@@ -39,7 +39,7 @@ void KillOverlapProcess(int overlapRule4, int overlapRule6,
 int openClientGate(char *clientAddr4, char *macAddr4, char *clientAddr6, char *macAddr6, char *userid, char *userProperty, int ipStatus)
 {
   int ret;
-  struct clientAddr *pLastClientAddr;
+  struct clientAddr *pLastClientAddr=NULL;
   int overlapRule4=0, overlapRule6=0;
 
   switch(ipStatus){
index d6a56e9..a37c1fa 100644 (file)
@@ -223,7 +223,7 @@ char *getConfValue(char *name)
 
     }else{
       /* other parameters must be set */
-      err_msg("ERR at %s#%d: cannot get %s",__FILE__,__LINE__,name);
+      err_msg("ERR at %s#%d: cannot get %s from conf file. Is it new?",__FILE__,__LINE__,name);
     }
   }
 
index 3880605..7812c70 100644 (file)
@@ -83,7 +83,6 @@ char* strSplit(char* str,const char* delimStr)
 {
     char* delimPoint = strstr(str,delimStr);
     const size_t delimLen = strlen(delimStr);
-    size_t i;
 
     if(delimPoint == NULL) return NULL;
     else{
index 7dd9045..6227082 100644 (file)
@@ -32,14 +32,12 @@ int  main(int argc, char **argv)
 
   char htmlFile[BUFFMAXLN]="";   /* html file */
   char lang[WORDMAXLN]="";       /* language */
-  char referer[BUFFMAXLN]="";    /* HTTP referer */
   char clientAddr[ADDRMAXLN]=""; /* client ip address */
   char paramString[BUFFMAXLN]="";   /* parameters in html access */
   char* pLang;  /* pointer to language string */ 
   char* pAddr4; /* pointer to addr4 string */
   char authCgiUrl[BUFFMAXLN];  /* url of opengateauth.cgi */
   char mainCgiUrl[BUFFMAXLN];  /* url of opengatesrv.cgi */
-  char remoteAddr[ADDRMAXLN];  /* remote address */
   char durationMax[WORDMAXLN]; /* usage duration maximum */
 
   /* keyword pairs */
index 973ffc0..570c47f 100644 (file)
@@ -57,6 +57,12 @@ typedef      void    Sigfunc(int);   /* for signal handlers */
 #include <sys/signal.h>
 #include <regex.h>
 
+#include <openssl/crypto.h>
+#include <openssl/x509.h>
+#include <openssl/pem.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+
 /***************** constants ***********************/
 
 /* Configuration file for opengate */ 
@@ -150,6 +156,9 @@ int WaitAppletConnect(char *userid, char *clientAddr4, char *clientAddr6, int du
 /* utilities */
 ssize_t readln(int fd, void *ptr, size_t maxlen);
 void Writefmt(int fd, const char *fmt, ...);
+ssize_t
+readlnSSL(SSL *fd, void *vptr, size_t maxlen);
+void WritefmtSSL(SSL *fd, const char *fmt, ...);
 int Lock(int fd);
 int Unlock(int fd);
 FILE *Popenl(const char *type, const char *path, ...);
index bd7b455..5e92f1e 100644 (file)
@@ -33,7 +33,6 @@ int  main(int argc, char **argv)
   char clientAddr6[100]="::1";
   char userID[100]="user1";
   char extraID[100]="default";
-  char dummy[100];
   int duration=60; 
   struct clientAddr ClientAddr;
   struct clientAddr *pClientAddr;
index d8475f6..3df3f46 100644 (file)
@@ -49,11 +49,11 @@ int  main(int argc, char **argv)
   printf("Enter extraID(if you do not want to use extraID, enter as [default])=");
   scanf("%s", extraID);
 
-  setupConfExtra(userID, extraID);
+  SetupConfExtra(userID, extraID);
 
   printf("Enter Parameter name (eg, Authserver/protocol)=");
   scanf("%s", name);
-  printf("%s\n", getConfValue(name));
-  closeConfFile();
+  printf("%s\n", GetConfValue(name));
+  CloseConfFile();
   return 0;
 }
index 04c1bdf..fedcb91 100644 (file)
@@ -48,8 +48,7 @@ void Writefmt(int fd, const char *fmt, ...)
   return;
 }
 
-
-void WritefmtSSL(int fd, const char *fmt, ...)
+void WritefmtSSL(SSL *fd, const char *fmt, ...)
 {
   char buff[BUFFMAXLN];
   va_list     ap;
@@ -109,7 +108,7 @@ readln(int fd, void *vptr, size_t maxlen)
 
 
 ssize_t
-readlnSSL(int fd, void *vptr, size_t maxlen)
+readlnSSL(SSL *fd, void *vptr, size_t maxlen)
 {
   ssize_t      n, rc;
   char *ptr,c;
index 17ee24c..d548db6 100644 (file)
@@ -24,7 +24,10 @@ Close(int fd)
   /*   if ((ret=close(fd)) == -1)
    *   err_msg("close error");
    */
-       return ret;
+
+  ret=close(fd);
+
+  return ret;
 }
 
 pid_t