Browse code

Merge branch 'feat_eurephia' into beta2.2

David Sommerseth authored on 2010/07/23 05:34:52
Showing 3 changed files
... ...
@@ -98,6 +98,12 @@ AC_ARG_ENABLE(plugins,
98 98
    [PLUGINS="yes"]
99 99
 )
100 100
 
101
+AC_ARG_ENABLE(eurephia,
102
+   [  --disable-eurephia      Disable support for the eurephia plug-in],
103
+   [EUREPHIA="$enableval"],
104
+   [EUREPHIA="yes"]
105
+)
106
+
101 107
 AC_ARG_ENABLE(management,
102 108
    [  --disable-management    Disable management server support],
103 109
    [MANAGEMENT="$enableval"],
... ...
@@ -631,6 +637,9 @@ if test "${WIN32}" != "yes"; then
631 631
            )],
632 632
            [AC_MSG_RESULT([libdl headers not found.])]
633 633
       )
634
+      if test "$EUREPHIA" = "yes"; then
635
+         AC_DEFINE(ENABLE_EUREPHIA, 1, [Enable support for the eurephia plug-in])
636
+      fi
634 637
    fi
635 638
 fi
636 639
 
... ...
@@ -7,6 +7,9 @@
7 7
  *
8 8
  *  Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
9 9
  *
10
+ *  Additions for eurephia plugin done by:
11
+ *         David Sommerseth <dazo@users.sourceforge.net> Copyright (C) 2009
12
+ *
10 13
  *  This program is free software; you can redistribute it and/or modify
11 14
  *  it under the terms of the GNU General Public License version 2
12 15
  *  as published by the Free Software Foundation.
... ...
@@ -75,6 +78,9 @@ const char title_string[] =
75 75
 #ifdef ENABLE_PKCS11
76 76
   " [PKCS11]"
77 77
 #endif
78
+#ifdef ENABLE_EUREPHIA
79
+  " [eurephia]"
80
+#endif
78 81
   " built on " __DATE__
79 82
 ;
80 83
 
... ...
@@ -7,6 +7,10 @@
7 7
  *
8 8
  *  Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
9 9
  *
10
+ *  Additions for eurephia plugin done by:
11
+ *         David Sommerseth <dazo@users.sourceforge.net> Copyright (C) 2008-2009
12
+ *
13
+ *
10 14
  *  This program is free software; you can redistribute it and/or modify
11 15
  *  it under the terms of the GNU General Public License version 2
12 16
  *  as published by the Free Software Foundation.
... ...
@@ -827,6 +831,16 @@ verify_callback (int preverify_ok, X509_STORE_CTX * ctx)
827 827
   openvpn_snprintf (envname, sizeof(envname), "tls_id_%d", ctx->error_depth);
828 828
   setenv_str (opt->es, envname, subject);
829 829
 
830
+#ifdef ENABLE_EUREPHIA
831
+  /* export X509 cert SHA1 fingerprint */
832
+  {
833
+    struct gc_arena gc = gc_new ();
834
+    openvpn_snprintf (envname, sizeof(envname), "tls_digest_%d", ctx->error_depth);
835
+    setenv_str (opt->es, envname,
836
+		format_hex_ex(ctx->current_cert->sha1_hash, SHA_DIGEST_LENGTH, 0, 1, ":", &gc));
837
+    gc_free(&gc);
838
+  }
839
+#endif
830 840
 #if 0
831 841
   /* export common name string as environmental variable */
832 842
   openvpn_snprintf (envname, sizeof(envname), "tls_common_name_%d", ctx->error_depth);