Symptom
I have an OpenVPN client running as a systemd daemon that works as expected in a chroot environment when the openvpn instance is run as root (both auth-token and the TLS handshake work upon key renegotiation). However, both auth-token and the TLS handshake fail (separately and together) when using the
user/group configuration settings to drop privileges. I do not believe the issue resides with the OpenVPN server or client configuration files themselves since the only change between a working client and a broken one resides in the removal of privileges (and thus have not posted those configuration files here).
Goal
To run the client OpenVPN daemon with unprivileged user/group that succeeds at TLS renegotiation and using auth-token.
Notes: failed TLS handshake
- The initial handshake works without issue (likely as it occurs before dropping privileges as the client is required to pull auth-token and defers dropping privileges)
- The renegotiation handshake proceeds through the point where (i) the server sends its public certificate and "hello done" (ii) the client checks the KU/EKU/x509 DN/CRL and (iii) the client writes its certificate and key exchange back to the server.
- The failure occurs as a malloc failure in OpenSSL's BUF_MEM_grow_clean memory buffer routines (appears to be called from OpenSSL's ssl3_send_client_verify SSL routine)
- For debugging purposes, I have set all of the Limit* systemd directives (AS,MEMLOCK,NPROC, etc) for the OpenVPN service to 'infinity' in an attempt to avoid an OOM scenario (running 'top' also indicates that virtual memory usage is under 70MB)
- There are no apparent AVC SELinux denials
Notes: auth-token
- Not much to say here, except I've confirmed the server pushes the token to the client and that both the server and client register an AUTH_FAIL message
OS and application versions
Fedora 25, 4.8.6-300.fc25,x86_64
OpenVPN 2.4.3
OpenSSL 1.0.2k-fips
Thanks in advance for the help, and happy to provide any other pertinent information.I started digging through the OpenVPN/SSL codebase, but thought someone may have cracked this nut already.