summaryrefslogtreecommitdiffstats
path: root/ssl_verify_openssl.c
diff options
context:
space:
mode:
authorHeiko Hund <heiko.hund@sophos.com>2012-02-10 15:13:42 +0100
committerDavid Sommerseth <davids@redhat.com>2012-02-13 17:11:50 +0100
commit71bbbd76c62630c88441237d72fe5b61f0b45b2a (patch)
tree715f8c8183c6e47bb26f0a10c0f6b14f9b9f83a2 /ssl_verify_openssl.c
parent2ee0dc2bd72ec318fcc227af54e5ca7e1384a6cc (diff)
downloadopenvpn-71bbbd76c62630c88441237d72fe5b61f0b45b2a.tar.gz
openvpn-71bbbd76c62630c88441237d72fe5b61f0b45b2a.tar.xz
openvpn-71bbbd76c62630c88441237d72fe5b61f0b45b2a.zip
handle Windows unicode paths
Openvpn for Windows is not compiled as a Unicode binary and thus cannot handle paths which contain non-ASCII characters using the argv vector. Characters that are not present in the system codepage are simply replaced with a question mark, e.g. if started as 'openvpn --config домой.ovpn' the file '?????.ovpn' is tried to be opened as configuration. The same applies to paths in config files which need to be UTF-8 encoded if they contain non ASCII characters. The option line 'key лев.pem' will lead to openvpn trying to open 'лев.pem' on a system with codepage 1252. This patch makes openvpn read the command line in UCS-2 and convert it to UTF-8 internally. Windows stores names in the filesystem in UCS-2. When using a paths openvpn converts it from UTF-8 to UCS-2 and uses the wide character Windows API function. Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'ssl_verify_openssl.c')
-rw-r--r--ssl_verify_openssl.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/ssl_verify_openssl.c b/ssl_verify_openssl.c
index b2c01a3..200a570 100644
--- a/ssl_verify_openssl.c
+++ b/ssl_verify_openssl.c
@@ -584,13 +584,9 @@ x509_verify_crl(const char *crl_file, X509 *peer_cert, const char *subject)
int n,i;
result_t retval = FAILURE;
- in=BIO_new(BIO_s_file());
+ in = BIO_new_file (crl_file, "r");
if (in == NULL) {
- msg (M_ERR, "CRL: BIO err");
- goto end;
- }
- if (BIO_read_filename(in, crl_file) <= 0) {
msg (M_ERR, "CRL: cannot read: %s", crl_file);
goto end;
}