* starttls.el: Undo the last change.
[elisp/starttls.git] / starttls.c
index db74ed2..7268983 100644 (file)
@@ -3,7 +3,6 @@
    Copyright (C) 1999, 2000 Daiki Ueno <ueno@unixuser.org>
 
    Author: Daiki Ueno <ueno@unixuser.org>
-       Kenichi OKADA <okada@opaopa.org>
    Created: 1999-11-19
    Keywords: TLS, OpenSSL
 
@@ -55,7 +54,7 @@
 #endif 
 
 #ifndef HAVE_GETADDRINFO
-#include "getaddrinfo.h"
+#include "addrinfo.h"
 #endif /* !HAVE_GETADDRINFO */
 
 #include <sys/time.h>
 #define _GNU_SOURCE
 #include <getopt.h>
 
-#ifdef HAVE_BASENAME
-# ifdef HAVE_LIBGEN_H
-#  include <libgen.h>
-#  ifdef basename
-#   undef basename
-#  endif
-# endif
-# include <string.h>
-#else
-inline char *
-basename(path) 
-     const char *path;
-{ 
-  char *p = rindex((path), '/');
-  return p ? p + 1 : (path);
-}
-#endif
-
-#define true 1
-
 static SSL_CTX *tls_ctx = NULL;
 static SSL *tls_conn = NULL;
 static int tls_fd;
 
 static char *opt_cert_file = NULL, *opt_key_file = NULL;
 static int  opt_verify = 0;
-static int opt_force;
 
 static int
 tls_ssl_ctx_new (cert_file, key_file)
@@ -223,8 +201,7 @@ usage (progname)
          "Options:\n\n"
          " --cert-file [file]      specify certificate file\n"
          " --key-file [file]       specify private key file\n"
-         " --verify [level]        set verification level\n"
-         " --force                 force negotiate\n",
+         " --verify [level]        set verification level\n",
          progname, PACKAGE, VERSION, progname);
 }
      
@@ -246,7 +223,6 @@ main (argc, argv)
       {"cert-file", 1, 0, 'c'},
       {"key-file", 1, 0, 'k'},
       {"verify", 1, 0, 'v'},
-      {"force", 0, 0, 'f'},
       {0, 0, 0, 0}
     };
 
@@ -267,9 +243,6 @@ main (argc, argv)
        case 'v':
          opt_verify = atoi (optarg);
          break;
-       case 'f':
-         opt_force = true;
-         break;
        default:
          usage (basename (argv[0]));
          return 1;
@@ -295,9 +268,6 @@ main (argc, argv)
   act.sa_flags = SA_RESTART|SA_RESETHAND;
   sigaction (SIGALRM, &act, NULL);
 
-  if (opt_force == true)
-    tls_negotiate();
-
   while (1)
     {
       FD_SET (tls_fd, &readfds);