From: Andy Polyakov Date: Tue, 17 May 2005 00:01:48 +0000 (+0000) Subject: Move cryptlib.h prior bio.h. Actually it makes sense to include cryptlib.h X-Git-Tag: OpenSSL_0_9_8-beta1~13^2~7 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=25a66ee3cbb7b3f76b95cd4e4b6d4ce6f114ecf8 Move cryptlib.h prior bio.h. Actually it makes sense to include cryptlib.h first everywhere in crypto and skip stdio.h and string.h [because it includes them]. --- diff --git a/crypto/asn1/a_strex.c b/crypto/asn1/a_strex.c index bde666a6ff..cc6a25d4d9 100644 --- a/crypto/asn1/a_strex.c +++ b/crypto/asn1/a_strex.c @@ -58,12 +58,12 @@ #include #include +#include "cryptlib.h" #include #include #include #include "charmap.h" -#include "cryptlib.h" /* ASN1_STRING_print_ex() and X509_NAME_print_ex(). * Enhanced string and name printing routines handling @@ -513,7 +513,7 @@ int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags) return do_name_ex(send_bio_chars, out, nm, indent, flags); } - +#ifndef OPENSSL_NO_FP_API int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags) { if(flags == XN_FLAG_COMPAT) @@ -528,17 +528,19 @@ int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long fla } return do_name_ex(send_fp_chars, fp, nm, indent, flags); } +#endif int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags) { return do_print_ex(send_bio_chars, out, flags, str); } - +#ifndef OPENSSL_NO_FP_API int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags) { return do_print_ex(send_fp_chars, fp, flags, str); } +#endif /* Utility function: convert any string type to UTF8, returns number of bytes * in output string or a negative error code diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index f14de2293e..996a0999ac 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -60,6 +60,7 @@ #include #include +#include "cryptlib.h" #include #include #include @@ -67,7 +68,6 @@ #include "conf_def.h" #include #include -#include "cryptlib.h" static char *eat_ws(CONF *conf, char *p); static char *eat_alpha_numeric(CONF *conf, char *p); diff --git a/crypto/err/err.c b/crypto/err/err.c index 549229bcfb..e084714383 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -112,9 +112,9 @@ #include #include #include +#include "cryptlib.h" #include #include -#include "cryptlib.h" #include #include #include diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c index 81e34bd6ce..2224a901e5 100644 --- a/crypto/err/err_prn.c +++ b/crypto/err/err_prn.c @@ -57,9 +57,9 @@ */ #include +#include "cryptlib.h" #include #include -#include "cryptlib.h" #include #include @@ -86,7 +86,12 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), #ifndef OPENSSL_NO_FP_API static int print_fp(const char *str, size_t len, void *fp) { - return fprintf((FILE *)fp, "%s", str); + BIO bio; + + BIO_set(&bio,BIO_s_file()); + BIO_set_fp(&bio,fp,BIO_NOCLOSE); + + return BIO_printf(&bio, "%s", str); } void ERR_print_errors_fp(FILE *fp) { diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index 16d95e08d5..c45e001492 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -58,8 +58,8 @@ #include #include #include -#include #include "cryptlib.h" +#include void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md, ENGINE *impl) diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c index e212de27e4..557516bde9 100644 --- a/crypto/mem_dbg.c +++ b/crypto/mem_dbg.c @@ -59,11 +59,11 @@ #include #include #include +#include "cryptlib.h" #include #include #include #include -#include "cryptlib.h" static int mh_mode=CRYPTO_MEM_CHECK_OFF; /* The state changes to CRYPTO_MEM_CHECK_ON | CRYPTO_MEM_CHECK_ENABLE diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c index 2d0d98926d..1a8f3ce113 100644 --- a/crypto/ui/ui_lib.c +++ b/crypto/ui/ui_lib.c @@ -57,12 +57,12 @@ */ #include +#include "cryptlib.h" #include #include #include #include #include "ui_locl.h" -#include "cryptlib.h" IMPLEMENT_STACK_OF(UI_STRING_ST)