Bug#521951: ike: FTBFS: ISO C++ forbids declaration of 'BDATA' with no type

2009-05-02 Thread Matthew Grooms

Philipp Matthias Hahn wrote:

Hello Matthew,

On Tue, Mar 31, 2009 at 11:09:26PM +0200, Philipp Matthias Hahn wrote:

Hello Matthew,

I just received this bug-report for Debian. Please keep
521...@bugs.debian.org in the cc: for tracking.


I created the following patch which should fix the problem; at least it
does for me.



Philipp,

This was a mess. I just finished winding through the include files. I 
believe they have been successfully untangling and a patch has been 
committed to both head and the 2.1 branch to correct this issue. I plan 
on releasing 2.1.5 very soon. Please let me know if you see any other 
problems.


Thanks,

-Matthew



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#521951: ike: FTBFS: ISO C++ forbids declaration of 'BDATA' with no type

2009-04-07 Thread Matthew Grooms

Philipp Matthias Hahn wrote:

Hello Matthew,

I just received this bug-report for Debian. Please keep
521...@bugs.debian.org in the cc: for tracking.



Phillip,

I'm pretty sure this is related to using bison 2.4.x instead of 2.3.x. 
It probably juggles the order of how things are included. A few people 
have reported it so far and said it was corrected after downgrading to 
bison 2.3.x. I'll create a ticket in my trac system to make sure it gets 
corrected before the 2.1.5 release.


Thanks,

-Matthew



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#500027: ike: bug in check of remote IPv4 address

2008-09-26 Thread Matthew Grooms

Nicolas and Philipp,

Here a patch that I have tested and committed to the head and the 2.1 
maintenance branch. It will be in the forthcoming 2.1.3 release. Thanks 
for identifying the issue and providing the problem evaluation.


-Matthew
Index: ike.peerid.cpp
===
--- ike.peerid.cpp  (revision 516)
+++ ike.peerid.cpp  (working copy)
@@ -43,10 +43,6 @@
 
 bool _IKED::gen_ph1id_l( IDB_PH1 * ph1, IKE_PH1ID  ph1id )
 {
-   //
-   // initialize local id
-   //
-
ph1id.type = ph1-tunnel-peer-idtype_l;
 
switch( ph1id.type )
@@ -62,16 +58,14 @@
ph1-tunnel-peer-iddata_l,
ph1id.varid ) )
{
-   char temp[ 512 ];
-   size_t size = 
ph1-tunnel-peer-iddata_l.size();
-   if( size  511 )
-   size = 511;
+   BDATA temp;
+   temp = ph1-tunnel-peer-iddata_l;
+   temp.add( , 1 );
 
-   memcpy( temp, 
ph1-tunnel-peer-iddata_l.buff(), size );
-   temp[ size ] = 0;
-
log.txt( LLOG_ERROR,
-   !! : gen_ph1id_l failed. 
invalid initiator id data \'%s\'\n, temp );
+   !! : failed to generate local 
%s id from \'%s\'\n,
+   find_name( NAME_IDENT, 
ph1id.type ),
+   temp.text() );
 
return false;
}
@@ -90,8 +84,21 @@
{
if( ph1-tunnel-peer-iddata_l.size() )
{
-   ph1id.addr.s_addr =
-   inet_addr( ( char * ) 
ph1-tunnel-peer-iddata_l.buff() );
+   BDATA temp;
+   temp = ph1-tunnel-peer-iddata_l;
+   temp.add( , 1 );
+
+   ph1id.addr.s_addr = inet_addr( temp.text() );
+
+   if( ph1id.addr.s_addr == INADDR_NONE )
+   {
+   log.txt( LLOG_ERROR,
+   !! : failed to generate local 
%s id from \'%s\'\n,
+   find_name( NAME_IDENT, 
ph1id.type ),
+   temp.text() );
+
+   return false;
+   }
}
else
{
@@ -114,7 +121,8 @@
default:
{
log.txt( LLOG_ERROR,
-   !! : gen_ph1id_l failed. unhandled id type 
%i\n, ph1id.type );
+   !! : failed to generate local id for unknown 
type %i\n,
+   ph1id.type );
 
return false;
}
@@ -137,16 +145,14 @@
ph1-tunnel-peer-iddata_r,
ph1id.varid ) )
{
-   char temp[ 512 ];
-   size_t size = 
ph1-tunnel-peer-iddata_r.size();
-   if( size  511 )
-   size = 511;
+   BDATA temp;
+   temp = ph1-tunnel-peer-iddata_r;
+   temp.add( , 1 );
 
-   memcpy( temp, 
ph1-tunnel-peer-iddata_r.buff(), size );
-   temp[ size ] = 0;
-
log.txt( LLOG_ERROR,
-   !! : gen_ph1id failed. invalid 
responder id data \'%s\'\n, temp );
+   !! : failed to generate remote 
%s id from \'%s\'\n,
+   find_name( NAME_IDENT, 
ph1id.type ),
+   temp.text() );
 
return false;
}
@@ -159,8 +165,21 @@
{
if( ph1-tunnel-peer-iddata_r.size() )
{
-   ph1id.addr.s_addr =
- 

Bug#500027: ike: bug in check of remote IPv4 address

2008-09-25 Thread Matthew Grooms

Philipp Matthias Hahn wrote:

Hello Matthew!



Hi Phillipp,


First of all, thanks for writing and providing ike.



No problem. Its been a fun project to work on and I'm very happy to have 
more users trying out the software and providing feedback. Thanks to all 
you folks who package and maintain this software. I know its a difficult 
and mostly thankless job :)



On Wed, Sep 24, 2008 at 11:14:39AM -0500, Matthew Grooms wrote:

Nicolas Deschildre wrote:

Thanks for the detailed bug report!
I'm forwarding upstream.

Matthew : see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=500027
Thanks for the heads up. This and many other bugs have been fixed in the  
2.1.2 maintenance release.


I think this particular bug is NOT fixed in 2.1.2, since I still
encountered the bug of inet_addr() returning 255.255.255.255 because it
gets passed a non-\0-terminated string.



I believe I understand the issue now. The ID information is stored 
without null termination. In some instances its necessary to add the 
terminator before evaluating / manipulating the ID data. As you have 
discovered, I apparently missed one of these cases :)


