1336823Sdim/* crypto/dh/dh_depr.c */ 2336823Sdim/* ==================================================================== 3353358Sdim * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 4353358Sdim * 5353358Sdim * Redistribution and use in source and binary forms, with or without 6336823Sdim * modification, are permitted provided that the following conditions 7336823Sdim * are met: 8336823Sdim * 9336823Sdim * 1. Redistributions of source code must retain the above copyright 10353358Sdim * notice, this list of conditions and the following disclaimer. 11336823Sdim * 12353358Sdim * 2. Redistributions in binary form must reproduce the above copyright 13336823Sdim * notice, this list of conditions and the following disclaimer in 14336823Sdim * the documentation and/or other materials provided with the 15336823Sdim * distribution. 16336823Sdim * 17336823Sdim * 3. All advertising materials mentioning features or use of this 18336823Sdim * software must display the following acknowledgment: 19336823Sdim * "This product includes software developed by the OpenSSL Project 20353358Sdim * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 21336823Sdim * 22336823Sdim * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 23336823Sdim * endorse or promote products derived from this software without 24353358Sdim * prior written permission. For written permission, please contact 25336823Sdim * openssl-core@openssl.org. 26353358Sdim * 27336823Sdim * 5. Products derived from this software may not be called "OpenSSL" 28336823Sdim * nor may "OpenSSL" appear in their names without prior written 29336823Sdim * permission of the OpenSSL Project. 30336823Sdim * 31336823Sdim * 6. Redistributions of any form whatsoever must retain the following 32336823Sdim * acknowledgment: 33336823Sdim * "This product includes software developed by the OpenSSL Project 34336823Sdim * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 35336823Sdim * 36336823Sdim * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 37336823Sdim * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38336823Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 39336823Sdim * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 40336823Sdim * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41336823Sdim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 42336823Sdim * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43336823Sdim * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44336823Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 45336823Sdim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 46336823Sdim * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 47336823Sdim * OF THE POSSIBILITY OF SUCH DAMAGE. 48336823Sdim * ==================================================================== 49336823Sdim * 50336823Sdim * This product includes cryptographic software written by Eric Young 51336823Sdim * (eay@cryptsoft.com). This product includes software written by Tim 52336823Sdim * Hudson (tjh@cryptsoft.com). 53336823Sdim * 54336823Sdim */ 55336823Sdim 56336823Sdim/* This file contains deprecated functions as wrappers to the new ones */ 57336823Sdim 58336823Sdim#include <stdio.h> 59336823Sdim#include "cryptlib.h" 60336823Sdim#include <openssl/bn.h> 61336823Sdim#include <openssl/dh.h> 62336823Sdim 63336823Sdimstatic void *dummy = &dummy; 64336823Sdim 65336823Sdim#ifndef OPENSSL_NO_DEPRECATED 66336823SdimDH *DH_generate_parameters(int prime_len, int generator, 67 void (*callback) (int, int, void *), void *cb_arg) 68{ 69 BN_GENCB cb; 70 DH *ret = NULL; 71 72 if ((ret = DH_new()) == NULL) 73 return NULL; 74 75 BN_GENCB_set_old(&cb, callback, cb_arg); 76 77 if (DH_generate_parameters_ex(ret, prime_len, generator, &cb)) 78 return ret; 79 DH_free(ret); 80 return NULL; 81} 82#endif 83