1224006Shrs/* crypto/asn1/t_pkey.c */
2224006Shrs/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3224006Shrs * All rights reserved.
4224006Shrs *
5224006Shrs * This package is an SSL implementation written
6224006Shrs * by Eric Young (eay@cryptsoft.com).
7224006Shrs * The implementation was written so as to conform with Netscapes SSL.
8224006Shrs *
9224006Shrs * This library is free for commercial and non-commercial use as long as
10224006Shrs * the following conditions are aheared to.  The following conditions
11224006Shrs * apply to all code found in this distribution, be it the RC4, RSA,
12224006Shrs * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
13224006Shrs * included with this distribution is covered by the same copyright terms
14224006Shrs * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15224006Shrs *
16224006Shrs * Copyright remains Eric Young's, and as such any Copyright notices in
17224006Shrs * the code are not to be removed.
18224006Shrs * If this package is used in a product, Eric Young should be given attribution
19224006Shrs * as the author of the parts of the library used.
20224006Shrs * This can be in the form of a textual message at program startup or
21224006Shrs * in documentation (online or textual) provided with the package.
22224006Shrs *
23224006Shrs * Redistribution and use in source and binary forms, with or without
24224006Shrs * modification, are permitted provided that the following conditions
25224006Shrs * are met:
26224006Shrs * 1. Redistributions of source code must retain the copyright
27224006Shrs *    notice, this list of conditions and the following disclaimer.
28224006Shrs * 2. Redistributions in binary form must reproduce the above copyright
29224006Shrs *    notice, this list of conditions and the following disclaimer in the
30224006Shrs *    documentation and/or other materials provided with the distribution.
31224006Shrs * 3. All advertising materials mentioning features or use of this software
32224006Shrs *    must display the following acknowledgement:
33224006Shrs *    "This product includes cryptographic software written by
34224006Shrs *     Eric Young (eay@cryptsoft.com)"
35224006Shrs *    The word 'cryptographic' can be left out if the rouines from the library
36224006Shrs *    being used are not cryptographic related :-).
37224006Shrs * 4. If you include any Windows specific code (or a derivative thereof) from
38224006Shrs *    the apps directory (application code) you must include an acknowledgement:
39224006Shrs *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40224006Shrs *
41224006Shrs * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42224006Shrs * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43224006Shrs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44224006Shrs * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45224006Shrs * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46224006Shrs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47224006Shrs * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48224006Shrs * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49224144Shrs * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50224006Shrs * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51224006Shrs * SUCH DAMAGE.
52224006Shrs *
53224006Shrs * The licence and distribution terms for any publically available version or
54224006Shrs * derivative of this code cannot be changed.  i.e. this code cannot simply be
55224006Shrs * copied and put under another distribution licence
56224006Shrs * [including the GNU Public Licence.]
57224006Shrs */
58253970Shrs
59224006Shrs#include <stdio.h>
60224006Shrs#include "cryptlib.h"
61224006Shrs#include <openssl/evp.h>
62224006Shrs#include <openssl/dh.h>
63224006Shrs
64224006Shrs#ifndef OPENSSL_NO_FP_API
65224144Shrsint DHparams_print_fp(FILE *fp, const DH *x)
66224006Shrs{
67224006Shrs    BIO *b;
68224006Shrs    int ret;
69224006Shrs
70224006Shrs    if ((b = BIO_new(BIO_s_file())) == NULL) {
71224006Shrs        DHerr(DH_F_DHPARAMS_PRINT_FP, ERR_R_BUF_LIB);
72224006Shrs        return (0);
73224006Shrs    }
74224006Shrs    BIO_set_fp(b, fp, BIO_NOCLOSE);
75224006Shrs    ret = DHparams_print(b, x);
76224006Shrs    BIO_free(b);
77224006Shrs    return (ret);
78224006Shrs}
79224006Shrs#endif
80224006Shrs