Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
fd38fecc
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fd38fecc
编写于
1月 24, 2000
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Document how CRYPTO_EX_DATA stuff works for
RSA structures. Other structures behave in a similar way.
上级
3bec05e9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
95 addition
and
7 deletion
+95
-7
doc/crypto/RSA_get_ex_new_index.pod
doc/crypto/RSA_get_ex_new_index.pod
+95
-7
未找到文件。
doc/crypto/RSA_get_ex_new_index.pod
浏览文件 @
fd38fecc
...
...
@@ -2,26 +2,114 @@
=head1 NAME
RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data -
..
.
RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data -
add application specific data to RSA structures
.
=head1 SYNOPSIS
#include <openssl/rsa.h>
int RSA_get_ex_new_index(long argl, char *argp, int (*new_func)(),
int (*dup_func)(), void (*free_func)());
int RSA_get_ex_new_index(long argl, void *argp,
CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func,
CRYPTO_EX_free *free_func);
int RSA_set_ex_data(RSA *r,int idx,void *arg);
void *RSA_get_ex_data(RSA *r, int idx);
int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
int idx, long argl, void *argp);
int RSA_set_ex_data(RSA *r,int idx,char *arg);
char *RSA_get_ex_data(RSA *r, int idx);
=head1 DESCRIPTION
...
Several OpenSSL structures can have application specific data attached to them.
This has several potential uses, it can be used to cache data associated with
a structure (for example the hash of some part of the structure) or some
additional data (for example a handle to the data in an external library).
Since the application data can be anything at all it is passed and retrieved
as a B<void *> type.
The B<RSA_get_ex_new_index()> function is initially called to "register" some
new application specific data. It takes three optional function pointers which
are called when the parent structure (in this case an RSA structure) is
initially created, when it is copied and when it is freed up. If any or all of
these function pointer arguments are not used they should be set to NULL. The
precise manner in which these function pointer are called is described in more
detail below. B<RSA_get_ex_new_index()> also takes additional long and pointer
parameters which will be passed to the supplied functions but which otherwise
have no special meaning. It returns an B<index> which should be stored
(typically in a static variable) and passed used in the B<idx> parameter in
the remaining functions. Each successful call to B<RSA_get_ex_new_index()>
will return an index greater than any previously returned, this is important
because the optional functions are called in order of increasing index value.
B<RSA_set_ex_data()> is used to set application specific data, the data is
supplied in the B<arg> parameter and its precise meaning is up to the
application.
B<RSA_get_ex_data()> is used to retrieve application specific data. The data
is returned to the application, this will be the same value as supplied to
a previous B<RSA_set_ex_data()> call.
B<new_func()> is called when a structure is initially allocated (for example
with B<RSA_new()>. The parent structure members will not have any meaningful
values at this point. This function will typically be used to allocate any
application specific structure.
B<free_func()> is called when a structure is being freed up. The dynamic parent
structure members should not be accessed because they will be freed up when
this function is called.
B<new_func()> and B<free_func()> take the same parameters. B<parent> is a
pointer to the parent RSA structure. B<ptr> is a the application specific data
(this wont be of much use in B<new_func()>. B<ad> is a pointer to the
B<CRYPTO_EX_DATA> structure from the parent RSA structure: the functions
B<CRYPTO_get_ex_data()> and B<CRYPTO_get_ex_data()> can be called to manipulate
it. The B<idx> parameter is the index: this will be the same value returned by
B<RSA_get_ex_new_index()> when the functions were initially registered. Finally
the B<argl> and B<argp> parameters are the values originally passed to the same
corresponding parameters when B<RSA_get_ex_new_index()> was called.
B<dup_func()> is called when a structure is being copied. Pointers to the
destination and source B<CRYPTO_EX_DATA> structures are passed in the B<to> and
B<from> parameters respectively. The B<from_d> parameter is passed a pointer to
the source application data when the function is called, when the function returns
the value is copied to the destination: the application can thus modify the data
pointed to by B<from_d> and have different values in the source and destination.
The B<idx>, B<argl> and B<argp> parameters are the same as those in B<new_func()>
and B<free_func()>.
=head1 RETURN VALUES
...
B<RSA_get_ex_new_index()> returns a new index or -1 on failure (note 0 is a valid
index value).
B<RSA_set_ex_data()> returns 1 on success or 0 on failure.
B<RSA_get_ex_data()> returns the application data or 0 on failure. 0 may also
be valid application data but currently it can only fail if given an invalid B<idx>
parameter.
B<new_func()> and B<dup_func()> should return 0 for failure and 1 for success.
On failure an error code can be obtained from B<ERR_get_error(3)>.
=head1 BUGS
B<dup_func()> is currently never called.
The return value of B<new_func()> is ignored.
The B<new_func()> function isn't very useful because no meaningful values are
present in the parent RSA structure when it is called.
=head1 SEE ALSO
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录