dso_openssl.c revision 296341
1218893Sdim/* dso_openssl.c */
2193326Sed/*
3193326Sed * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project
4193326Sed * 2000.
5193326Sed */
6193326Sed/* ====================================================================
7193326Sed * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
8193326Sed *
9193326Sed * Redistribution and use in source and binary forms, with or without
10193326Sed * modification, are permitted provided that the following conditions
11249423Sdim * are met:
12249423Sdim *
13208600Srdivacky * 1. Redistributions of source code must retain the above copyright
14193326Sed *    notice, this list of conditions and the following disclaimer.
15193326Sed *
16199512Srdivacky * 2. Redistributions in binary form must reproduce the above copyright
17263508Sdim *    notice, this list of conditions and the following disclaimer in
18249423Sdim *    the documentation and/or other materials provided with the
19212904Sdim *    distribution.
20193326Sed *
21226633Sdim * 3. All advertising materials mentioning features or use of this
22263508Sdim *    software must display the following acknowledgment:
23263508Sdim *    "This product includes software developed by the OpenSSL Project
24263508Sdim *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
25263508Sdim *
26198092Srdivacky * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27218893Sdim *    endorse or promote products derived from this software without
28218893Sdim *    prior written permission. For written permission, please contact
29249423Sdim *    licensing@OpenSSL.org.
30193326Sed *
31218893Sdim * 5. Products derived from this software may not be called "OpenSSL"
32263508Sdim *    nor may "OpenSSL" appear in their names without prior written
33193326Sed *    permission of the OpenSSL Project.
34249423Sdim *
35249423Sdim * 6. Redistributions of any form whatsoever must retain the following
36249423Sdim *    acknowledgment:
37243830Sdim *    "This product includes software developed by the OpenSSL Project
38193326Sed *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
39193326Sed *
40193326Sed * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41193326Sed * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42226633Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43263508Sdim * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
44193326Sed * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45198092Srdivacky * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46193326Sed * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47249423Sdim * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48249423Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49198092Srdivacky * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50234353Sdim * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51234353Sdim * OF THE POSSIBILITY OF SUCH DAMAGE.
52234353Sdim * ====================================================================
53234353Sdim *
54234353Sdim * This product includes cryptographic software written by Eric Young
55234353Sdim * (eay@cryptsoft.com).  This product includes software written by Tim
56234353Sdim * Hudson (tjh@cryptsoft.com).
57212904Sdim *
58234353Sdim */
59234353Sdim
60234353Sdim#include <stdio.h>
61234353Sdim#include "cryptlib.h"
62234353Sdim#include <openssl/dso.h>
63239462Sdim
64239462Sdim/* We just pinch the method from an appropriate "default" method. */
65239462Sdim
66239462SdimDSO_METHOD *DSO_METHOD_openssl(void)
67239462Sdim{
68198092Srdivacky#ifdef DEF_DSO_METHOD
69198092Srdivacky    return (DEF_DSO_METHOD());
70212904Sdim#elif defined(DSO_DLFCN)
71212904Sdim    return (DSO_METHOD_dlfcn());
72212904Sdim#elif defined(DSO_DL)
73212904Sdim    return (DSO_METHOD_dl());
74212904Sdim#elif defined(DSO_WIN32)
75212904Sdim    return (DSO_METHOD_win32());
76212904Sdim#elif defined(DSO_VMS)
77212904Sdim    return (DSO_METHOD_vms());
78212904Sdim#elif defined(DSO_BEOS)
79212904Sdim    return (DSO_METHOD_beos());
80218893Sdim#else
81218893Sdim    return (DSO_METHOD_null());
82218893Sdim#endif
83218893Sdim}
84239462Sdim