Hi, First of all - this is my first time using mailing lists and contributing to a big project, so please let me know if I'm doing anything wrong. Apparently my last email didn't go through because I wasn't signed up for the mailing list.
I was having trouble compiling openssl with no-sock parameter under Windows VS2008. To replicate, try: perl Configure VC-WIN32 no-asm no-sock --prefix="C:\Users\Administrator\Documents\openssl\builddir" perl util\mkdef.pl crypto ssl update ms\do_ms nmake -f ms\nt.mak then the build would fail. This is because not all socket-related functions were under #ifndef OPENSSL_NO_SOCK. After my changes, the build succeeds, and all tests from running "nmake -f ms\nt.mak test" pass. My changes are below (git patch format). I also created a pull request here - https://github.com/openssl/openssl/pull/47 . Thanks, Vlad --- apps/apps.c | 12 ++++++++++++ apps/ocsp.c | 3 +++ crypto/bio/bss_dgram.c | 3 +++ 3 files changed, 18 insertions(+) diff --git a/apps/apps.c b/apps/apps.c index c5a3bb2..8d754b5 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -785,6 +785,8 @@ static int load_pkcs12(BIO *err, BIO *in, const char *desc, return ret; } +#ifndef OPENSSL_NO_SOCK + int load_cert_crl_http(const char *url, BIO *err, X509 **pcert, X509_CRL **pcrl) { @@ -847,18 +849,24 @@ int load_cert_crl_http(const char *url, BIO *err, return rv; } +#endif + X509 *load_cert(BIO *err, const char *file, int format, const char *pass, ENGINE *e, const char *cert_descrip) { X509 *x=NULL; BIO *cert; +#ifndef OPENSSL_NO_SOCK + if (format == FORMAT_HTTP) { load_cert_crl_http(file, err, &x, NULL); return x; } +#endif + if ((cert=BIO_new(BIO_s_file())) == NULL) { ERR_print_errors(err); @@ -934,12 +942,16 @@ X509_CRL *load_crl(const char *infile, int format) X509_CRL *x=NULL; BIO *in=NULL; +#ifndef OPENSSL_NO_SOCK + if (format == FORMAT_HTTP) { load_cert_crl_http(infile, bio_err, NULL, &x); return x; } +#endif + in=BIO_new(BIO_s_file()); if (in == NULL) { diff --git a/apps/ocsp.c b/apps/ocsp.c index ccf2f0f..ebe14d9 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -1321,6 +1321,8 @@ static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp) return 1; } +#ifndef OPENSSL_NO_SOCK + static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, const char *path, const STACK_OF(CONF_VALUE) *headers, OCSP_REQUEST *req, int req_timeout) @@ -1468,3 +1470,4 @@ OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req, } #endif +#endif diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index 6912aa1..8ac49c0 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -63,6 +63,8 @@ #define USE_SOCKETS #include "cryptlib.h" +#ifndef OPENSSL_NO_SOCK + #include <openssl/bio.h> #ifndef OPENSSL_NO_DGRAM @@ -1915,3 +1917,4 @@ static void get_current_time(struct timeval *t) } #endif +#endif -- 1.8.3.msysgit.0
