[CoovaChilli] Installing covachilli on debian

Roberto J. Blandino Cisneros roberto.blandino at ibw.com.ni
Thu Feb 7 20:54:27 GMT 2019


After installing dependencies not mentioned on the page, following these instructions " http://coova.github.io/CoovaChilli/DistroBuilding/" : 

DEB (Debian/Ubuntu) 

wget https://github.com/coova/coova-chilli/archive/1.3.1.4.tar.gz
tar xzf 1.3.1.4.tar.gz
cd coova-chilli-1.3.1.4/
debuild -b 


I am using Debian 9.7 amd64 with kernel 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux. 



Following the DistroBuilding, I started to get a lot of errors: 


1) The first time i got 
.... 

chilli.c:4350:4: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] 
if (oldfd) safe_close(oldfd); oldfd=0; 
^~ 
chilli.c:4350:34: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ 
if (oldfd) safe_close(oldfd); oldfd=0; 
^~~~~ 
cc1: all warnings being treated as errors 
Makefile:937: fallo en las instrucciones para el objetivo 'chilli.lo' 
make[4]: *** [chilli.lo] Error 1 
make[4]: se sale del directorio '/root/coova-chilli-1.3.1.4/src' 
Makefile:980: fallo en las instrucciones para el objetivo 'all-recursive' 
make[3]: *** [all-recursive] Error 1 
make[3]: se sale del directorio '/root/coova-chilli-1.3.1.4/src' 
Makefile:416: fallo en las instrucciones para el objetivo 'all-recursive' 
make[2]: *** [all-recursive] Error 1 
make[2]: se sale del directorio '/root/coova-chilli-1.3.1.4' 
Makefile:344: fallo en las instrucciones para el objetivo 'all' 
make[1]: *** [all] Error 2 
make[1]: se sale del directorio '/root/coova-chilli-1.3.1.4' 
debian/rules:34: fallo en las instrucciones para el objetivo 'build' 
make: *** [build] Error 2 
dpkg-buildpackage: fallo: debian/rules build devolvió un estado de salida de error 2 
debuild: fatal error at line 1116: 
dpkg-buildpackage -rfakeroot -us -uc -b failed 


Solution: I fixed doing following changes: 



--- coova-chilli-1.3.1.4/src/chilli.c 2016-05-23 14:35:38.000000000 -0600 
+++ coova-chilli-1.3.1.4-fixed/src/chilli.c 2019-02-07 13:15:26.790832265 -0600 
@@ -4347,7 +4347,7 @@ 
while (!differ && r1 > 0 && r2 > 0); 
} 

- if (oldfd) safe_close(oldfd); oldfd=0; 
+ if (oldfd){ safe_close(oldfd); oldfd=0; } 

if (differ) { 
if (_options.debug) 


NOTE: ¿Who forgot the >>{<< >>}<< for the function? 


2) Fixing the last file i runned again 
... 

redir.c: In function ‘redir_fork’: 
redir.c:3280:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] 
if (fcntl(in,F_GETFL,0) == -1) return -1; safe_close(0); 
^~ 
redir.c:3280:47: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ 
if (fcntl(in,F_GETFL,0) == -1) return -1; safe_close(0); 
^~~~~~~~~~ 
redir.c:3282:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] 
if (fcntl(out,F_GETFL,1) == -1) return -1; safe_close(1); 
^~ 
redir.c:3282:48: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ 
if (fcntl(out,F_GETFL,1) == -1) return -1; safe_close(1); 
^~~~~~~~~~ 
cc1: all warnings being treated as errors 
Makefile:937: fallo en las instrucciones para el objetivo 'redir.lo' 
make[4]: *** [redir.lo] Error 1 
make[4]: se sale del directorio '/root/coova-chilli-1.3.1.4/src' 
Makefile:980: fallo en las instrucciones para el objetivo 'all-recursive' 
make[3]: *** [all-recursive] Error 1 
make[3]: se sale del directorio '/root/coova-chilli-1.3.1.4/src' 
Makefile:416: fallo en las instrucciones para el objetivo 'all-recursive' 
make[2]: *** [all-recursive] Error 1 
make[2]: se sale del directorio '/root/coova-chilli-1.3.1.4' 
Makefile:344: fallo en las instrucciones para el objetivo 'all' 
make[1]: *** [all] Error 2 
make[1]: se sale del directorio '/root/coova-chilli-1.3.1.4' 
debian/rules:34: fallo en las instrucciones para el objetivo 'build' 
make: *** [build] Error 2 
dpkg-buildpackage: fallo: debian/rules build devolvió un estado de salida de error 2 
debuild: fatal error at line 1116: 
dpkg-buildpackage -rfakeroot -us -uc -b failed 


