summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2000-10-08 22:32:57 +0000
committerGeoff Thorpe <geoff@openssl.org>2000-10-08 22:32:57 +0000
commit5b0a0544f2a7e4cc0666aea72fc45da2f17473a4 (patch)
treeb76e77dc165a8e9cbe5a20e81b8b9c9e0e3e1dbf
parenta0ec9cf6d55ac372922046367ad0128e1abcd0df (diff)
downloadopenssl-new-5b0a0544f2a7e4cc0666aea72fc45da2f17473a4.tar.gz
Time to get rid of some rather silly code duplication - some DSO_ctrl()
commands are common to all DSO_METHODs, hence handle them at the top.
-rw-r--r--crypto/dso/dso_lib.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/dso/dso_lib.c b/crypto/dso/dso_lib.c
index acd166697e..fc3d76034a 100644
--- a/crypto/dso/dso_lib.c
+++ b/crypto/dso/dso_lib.c
@@ -297,6 +297,22 @@ long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg)
DSOerr(DSO_F_DSO_CTRL,ERR_R_PASSED_NULL_PARAMETER);
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:
+ return dso->flags;
+ case DSO_CTRL_SET_FLAGS:
+ dso->flags = (int)larg;
+ return(0);
+ case DSO_CTRL_OR_FLAGS:
+ dso->flags |= (int)larg;
+ return(0);
+ default:
+ break;
+ }
if((dso->meth == NULL) || (dso->meth->dso_ctrl == NULL))
{
DSOerr(DSO_F_DSO_CTRL,DSO_R_UNSUPPORTED);