Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
73decf59
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
73decf59
编写于
3月 22, 2016
作者:
R
Rich Salz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make DSO opaque.
This was really easy. Reviewed-by:
N
Tim Hudson
<
tjh@openssl.org
>
上级
29fa0a1a
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
119 addition
and
126 deletion
+119
-126
crypto/dso/dso_dl.c
crypto/dso/dso_dl.c
+1
-4
crypto/dso/dso_dlfcn.c
crypto/dso/dso_dlfcn.c
+1
-4
crypto/dso/dso_err.c
crypto/dso/dso_err.c
+1
-3
crypto/dso/dso_lib.c
crypto/dso/dso_lib.c
+1
-4
crypto/dso/dso_locl.h
crypto/dso/dso_locl.h
+108
-0
crypto/dso/dso_null.c
crypto/dso/dso_null.c
+2
-4
crypto/dso/dso_openssl.c
crypto/dso/dso_openssl.c
+1
-3
crypto/dso/dso_vms.c
crypto/dso/dso_vms.c
+2
-5
crypto/dso/dso_win32.c
crypto/dso/dso_win32.c
+1
-4
include/openssl/dso.h
include/openssl/dso.h
+1
-95
未找到文件。
crypto/dso/dso_dl.c
浏览文件 @
73decf59
...
...
@@ -56,10 +56,7 @@
*
*/
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/dso.h>
#include "internal/dso_conf.h"
#include "dso_locl.h"
#ifndef DSO_DL
DSO_METHOD
*
DSO_METHOD_dl
(
void
)
...
...
crypto/dso/dso_dlfcn.c
浏览文件 @
73decf59
...
...
@@ -65,10 +65,7 @@
# define _GNU_SOURCE
/* make sure dladdr is declared */
#endif
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/dso.h>
#include "internal/dso_conf.h"
#include "dso_locl.h"
#ifndef DSO_DLFCN
DSO_METHOD
*
DSO_METHOD_dlfcn
(
void
)
...
...
crypto/dso/dso_err.c
浏览文件 @
73decf59
...
...
@@ -58,9 +58,7 @@
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include <openssl/dso.h>
#include "dso_locl.h"
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
...
...
crypto/dso/dso_lib.c
浏览文件 @
73decf59
...
...
@@ -56,10 +56,7 @@
*
*/
#include <stdio.h>
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
#include <openssl/dso.h>
#include "dso_locl.h"
static
DSO_METHOD
*
default_DSO_meth
=
NULL
;
...
...
crypto/dso/dso_locl.h
0 → 100644
浏览文件 @
73decf59
/*
* Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
* Licensed under the OpenSSL licenses, (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://www.openssl.org/source/license.html
* or in the file LICENSE in the source distribution.
*/
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/dso.h>
#include "internal/dso_conf.h"
/**********************************************************************/
/* The low-level handle type used to refer to a loaded shared library */
struct
dso_st
{
DSO_METHOD
*
meth
;
/*
* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS doesn't use
* anything but will need to cache the filename for use in the dso_bind
* handler. All in all, let each method control its own destiny.
* "Handles" and such go in a STACK.
*/
STACK_OF
(
void
)
*
meth_data
;
int
references
;
int
flags
;
/*
* For use by applications etc ... use this for your bits'n'pieces, don't
* touch meth_data!
*/
CRYPTO_EX_DATA
ex_data
;
/*
* If this callback function pointer is set to non-NULL, then it will be
* used in DSO_load() in place of meth->dso_name_converter. NB: This
* should normally set using DSO_set_name_converter().
*/
DSO_NAME_CONVERTER_FUNC
name_converter
;
/*
* If this callback function pointer is set to non-NULL, then it will be
* used in DSO_load() in place of meth->dso_merger. NB: This should
* normally set using DSO_set_merger().
*/
DSO_MERGER_FUNC
merger
;
/*
* This is populated with (a copy of) the platform-independent filename
* used for this DSO.
*/
char
*
filename
;
/*
* This is populated with (a copy of) the translated filename by which
* the DSO was actually loaded. It is NULL iff the DSO is not currently
* loaded. NB: This is here because the filename translation process may
* involve a callback being invoked more than once not only to convert to
* a platform-specific form, but also to try different filenames in the
* process of trying to perform a load. As such, this variable can be
* used to indicate (a) whether this DSO structure corresponds to a
* loaded library or not, and (b) the filename with which it was actually
* loaded.
*/
char
*
loaded_filename
;
CRYPTO_RWLOCK
*
lock
;
};
struct
dso_meth_st
{
const
char
*
name
;
/*
* Loads a shared library, NB: new DSO_METHODs must ensure that a
* successful load populates the loaded_filename field, and likewise a
* successful unload OPENSSL_frees and NULLs it out.
*/
int
(
*
dso_load
)
(
DSO
*
dso
);
/* Unloads a shared library */
int
(
*
dso_unload
)
(
DSO
*
dso
);
/* Binds a variable */
void
*
(
*
dso_bind_var
)
(
DSO
*
dso
,
const
char
*
symname
);
/*
* Binds a function - assumes a return type of DSO_FUNC_TYPE. This should
* be cast to the real function prototype by the caller. Platforms that
* don't have compatible representations for different prototypes (this
* is possible within ANSI C) are highly unlikely to have shared
* libraries at all, let alone a DSO_METHOD implemented for them.
*/
DSO_FUNC_TYPE
(
*
dso_bind_func
)
(
DSO
*
dso
,
const
char
*
symname
);
/*
* The generic (yuck) "ctrl()" function. NB: Negative return values
* (rather than zero) indicate errors.
*/
long
(
*
dso_ctrl
)
(
DSO
*
dso
,
int
cmd
,
long
larg
,
void
*
parg
);
/*
* The default DSO_METHOD-specific function for converting filenames to a
* canonical native form.
*/
DSO_NAME_CONVERTER_FUNC
dso_name_converter
;
/*
* The default DSO_METHOD-specific function for converting filenames to a
* canonical native form.
*/
DSO_MERGER_FUNC
dso_merger
;
/* [De]Initialisation handlers. */
int
(
*
init
)
(
DSO
*
dso
);
int
(
*
finish
)
(
DSO
*
dso
);
/* Return pathname of the module containing location */
int
(
*
pathbyaddr
)
(
void
*
addr
,
char
*
path
,
int
sz
);
/* Perform global symbol lookup, i.e. among *all* modules */
void
*
(
*
globallookup
)
(
const
char
*
symname
);
};
crypto/dso/dso_null.c
浏览文件 @
73decf59
...
...
@@ -61,9 +61,7 @@
* appropriate support for "shared-libraries".
*/
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/dso.h>
#include "dso_locl.h"
static
DSO_METHOD
dso_meth_null
=
{
"NULL shared library method"
,
...
...
@@ -82,5 +80,5 @@ static DSO_METHOD dso_meth_null = {
DSO_METHOD
*
DSO_METHOD_null
(
void
)
{
return
(
&
dso_meth_null
)
;
return
&
dso_meth_null
;
}
crypto/dso/dso_openssl.c
浏览文件 @
73decf59
...
...
@@ -56,9 +56,7 @@
*
*/
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/dso.h>
#include "dso_locl.h"
/* We just pinch the method from an appropriate "default" method. */
...
...
crypto/dso/dso_vms.c
浏览文件 @
73decf59
...
...
@@ -56,11 +56,7 @@
*
*/
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "internal/cryptlib.h"
#include <openssl/dso.h>
#include "dso_locl.h"
#ifndef OPENSSL_SYS_VMS
DSO_METHOD
*
DSO_METHOD_vms
(
void
)
...
...
@@ -70,6 +66,7 @@ DSO_METHOD *DSO_METHOD_vms(void)
#else
# pragma message disable DOLLARID
# include <errno.h>
# include <rms.h>
# include <lib$routines.h>
# include <stsdef.h>
...
...
crypto/dso/dso_win32.c
浏览文件 @
73decf59
...
...
@@ -56,10 +56,7 @@
*
*/
#include <stdio.h>
#include <string.h>
#include "internal/cryptlib.h"
#include <openssl/dso.h>
#include "dso_locl.h"
#if !defined(DSO_WIN32)
DSO_METHOD
*
DSO_METHOD_win32
(
void
)
...
...
include/openssl/dso.h
浏览文件 @
73decf59
...
...
@@ -109,6 +109,7 @@ extern "C" {
typedef
void
(
*
DSO_FUNC_TYPE
)
(
void
);
typedef
struct
dso_st
DSO
;
typedef
struct
dso_meth_st
DSO_METHOD
;
/*
* The function prototype used for method functions (or caller-provided
...
...
@@ -136,101 +137,6 @@ typedef char *(*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);
*/
typedef
char
*
(
*
DSO_MERGER_FUNC
)(
DSO
*
,
const
char
*
,
const
char
*
);
typedef
struct
dso_meth_st
{
const
char
*
name
;
/*
* Loads a shared library, NB: new DSO_METHODs must ensure that a
* successful load populates the loaded_filename field, and likewise a
* successful unload OPENSSL_frees and NULLs it out.
*/
int
(
*
dso_load
)
(
DSO
*
dso
);
/* Unloads a shared library */
int
(
*
dso_unload
)
(
DSO
*
dso
);
/* Binds a variable */
void
*
(
*
dso_bind_var
)
(
DSO
*
dso
,
const
char
*
symname
);
/*
* Binds a function - assumes a return type of DSO_FUNC_TYPE. This should
* be cast to the real function prototype by the caller. Platforms that
* don't have compatible representations for different prototypes (this
* is possible within ANSI C) are highly unlikely to have shared
* libraries at all, let alone a DSO_METHOD implemented for them.
*/
DSO_FUNC_TYPE
(
*
dso_bind_func
)
(
DSO
*
dso
,
const
char
*
symname
);
/*
* The generic (yuck) "ctrl()" function. NB: Negative return values
* (rather than zero) indicate errors.
*/
long
(
*
dso_ctrl
)
(
DSO
*
dso
,
int
cmd
,
long
larg
,
void
*
parg
);
/*
* The default DSO_METHOD-specific function for converting filenames to a
* canonical native form.
*/
DSO_NAME_CONVERTER_FUNC
dso_name_converter
;
/*
* The default DSO_METHOD-specific function for converting filenames to a
* canonical native form.
*/
DSO_MERGER_FUNC
dso_merger
;
/* [De]Initialisation handlers. */
int
(
*
init
)
(
DSO
*
dso
);
int
(
*
finish
)
(
DSO
*
dso
);
/* Return pathname of the module containing location */
int
(
*
pathbyaddr
)
(
void
*
addr
,
char
*
path
,
int
sz
);
/* Perform global symbol lookup, i.e. among *all* modules */
void
*
(
*
globallookup
)
(
const
char
*
symname
);
}
DSO_METHOD
;
/**********************************************************************/
/* The low-level handle type used to refer to a loaded shared library */
struct
dso_st
{
DSO_METHOD
*
meth
;
/*
* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS doesn't use
* anything but will need to cache the filename for use in the dso_bind
* handler. All in all, let each method control its own destiny.
* "Handles" and such go in a STACK.
*/
STACK_OF
(
void
)
*
meth_data
;
int
references
;
int
flags
;
/*
* For use by applications etc ... use this for your bits'n'pieces, don't
* touch meth_data!
*/
CRYPTO_EX_DATA
ex_data
;
/*
* If this callback function pointer is set to non-NULL, then it will be
* used in DSO_load() in place of meth->dso_name_converter. NB: This
* should normally set using DSO_set_name_converter().
*/
DSO_NAME_CONVERTER_FUNC
name_converter
;
/*
* If this callback function pointer is set to non-NULL, then it will be
* used in DSO_load() in place of meth->dso_merger. NB: This should
* normally set using DSO_set_merger().
*/
DSO_MERGER_FUNC
merger
;
/*
* This is populated with (a copy of) the platform-independent filename
* used for this DSO.
*/
char
*
filename
;
/*
* This is populated with (a copy of) the translated filename by which
* the DSO was actually loaded. It is NULL iff the DSO is not currently
* loaded. NB: This is here because the filename translation process may
* involve a callback being invoked more than once not only to convert to
* a platform-specific form, but also to try different filenames in the
* process of trying to perform a load. As such, this variable can be
* used to indicate (a) whether this DSO structure corresponds to a
* loaded library or not, and (b) the filename with which it was actually
* loaded.
*/
char
*
loaded_filename
;
CRYPTO_RWLOCK
*
lock
;
};
DSO
*
DSO_new
(
void
);
DSO
*
DSO_new_method
(
DSO_METHOD
*
method
);
int
DSO_free
(
DSO
*
dso
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录