]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/ccp.c
Ensure that MPPE keys are available when using a plugin.
[ppp.git] / pppd / ccp.c
index 18f2dc0cdbd871e6f6b613b7a7e3f185c943cc20..0e768b71ad2d426982fc3cdefb0b3c8718a68fe9 100644 (file)
@@ -33,7 +33,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#define RCSID  "$Id: ccp.c,v 1.41 2002/12/04 23:03:32 paulus Exp $"
+#define RCSID  "$Id: ccp.c,v 1.42 2002/12/23 23:24:37 fcusack Exp $"
 
 #include <stdlib.h>
 #include <string.h>
@@ -44,7 +44,7 @@
 #include <net/ppp-comp.h>
 
 #ifdef MPPE
-#include "chap_ms.h"   /* mppe_xxxx_key */
+#include "chap_ms.h"   /* mppe_xxxx_key, mppe_keys_set */
 #include "lcp.h"       /* lcp_close(), lcp_fsm */
 #endif
 
@@ -578,6 +578,14 @@ ccp_resetci(f)
            return;
        }
 
+       /* A plugin (eg radius) may not have obtained key material. */
+       if (!mppe_keys_set) {
+           error("MPPE required, but keys are not available.  "
+                 "Possible plugin problem?");
+           lcp_close(f->unit, "MPPE required but not available");
+           return;
+       }
+
        /* LM auth not supported for MPPE */
        if (auth_done[f->unit] & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) {
            /* This might be noise */