summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2015-09-11 14:56:32 -0400
committerRich Salz <rsalz@openssl.org>2015-09-29 21:59:19 -0400
commit984d6c6052169bcae8010de33f7796e455536d61 (patch)
tree0448e92cb3b120f8e685fa2d390007c57f13dee3
parent57ebe74831d9875dde98d5088bb78f5c89396d6b (diff)
Fix no-stdio build
Much related/similar work also done by Ivan Nestlerode <ivan.nestlerode@sonos.com> +Replace FILE BIO's with dummy ops that fail. +Include <stdio.h> 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 <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
-rw-r--r--CHANGES4
-rwxr-xr-xConfigure2
-rw-r--r--crypto/asn1/Makefile8
-rw-r--r--crypto/asn1/a_strex.c2
-rw-r--r--crypto/asn1/tasn_utl.c1
-rw-r--r--crypto/bio/bss_file.c54
-rw-r--r--crypto/conf/conf_sap.c2
-rw-r--r--crypto/cryptlib.c8
-rw-r--r--crypto/des/read2pwd.c4
-rw-r--r--crypto/ec/Makefile17
-rw-r--r--crypto/ec/ec_key.c1
-rw-r--r--crypto/engine/eng_openssl.c2
-rw-r--r--crypto/include/internal/cryptlib.h1
-rw-r--r--crypto/lock.c3
-rw-r--r--crypto/pem/pem_pk8.c4
-rw-r--r--crypto/ts/Makefile4
-rw-r--r--crypto/ui/ui_util.c4
-rw-r--r--crypto/x509/by_dir.c1
-rw-r--r--crypto/x509/by_file.c4
-rw-r--r--crypto/x509/x509_d2.c3
-rw-r--r--e_os.h6
-rw-r--r--include/openssl/bio.h4
-rw-r--r--include/openssl/conf.h4
-rw-r--r--include/openssl/pem.h6
-rw-r--r--include/openssl/ssl.h7
-rw-r--r--include/openssl/ts.h20
-rw-r--r--include/openssl/x509_vfy.h5
-rw-r--r--include/openssl/x509v3.h3
-rw-r--r--ssl/ssl_cert.c2
-rw-r--r--ssl/ssl_lib.c2
-rw-r--r--ssl/ssl_rsa.c2
-rw-r--r--test/Makefile17
-rwxr-xr-xutil/libeay.num87
-rwxr-xr-xutil/ssleay.num30
34 files changed, 193 insertions, 131 deletions
diff --git a/CHANGES b/CHANGES
index 3aa9dc813b..220ab60383 100644
--- a/CHANGES
+++ b/CHANGES
@@ -9,7 +9,9 @@
though the change is mostly in the more lenient direction, and
legacy behaviour is preserved as much as possible.
[Emilia Käsper]
-
+ *) Fix no-stdio build.
+ [ David Woodhouse <David.Woodhouse@intel.com> and also
+ Ivan Nestlerode <ivan.nestlerode@sonos.com> ]
*) New testing framework
The testing framework has been largely rewritten and is now using
perl and the perl modules Test::Harness and an extended variant of
diff --git a/Configure b/Configure
index e1edfa9d88..b27795789e 100755
--- a/Configure
+++ b/Configure
@@ -1086,7 +1086,7 @@ if (defined($disabled{"md5"}) || defined($disabled{"sha"})
if (defined($disabled{"ec"}) || defined($disabled{"dsa"})
- || defined($disabled{"dh"}))
+ || defined($disabled{"dh"}) || defined($disabled{"stdio"}))
{
$disabled{"gost"} = "forced";
}
diff --git a/crypto/asn1/Makefile b/crypto/asn1/Makefile
index b0d4e14ec4..a6f1bac313 100644
--- a/crypto/asn1/Makefile
+++ b/crypto/asn1/Makefile
@@ -668,14 +668,16 @@ tasn_typ.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
tasn_typ.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tasn_typ.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
tasn_typ.o: ../../include/openssl/symhacks.h tasn_typ.c
-tasn_utl.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
-tasn_utl.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
+tasn_utl.o: ../../e_os.h ../../include/openssl/asn1.h
+tasn_utl.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
+tasn_utl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
tasn_utl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
tasn_utl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tasn_utl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tasn_utl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tasn_utl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
-tasn_utl.o: ../../include/openssl/symhacks.h asn1_locl.h tasn_utl.c
+tasn_utl.o: ../../include/openssl/symhacks.h ../include/internal/cryptlib.h
+tasn_utl.o: asn1_locl.h tasn_utl.c
x_algor.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
x_algor.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
x_algor.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
diff --git a/crypto/asn1/a_strex.c b/crypto/asn1/a_strex.c
index 2f233a2608..c9d3cea036 100644
--- a/crypto/asn1/a_strex.c
+++ b/crypto/asn1/a_strex.c
@@ -92,6 +92,7 @@ static int send_bio_chars(void *arg, const void *buf, int len)
return 1;
}
+#ifndef OPENSSL_NO_STDIO
static int send_fp_chars(void *arg, const void *buf, int len)
{
if (!arg)
@@ -100,6 +101,7 @@ static int send_fp_chars(void *arg, const void *buf, int len)
return 0;
return 1;
}
+#endif
typedef int char_io (void *arg, const void *buf, int len);
diff --git a/crypto/asn1/tasn_utl.c b/crypto/asn1/tasn_utl.c
index 76e96051bf..8b62341b9b 100644
--- a/crypto/asn1/tasn_utl.c
+++ b/crypto/asn1/tasn_utl.c
@@ -59,6 +59,7 @@
#include <stddef.h>
#include <string.h>
+#include <internal/cryptlib.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/objects.h>
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 */
diff --git a/crypto/conf/conf_sap.c b/crypto/conf/conf_sap.c
index e99a38ef63..308989b451 100644
--- a/crypto/conf/conf_sap.c
+++ b/crypto/conf/conf_sap.c
@@ -87,9 +87,11 @@ void OPENSSL_config(const char *config_name)
ENGINE_load_builtin_engines();
#endif
ERR_clear_error();
+#ifndef OPENSSL_SYS_UEFI
CONF_modules_load_file(NULL, config_name,
CONF_MFLAGS_DEFAULT_SECTION |
CONF_MFLAGS_IGNORE_MISSING_FILE);
+#endif
}
void OPENSSL_no_config()
diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c
index f0aaae6893..a9f9697c70 100644
--- a/crypto/cryptlib.c
+++ b/crypto/cryptlib.c
@@ -129,6 +129,7 @@ unsigned int *OPENSSL_ia32cap_loc(void)
}
# if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY)
+#include <stdio.h>
# define OPENSSL_CPUID_SETUP
typedef uint64_t IA32CAP;
void OPENSSL_cpuid_setup(void)
@@ -432,11 +433,13 @@ void OPENSSL_showfatal(const char *fmta, ...)
#else
void OPENSSL_showfatal(const char *fmta, ...)
{
+#ifndef OPENSSL_NO_STDIO
va_list ap;
va_start(ap, fmta);
vfprintf(stderr, fmta, ap);
va_end(ap);
+#endif
}
int OPENSSL_isservice(void)
@@ -463,11 +466,6 @@ void OpenSSLDie(const char *file, int line, const char *assertion)
#endif
}
-void *OPENSSL_stderr(void)
-{
- return stderr;
-}
-
int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len)
{
size_t i;
diff --git a/crypto/des/read2pwd.c b/crypto/des/read2pwd.c
index 01e275f331..7633139604 100644
--- a/crypto/des/read2pwd.c
+++ b/crypto/des/read2pwd.c
@@ -114,6 +114,10 @@
#include <openssl/ui.h>
#include <openssl/crypto.h>
+#ifndef BUFSIZ
+#define BUFSIZ 256
+#endif
+
int DES_read_password(DES_cblock *key, const char *prompt, int verify)
{
int ok;
diff --git a/crypto/ec/Makefile b/crypto/ec/Makefile
index 9ad71f6ee1..18e9610180 100644
--- a/crypto/ec/Makefile
+++ b/crypto/ec/Makefile
@@ -169,14 +169,15 @@ ec_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ec_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_err.o: ../../include/openssl/symhacks.h ec_err.c
-ec_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
-ec_key.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
-ec_key.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
-ec_key.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
-ec_key.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
-ec_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
-ec_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
-ec_key.o: ../../include/openssl/symhacks.h ec_key.c ec_lcl.h
+ec_key.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
+ec_key.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
+ec_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
+ec_key.o: ../../include/openssl/ec.h ../../include/openssl/err.h
+ec_key.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
+ec_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
+ec_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
+ec_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
+ec_key.o: ../include/internal/cryptlib.h ec_key.c ec_lcl.h
ec_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ec_lib.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ec_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c
index 238009788a..ddb3257d77 100644
--- a/crypto/ec/ec_key.c
+++ b/crypto/ec/ec_key.c
@@ -61,6 +61,7 @@
* contributed to the OpenSSL project.
*/
+#include <internal/cryptlib.h>
#include <string.h>
#include "ec_lcl.h"
#include <openssl/err.h>
diff --git a/crypto/engine/eng_openssl.c b/crypto/engine/eng_openssl.c
index 4bc9b2ec69..095b5a02fb 100644
--- a/crypto/engine/eng_openssl.c
+++ b/crypto/engine/eng_openssl.c
@@ -89,7 +89,9 @@
* this is no longer automatic in ENGINE_load_builtin_engines().
*/
#define TEST_ENG_OPENSSL_RC4
+#ifndef OPENSSL_NO_STDIO
#define TEST_ENG_OPENSSL_PKEY
+#endif
/* #define TEST_ENG_OPENSSL_HMAC */
/* #define TEST_ENG_OPENSSL_HMAC_INIT */
/* #define TEST_ENG_OPENSSL_RC4_OTHERS */
diff --git a/crypto/include/internal/cryptlib.h b/crypto/include/internal/cryptlib.h
index fba180a6b2..d7018b61e7 100644
--- a/crypto/include/internal/cryptlib.h
+++ b/crypto/include/internal/cryptlib.h
@@ -101,7 +101,6 @@ extern "C" {
void OPENSSL_cpuid_setup(void);
extern unsigned int OPENSSL_ia32cap_P[];
void OPENSSL_showfatal(const char *fmta, ...);
-void *OPENSSL_stderr(void);
extern int OPENSSL_NONPIC_relocated;
#ifdef __cplusplus
diff --git a/crypto/lock.c b/crypto/lock.c
index d7d672d70d..12e4323110 100644
--- a/crypto/lock.c
+++ b/crypto/lock.c
@@ -309,8 +309,7 @@ void CRYPTO_destroy_dynlockid(int i)
--pointer->references;
#ifdef REF_CHECK
if (pointer->references < 0) {
- fprintf(stderr,
- "CRYPTO_destroy_dynlockid, bad reference count\n");
+ OPENSSL_showfatal("CRYPTO_destroy_dynlockid, bad reference count\n");
abort();
} else
#endif
diff --git a/crypto/pem/pem_pk8.c b/crypto/pem/pem_pk8.c
index ef5131fa29..e238b95865 100644
--- a/crypto/pem/pem_pk8.c
+++ b/crypto/pem/pem_pk8.c
@@ -69,10 +69,12 @@
static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder,
int nid, const EVP_CIPHER *enc,
char *kstr, int klen, pem_password_cb *cb, void *u);
+
+#ifndef OPENSSL_NO_STDIO
static int do_pk8pkey_fp(FILE *bp, EVP_PKEY *x, int isder,
int nid, const EVP_CIPHER *enc,
char *kstr, int klen, pem_password_cb *cb, void *u);
-
+#endif
/*
* These functions write a private key in PKCS#8 format: it is a "drop in"
* replacement for PEM_write_bio_PrivateKey() and friends. As usual if 'enc'
diff --git a/crypto/ts/Makefile b/crypto/ts/Makefile
index 754b89a617..76d1aeac72 100644
--- a/crypto/ts/Makefile
+++ b/crypto/ts/Makefile
@@ -207,7 +207,7 @@ ts_rsp_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ts_rsp_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/ts.h
ts_rsp_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ts_rsp_sign.o: ../../include/openssl/x509v3.h ../include/internal/cryptlib.h
-ts_rsp_sign.o: ../include/internal/x509_int.h ts_lcl.h ts_rsp_sign.c
+ts_rsp_sign.o: ts_lcl.h ts_rsp_sign.c
ts_rsp_utils.o: ../../e_os.h ../../include/openssl/asn1.h
ts_rsp_utils.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
ts_rsp_utils.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
@@ -243,7 +243,7 @@ ts_rsp_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ts_rsp_verify.o: ../../include/openssl/symhacks.h ../../include/openssl/ts.h
ts_rsp_verify.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ts_rsp_verify.o: ../../include/openssl/x509v3.h ../include/internal/cryptlib.h
-ts_rsp_verify.o: ../include/internal/x509_int.h ts_lcl.h ts_rsp_verify.c
+ts_rsp_verify.o: ts_lcl.h ts_rsp_verify.c
ts_verify_ctx.o: ../../e_os.h ../../include/openssl/asn1.h
ts_verify_ctx.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
ts_verify_ctx.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
diff --git a/crypto/ui/ui_util.c b/crypto/ui/ui_util.c
index f65f80d71d..b18e2a2a42 100644
--- a/crypto/ui/ui_util.c
+++ b/crypto/ui/ui_util.c
@@ -56,6 +56,10 @@
#include <string.h>
#include "ui_locl.h"
+#ifndef BUFSIZ
+#define BUFSIZ 256
+#endif
+
int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt,
int verify)
{
diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c
index 5241cad639..3dd04d04aa 100644
--- a/crypto/x509/by_dir.c
+++ b/crypto/x509/by_dir.c
@@ -69,6 +69,7 @@
# include <sys/stat.h>
#endif
+
#include <openssl/lhash.h>
#include <openssl/x509.h>
#include "internal/x509_int.h"
diff --git a/crypto/x509/by_file.c b/crypto/x509/by_file.c
index 6fbffe11c1..7983b1527e 100644
--- a/crypto/x509/by_file.c
+++ b/crypto/x509/by_file.c
@@ -66,8 +66,6 @@
#include <openssl/x509.h>
#include <openssl/pem.h>
-#ifndef OPENSSL_NO_STDIO
-
static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
long argl, char **ret);
static X509_LOOKUP_METHOD x509_file_lookup = {
@@ -269,5 +267,3 @@ int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type)
sk_X509_INFO_pop_free(inf, X509_INFO_free);
return count;
}
-
-#endif /* OPENSSL_NO_STDIO */
diff --git a/crypto/x509/x509_d2.c b/crypto/x509/x509_d2.c
index 29bbf50a2c..e3d08630b9 100644
--- a/crypto/x509/x509_d2.c
+++ b/crypto/x509/x509_d2.c
@@ -61,7 +61,6 @@
#include <openssl/crypto.h>
#include <openssl/x509.h>
-#ifndef OPENSSL_NO_STDIO
int X509_STORE_set_default_paths(X509_STORE *ctx)
{
X509_LOOKUP *lookup;
@@ -105,5 +104,3 @@ int X509_STORE_load_locations(X509_STORE *ctx, const char *file,
return (0);
return (1);
}
-
-#endif
diff --git a/e_os.h b/e_os.h
index b3a3338eeb..8c4223bc53 100644
--- a/e_os.h
+++ b/e_os.h
@@ -76,6 +76,12 @@ extern "C" {
# undef REF_PRINT
# define REF_PRINT(a,b) fprintf(stderr,"%08X:%4d:%s\n",(int)b,b->references,a)
# endif
+# if defined(OPENSSL_NO_STDIO) && defined(REF_CHECK)
+# error "Cannot have REF_CHECK with no-stdio"
+# endif
+# if defined(OPENSSL_NO_STDIO) && defined(REF_PRINT)
+# error "Cannot have REF_PRINT with no-stdio"
+# endif
# ifndef DEVRANDOM
/*
diff --git a/include/openssl/bio.h b/include/openssl/bio.h
index 75d052fdab..0577bd8751 100644
--- a/include/openssl/bio.h
+++ b/include/openssl/bio.h
@@ -633,11 +633,11 @@ int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
asn1_ps_func **psuffix_free);
-# ifndef OPENSSL_NO_STDIO
BIO_METHOD *BIO_s_file(void);
BIO *BIO_new_file(const char *filename, const char *mode);
+# define BIO_s_file_internal BIO_s_file
+# ifndef OPENSSL_NO_STDIO
BIO *BIO_new_fp(FILE *stream, int close_flag);
-# define BIO_s_file_internal BIO_s_file
# endif
BIO *BIO_new(BIO_METHOD *type);
int BIO_set(BIO *a, BIO_METHOD *type);
diff --git a/include/openssl/conf.h b/include/openssl/conf.h
index 06c76018fd..c1114647dc 100644
--- a/include/openssl/conf.h
+++ b/include/openssl/conf.h
@@ -133,7 +133,9 @@ char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
const char *name);
void CONF_free(LHASH_OF(CONF_VALUE) *conf);
+#ifndef OPENSSL_NO_STDIO
int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
+#endif
int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
void OPENSSL_config(const char *config_name);
@@ -166,7 +168,9 @@ STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,
char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
long *result);
+#ifndef OPENSSL_NO_STDIO
int NCONF_dump_fp(const CONF *conf, FILE *out);
+#endif
int NCONF_dump_bio(const CONF *conf, BIO *out);
#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
diff --git a/include/openssl/pem.h b/include/openssl/pem.h
index a1e51669cc..f9e23d295c 100644
--- a/include/openssl/pem.h
+++ b/include/openssl/pem.h
@@ -284,6 +284,7 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
# define DECLARE_PEM_read_fp(name, type) /**/
# define DECLARE_PEM_write_fp(name, type) /**/
+# define DECLARE_PEM_write_fp_const(name, type) /**/
# define DECLARE_PEM_write_cb_fp(name, type) /**/
# else
@@ -361,6 +362,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
unsigned char *kstr, int klen,
pem_password_cb *cd, void *u);
+#ifndef OPENSSL_NO_STDIO
int PEM_read(FILE *fp, char **name, char **header,
unsigned char **data, long *len);
int PEM_write(FILE *fp, const char *name, const char *hdr,
@@ -372,6 +374,7 @@ int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
int klen, pem_password_cb *callback, void *u);
STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
pem_password_cb *cb, void *u);
+#endif
int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type,
EVP_MD *md_type, unsigned char **ek, int *ekl,
@@ -437,6 +440,7 @@ int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid,
EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
void *u);
+#ifndef OPENSSL_NO_STDIO
int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
char *kstr, int klen,
pem_password_cb *cb, void *u);
@@ -453,7 +457,7 @@ EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
char *kstr, int klen, pem_password_cb *cd,
void *u);
-
+#endif
EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
int PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x);
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index 04ef4d4972..d488aa5cf4 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -1386,11 +1386,8 @@ __owur int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len);
/* Set serverinfo data for the current active cert. */
__owur int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
size_t serverinfo_length);
-# ifndef OPENSSL_NO_STDIO
__owur int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file);
-# endif /* NO_STDIO */
-# ifndef OPENSSL_NO_STDIO
__owur int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);
__owur int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);
__owur int SSL_use_certificate_file(SSL *ssl, const char *file, int type);
@@ -1403,11 +1400,9 @@ __owur int SSL_use_certificate_chain_file(SSL *ssl, const char *file);
__owur STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
__owur int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
const char *file);
-# ifndef OPENSSL_SYS_VMS
+# ifndef OPENSSL_SYS_VMS
int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
const char *dir);
-# endif
-
# endif
void SSL_load_error_strings(void);
diff --git a/include/openssl/ts.h b/include/openssl/ts.h
index d66b49d734..f74fce7591 100644
--- a/include/openssl/ts.h
+++ b/include/openssl/ts.h
@@ -133,8 +133,10 @@ TS_REQ *d2i_TS_REQ(TS_REQ **a, const unsigned char **pp, long length);
TS_REQ *TS_REQ_dup(TS_REQ *a);
+#ifndef OPENSSL_NO_STDIO
TS_REQ *d2i_TS_REQ_fp(FILE *fp, TS_REQ **a);
int i2d_TS_REQ_fp(FILE *fp, TS_REQ *a);
+#endif
TS_REQ *d2i_TS_REQ_bio(BIO *fp, TS_REQ **a);
int i2d_TS_REQ_bio(BIO *fp, TS_REQ *a);
@@ -146,10 +148,12 @@ TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT(TS_MSG_IMPRINT **a,
TS_MSG_IMPRINT *TS_MSG_IMPRINT_dup(TS_MSG_IMPRINT *a);
+#ifndef OPENSSL_NO_STDIO
TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT **a);
int i2d_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT *a);
-TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT **a);
-int i2d_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT *a);
+#endif
+TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_bio(BIO *bio, TS_MSG_IMPRINT **a);
+int i2d_TS_MSG_IMPRINT_bio(BIO *bio, TS_MSG_IMPRINT *a);
TS_RESP *TS_RESP_new(void);
void TS_RESP_free(TS_RESP *a);
@@ -158,10 +162,12 @@ TS_RESP *d2i_TS_RESP(TS_RESP **a, const unsigned char **pp, long length);
TS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token);
TS_RESP *TS_RESP_dup(TS_RESP *a);
+#ifndef OPENSSL_NO_STDIO
TS_RESP *d2i_TS_RESP_fp(FILE *fp, TS_RESP **a);
int i2d_TS_RESP_fp(FILE *fp, TS_RESP *a);
-TS_RESP *d2i_TS_RESP_bio(BIO *fp, TS_RESP **a);
-int i2d_TS_RESP_bio(BIO *fp, TS_RESP *a);
+#endif
+TS_RESP *d2i_TS_RESP_bio(BIO *bio, TS_RESP **a);
+int i2d_TS_RESP_bio(BIO *bio, TS_RESP *a);
TS_STATUS_INFO *TS_STATUS_INFO_new(void);
void TS_STATUS_INFO_free(TS_STATUS_INFO *a);
@@ -177,10 +183,12 @@ TS_TST_INFO *d2i_TS_TST_INFO(TS_TST_INFO **a, const unsigned char **pp,
long length);
TS_TST_INFO *TS_TST_INFO_dup(TS_TST_INFO *a);
+#ifndef OPENSSL_NO_STDIO
TS_TST_INFO *d2i_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO **a);
int i2d_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO *a);
-TS_TST_INFO *d2i_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO **a);
-int i2d_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO *a);
+#endif
+TS_TST_INFO *d2i_TS_TST_INFO_bio(BIO *bio, TS_TST_INFO **a);
+int i2d_TS_TST_INFO_bio(BIO *bio, TS_TST_INFO *a);
TS_ACCURACY *TS_ACCURACY_new(void);
void TS_ACCURACY_free(TS_ACCURACY *a);
diff --git a/include/openssl/x509_vfy.h b/include/openssl/x509_vfy.h
index c78ba98232..5d06b0d75f 100644
--- a/include/openssl/x509_vfy.h
+++ b/include/openssl/x509_vfy.h
@@ -461,7 +461,6 @@ void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx);
X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);
-
X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
@@ -474,11 +473,9 @@ int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name,
int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
long argl, char **ret);
-# ifndef OPENSSL_NO_STDIO
int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
-# endif
X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
void X509_LOOKUP_free(X509_LOOKUP *ctx);
@@ -494,11 +491,9 @@ int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len,
X509_OBJECT *ret);
int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
-# ifndef OPENSSL_NO_STDIO
int X509_STORE_load_locations(X509_STORE *ctx,
const char *file, const char *dir);
int X509_STORE_set_default_paths(X509_STORE *ctx);
-# endif
int X509_STORE_CTX_get_ex_new_index(long argl, void *argp,
CRYPTO_EX_new *new_func,
diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h
index 3898426b84..9a68b7316c 100644
--- a/include/openssl/x509v3.h
+++ b/include/openssl/x509v3.h
@@ -684,8 +684,9 @@ void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
int ml);
int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag,
int indent);
+#ifndef OPENSSL_NO_STDIO
int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
-
+#endif
int X509V3_extensions_print(BIO *out, char *title,
STACK_OF(X509_EXTENSION) *exts,
unsigned long flag, int indent);
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c
index ecef7bddc8..fb8a9f9716 100644
--- a/ssl/ssl_cert.c
+++ b/ssl/ssl_cert.c
@@ -672,7 +672,6 @@ static int xname_cmp(const X509_NAME *const *a, const X509_NAME *const *b)
return (X509_NAME_cmp(*a, *b));
}
-#ifndef OPENSSL_NO_STDIO
/**
* Load CA certs from a file into a ::STACK. Note that it is somewhat misnamed;
* it doesn't really have anything to do with clients (except that a common use
@@ -736,7 +735,6 @@ STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file)
ERR_clear_error();
return (ret);
}
-#endif