Can you please try the attached patch? If it solves the problem for you 
I will commit this to both the head and 2.1 maintenance branch. Perhaps 
it can be added as a local patch until 2.1.3 is released.


Thanks again,

-Matthew
Index: ike.peerid.cpp
===
--- ike.peerid.cpp  (revision 518)
+++ ike.peerid.cpp  (working copy)
@@ -62,16 +62,12 @@
ph1-tunnel-peer-iddata_l,
ph1id.varid ) )
{
-   char temp[ 512 ];
-   size_t size = 
ph1-tunnel-peer-iddata_l.size();
-   if( size  511 )
-   size = 511;
+   BDATA temp;
+   temp = ph1-tunnel-peer-iddata_l;
+   temp.add( , 1 );
 
-   memcpy( temp, 
ph1-tunnel-peer-iddata_l.buff(), size );
-   temp[ size ] = 0;
-
log.txt( LLOG_ERROR,
-   !! : gen_ph1id_l failed. 
invalid initiator id data \'%s\'\n, temp );
+   !! : gen_ph1id_l failed. 
invalid initiator id data \'%s\'\n, temp.text() );
 
return false;
}
@@ -90,8 +86,19 @@
{
if( ph1-tunnel-peer-iddata_l.size() )
{
-   ph1id.addr.s_addr =
-   inet_addr( ( char * ) 
ph1-tunnel-peer-iddata_l.buff() );
+   BDATA temp;
+   temp = ph1-tunnel-peer-iddata_l;
+   temp.add( , 1 );
+
+   ph1id.addr.s_addr = inet_addr( temp.text() );
+
+   if( ph1id.addr.s_addr == INADDR_NONE )
+   {
+   log.txt( LLOG_ERROR,
+   !! : gen_ph1id_l failed. 
invalid initiator id data \'%s\'\n, temp.text() );
+
+   return false;
+   }
}
else
{


Bug#500027: ike: bug in check of remote IPv4 address

2008-09-24 Thread Matthew Grooms

Nicolas Deschildre wrote:

Thanks for the detailed bug report!
I'm forwarding upstream.

Matthew : see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=500027


Thanks for the heads up. This and many other bugs have been fixed in the 
2.1.2 maintenance release. Would it be possible to update the package?


Thanks,

-Matthew



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]