jeroen / openssl

OpenSSL bindings for R
Other
65 stars 23 forks source link

cert.c: dereferencing pointer error to incomplete type #32

Closed chartl closed 7 years ago

chartl commented 8 years ago

I'm attempting to install to a fresh build of R:

> R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
> Copyright (C) 2016 The R Foundation for Statistical Computing
> Platform: x86_64-pc-linux-gnu (64-bit)

and openssl 1.1.1-dev on CentOS-6.3. It fails on both the release and current master version due to the error below. Due to the nature of the error, I suspected that gcc-4.2 may have been too outdated a compiler; but the error persists in gcc-4.9.1 as well.

Any help would be appreciated.

Thanks!

> > install.packages("https://github.com/jeroenooms/openssl/archive/master.tar.gz", repos = NULL)
> trying URL 'https://github.com/jeroenooms/openssl/archive/master.tar.gz'
> Content type 'application/x-gzip' length 223892 bytes (218 KB)
> ==================================================
> downloaded 218 KB
> 
> Warning in untar2(tarfile, files, list, exdir, restore_times) :
>   skipping pax global extended headers
> * installing *source* package ‘openssl’ ...
> Found INCLUDE_DIR and/or LIB_DIR!
> Using PKG_CFLAGS=-I 
> Using PKG_LIBS=-L/ifshome/chartl/usr/local/lib:/ifshome/chartl/usr/local/lib64 -lssl -lcrypto
> ** libs
> gcc -std=gnu99 -I/ifshome/chartl/usr/local/lib64/R/include -DNDEBUG -I  -I/ifshome/chartl/usr/local/include    -fpic  -g -O2  -c aes.c -o aes.o
> gcc -std=gnu99 -I/ifshome/chartl/usr/local/lib64/R/include -DNDEBUG -I  -I/ifshome/chartl/usr/local/include    -fpic  -g -O2  -c base64.c -o base64.o
> gcc -std=gnu99 -I/ifshome/chartl/usr/local/lib64/R/include -DNDEBUG -I  -I/ifshome/chartl/usr/local/include    -fpic  -g -O2  -c bignum.c -o bignum.o
> gcc -std=gnu99 -I/ifshome/chartl/usr/local/lib64/R/include -DNDEBUG -I  -I/ifshome/chartl/usr/local/include    -fpic  -g -O2  -c cert.c -o cert.o
> cert.c: In function ‘R_cert_info’:
> cert.c:45: error: dereferencing pointer to incomplete type
> cert.c:49: error: dereferencing pointer to incomplete type
> cert.c:50: error: dereferencing pointer to incomplete type
> cert.c:50: error: dereferencing pointer to incomplete type
> cert.c:55: error: dereferencing pointer to incomplete type
> cert.c:62: error: dereferencing pointer to incomplete type
> make: *** [cert.o] Error 1
> ERROR: compilation failed for package ‘openssl’
> * removing ‘/ifshome/chartl/usr/local/lib64/R/library/openssl’
> Warning message:
> In install.packages("https://github.com/jeroenooms/openssl/archive/master.tar.gz",  :
>   installation of package ‘/tmp/Rtmp3rtRhy/downloaded_packages/master.tar.gz’ had non-zero exit status

Relevant lines

> (45)  OBJ_obj2txt(buf, sizeof(buf), cert->sig_alg->algorithm, 0);
> (49)  SET_VECTOR_ELT(out, 3, allocVector(RAWSXP, cert->signature->length));
> (50)  memcpy(RAW(VECTOR_ELT(out, 3)), cert->signature->data, cert->signature->length);
> (55)  bail(ASN1_TIME_print(b, cert->cert_info->validity->notBefore));
> (62)  bail(ASN1_TIME_print(b, cert->cert_info->validity->notAfter));

Note that there are no occurrences of cert->xxx->yyy that are not flagged as errors.

chartl commented 8 years ago

This was fixed by downgrading to SSL-1.0.2. Same error in SSL-1.1.0.

jeroen commented 8 years ago

Hmm sorry I missed this. Don't close so fast next time :)

jeroen commented 7 years ago

This has been fixed, right?