aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-08-10 22:37:18 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-08-10 22:37:18 +0000
commitc282a2c296f6273a46a4d99b7a9ca83e5293dd42 (patch)
treeeda824e9d87cb918771a650c202ff56570ecad2b
parentFixed build issue with ./configure --disable-socks --disable-http. (diff)
downloadopenvpn-c282a2c296f6273a46a4d99b7a9ca83e5293dd42.tar.xz
Workaround bug in OpenSSL 0.9.6b ASN1_STRING_to_UTF8, which
the new implementation of extract_x509_field_ssl depends on. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3220 e7ae566f-a301-0410-adde-c780ea21d3b5
-rw-r--r--crypto.h3
-rw-r--r--ssl.c4
2 files changed, 2 insertions, 5 deletions
diff --git a/crypto.h b/crypto.h
index 185f9d2..5ac1208 100644
--- a/crypto.h
+++ b/crypto.h
@@ -69,9 +69,6 @@
#if SSLEAY_VERSION_NUMBER < 0x00907000L
-/* Workaround: OpenSSL 0.9.6 breaks extract_x509_field_ssl function */
-#define USE_OLD_EXTRACT_X509_FIELD
-
/* Workaround: EVP_CIPHER_mode is defined wrong in OpenSSL 0.9.6 but is fixed in 0.9.7 */
#undef EVP_CIPHER_mode
#define EVP_CIPHER_mode(e) (((e)->flags) & EVP_CIPH_MODE)
diff --git a/ssl.c b/ssl.c
index 9318b8a..cd1692b 100644
--- a/ssl.c
+++ b/ssl.c
@@ -358,8 +358,8 @@ extract_x509_field_ssl (X509_NAME *x509, const char *field_name, char *out, int
int tmp = -1;
X509_NAME_ENTRY *x509ne = 0;
ASN1_STRING *asn1 = 0;
- unsigned char *buf = 0;
- int nid = OBJ_txt2nid(field_name);
+ unsigned char *buf = (unsigned char *)1; /* bug in OpenSSL 0.9.6b ASN1_STRING_to_UTF8 requires this workaround */
+ int nid = OBJ_txt2nid((char *)field_name);
ASSERT (size > 0);
*out = '\0';