[Swan-dev] 'error: ‘CKM_AES_CTR’ undeclared' while compiling libreswan-3.15

Paul Wouters paul at nohats.ca
Mon Sep 14 21:15:14 EEST 2015


On Mon, 14 Sep 2015, prasad zambare wrote:

> Thank you for the quick reply.
> 
> I installed nss-3.16.1 using below steps
> 1. Downloaded nss-3.16 code from
> https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_16_RTM/src/nss-3.16-with-nspr-4.10.4.tar.gz
> 2. Downloaded nsprpub source from
> https://github.com/makotokato/nsprpub
> 3. Complied nsprpub code and installed
> 4. Extracted nss-3.16.1 source code
> 5. cd nss-3.16.1, gmake clean nss_build_all
> 6. It got compiled

Did that install in /usr/local ?

> 7. cd ../libreswan-3.15 and did 'make clean; make programs'

We detect the nss includes via:

$ pkg-config --cflags nss
-I/usr/include/nss3 -I/usr/include/nspr4

perhaps your old nss is still there and your new nss is in /usr/local ?

You can override these by defining them in a Makefile.inc.local:

#NSSFLAGS?=$(shell pkg-config --cflags nss)
#NSSLIBS?=$(shell pkg-config --libs nss)
NSSFLAGS=-I/usr/local/include/nss3 -I/usr/local/include/nspr4
NSSLIBS=-L/usr/local/lib -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl

Paul

> But still got the same error.
> 
> /root/libreswan-3.15/programs/pluto/ctr_test_vectors.c: In function ‘test_aes_ctr’:
> /root/libreswan-3.15/programs/pluto/ctr_test_vectors.c:243: error: ‘CKM_AES_CTR’ undeclared (first use in this function)
> /root/libreswan-3.15/programs/pluto/ctr_test_vectors.c:243: error: (Each undeclared identifier is reported only once
> /root/libreswan-3.15/programs/pluto/ctr_test_vectors.c:243: error: for each function it appears in.)
> make[3]: *** [ctr_test_vectors.o] Error 1
> 
> 
> Please let me know what went wrong? Please help me on this.
> 
> Thank You,
> Prasad
> 
> On Mon, Sep 14, 2015 at 9:13 PM, Paul Wouters <paul at nohats.ca> wrote:
>       On Mon, 14 Sep 2015, prasad zambare wrote:
>
>             I am getting compilation error while compiling libreswan-3.15 source code.
>
>             make[3]: Entering directory `/root/libreswan-3.15/OBJ.linux.i386/programs/pluto'
>             cc   -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-all -fno-strict-aliasing -fPIE -DPIE
>             -DFORCE_PR_ASSERT -DDNSSEC -DFIPS_CHECK
>             -DFIPSPRODUCTCHECK=\"/etc/system-fips\" -DKLIPS -DLIBCURL -DUSE_LINUX_AUDIT -DUSE_MD5 -DHAVE_NM -DUSE_SHA2 -DUSE_SHA1
>             -DFIPSPRODUCTCHECK=\"/etc/system-fips\"
>             -DIPSEC_CONF=\"/etc/ipsec.conf\" -DIPSEC_CONFDDIR=\"/etc/ipsec.d\" -DIPSEC_NSSDIR=\"/etc/ipsec.d\"
>             -DIPSEC_CONFDIR=\"/etc\" -DIPSEC_EXECDIR=\"/usr/local/libexec/ipsec\"
>             -DIPSEC_SBINDIR=\"/usr/local/sbin\" -DIPSEC_VARDIR=\"/var\" -DPOLICYGROUPSDIR=\"/etc/ipsec.d/policies\"
>             -DSHARED_SECRETS_FILE=\"/etc/ipsec.secrets\" -DGCC_LINT
>             -DALLOW_MICROSOFT_BAD_PROPOSAL  -Wall -Wextra -Wformat -Wformat-nonliteral -Wformat-security -Wundef
>             -Wmissing-declarations -Wredundant-decls -Wnested-externs
>             -I/root/libreswan-3.15/ports/linux/include -I/root/libreswan-3.15/ports/linux/include
>             -I/root/libreswan-3.15/ports/linux/include -I/root/libreswan-3.15/ports/linux/include 
>             -I/root/libreswan-3.15/programs/pluto/linux26 -I/root/libreswan-3.15/include -I/root/libreswan-3.15/lib/libcrypto
>             -I/root/libreswan-3.15/linux/include   -DUSE_KEYRR   -DNETKEY_SUPPORT
>             -DKERNEL26_HAS_KAME_DUPLICATES -DPFKEY  -DUSE_TWOFISH -DUSE_SERPENT -DKLIPS -DPFKEY    -DUSE_AES -DUSE_3DES -DUSE_SHA2
>             -DUSE_SHA1 -DUSE_MD5 -DUSE_CAMELLIA   -DXAUTH_HAVE_PAM -DLIBCURL   
>             -DFIPS_CHECK -DHAVE_LIBCAP_NG -DHAVE_NM -I/usr/include/nss3 -I/usr/include/nspr4     \
>                             -MMD -MF ./ctr_test_vectors.d \
>                             -o ./ctr_test_vectors.o \
>                             -c /root/libreswan-3.15/programs/pluto/ctr_test_vectors.c
>             /root/libreswan-3.15/programs/pluto/ctr_test_vectors.c: In function ‘test_aes_ctr’:
>             /root/libreswan-3.15/programs/pluto/ctr_test_vectors.c:243: error: ‘CKM_AES_CTR’ undeclared (first use in this
>             function)
>             /root/libreswan-3.15/programs/pluto/ctr_test_vectors.c:243: error: (Each undeclared identifier is reported only once
>             /root/libreswan-3.15/programs/pluto/ctr_test_vectors.c:243: error: for each function it appears in.)
>             make[3]: *** [ctr_test_vectors.o] Error 1
>             make[3]: Leaving directory `/root/libreswan-3.15/OBJ.linux.i386/programs/pluto'
>             make[2]: *** [local-base] Error 2
>             make[2]: Leaving directory `/root/libreswan-3.15/programs/pluto'
>             make[1]: *** [all] Error 2
>             make[1]: Leaving directory `/root/libreswan-3.15/programs'
>             make: *** [all] Error 2
>
>             Tried searching on internet but did not find the solution. Please provide some pointers so that I can fix this issue.
> 
> 
> It seems you have an old version of nss then? AES CTR was introduced in
> nss-3.14 (not libreswan-3.14)
> 
> You should be using at least nss-3.16.
> 
> Paul
> 
> 
> 
>


More information about the Swan-dev mailing list