mpeylo / cmpossl

An OpenSSL-based implementation of the Certificate Management Protocol (CMP), defined in IETF RFCs 4210, 4211, and 6712. It is being extended according to the emerging RFCs 'CMP Updates' (CMPv3), 'CMP Algorithms', and 'Lightweight CMP Profile'.
https://github.com/mpeylo/cmpossl/wiki
Other
35 stars 13 forks source link

Cannot build the code on MacOS High Sierra #146

Closed zentavr closed 6 years ago

zentavr commented 6 years ago

I did a checkout of 1e3a3f2e and trying to build at MacOS X High Sierra. The problem is that I catch the error like:

/usr/local/Cellar/perl/5.26.1/bin/perl apps/progs.pl apps/openssl > apps/progs.h
cc  -I. -Iinclude -Iapps -arch x86_64 -Wa,--noexecstack -Qunused-arguments -O3 -Wall -D_REENTRANT -DNDEBUG  -MMD -MF apps/asn1pars.d.tmp -MT apps/asn1pars.o -c -o apps/asn1pars.o apps/asn1pars.c
cc  -I. -Iinclude -Iapps -arch x86_64 -Wa,--noexecstack -Qunused-arguments -O3 -Wall -D_REENTRANT -DNDEBUG  -MMD -MF apps/ca.d.tmp -MT apps/ca.o -c -o apps/ca.o apps/ca.c
cc  -I. -Iinclude -Iapps -arch x86_64 -Wa,--noexecstack -Qunused-arguments -O3 -Wall -D_REENTRANT -DNDEBUG  -MMD -MF apps/ciphers.d.tmp -MT apps/ciphers.o -c -o apps/ciphers.o apps/ciphers.c
cc  -I. -Iinclude -Iapps -arch x86_64 -Wa,--noexecstack -Qunused-arguments -O3 -Wall -D_REENTRANT -DNDEBUG  -MMD -MF apps/cmp.d.tmp -MT apps/cmp.o -c -o apps/cmp.o apps/cmp.c
apps/cmp.c:2145:13: error: use of undeclared identifier 'opt_mock_srv'
        if (opt_mock_srv) {
            ^
apps/cmp.c:2146:51: error: use of undeclared identifier 'srv_ctx'; did you mean 'cmp_ctx'?
            OSSL_CMP_CTX_set_transfer_cb_arg(ctx, srv_ctx);
                                                  ^~~~~~~
                                                  cmp_ctx
apps/cmp.c:65:22: note: 'cmp_ctx' declared here
static OSSL_CMP_CTX *cmp_ctx = NULL;
                     ^
2 errors generated.
make[1]: *** [apps/cmp.o] Error 1
make: *** [all] Error 2

I wonder what could be the issue?

mpeylo commented 6 years ago

Hi Andrey,

Thank you for reporting this; this issue slips through when configuring with the --debug option, resulting in the -DNDEBUG compiler option.

I fixed that now explicitly on the cmp-rebased-2018-07-25 branch in commit 237c2cd, respectively implicitly on the (rebased, see below) main cmp branch with commit 3d5d709. Kindly let me know whether it builds for you now.

Kindly note that just now (2018-07-28), I also rebased the "cmp" branch to the latest upstream OpenSSL master branch, and squashed the current version of the CMP patch into one single commit (as this is a requirement by upstream OpenSSL for our upcoming pull requests). You might need to check out the cmp branch again from scratch to avoid git getting confused.

In case you have any further questions, you'll see that we're happy to assist (but beware that replies might be delayed right now due to vacation time).

Kind regards, Martin

zentavr commented 6 years ago

@mpeylo, thank you for the patch. I am able to do the compilation on MacOS right now.