v3.5.0 Build errors

Discussion to talk about software related topics only.
Post Reply
SeeCwriter
Posts: 624
Joined: Mon May 12, 2008 10:55 am

v3.5.0 Build errors

Post by SeeCwriter »

I installed v3.5.0, and in predef.h I uncommented ENABLE_AUTOCERT_REGEN and tried to rebuild the system. I get the following compiler errors:

Code: Select all

C:/nburn/libraries/crypto/NetBurner/NbCertGen.cpp:126:111: error: request for member 'm_certExpTime' in 'pGenData', which is of pointer type 'CertGenData*' (maybe you meant to use '->' ?)
         else if (SSL_GetTimeToExpire(HalGetDeviceCert(), HalGetDeviceCertLen(), HalGetDeviceFormat(),pGenData.m_certExpTime))
                                                                                                               ^~~~~~~~~~~~~
C:/nburn/libraries/crypto/NetBurner/NbCertGen.cpp:128:13: error: 'gCertGenData' was not declared in this scope
             gCertGenData.m_certExpTimeSet = true;
             ^~~~~~~~~~~~
C:/nburn/libraries/crypto/NetBurner/NbCertGen.cpp:473:90: error: 'gCertGenData' was not declared in this scope
     SSL_GetTimeToExpire(HalGetDeviceCert(), HalGetDeviceCertLen(), HalGetDeviceFormat(), gCertGenData.m_certExpTime);
                                                                                          ^~~~~~~~~~~~
User avatar
Forrest
Posts: 288
Joined: Wed Apr 23, 2008 10:05 am

Re: v3.5.0 Build errors

Post by Forrest »

Hello,
I looked through this and it looks like we failed to change the name of the global variable under the ENABLE_AUTOCERT_REGEN ifdefs. This internal variable name had been changed between the 3.5.0 and previous release. I fixed this for the upcoming release. You can fix it locally by renaming all instances of gCertGenData in the file libraries/crypto/NetBurner/NbCertGen.cpp. They should be pGenData. Thanks for the report...

See patch below:

Code: Select all

diff --git a/libraries/crypto/NetBurner/NbCertGen.cpp b/libraries/crypto/NetBurner/NbCertGen.cpp
index 45542dad4..909b58f11 100644
--- a/libraries/crypto/NetBurner/NbCertGen.cpp
+++ b/libraries/crypto/NetBurner/NbCertGen.cpp
@@ -103,7 +103,7 @@ CertGenReturnCode CheckAndCreateHalCertAndKey()
         if (ShouldReplaceNbHalCert()) { createCert = true; }
         else if (SSL_GetTimeToExpire(HalGetDeviceCert(), HalGetDeviceCertLen(), HalGetDeviceFormat(),pGenData.m_certExpTime))
         {
-            gCertGenData.m_certExpTimeSet = true;
+            pGenData.m_certExpTimeSet = true;
         }
 #endif
     }
@@ -448,8 +448,8 @@ extern "C" CertGenReturnCode SSL_CreateNewSelfSignedCert(CertGenData & GenData)
 
 #ifdef ENABLE_AUTOCERT_REGEN
     // Set the new expriation time so we can check it and re-generate the cert if needed
-    SSL_GetTimeToExpire(HalGetDeviceCert(), HalGetDeviceCertLen(), HalGetDeviceFormat(), gCertGenData.m_certExpTime);
-    gCertGenData.m_certExpTimeSet = true;
+    SSL_GetTimeToExpire(HalGetDeviceCert(), HalGetDeviceCertLen(), HalGetDeviceFormat(), pGenData.m_certExpTime);
+    pGenData.m_certExpTimeSet = true;
 #endif
 
     return CERT_GEN_RETURN_SUCCESS;

Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
SeeCwriter
Posts: 624
Joined: Mon May 12, 2008 10:55 am

Re: v3.5.0 Build errors

Post by SeeCwriter »

I made the changes, and additional errors were revealed in file NbCertGen.cpp.

Line 128: "CertGenData has no member named m_certExpTimeSet."
Line 473: "pGenData was not declared in this scope."

It looks like line 474 will have the same error as line 128.
Post Reply