static void tlso_info_cb( const SSL *ssl, int where, int ret );
static int tlso_verify_cb( int ok, X509_STORE_CTX *ctx );
static int tlso_verify_ok( int ok, X509_STORE_CTX *ctx );
+#if OPENSSL_VERSION_NUMBER < 0x10100000
static RSA * tlso_tmp_rsa_cb( SSL *ssl, int is_export, int key_length );
+#endif
static int tlso_seed_PRNG( const char *randfile );
SSL_CTX_set_verify( ctx, i,
lo->ldo_tls_require_cert == LDAP_OPT_X_TLS_ALLOW ?
tlso_verify_ok : tlso_verify_cb );
+#if OPENSSL_VERSION_NUMBER < 0x10100000
SSL_CTX_set_tmp_rsa_callback( ctx, tlso_tmp_rsa_cb );
+#endif
#ifdef HAVE_OPENSSL_CRL
if ( lo->ldo_tls_crlcheck ) {
X509_STORE *x509_s = SSL_CTX_get_cert_store( ctx );
if (!x) return LDAP_INVALID_CREDENTIALS;
xn = X509_get_subject_name(x);
+#if OPENSSL_VERSION_NUMBER < 0x10100000
der_dn->bv_len = i2d_X509_NAME( xn, NULL );
der_dn->bv_val = xn->bytes->data;
+#else
+ {
+ size_t len = 0;
+ der_dn->bv_val = NULL;
+ X509_NAME_get0_der( (const unsigned char **)&der_dn->bv_val, &len, xn );
+ der_dn->bv_len = len;
+ }
+#endif
/* Don't X509_free, the session is still using it */
return 0;
}
return LDAP_INVALID_CREDENTIALS;
xn = X509_get_subject_name(x);
+#if OPENSSL_VERSION_NUMBER < 0x10100000
der_dn->bv_len = i2d_X509_NAME( xn, NULL );
der_dn->bv_val = xn->bytes->data;
+#else
+ {
+ size_t len = 0;
+ der_dn->bv_val = NULL;
+ X509_NAME_get0_der( (const unsigned char **)&der_dn->bv_val, &len, xn );
+ der_dn->bv_len = len;
+ }
+#endif
X509_free(x);
return 0;
}
}
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000
static RSA *
tlso_tmp_rsa_cb( SSL *ssl, int is_export, int key_length )
{
}
return tmp_rsa;
}
+#endif /* OPENSSL_VERSION_NUMBER < 1.1 */
static int
tlso_seed_PRNG( const char *randfile )