]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Remove AUTO_USERID feature
authorArne Schwabe <arne@rfc2549.org>
Mon, 8 Oct 2018 18:16:16 +0000 (20:16 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 8 Oct 2018 18:42:42 +0000 (20:42 +0200)
There is no user facing way to enable this feature and way that feature
works (username build from MAC of primary net device) is questionable.

It also does not compile anymore.
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20181008181618.8976-2-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17664.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/errlevel.h
src/openvpn/misc.c
src/openvpn/misc.h
src/openvpn/ssl.c
src/openvpn/syshead.h

index 5ca4fa8fe21e0712279a03084cf1ee8200bdb03b..c30284fc62070ff744dd7c59d389641682ef6a46 100644 (file)
 #define D_PACKET_TRUNC_DEBUG LOGLEV(7, 70, M_DEBUG)  /* PACKET_TRUNCATION_CHECK verbose */
 #define D_PING               LOGLEV(7, 70, M_DEBUG)  /* PING send/receive messages */
 #define D_PS_PROXY_DEBUG     LOGLEV(7, 70, M_DEBUG)  /* port share proxy debug */
-#define D_AUTO_USERID        LOGLEV(7, 70, M_DEBUG)  /* AUTO_USERID debugging */
 #define D_TLS_KEYSELECT      LOGLEV(7, 70, M_DEBUG)  /* show information on key selection for data channel */
 #define D_ARGV_PARSE_CMD     LOGLEV(7, 70, M_DEBUG)  /* show parse_line() errors in argv_parse_cmd */
 #define D_CRYPTO_DEBUG       LOGLEV(7, 70, M_DEBUG)  /* show detailed info from crypto.c routines */
index 71fa21352f0dbb11230aadee561d88ec9a305316..2759d98df113afa9d408392fd475f87a21771aba 100644 (file)
@@ -457,51 +457,6 @@ get_auth_challenge(const char *auth_challenge, struct gc_arena *gc)
 
 #endif /* ifdef ENABLE_CLIENT_CR */
 
-#if AUTO_USERID
-
-void
-get_user_pass_auto_userid(struct user_pass *up, const char *tag)
-{
-    struct gc_arena gc = gc_new();
-    struct buffer buf;
-    uint8_t macaddr[6];
-    static uint8_t digest [MD5_DIGEST_LENGTH];
-    static const uint8_t hashprefix[] = "AUTO_USERID_DIGEST";
-
-    const md_kt_t *md5_kt = md_kt_get("MD5");
-    md_ctx_t *ctx;
-
-    CLEAR(*up);
-    buf_set_write(&buf, (uint8_t *)up->username, USER_PASS_LEN);
-    buf_printf(&buf, "%s", TARGET_PREFIX);
-    if (get_default_gateway_mac_addr(macaddr))
-    {
-        dmsg(D_AUTO_USERID, "GUPAU: macaddr=%s", format_hex_ex(macaddr, sizeof(macaddr), 0, 1, ":", &gc));
-        ctx = md_ctx_new();
-        md_ctx_init(ctx, md5_kt);
-        md_ctx_update(ctx, hashprefix, sizeof(hashprefix) - 1);
-        md_ctx_update(ctx, macaddr, sizeof(macaddr));
-        md_ctx_final(ctx, digest);
-        md_ctx_cleanup(ctx);
-        md_ctx_free(ctx);
-        buf_printf(&buf, "%s", format_hex_ex(digest, sizeof(digest), 0, 256, " ", &gc));
-    }
-    else
-    {
-        buf_printf(&buf, "UNKNOWN");
-    }
-    if (tag && strcmp(tag, "stdin"))
-    {
-        buf_printf(&buf, "-%s", tag);
-    }
-    up->defined = true;
-    gc_free(&gc);
-
-    dmsg(D_AUTO_USERID, "GUPAU: AUTO_USERID: '%s'", up->username);
-}
-
-#endif /* if AUTO_USERID */
-
 void
 purge_user_pass(struct user_pass *up, const bool force)
 {
index 9d4601f0542fe2cb972ec7d82e4b2dec1ad4ee9e..b4d9d035b420252f65e350986b125d66faf9bb31 100644 (file)
@@ -159,11 +159,6 @@ void configure_path(void);
 
 const char *sanitize_control_message(const char *str, struct gc_arena *gc);
 
-#if AUTO_USERID
-void get_user_pass_auto_userid(struct user_pass *up, const char *tag);
-
-#endif
-
 /*
  * /sbin/ip path, may be overridden
  */
index 315303b0abe336fb0fc1c612f09347203278c5e5..455adfb71c9c806af3b739525c61cea9f5913d43 100644 (file)
@@ -409,9 +409,6 @@ auth_user_pass_setup(const char *auth_file, const struct static_challenge_info *
     auth_user_pass_enabled = true;
     if (!auth_user_pass.defined)
     {
-#if AUTO_USERID
-        get_user_pass_auto_userid(&auth_user_pass, auth_file);
-#else
 #ifdef ENABLE_CLIENT_CR
         if (auth_challenge) /* dynamic challenge/response */
         {
@@ -437,7 +434,6 @@ auth_user_pass_setup(const char *auth_file, const struct static_challenge_info *
         else
 #endif /* ifdef ENABLE_CLIENT_CR */
         get_user_pass(&auth_user_pass, auth_file, UP_TYPE_AUTH, GET_USER_PASS_MANAGEMENT);
-#endif /* if AUTO_USERID */
     }
 }
 
index ced7fdc139e79148a8d77f38f207c5e9c5a0bf6e..487b32a6f663442501a43b6b49e4bd5667eb971f 100644 (file)
@@ -658,15 +658,6 @@ socket_defined(const socket_descriptor_t sd)
 #define CONNECT_NONBLOCK
 #endif
 
-/*
- * Do we have the capability to support the AUTO_USERID feature?
- */
-#if defined(ENABLE_AUTO_USERID)
-#define AUTO_USERID 1
-#else
-#define AUTO_USERID 0
-#endif
-
 /*
  * Do we support challenge/response authentication as client?
  */