Solution: I found same mistake of the first point, the "{}" were missing: 



--- coova-chilli-1.3.1.4/src/redir.c 2016-05-23 14:35:38.000000000 -0600 
+++ coova-chilli-1.3.1.4-fixed/src/redir.c 2019-02-07 13:16:28.966189516 -0600 
@@ -3277,9 +3277,9 @@ 
} 

#if defined(F_DUPFD) 
- if (fcntl(in,F_GETFL,0) == -1) return -1; safe_close(0); 
+ if (fcntl(in,F_GETFL,0) == -1){ return -1; safe_close(0);} 
if (fcntl(in,F_DUPFD,0) == -1) return -1; 
- if (fcntl(out,F_GETFL,1) == -1) return -1; safe_close(1); 
+ if (fcntl(out,F_GETFL,1) == -1){ return -1; safe_close(1);} 
if (fcntl(out,F_DUPFD,1) == -1) return -1; 
#else 
if (dup2(in,0) == -1) return -1; 


NOTE: ¿Who forgot the >>{<< >>}<< for the function? 


3) After fixing last errores i got following errors 
... 

ms_chap.c: In function ‘MakeKey’: 
ms_chap.c:99:3: error: implicit declaration of function ‘des_set_odd_parity’ [-Werror=implicit-function-declaration] 
des_set_odd_parity((des_cblock *)des_key); 
^~~~~~~~~~~~~~~~~~ 
ms_chap.c:99:23: error: ‘des_cblock’ undeclared (first use in this function) 
des_set_odd_parity((des_cblock *)des_key); 
^~~~~~~~~~ 
ms_chap.c:99:23: note: each undeclared identifier is reported only once for each function it appears in 
ms_chap.c:99:35: error: expected expression before ‘)’ token 
des_set_odd_parity((des_cblock *)des_key); 
^ 
ms_chap.c: In function ‘DesEncrypt’: 
ms_chap.c:105:3: error: unknown type name ‘des_cblock’ 
des_cblock des_key; 
^~~~~~~~~~ 
ms_chap.c:106:3: error: unknown type name ‘des_key_schedule’ 
des_key_schedule key_schedule; 
^~~~~~~~~~~~~~~~ 
ms_chap.c:108:16: error: passing argument 2 of ‘MakeKey’ makes pointer from integer without a cast [-Werror=int-conversion] 
MakeKey(key, des_key); 
^~~~~~~ 
ms_chap.c:88:1: note: expected ‘u_char * {aka unsigned char *}’ but argument is of type ‘int’ 
MakeKey(u_char *key, u_char *des_key) 
^~~~~~~ 
ms_chap.c:109:3: error: implicit declaration of function ‘des_set_key’ [-Werror=implicit-function-declaration] 
des_set_key(&des_key, key_schedule); 
^~~~~~~~~~~ 
ms_chap.c:110:3: error: implicit declaration of function ‘des_ecb_encrypt’ [-Werror=implicit-function-declaration] 
des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher, key_schedule, 1); 
^~~~~~~~~~~~~~~ 
ms_chap.c:110:20: error: ‘des_cblock’ undeclared (first use in this function) 
des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher, key_schedule, 1); 
^~~~~~~~~~ 
ms_chap.c:110:32: error: expected expression before ‘)’ token 
des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher, key_schedule, 1); 
^ 
cc1: all warnings being treated as errors 
Makefile:937: fallo en las instrucciones para el objetivo 'ms_chap.lo' 
make[4]: *** [ms_chap.lo] Error 1 
make[4]: se sale del directorio '/root/coova-chilli-1.3.1.4/src' 
Makefile:980: fallo en las instrucciones para el objetivo 'all-recursive' 
make[3]: *** [all-recursive] Error 1 
make[3]: se sale del directorio '/root/coova-chilli-1.3.1.4/src' 
Makefile:416: fallo en las instrucciones para el objetivo 'all-recursive' 
make[2]: *** [all-recursive] Error 1 
make[2]: se sale del directorio '/root/coova-chilli-1.3.1.4' 
Makefile:344: fallo en las instrucciones para el objetivo 'all' 
make[1]: *** [all] Error 2 
make[1]: se sale del directorio '/root/coova-chilli-1.3.1.4' 
debian/rules:34: fallo en las instrucciones para el objetivo 'build' 
make: *** [build] Error 2 
dpkg-buildpackage: fallo: debian/rules build devolvió un estado de salida de error 2 
debuild: fatal error at line 1116: 
dpkg-buildpackage -rfakeroot -us -uc -b failed 



