Binary files /tmp/tmpQoqv1r/AWSju_sSL7/oesenc-pi-1.0.0/buildlinux/oeserverd/oeserverd and /tmp/tmpQoqv1r/TZKGykOMpS/oesenc-pi-1.2.0/buildlinux/oeserverd/oeserverd differ Binary files /tmp/tmpQoqv1r/AWSju_sSL7/oesenc-pi-1.0.0/buildlinux64/oeserverd/oeserverd and /tmp/tmpQoqv1r/TZKGykOMpS/oesenc-pi-1.2.0/buildlinux64/oeserverd/oeserverd differ Binary files /tmp/tmpQoqv1r/AWSju_sSL7/oesenc-pi-1.0.0/buildlinuxarm/oeserverd/oeserverd and /tmp/tmpQoqv1r/TZKGykOMpS/oesenc-pi-1.2.0/buildlinuxarm/oeserverd/oeserverd differ diff -Nru oesenc-pi-1.0.0/CMakeLists.txt oesenc-pi-1.2.0/CMakeLists.txt --- oesenc-pi-1.0.0/CMakeLists.txt 2017-03-18 14:57:31.000000000 +0000 +++ oesenc-pi-1.2.0/CMakeLists.txt 2017-04-28 02:02:11.000000000 +0000 @@ -22,7 +22,7 @@ MESSAGE (STATUS "*** Building ${PACKAGE_NAME} ***") SET(VERSION_MAJOR "1") -SET(VERSION_MINOR "0") +SET(VERSION_MINOR "2") SET(VERSION_PATCH "0") SET(PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" ) diff -Nru oesenc-pi-1.0.0/debian/changelog oesenc-pi-1.2.0/debian/changelog --- oesenc-pi-1.0.0/debian/changelog 2017-03-18 15:25:58.000000000 +0000 +++ oesenc-pi-1.2.0/debian/changelog 2017-04-29 12:47:00.000000000 +0000 @@ -1,3 +1,103 @@ +oesenc-pi (1.2.0-0~trusty1) trusty; urgency=low + + * Version 1.2.0 + + -- Dave Register Sat, 29 Apr 2017 08:46:23 -0400 +oesenc-pi (1.2.0-0~vivid1) vivid; urgency=low + + * Version 1.2.0 + + -- Dave Register Sat, 29 Apr 2017 08:46:23 -0400 +oesenc-pi (1.2.0-0~xenial1) xenial; urgency=low + + * Version 1.2.0 + + -- Dave Register Sat, 29 Apr 2017 08:46:23 -0400 +oesenc-pi (1.2.0-0~precise1) precise; urgency=low + + * Version 1.2.0 + + -- Dave Register Sat, 29 Apr 2017 08:39:25 -0400 +oesenc-pi (1.2.0-0~trusty1) trusty; urgency=low + + * Version 1.2.0 + + -- Dave Register Sat, 29 Apr 2017 08:39:25 -0400 +oesenc-pi (1.2.0-0~vivid1) vivid; urgency=low + + * Version 1.2.0 + + -- Dave Register Sat, 29 Apr 2017 08:39:25 -0400 +oesenc-pi (1.2.0-0~xenial1) xenial; urgency=low + + * Version 1.2.0 + + -- Dave Register Sat, 29 Apr 2017 08:39:25 -0400 +oesenc-pi (1.2.0-0~precise1) precise; urgency=low + + * Beta Version 1.2.0 + + -- Dave Register Thu, 27 Apr 2017 22:04:30 -0400 +oesenc-pi (1.2.0-0~trusty1) trusty; urgency=low + + * Beta Version 1.2.0 + + -- Dave Register Thu, 27 Apr 2017 22:04:30 -0400 +oesenc-pi (1.2.0-0~vivid1) vivid; urgency=low + + * Beta Version 1.2.0 + + -- Dave Register Thu, 27 Apr 2017 22:04:30 -0400 +oesenc-pi (1.2.0-0~xenial1) xenial; urgency=low + + * Beta Version 1.2.0 + + -- Dave Register Thu, 27 Apr 2017 22:04:30 -0400 +oesenc-pi (1.0.423-0~precise1) precise; urgency=low + + * Version 1.0.423 + + -- Dave Register Sun, 23 Apr 2017 21:05:21 -0400 +oesenc-pi (1.0.423-0~trusty1) trusty; urgency=low + + * Version 1.0.423 + + -- Dave Register Sun, 23 Apr 2017 21:05:21 -0400 +oesenc-pi (1.0.423-0~vivid1) vivid; urgency=low + + * Version 1.0.423 + + -- Dave Register Sun, 23 Apr 2017 21:05:21 -0400 +oesenc-pi (1.0.423-0~xenial1) xenial; urgency=low + + * Version 1.0.423 + + -- Dave Register Sun, 23 Apr 2017 21:05:21 -0400 +oesenc-pi (1.0.403-0~precise1) precise; urgency=low + + * Beta Version 1.0.403 + + -- Dave Register Mon, 03 Apr 2017 22:22:29 -0400 +oesenc-pi (1.0.403-0~trusty1) trusty; urgency=low + + * Beta Version 1.0.403 + + -- Dave Register Mon, 03 Apr 2017 22:22:29 -0400 +oesenc-pi (1.0.403-0~vivid1) vivid; urgency=low + + * Beta Version 1.0.403 + + -- Dave Register Mon, 03 Apr 2017 22:22:29 -0400 +oesenc-pi (1.0.403-0~xenial1) xenial; urgency=low + + * Beta Version 1.0.403 + + -- Dave Register Mon, 03 Apr 2017 22:22:29 -0400 +oesenc-pi (1.0.0-0~precise1) precise; urgency=low + + * Version 1.0.0 + + -- Dave Register Sat, 18 Mar 2017 11:25:08 -0400 oesenc-pi (1.0.0-0~trusty1) trusty; urgency=low * Version 1.0.0 diff -Nru oesenc-pi-1.0.0/src/eSENCChart.cpp oesenc-pi-1.2.0/src/eSENCChart.cpp --- oesenc-pi-1.0.0/src/eSENCChart.cpp 2017-03-18 14:57:31.000000000 +0000 +++ oesenc-pi-1.2.0/src/eSENCChart.cpp 2017-04-28 02:02:11.000000000 +0000 @@ -3562,10 +3562,22 @@ // Create a hash map of VE_Element pointers as a chart class member int n_ve_elements = VEs.size(); - + + wxString msgs; + msgs.Printf(_T("%d"), n_ve_elements); + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: VEs Size: ") + msgs); + for( int i = 0; i < n_ve_elements; i++ ) { VE_Element *vep = VEs.at( i ); + // The hash key needs to be a reasonable 32 bit int... + if(vep->index > 0x7FFFFFFF){ + wxString msg; + msg.Printf(_T("%d"), i); + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: Found bad VE_Element index at i:") + msg); +// continue; + } + // VE_Element ve_from_array = VEs.at( i ); vep->max_priority = 0; // Default @@ -3603,10 +3615,17 @@ fromSM_Plugin( east_max, north_max, m_ref_lat, m_ref_lon, &lat, &lon ); vep->edgeBBox.SetMax( lon, lat); } - + m_ve_hash[vep->index] = vep; } + + wxString msgss; + msgss.Printf(_T("%d"), m_ve_hash.size()); + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: VE_hash Size: ") + msgss); + + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: Process Edge Vectors OK")); + // Create a hash map VC_Element pointers as a chart class member int n_vc_elements = VCs.size(); @@ -3616,6 +3635,8 @@ m_vc_hash[vcp->index] = vcp; } + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: Process Connect Vectors OK")); + VEs.clear(); // destroy contents, no longer needed VCs.clear(); @@ -3718,7 +3739,9 @@ } } // Objects iterator - + + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: Object tree Walk OK")); + // Decide on pub date to show wxDateTime d000; @@ -3772,7 +3795,8 @@ // Validate hash maps.... //TODO Do we really need to do this? // nedd to fix up the negatives? - + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: Start Validate Hashmaps...")); + ObjRazRules *top; ObjRazRules *nxx; @@ -3791,10 +3815,11 @@ int inode = *index_run; if( ( inode ) ) { if( m_vc_hash.find( inode ) == m_vc_hash.end() ) { + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: Bad inode 0")); // Must be a bad index in the SENC file // Stuff a recognizable flag to indicate invalidity *index_run = 0; - m_vc_hash[0] = 0; +// m_vc_hash[0] = 0; } } index_run++; @@ -3805,10 +3830,12 @@ enode = -enode; if( ( enode ) ) { if( m_ve_hash.find( enode ) == m_ve_hash.end() ) { + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: Bad enode 1")); + // Must be a bad index in the SENC file // Stuff a recognizable flag to indicate invalidity *index_run = 0; - m_ve_hash[0] = 0; +// m_ve_hash[0] = 0; } } @@ -3820,8 +3847,9 @@ if( m_vc_hash.find( jnode ) == m_vc_hash.end() ) { // Must be a bad index in the SENC file // Stuff a recognizable flag to indicate invalidity + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: Bad jnode 2")); *index_run = 0; - m_vc_hash[0] = 0; +// m_vc_hash[0] = 0; } } index_run++; @@ -3833,6 +3861,7 @@ } } } + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: Validate Hashmaps OK")); // Set up the chart context m_this_chart_context = (chart_context *)calloc( sizeof(chart_context), 1); @@ -3850,8 +3879,12 @@ } } + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: Start AssembleLineGeometry")); + AssembleLineGeometry(); - + + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile: AssembleLineGeometry OK")); + if(g_debugLevel) wxLogMessage(_T("BuildRAZFromSENCFile Return OK")); delete sencfile; @@ -6819,7 +6852,12 @@ void eSENCChart::AssembleLineGeometry( void ) { - + if(g_debugLevel) wxLogMessage(_T("AssembleLineGeometry: Start ")); + + wxString msgss; + msgss.Printf(_T("%d"), m_ve_hash.size()); + if(g_debugLevel) wxLogMessage(_T("AssembleLineGeometry: VE_hash Size: ") + msgss); + // OCPNStopWatch sw; // Walk the hash tables to get the required buffer size @@ -6835,7 +6873,9 @@ } // printf("time0 %f\n", sw.GetTime()); - + wxString msgc; + msgc.Printf( _T("%d"), nPoints); + if(g_debugLevel) wxLogMessage(_T("AssembleLineGeometry: Got Point count: ") + msgc); std::map ce_connector_hash; @@ -6849,7 +6889,8 @@ std::vector connector_segment_vector; size_t seg_pair_index = 0; - + if(g_debugLevel) wxLogMessage(_T("AssembleLineGeometry: Start Object Walk")); + // Get the end node connected segments. To do this, we // walk the Feature array and process each feature that potentially has a LINE type element @@ -7112,7 +7153,8 @@ } } // printf("time1 %f\n", sw.GetTime()); - + if(g_debugLevel) wxLogMessage(_T("AssembleLineGeometry: Finish Object Walk OK")); + // We have the total VBO point count, and a nice hashmap of the connector segments nPoints += ndelta; // allow for the connector segments @@ -7140,7 +7182,9 @@ // Now iterate on the hashmaps, adding the connector segments in the temporary vector to the VBO buffer // At the same time, populate a vector, storing the pcs pointers to allow destruction at this class dtor. // This will allow us to destroy (automatically) the pcs hashmaps, and save some storage - + + if(g_debugLevel) wxLogMessage(_T("AssembleLineGeometry: Begin Hash iteration")); + std::map::iterator iter; for( iter = ce_connector_hash.begin(); iter != ce_connector_hash.end(); ++iter ) @@ -7190,7 +7234,9 @@ // And so we can empty the temp buffer connector_segment_vector.clear(); - + + if(g_debugLevel) wxLogMessage(_T("AssembleLineGeometry: End Hash iteration")); + // Wwe can convert the edge hashmap to a vector, to allow us to destroy the hashmap // and at the same time free up the point storage in the VE_Elements, since all the points // are now in the VBO buffer @@ -7202,7 +7248,9 @@ } } m_ve_hash.clear(); - + + if(g_debugLevel) wxLogMessage(_T("AssembleLineGeometry: End Edge vector convert OK")); + // and we can empty the connector hashmap, // and at the same time free up the point storage in the VC_Elements, since all the points // are now in the VBO buffer @@ -7215,6 +7263,7 @@ } m_vc_hash.clear(); + if(g_debugLevel) wxLogMessage(_T("AssembleLineGeometry: End Connector vector convert OK")); // printf("time3 %f\n", sw.GetTime()); diff -Nru oesenc-pi-1.0.0/src/eSENCChart.h oesenc-pi-1.2.0/src/eSENCChart.h --- oesenc-pi-1.0.0/src/eSENCChart.h 2017-03-18 14:57:31.000000000 +0000 +++ oesenc-pi-1.2.0/src/eSENCChart.h 2017-04-28 02:02:11.000000000 +0000 @@ -33,7 +33,7 @@ #include "Osenc.h" #include -WX_DECLARE_HASH_MAP( int, VE_Element *, wxIntegerHash, wxIntegerEqual, VE_Hash ); +WX_DECLARE_HASH_MAP( unsigned int, VE_Element *, wxIntegerHash, wxIntegerEqual, VE_Hash ); WX_DECLARE_HASH_MAP( unsigned int, VC_Element *, wxIntegerHash, wxIntegerEqual, VC_Hash ); WX_DEFINE_ARRAY_DOUBLE(double, ArrayOfSortedDoubles); diff -Nru oesenc-pi-1.0.0/src/oesenc_pi.cpp oesenc-pi-1.2.0/src/oesenc_pi.cpp --- oesenc-pi-1.0.0/src/oesenc_pi.cpp 2017-03-18 14:57:31.000000000 +0000 +++ oesenc-pi-1.2.0/src/oesenc_pi.cpp 2017-04-28 02:02:11.000000000 +0000 @@ -2771,7 +2771,7 @@ if(g_serverProc){ // Check to see if the server is already running, and available Osenc_instream testAvail; - if(testAvail.isAvailable()){ + if(testAvail.isAvailable(g_UserKey)){ wxLogMessage(_T("Available TRUE")); return true; } @@ -2784,7 +2784,7 @@ wxLogMessage(_T("Available FALSE, retry...") + tmsg); wxMilliSleep(500); Osenc_instream testAvailRetry; - if(testAvailRetry.isAvailable()){ + if(testAvailRetry.isAvailable(g_UserKey)){ wxLogMessage(_T("Available TRUE")); return true; } @@ -2913,7 +2913,7 @@ while(nLoop){ Osenc_instream testAvail_One; - if(!testAvail_One.isAvailable()) + if(!testAvail_One.isAvailable(_T("?"))) wxSleep(1); else{ bAvail = true; @@ -2938,7 +2938,11 @@ else{ wxString nc; nc.Printf(_T("LoopCount: %d"), nLoop); - + + // Get the decrypt type into the logfile + Osenc_instream testAvail_type; + testAvail_type.isAvailable( g_UserKey ); + wxLogMessage(_T("oesenc_pi: oeserverd Check OK...") + nc); } } @@ -2961,22 +2965,16 @@ bool shutdown_SENC_server( void ) { -// #ifdef __WXMSW__ -// wxExecute(_T("net stop oeserverd")); // exec asynchronously -// return true; -// #else // Check to see if the server is already running, and available Osenc_instream testAvail; - if(1/*testAvail.isAvailable()*/){ + if(1){ testAvail.Shutdown(); return true; } else{ return false; } -// #endif - } @@ -3119,10 +3117,29 @@ fpr_dir += wxFileName::GetPathSeparator(); wxString cmd = g_sencutil_bin; - cmd += _T(" -f "); // Make fingerprint + cmd += _T(" -g "); // Make fingerprint + +#ifndef __WXMSW__ + cmd += _T("\""); + cmd += fpr_dir; + + //cmd += _T("my fpr/"); // testing +// wxString tst_cedilla = wxString::Format(_T("my fpr copy %cCedilla/"), 0x00E7); // testing French cedilla +// cmd += tst_cedilla; // testing + + cmd += _T("\""); +#else + cmd += wxString('\"'); cmd += fpr_dir; +// cmd += _T("my fpr\\"); // testing spaces in path + +// wxString tst_cedilla = wxString::Format(_T("my%c\\"), 0x00E7); // testing French cedilla +// cmd += tst_cedilla; // testing +#endif + wxLogMessage(_T("Create FPR command: ") + cmd); + ::wxBeginBusyCursor(); wxArrayString ret_array; @@ -3182,7 +3199,8 @@ char str[128]; wcstombs(str, desktop_path, 128); - wxString desktop_fpr(str, wxConvUTF8); + wxString desktop_fpr(str, wxConvAuto()); + sdesktop_path = desktop_fpr; if( desktop_fpr.Last() != wxFileName::GetPathSeparator() ) desktop_fpr += wxFileName::GetPathSeparator(); @@ -3190,14 +3208,10 @@ wxFileName fn(fpr_file); wxString desktop_fpr_file = desktop_fpr + fn.GetFullName(); - wxString wcmd = g_sencutil_bin; - wcmd += _T(" -f "); // Make fingerprint - wcmd += desktop_fpr; - - wxString exe = g_sencutil_bin; - wxString parms = _T(" -f "); - parms += desktop_fpr; + wxString exe = _T("xcopy"); + wxString parms = fpr_file.Trim() + _T(" ") + wxString('\"') + desktop_fpr + wxString('\"'); + wxLogMessage(_T("FPR copy command: ") + exe + _T(" ") + parms); const wchar_t *wexe = exe.wc_str(wxConvUTF8); const wchar_t *wparms = parms.wc_str(wxConvUTF8); @@ -3228,7 +3242,7 @@ if (dwError == ERROR_CANCELLED) { // The user refused to allow privileges elevation. - OCPNMessageBox_PlugIn(NULL, _("Administrator priveleges are required to create fpr.\n Please try again...."), _("oeSENC_pi Message"), wxOK); + OCPNMessageBox_PlugIn(NULL, _("Administrator priveleges are required to copy fpr.\n Please try again...."), _("oeSENC_pi Message"), wxOK); berror = true; } } diff -Nru oesenc-pi-1.0.0/src/Osenc.cpp oesenc-pi-1.2.0/src/Osenc.cpp --- oesenc-pi-1.0.0/src/Osenc.cpp 2017-03-18 14:57:31.000000000 +0000 +++ oesenc-pi-1.2.0/src/Osenc.cpp 2017-04-28 02:02:11.000000000 +0000 @@ -148,7 +148,7 @@ } -bool Osenc_instream::isAvailable() +bool Osenc_instream::isAvailable( wxString user_key ) { if(g_debugLevel)printf("TestAvail\n"); @@ -156,7 +156,7 @@ return m_uncrypt_stream->IsOk(); } else{ - if( Open(CMD_TEST_AVAIL, _T(""), _T("?")) ){ + if( Open(CMD_TEST_AVAIL, _T(""), user_key) ){ if(g_debugLevel)printf("TestAvail Open OK\n"); char response[8]; memset( response, 0, 8); @@ -227,6 +227,7 @@ // Open the well known public FIFO for writing if( (publicfifo = open(PUBLIC, O_WRONLY | O_NDELAY) ) == -1) { + wxLogMessage(_T("oesenc_pi: Could not open PUBLIC pipe")); return false; //if( errno == ENXIO ) } @@ -246,9 +247,9 @@ // Open the private FIFO for reading to get output of command // from the server. if((privatefifo = open(privatefifo_name, O_RDONLY) ) == -1) { + wxLogMessage(_T("oesenc_pi: Could not open private pipe")); return false; } - return true; } else{ // not encrypted @@ -355,15 +356,27 @@ } -bool Osenc_instream::isAvailable() +bool Osenc_instream::isAvailable( wxString user_key ) { - if( Open(CMD_TEST_AVAIL, _T(""), _T("")) ){ + if( Open(CMD_TEST_AVAIL, _T(""), user_key ) ){ char response[8]; memset( response, 0, 8); int nTry = 5; do{ - if( Read(response, 2).IsOk() ){ - return( !strncmp(response, "OK", 2) ); + if( Read(response, 3).IsOk() ){ + if(strncmp(response, "OK", 2)) + return false; + + if(response[2] == '1') + wxLogMessage(_T("Osenc_instream decrypt T")); + else if(response[2] == '2') + wxLogMessage(_T("Osenc_instream decrypt S")); + else if(response[2] == '3') + wxLogMessage(_T("Osenc_instream decrypt L")); + else + wxLogMessage(_T("Osenc_instream decrypt ?")); + + return true; } wxMilliSleep(100); diff -Nru oesenc-pi-1.0.0/src/Osenc.h oesenc-pi-1.2.0/src/Osenc.h --- oesenc-pi-1.0.0/src/Osenc.h 2017-03-18 14:57:31.000000000 +0000 +++ oesenc-pi-1.2.0/src/Osenc.h 2017-04-28 02:02:11.000000000 +0000 @@ -548,7 +548,7 @@ Osenc_instream &Read(void *buffer, size_t size); bool IsOk(); - bool isAvailable(); + bool isAvailable(wxString user_key); void Shutdown(); private: