diff -X /home/michele/svn/programming/vte/dontdiff -urN gnome-terminal.skeyfixed/ChangeLog gnome-terminal.otp/ChangeLog
--- gnome-terminal.skeyfixed/ChangeLog	2005-07-15 17:01:09.000000000 +0200
+++ gnome-terminal.otp/ChangeLog	2005-07-15 21:19:25.000000000 +0200
@@ -1,3 +1,10 @@
+2005-07-15  Michele Baldessari  <michele@pupazzo.org>
+
+	* src/skey-popup.c, src/terminal-screen.c: Added OTP
+	(One Time Password - RFC 2289) support. The Ctrl-Click
+	dingus now supports the more recent 
+        otp-<hash> sequence seed challenges. 
+
 2005-07-12  Michele Baldessari  <michele@pupazzo.org>
 
 	* configure.in: Added AC_C_BIGENDIAN check
Binary files gnome-terminal.skeyfixed/src/gnome-terminal and gnome-terminal.otp/src/gnome-terminal differ
Binary files gnome-terminal.skeyfixed/src/skey/testskey and gnome-terminal.otp/src/skey/testskey differ
diff -X /home/michele/svn/programming/vte/dontdiff -urN gnome-terminal.skeyfixed/src/skey-popup.c gnome-terminal.otp/src/skey-popup.c
--- gnome-terminal.skeyfixed/src/skey-popup.c	2003-07-17 09:09:30.000000000 +0200
+++ gnome-terminal.otp/src/skey-popup.c	2005-07-15 21:57:47.000000000 +0200
@@ -28,6 +28,8 @@
 #include <string.h>
 
 #define SKEY_PREFIX "s/key "
+#define OTP_PREFIX  "otp-"
+
 static gboolean
 extract_seq_and_seed (const gchar  *skey_match,
 		      gint         *seq,
@@ -35,9 +37,6 @@
 {
   gchar *end_ptr = NULL;
 
-  if (strncmp (SKEY_PREFIX, skey_match, strlen (SKEY_PREFIX)))
-    return FALSE;
-
   *seq = strtol (skey_match + strlen (SKEY_PREFIX), &end_ptr, 0);
 
   if (end_ptr == NULL || *end_ptr == '\000')
@@ -46,6 +45,50 @@
   return TRUE;
 }
 
+static gboolean
+extract_hash_seq_and_seed (const gchar  *otp_match,
+			   gint         *hash,
+	  	           gint         *seq,
+		           gchar       **seed)
+{
+  gchar *end_ptr = NULL;
+  const gchar *p;
+  gint len = 3;
+
+  /* Match the hash algorithm */
+  if (strncmp(otp_match + strlen(OTP_PREFIX), "md4", 3) == 0)
+    *hash = MD4;
+  else if (strncmp(otp_match + strlen(OTP_PREFIX), "md5", 3) == 0)
+    *hash = MD5;
+  else if (strncmp(otp_match + strlen(OTP_PREFIX), "sha1", 4) == 0) {
+    *hash = SHA1;
+    len++;
+  } else
+    return FALSE;
+
+  p = otp_match + strlen(OTP_PREFIX) + len;
+  while (*p == ' ' || *p == '\t') {  /* Per RFC we must skip any number of white-spaces or tabs */
+    if (*p == '\0')
+      return FALSE;
+    p++;
+  }
+
+  *seq = strtol (p, &end_ptr, 0);
+  if (end_ptr == NULL || *end_ptr == '\000')
+    return FALSE;
+
+  p = end_ptr;
+  while (*p == ' ' || *p == '\t') {
+    if (*p == '\0')
+      return FALSE;
+    p++;
+  }
+
+  *seed = strdup (p);
+  return TRUE;
+}
+
+
 void
 terminal_skey_do_popup (TerminalScreen *screen,
 			GtkWindow      *transient_parent,
@@ -56,14 +99,34 @@
   GtkWidget *ok_button;
   gint seq;
   gchar *seed;
+  gint hash = MD5; /* We leave it at MD5, if it gets changed we're in an OTP challenge with different hash */
+		   /* otherwise we're the usual S/Key with md5 */
 
-  if (!extract_seq_and_seed (skey_match, &seq, &seed))
+  if (strncmp (SKEY_PREFIX, skey_match, strlen (SKEY_PREFIX)) == 0) 
+    {
+      if (!extract_seq_and_seed (skey_match, &seq, &seed))
+        {
+          terminal_util_show_error_dialog (GTK_WINDOW (transient_parent), NULL,
+                                           _("The text you clicked doesn't seem to be an S/Key challenge."));
+          return;
+        }
+    } else if (strncmp (OTP_PREFIX, skey_match, strlen (OTP_PREFIX)) == 0) 
+    {
+      if (!extract_hash_seq_and_seed (skey_match, &hash, &seq, &seed))
+        {
+          terminal_util_show_error_dialog (GTK_WINDOW (transient_parent), NULL,
+                                           _("The text you clicked doesn't seem to be an OTP challenge."));
+          return;
+        }
+    } else 
     {
       terminal_util_show_error_dialog (GTK_WINDOW (transient_parent), NULL,
                                        _("The text you clicked doesn't seem to be an S/Key challenge."));
       return;
     }
 
+
+
   if (dialog == NULL)
     {
       GladeXML *xml;
@@ -103,7 +166,7 @@
       gchar *response;
       
       password = gtk_entry_get_text (GTK_ENTRY (entry));
-      response = skey (MD5, seq, seed, password);
+      response = skey (hash, seq, seed, password);
       if (response)
 	{
 	  terminal_widget_write_data_to_child (terminal_screen_get_widget (screen),
@@ -119,3 +182,4 @@
   gtk_widget_destroy (dialog);
   g_free (seed);
 }
+
diff -X /home/michele/svn/programming/vte/dontdiff -urN gnome-terminal.skeyfixed/src/terminal-screen.c gnome-terminal.otp/src/terminal-screen.c
--- gnome-terminal.skeyfixed/src/terminal-screen.c	2005-07-02 02:38:04.000000000 +0200
+++ gnome-terminal.otp/src/terminal-screen.c	2005-07-15 21:13:42.000000000 +0200
@@ -85,7 +85,8 @@
   FLAVOR_AS_IS = 0,
   FLAVOR_DEFAULT_TO_HTTP,
   FLAVOR_MAILTO,
-  FLAVOR_SKEY
+  FLAVOR_SKEY,
+  FLAVOR_OTP
 };
 
 static void terminal_screen_init        (TerminalScreen      *screen);
@@ -538,6 +539,8 @@
     {
       terminal_widget_skey_match_add (screen->priv->term,
 				      "s/key [0-9]* [-A-Za-z0-9]*", FLAVOR_SKEY);
+      terminal_widget_skey_match_add (screen->priv->term,
+				      "otp-[a-z0-9]* [0-9]* [-A-Za-z0-9]*", FLAVOR_OTP);
     }
   else
     {
