dso_lib.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/* dso_lib.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
/* ====================================================================
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.h>
#include "cryptlib.h"
{
return(DSO_new_method(NULL));
}
{
}
DSO_METHOD *DSO_get_default_method(void)
{
return(default_DSO_meth);
}
{
}
{
return(mtmp);
}
{
if(default_DSO_meth == NULL)
/* We default to DSO_METH_openssl() which in turn defaults
* to stealing the "best available" method. Will fallback
* to DSO_METH_null() in the worst case. */
{
return(NULL);
}
{
/* sk_new doesn't generate any errors so we do */
return(NULL);
}
else
{
}
return(ret);
}
{
int i;
{
return(0);
}
#ifdef REF_PRINT
#endif
if(i > 0) return(1);
#ifdef REF_CHECK
if(i < 0)
{
abort();
}
#endif
{
return(0);
}
{
return(0);
}
return(1);
}
{
}
{
{
return(0);
}
return(1);
}
{
int allocated = 0;
{
{
goto err;
}
allocated = 1;
/* Pass the provided flags to the new DSO object */
{
goto err;
}
}
else
/* Don't load if we're currently already loaded */
{
goto err;
}
/* filename can only be NULL if we were passed a dso that already has
* one set. */
{
goto err;
}
{
goto err;
}
{
goto err;
}
{
goto err;
}
/* Load succeeded */
return(ret);
err:
if(allocated)
return(NULL);
}
{
{
return(NULL);
}
{
return(NULL);
}
{
return(NULL);
}
/* Success */
return(ret);
}
{
{
return(NULL);
}
{
return(NULL);
}
{
return(NULL);
}
/* Success */
return(ret);
}
/* I don't really like these *_ctrl functions very much to be perfectly
* honest. For one thing, I think I have to return a negative value for
* any error because possible DSO_ctrl() commands may return values
* such as "size"s that can legitimately be zero (making the standard
* "if(DSO_cmd(...))" form that works almost everywhere else fail at
* odd times. I'd prefer "output" values to be passed by reference and
* when we must... :-) */
{
{
return(-1);
}
/* We should intercept certain generic commands and only pass control
* to the method-specific ctrl() function if it's something we don't
* handle. */
switch(cmd)
{
case DSO_CTRL_GET_FLAGS:
case DSO_CTRL_SET_FLAGS:
return(0);
case DSO_CTRL_OR_FLAGS:
return(0);
default:
break;
}
{
return(-1);
}
}
{
{
return(0);
}
if(oldcb)
return(1);
}
{
{
return(NULL);
}
}
{
char *copied;
{
return(0);
}
if(dso->loaded_filename)
{
return(0);
}
/* We'll duplicate filename */
{
return(0);
}
return(1);
}
{
{
return(NULL);
}
{
return(NULL);
}
{
}
{
{
return(NULL);
}
}
return(result);
}
{
{
return(NULL);
}
return(dso->loaded_filename);
}