]> git.ipfire.org Git - thirdparty/openvpn.git/commit - src/openvpn/options.h
Rewrite auth-token-gen to be based on HMAC based tokens
authorArne Schwabe <arne@rfc2549.org>
Tue, 17 Sep 2019 12:10:04 +0000 (14:10 +0200)
committerGert Doering <gert@greenie.muc.de>
Tue, 1 Oct 2019 10:19:03 +0000 (12:19 +0200)
commit1b9a88a2c38a6a29f8ccbec4fd529d7b363bfc06
tree1121f0503fea2041c51af39c1bd55487496a34a7
parent7e4a261cc92a813f9e9ba9ee91c6e08de9d843f8
Rewrite auth-token-gen to be based on HMAC based tokens

The previous auth-token implementation had a serious problem, especially
when paired with an unpatched OpenVPN client that keeps trying the
auth-token (commit e61b401a).

The auth-token-gen implementation forgot the auth-token on reconnect, this
lead to reconnect with auth-token never working.

This new implementation implements the auth-token in a stateles variant. By
using HMAC to sign the auth-token the server can verify if a token has been
authenticated and by checking the embedded timestamp in the token it can
also verify that the auth-token is still valid.

Using the new config directive auth-gen-token-secret instead of
extending auth-gen-token (--auth-gen-token [lifetime] [secret-key]) was
chosen to allow inlining the secret key.

Patch V2: cleaned up code, use refactored read_pem_key_file function
Patch V3: clarify some design decision in the commit message
Patch V4: Use ephermal_generate_key
Patch V5: Use C99 PRIu64 instead of %lld int printf like statement,
          fix strict aliasing
Patch V6: Rebase on master
Patch V7: fix compiling with --disable-server

Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20190917121004.13685-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18818.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>
13 files changed:
doc/openvpn.8
src/openvpn/Makefile.am
src/openvpn/auth_token.c [new file with mode: 0644]
src/openvpn/auth_token.h [new file with mode: 0644]
src/openvpn/init.c
src/openvpn/openvpn.h
src/openvpn/options.c
src/openvpn/options.h
src/openvpn/push.c
src/openvpn/push.h
src/openvpn/ssl.c
src/openvpn/ssl_common.h
src/openvpn/ssl_verify.c