]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/eap.c
Use autoconf/automake to configure and make ppp
[ppp.git] / pppd / eap.c
index 342d91f0897d341c4ddf6132c507cac2f67b1d97..9773ae2add5ac114803487bc88c5d0dd3e9d4439 100644 (file)
  * Implemented EAP-TLS authentication
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -65,6 +69,9 @@
 #include "eap.h"
 
 #ifdef USE_SRP
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
 #include <t_pwd.h>
 #include <t_server.h>
 #include <t_client.h>
@@ -552,7 +559,7 @@ eap_figure_next_state(eap_state *esp, int status)
                        tpw.pebuf.name = esp->es_server.ea_peer;
                        tpw.pebuf.password.len = t_fromb64((char *)tpw.pwbuf,
                            cp);
-                       tpw.pebuf.password.data = tpw.pwbuf;
+                       tpw.pebuf.password.data = (char*) tpw.pwbuf;
                        tpw.pebuf.salt.len = t_fromb64((char *)tpw.saltbuf,
                            cp2);
                        tpw.pebuf.salt.data = tpw.saltbuf;
@@ -2253,8 +2260,6 @@ eap_response(eap_state *esp, u_char *inp, int id, int len)
        struct t_num A;
        SHA1_CTX ctxt;
        u_char dig[SHA_DIGESTSIZE];
-       SHA1_CTX ctxt;
-       u_char dig[SHA_DIGESTSIZE];
 #endif /* USE_SRP */
 
 #ifdef USE_EAPTLS
@@ -3021,6 +3026,7 @@ eap_printpkt(u_char *inp, int inlen,
                        break;
 #endif /* USE_EAPTLS */
 
+#ifdef USE_SRP
                case EAPT_SRP:
                        if (len < 3)
                                goto truncated;
@@ -3108,6 +3114,7 @@ eap_printpkt(u_char *inp, int inlen,
                                break;
                        }
                        break;
+#endif  /* USE_SRP */
                }
                break;
 
@@ -3233,6 +3240,7 @@ eap_printpkt(u_char *inp, int inlen,
                        break;
 #endif /* CHAPMS */
 
+#ifdef USE_SRP
                case EAPT_SRP:
                        if (len < 1)
                                goto truncated;
@@ -3277,6 +3285,7 @@ eap_printpkt(u_char *inp, int inlen,
                                break;
                        }
                        break;
+#endif  /* USE_SRP */
                }
                break;