openssl.c, Showing 1 changed file with 14 additions and 7 deletions
... ... @@ -47,6 +47,13 @@
47 47  
48 48 #define DEBUG_SMIME 0
49 49  
  50 +#if OPENSSL_VERSION_NUMBER >= 0x10000000L
  51 +#define OPENSSL_D2I_X509_CAST d2i_of_void *
  52 +#else
  53 +#define OPENSSL_D2I_X509_CAST char *(*)()
  54 +#define LHASH_OF(x) LHASH
  55 +#endif
  56 +
50 57 static unsigned char arg2_force_ref[] =
51 58 { 2, BYREF_NONE, BYREF_FORCE };
52 59 static unsigned char arg2and3_force_ref[] =
... ... @@ -179,8 +186,8 @@
179 186 static char default_ssl_conf_filename[MAXPATHLEN];
180 187  
181 188 struct php_x509_request {
182   - LHASH * global_config; /* Global SSL config */
183   - LHASH * req_config; /* SSL config for this request */
  189 + LHASH_OF(CONF_VALUE) * global_config; /* Global SSL config */
  190 + LHASH_OF(CONF_VALUE) * req_config; /* SSL config for this request */
184 191 const EVP_MD * md_alg;
185 192 const EVP_MD * digest;
186 193 char * section_name,
... ... @@ -340,7 +347,7 @@
340 347 const char * section_label,
341 348 const char * config_filename,
342 349 const char * section,
343   - LHASH * config TSRMLS_DC)
  350 + LHASH_OF(CONF_VALUE) * config TSRMLS_DC)
344 351 {
345 352 X509V3_CTX ctx;
346 353  
... ... @@ -720,7 +727,7 @@
720 727 if (in == NULL)
721 728 return NULL;
722 729  
723   - cert = (X509 *) PEM_ASN1_read_bio((char *(*)())d2i_X509,
  730 + cert = (X509 *) PEM_ASN1_read_bio((OPENSSL_D2I_X509_CAST)d2i_X509,
724 731 PEM_STRING_X509, in,
725 732 NULL, NULL, NULL);
726 733 BIO_free(in);
... ... @@ -1859,7 +1866,7 @@
1859 1866 case EVP_PKEY_RSA2:
1860 1867 assert(pkey->pkey.rsa != NULL);
1861 1868  
1862   - if (NULL == pkey->pkey.rsa->p || NULL == pkey->pkey.rsa->q)
  1869 + if (NULL == pkey->pkey.rsa || NULL == pkey->pkey.rsa->p || NULL == pkey->pkey.rsa->q)
1863 1870 return 0;
1864 1871 break;
1865 1872 #endif
... ... @@ -1871,7 +1878,7 @@
1871 1878 case EVP_PKEY_DSA4:
1872 1879 assert(pkey->pkey.dsa != NULL);
1873 1880  
1874   - if (NULL == pkey->pkey.dsa->p || NULL == pkey->pkey.dsa->q || NULL == pkey->pkey.dsa->priv_key)
  1881 + if (NULL == pkey->pkey.dsa || NULL == pkey->pkey.dsa->p || NULL == pkey->pkey.dsa->q || NULL == pkey->pkey.dsa->priv_key)
1875 1882 return 0;
1876 1883 break;
1877 1884 #endif
... ... @@ -1879,7 +1886,7 @@
1879 1886 case EVP_PKEY_DH:
1880 1887 assert(pkey->pkey.dh != NULL);
1881 1888  
1882   - if (NULL == pkey->pkey.dh->p || NULL == pkey->pkey.dh->priv_key)
  1889 + if (NULL == pkey->pkey.dh || NULL == pkey->pkey.dh->p || NULL == pkey->pkey.dh->priv_key)
1883 1890 return 0;
1884 1891 break;
1885 1892 #endif
openssl.c, Showing 1 changed file with 14 additions and 7 deletions