Browse code

Add "forget-passwords" command to the management interface (Alon Bar-Lev).

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@2412 e7ae566f-a301-0410-adde-c780ea21d3b5

james authored on 2007/10/23 04:02:21
Showing 2 changed files
... ...
@@ -40,6 +40,7 @@
40 40
 #include "otime.h"
41 41
 #include "integer.h"
42 42
 #include "misc.h"
43
+#include "ssl.h"
43 44
 #include "manage.h"
44 45
 
45 46
 #include "memdbg.h"
... ...
@@ -70,6 +71,7 @@ man_help ()
70 70
   msg (M_CLIENT, "bytecount n            : Show bytes in/out, update every n secs (0=off).");
71 71
   msg (M_CLIENT, "echo [on|off] [N|all]  : Like log, but only show messages in echo buffer.");
72 72
   msg (M_CLIENT, "exit|quit              : Close management session.");
73
+  msg (M_CLIENT, "forget-passwords       : Forget passwords entered so far.");
73 74
   msg (M_CLIENT, "help                   : Print this message.");
74 75
   msg (M_CLIENT, "hold [on|off|release]  : Set/show hold flag to on/off state, or"); 
75 76
   msg (M_CLIENT, "                         release current hold and start tunnel."); 
... ...
@@ -602,6 +604,13 @@ man_query_need_ok (struct management *man, const char *type, const char *action)
602 602
 }
603 603
 
604 604
 static void
605
+man_forget_passwords (struct management *man)
606
+{
607
+  ssl_purge_auth ();
608
+  msg (M_CLIENT, "SUCCESS: Passwords were forgotten");
609
+}
610
+
611
+static void
605 612
 man_net (struct management *man)
606 613
 {
607 614
   if (man->persist.callback.show_net)
... ...
@@ -789,6 +798,10 @@ man_dispatch_command (struct management *man, struct status_output *so, const ch
789 789
       if (man_need (man, p, 2, 0))
790 790
 	man_query_password (man, p[1], p[2]);
791 791
     }
792
+  else if (streq (p[0], "forget-passwords"))
793
+    {
794
+      man_forget_passwords (man);
795
+    }
792 796
   else if (streq (p[0], "needok"))
793 797
     {
794 798
       if (man_need (man, p, 2, 0))
... ...
@@ -268,6 +268,16 @@ COMMAND -- password and username
268 268
 
269 269
     >PASSWORD:Verification Failed: 'Auth'
270 270
 
271
+COMMAND -- forget-passwords
272
+---------------------------
273
+
274
+The forget-passwords command will cause the daemon to forget passwords
275
+entered during the session.
276
+
277
+Command example:
278
+
279
+  forget-passwords -- forget passwords entered so far.
280
+
271 281
 COMMAND -- signal
272 282
 -----------------
273 283