1193645Ssimon/* crypto/err/err_prn.c */ 2193645Ssimon/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3193645Ssimon * All rights reserved. 4193645Ssimon * 5193645Ssimon * This package is an SSL implementation written 6193645Ssimon * by Eric Young (eay@cryptsoft.com). 7193645Ssimon * The implementation was written so as to conform with Netscapes SSL. 8296465Sdelphij * 9193645Ssimon * This library is free for commercial and non-commercial use as long as 10193645Ssimon * the following conditions are aheared to. The following conditions 11193645Ssimon * apply to all code found in this distribution, be it the RC4, RSA, 12193645Ssimon * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13193645Ssimon * included with this distribution is covered by the same copyright terms 14193645Ssimon * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15296465Sdelphij * 16193645Ssimon * Copyright remains Eric Young's, and as such any Copyright notices in 17193645Ssimon * the code are not to be removed. 18193645Ssimon * If this package is used in a product, Eric Young should be given attribution 19193645Ssimon * as the author of the parts of the library used. 20193645Ssimon * This can be in the form of a textual message at program startup or 21193645Ssimon * in documentation (online or textual) provided with the package. 22296465Sdelphij * 23193645Ssimon * Redistribution and use in source and binary forms, with or without 24193645Ssimon * modification, are permitted provided that the following conditions 25193645Ssimon * are met: 26193645Ssimon * 1. Redistributions of source code must retain the copyright 27193645Ssimon * notice, this list of conditions and the following disclaimer. 28193645Ssimon * 2. Redistributions in binary form must reproduce the above copyright 29193645Ssimon * notice, this list of conditions and the following disclaimer in the 30193645Ssimon * documentation and/or other materials provided with the distribution. 31193645Ssimon * 3. All advertising materials mentioning features or use of this software 32193645Ssimon * must display the following acknowledgement: 33193645Ssimon * "This product includes cryptographic software written by 34193645Ssimon * Eric Young (eay@cryptsoft.com)" 35193645Ssimon * The word 'cryptographic' can be left out if the rouines from the library 36193645Ssimon * being used are not cryptographic related :-). 37296465Sdelphij * 4. If you include any Windows specific code (or a derivative thereof) from 38193645Ssimon * the apps directory (application code) you must include an acknowledgement: 39193645Ssimon * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40296465Sdelphij * 41193645Ssimon * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42193645Ssimon * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43193645Ssimon * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44193645Ssimon * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45193645Ssimon * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46193645Ssimon * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47193645Ssimon * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48193645Ssimon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49193645Ssimon * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50193645Ssimon * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51193645Ssimon * SUCH DAMAGE. 52296465Sdelphij * 53193645Ssimon * The licence and distribution terms for any publically available version or 54193645Ssimon * derivative of this code cannot be changed. i.e. this code cannot simply be 55193645Ssimon * copied and put under another distribution licence 56193645Ssimon * [including the GNU Public Licence.] 57193645Ssimon */ 58193645Ssimon 59193645Ssimon#include <stdio.h> 60193645Ssimon#include "cryptlib.h" 61193645Ssimon#include <openssl/lhash.h> 62193645Ssimon#include <openssl/crypto.h> 63193645Ssimon#include <openssl/buffer.h> 64193645Ssimon#include <openssl/err.h> 65193645Ssimon 66193645Ssimonstatic int print_bio(const char *str, size_t len, void *bp) 67296465Sdelphij{ 68296465Sdelphij return BIO_write((BIO *)bp, str, len); 69296465Sdelphij} 70296465Sdelphij 71193645Ssimonvoid ERR_print_errors(BIO *bp) 72296465Sdelphij{ 73296465Sdelphij ERR_print_errors_cb(print_bio, bp); 74296465Sdelphij} 75