tags 615697 patch
thanks

Hello,

Attached patches were used to fix FTBFS in Ubuntu.
https://launchpad.net/ubuntu/+source/beid/3.5.2.dfsg-10ubuntu3
Description: Correct variable types and add necessary type casts. Fixes build
 with OpenSSL 1.0.0.
Author: Ilya Barygin <bary...@gmail.com>
--- beid-3.5.2.dfsg.orig/_src/beid-2.6/src/eidlib/Verify.cpp
+++ beid-3.5.2.dfsg/_src/beid-2.6/src/eidlib/Verify.cpp
@@ -294,7 +294,7 @@
      }
   }
   sk_X509_free(spc_store->certs);
-  for (i = 0; i < sk_X509_num(spc_store->crls); i++)
+  for (i = 0; i < sk_X509_CRL_num(spc_store->crls); i++)
   {
      X509_CRL *pX509CRL = sk_X509_CRL_value(spc_store->crls, i);
      if (pX509CRL != NULL)
@@ -303,7 +303,7 @@
          pX509CRL = NULL;
      }
   }
-  sk_X509_free(spc_store->crls);
+  sk_X509_CRL_free(spc_store->crls);
   sk_X509_free(spc_store->use_certs);
 }
 
@@ -329,7 +329,7 @@
 {
     // Check CRL already in store
     bool bFound = false;
-    for (int i = 0; i < sk_X509_num(spc_store->crls); i++)
+    for (int i = 0; i < sk_X509_CRL_num(spc_store->crls); i++)
     {
         X509_CRL *pX509CRL = sk_X509_CRL_value(spc_store->crls, i);
         if (X509_V_OK == X509_CRL_cmp(pX509CRL, crl))
@@ -518,9 +518,9 @@
     {
         if(iNID == NID_crl_distribution_points)
         {
-            for(j = 0; j < sk_DIST_POINT_num(pStack) && !bFound; j++) 
+            for(j = 0; j < sk_DIST_POINT_num((STACK_OF(DIST_POINT) *)pStack) && !bFound; j++) 
             {
-                DIST_POINT *pRes = (DIST_POINT *)sk_DIST_POINT_value(pStack, j);
+                DIST_POINT *pRes = sk_DIST_POINT_value((STACK_OF(DIST_POINT) *)pStack, j);
                 if(pRes != NULL)
                 {
                     STACK_OF(GENERAL_NAME) *pNames = pRes->distpoint->name.fullname;
@@ -539,13 +539,13 @@
                     }
                 }
             } 
-            sk_DIST_POINT_free(pStack);
+            sk_DIST_POINT_free((STACK_OF(DIST_POINT) *)pStack);
         }
         else if(iNID == NID_info_access)
         {
-            for(j = 0; j < sk_ACCESS_DESCRIPTION_num(pStack) && !bFound; j++) 
+            for(j = 0; j < sk_ACCESS_DESCRIPTION_num((STACK_OF(ACCESS_DESCRIPTION) *)pStack) && !bFound; j++) 
             {
-                ACCESS_DESCRIPTION *pAccess = sk_ACCESS_DESCRIPTION_value(pStack, j);
+                ACCESS_DESCRIPTION *pAccess = sk_ACCESS_DESCRIPTION_value((STACK_OF(ACCESS_DESCRIPTION) *)pStack, j);
                 if(pAccess != NULL && pAccess->method != NULL && OBJ_obj2nid(pAccess->method) == NID_ad_OCSP)
                 {
                     GENERAL_NAME *pName = pAccess->location;
@@ -556,7 +556,7 @@
                     }
                 }
             }
-            sk_ACCESS_DESCRIPTION_free(pStack);
+            sk_ACCESS_DESCRIPTION_free((STACK_OF(ACCESS_DESCRIPTION) *)pStack);
         }
     }
 
@@ -569,10 +569,10 @@
 
 int CVerify::VerifyCertHostname(X509 *pCert, char *pszHostname)
 {
-    struct stack_st *pStack = NULL;
+    STACK_OF(GENERAL_NAME) *pStack = NULL;
     BOOL bFound = FALSE;
 
-    pStack = (struct stack_st *) X509_get_ext_d2i(pCert, NID_subject_alt_name, NULL, NULL);
+    pStack = (STACK_OF(GENERAL_NAME) *) X509_get_ext_d2i(pCert, NID_subject_alt_name, NULL, NULL);
     if(pStack != NULL)
     {
         int i, iLen1, iLen2;
@@ -1656,7 +1656,7 @@
     POLICYINFO *pinfo = NULL;
     BOOL bFound = FALSE;
 
-    pol = (struct stack_st *) X509_get_ext_d2i(pCert, NID_certificate_policies, NULL, NULL);
+    pol = (STACK_OF(POLICYINFO) *) X509_get_ext_d2i(pCert, NID_certificate_policies, NULL, NULL);
 
     if(pol != NULL)
     {
--- beid-3.5.2.dfsg.orig/_src/eidmw/applayer/cryptoFramework.cpp
+++ beid-3.5.2.dfsg/_src/eidmw/applayer/cryptoFramework.cpp
@@ -709,7 +709,7 @@
         
 	//Get the satck of policy info
 	STACK_OF(POLICYINFO) *pol = NULL;
-	if(NULL == (pol = (struct stack_st *) X509_get_ext_d2i(pX509, NID_certificate_policies, NULL, NULL)))
+	if(NULL == (pol = (STACK_OF(POLICYINFO) *) X509_get_ext_d2i(pX509, NID_certificate_policies, NULL, NULL)))
 		return false;
 
 	POLICYINFO *pinfo = NULL;
@@ -1265,11 +1265,11 @@
 
 char *APL_CryptoFwk::GetOCSPUrl(X509 *pX509_Cert) 
 {
-    struct stack_st *pStack = NULL;
+    STACK_OF(ACCESS_DESCRIPTION) *pStack = NULL;
     const char *pData = NULL;
     bool bFound = false;
 
-	pStack = (struct stack_st *) X509_get_ext_d2i(pX509_Cert, NID_info_access, NULL, NULL);
+	pStack = (STACK_OF(ACCESS_DESCRIPTION) *) X509_get_ext_d2i(pX509_Cert, NID_info_access, NULL, NULL);
 
     if(pStack == NULL)
 #ifdef WIN32
@@ -1343,11 +1343,11 @@
 
 char *APL_CryptoFwk::GetCDPUrl(X509 *pX509_Cert) 
 {
-    struct stack_st *pStack = NULL;
+    STACK_OF(DIST_POINT) *pStack = NULL;
     const char *pData = NULL;
     bool bFound = false;
 
-	pStack = (struct stack_st *) X509_get_ext_d2i(pX509_Cert, NID_crl_distribution_points, NULL, NULL);
+	pStack = (STACK_OF(DIST_POINT) *) X509_get_ext_d2i(pX509_Cert, NID_crl_distribution_points, NULL, NULL);
 
     if(pStack == NULL)
 #ifdef WIN32
Description: Add necessary library to fix build with --no-add-needed option.
Author: Ilya Barygin <bary...@gmail.com>

--- beid-3.5.2.dfsg.orig/_src/beid-2.6/src/beidcommon/SConscript
+++ beid-3.5.2.dfsg/_src/beid-2.6/src/beidcommon/SConscript
@@ -2,6 +2,7 @@
 
 Import('env')
 myenv=env.Copy()
+myenv.Append(LIBS = ['ssl'])
 obj=myenv.genobj('shlib', myenv)
 obj.target='libbeidcommon'
 obj.src=Split("""

Reply via email to