Browse code

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

james authored on 2008/08/11 07:37:18
Showing 2 changed files
... ...
@@ -69,9 +69,6 @@
69 69
 
70 70
 #if SSLEAY_VERSION_NUMBER < 0x00907000L
71 71
 
72
-/* Workaround: OpenSSL 0.9.6 breaks extract_x509_field_ssl function */
73
-#define USE_OLD_EXTRACT_X509_FIELD
74
-
75 72
 /* Workaround: EVP_CIPHER_mode is defined wrong in OpenSSL 0.9.6 but is fixed in 0.9.7 */
76 73
 #undef EVP_CIPHER_mode
77 74
 #define EVP_CIPHER_mode(e)                (((e)->flags) & EVP_CIPH_MODE)
... ...
@@ -358,8 +358,8 @@ extract_x509_field_ssl (X509_NAME *x509, const char *field_name, char *out, int
358 358
   int tmp = -1;
359 359
   X509_NAME_ENTRY *x509ne = 0;
360 360
   ASN1_STRING *asn1 = 0;
361
-  unsigned char *buf = 0;
362
-  int nid = OBJ_txt2nid(field_name);
361
+  unsigned char *buf = (unsigned char *)1; /* bug in OpenSSL 0.9.6b ASN1_STRING_to_UTF8 requires this workaround */
362
+  int nid = OBJ_txt2nid((char *)field_name);
363 363
 
364 364
   ASSERT (size > 0);
365 365
   *out = '\0';