Solution: The functions on " /usr/include/openssl/" does not start with des_, they start with DES_, substituting the functions mentioned fixed the error and adding "&" on right places: 



--- coova-chilli-1.3.1.4/src/ms_chap.c 2016-05-23 14:35:38.000000000 -0600 
+++ coova-chilli-1.3.1.4-fixed/src/ms_chap.c 2019-02-07 14:25:23.290840654 -0600 
@@ -1,4 +1,3 @@ 
- 
/*- 
* Copyright (c) 1997 Gabor Kincses <gabor at acm.org> 
* 1997 - 2001 Brian Somers <brian at Awfulhak.org> 
@@ -96,18 +95,18 @@ 
des_key[6] = Get7Bits(key, 42); 
des_key[7] = Get7Bits(key, 49); 

- des_set_odd_parity((des_cblock *)des_key); 
+ DES_set_odd_parity((DES_cblock *)des_key); 
} 

static void /* IN 8 octets IN 7 octest OUT 8 octets */ 
DesEncrypt(u_char *clear, u_char *key, u_char *cipher) 
{ 
- des_cblock des_key; 
- des_key_schedule key_schedule; 
+ DES_cblock des_key; 
+ DES_key_schedule key_schedule; 

MakeKey(key, des_key); 
- des_set_key(&des_key, key_schedule); 
- des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher, key_schedule, 1); 
+ DES_set_key(&des_key, &key_schedule); 
+ DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher, &key_schedule, 1); 
} 

#define LENGTH 20 



NOTE: ¿Who forgot the >>{<< >>}<< for the function? 


After doing the three changes shown at Top, I finally got following output: 


.... 

Finished running lintian. 
Now signing changes and any dsc files... 
signfile buildinfo coova-chilli_1.3.0_amd64.buildinfo David Bird (Coova Technologies) <support at coova.com> 
gpg: skipped "David Bird (Coova Technologies) <support at coova.com>": No secret key 
gpg: /tmp/debsign.k0bH95Wo/coova-chilli_1.3.0_amd64.buildinfo: clear-sign failed: No secret key 
debsign: gpg error occurred! Aborting.... 
debuild: fatal error at line 1045: 
running debsign failed 



But I do not where else should i fixed it only says "line 1045", Can somebody give me a hand? 


Thanks 







Roberto Blandino 
NOC 
IBW Nicaragua 



More information about the CoovaChilli mailing list