From 984d6c6052169bcae8010de33f7796e455536d61 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Fri, 11 Sep 2015 14:56:32 -0400 Subject: Fix no-stdio build Much related/similar work also done by Ivan Nestlerode +Replace FILE BIO's with dummy ops that fail. +Include for sscanf() even with no-stdio (since the declaration is there). We rely on sscanf() to parse the OPENSSL_ia32cap environment variable, since it can be larger than a 'long'. And we don't rely on the availability of strtoull(). +Remove OPENSSL_stderr(); not used. +Make OPENSSL_showfatal() do nothing (currently without stdio there's nothing we can do). +Remove file-based functionality from ssl/. The function prototypes were already gone, but not the functions themselves. +Remove unviable conf functionality via SYS_UEFI +Add fallback definition of BUFSIZ. +Remove functions taking FILE * from header files. +Add missing DECLARE_PEM_write_fp_const +Disable X509_LOOKUP_hash_dir(). X509_LOOKUP_file() was already compiled out, so remove its prototype. +Use OPENSSL_showfatal() in CRYPTO_destroy_dynlockid(). +Eliminate SRP_VBASE_init() and supporting functions. Users will need to build the verifier manually instead. +Eliminate compiler warning for unused do_pk8pkey_fp(). +Disable TEST_ENG_OPENSSL_PKEY. +Disable GOST engine as is uses [f]printf all over the place. +Eliminate compiler warning for unused send_fp_chars(). Signed-off-by: Rich Salz Reviewed-by: Tim Hudson --- crypto/bio/bss_file.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'crypto/bio') diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index 8f22ef7f9f..7692ee293c 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -467,6 +467,60 @@ static int file_puts(BIO *bp, const char *str) return (ret); } +#else + +static int file_write(BIO *b, const char *in, int inl) +{ + return -1; +} +static int file_read(BIO *b, char *out, int outl) +{ + return -1; +} +static int file_puts(BIO *bp, const char *str) +{ + return -1; +} +static int file_gets(BIO *bp, char *buf, int size) +{ + return 0; +} +static long file_ctrl(BIO *b, int cmd, long num, void *ptr) +{ + return 0; +} +static int file_new(BIO *bi) +{ + return 0; +} +static int file_free(BIO *a) +{ + return 0; +} + +static BIO_METHOD methods_filep = { + BIO_TYPE_FILE, + "FILE pointer", + file_write, + file_read, + file_puts, + file_gets, + file_ctrl, + file_new, + file_free, + NULL, +}; + +BIO_METHOD *BIO_s_file(void) +{ + return (&methods_filep); +} + +BIO *BIO_new_file(const char *filename, const char *mode) +{ + return NULL; +} + # endif /* OPENSSL_NO_STDIO */ #endif /* HEADER_BSS_FILE_C */ -- cgit v1.2.3