#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)
return (rsa_tmp);
}
+#ifdef USE_OLD_EXTRACT_X509_FIELD
+
/*
* Extract a field from an X509 subject name.
*
}
}
+#else
+
/*
* Extract a field from an X509 subject name.
*
OPENSSL_free(buf);
}
+#endif
+
static void
setenv_untrusted (struct tls_session *session)
{
string_mod (subject, X509_NAME_CHAR_CLASS, 0, '_');
/* extract the common name */
+#ifdef USE_OLD_EXTRACT_X509_FIELD
+ extract_x509_field (subject, "CN", common_name, TLS_CN_LEN);
+#else
extract_x509_field_ssl (X509_get_subject_name (ctx->current_cert), "CN", common_name, TLS_CN_LEN);
- //extract_x509_field (subject, "CN", common_name, TLS_CN_LEN);
+#endif
+
string_mod (common_name, COMMON_NAME_CHAR_CLASS, 0, '_');
#if 0 /* print some debugging info */